Skip to content

Commit d88d6bb

Browse files
Merge pull request #19 from Aleksey-Terzi/master
Avoid warnings
2 parents bd32b3b + 3d6c688 commit d88d6bb

File tree

3 files changed

+11
-45
lines changed

3 files changed

+11
-45
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>vg.civcraft.mc.civmodcore</groupId>
66
<artifactId>CivModCore</artifactId>
7-
<version>1.5.10</version>
7+
<version>1.5.11</version>
88

99
<name>CivModCore</name>
1010
<url>https://github.com/DevotedMC/CivModCore/</url>
Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
package vg.civcraft.mc.civmodcore.particles;
22

3-
import org.bukkit.Effect;
43
import org.bukkit.Location;
4+
import org.bukkit.Particle;
55

66
public class ParticleEffect {
77

8-
private Effect effect;
9-
10-
private int id;
11-
12-
private int data;
8+
private Particle particle;
139

1410
private float offsetX;
1511

@@ -21,40 +17,20 @@ public class ParticleEffect {
2117

2218
private int particleCount;
2319

24-
private int viewDistance;
25-
26-
public ParticleEffect(Effect effect, int id, int data, float offsetX, float offsetY, float offsetZ, float speed,
27-
int particleCount, int viewDistance) {
28-
this.effect = effect;
29-
this.id = id;
30-
this.data = data;
20+
public ParticleEffect(Particle particle, float offsetX, float offsetY, float offsetZ, float speed, int particleCount) {
21+
this.particle = particle;
3122
this.offsetX = offsetX;
3223
this.offsetY = offsetY;
3324
this.offsetZ = offsetZ;
3425
this.speed = speed;
3526
this.particleCount = particleCount;
36-
this.viewDistance = viewDistance;
3727
}
3828

3929
/**
4030
* @return the type of particle used in this effect
4131
*/
42-
public Effect getEffect() {
43-
return effect;
44-
}
45-
46-
/**
47-
* @return the item/block/data id for the effect
48-
*/
49-
public int getId() {
50-
return id;
51-
}
52-
53-
/**
54-
* @return the data value of the block/item for the effect
55-
*/
56-
public int getData() {
57-
return data;
32+
public Particle getParticle() {
33+
return particle;
5834
}
5935

6036
/**
@@ -92,30 +68,20 @@ public int getParticleCount() {
9268
return particleCount;
9369
}
9470

95-
/**
96-
* @return the distance from which players will be able to see the effect.
97-
*/
98-
public int getViewDistance() {
99-
return viewDistance;
100-
}
101-
10271
/**
10372
* Display an effect defined in the config around a reinforcement.
10473
*
10574
* @param location
10675
* the location of the reinforcement.
10776
*/
10877
public void playEffect(Location location) {
109-
location.getWorld().spigot()
110-
.playEffect(location, effect, id, data, offsetX, offsetY, offsetZ, speed, particleCount, viewDistance);
78+
location.getWorld().spawnParticle(particle, location, particleCount, offsetX, offsetY, offsetZ, speed, null);
11179
}
11280

11381
@Override
11482
public String toString() {
115-
return String.format(
116-
" type: %s \n id: %d \n data: %d \n offsetX: %f \n offsetY: %f \n offsetZ: %f \n speed:"
117-
+ " " + "%f \n particleCount: %d \n viewDistance: %d", effect, id, data, offsetX, offsetY,
118-
offsetZ, speed, particleCount, viewDistance);
83+
return String.format(" type: %s \n offsetX: %f \n offsetY: %f \n offsetZ: %f \n speed:"
84+
+ " " + "%f \n particleCount: %d", particle, offsetX, offsetY, offsetZ, speed, particleCount);
11985
}
12086

12187
}

src/main/java/vg/civcraft/mc/civmodcore/util/ConfigParsing.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static ItemMap parseItemMapDirectly(ConfigurationSection current) {
8282
meta.setLore(lore);
8383
}
8484
if (current.isBoolean("unbreakable")) {
85-
meta.spigot().setUnbreakable(current.getBoolean("unbreakable"));
85+
meta.setUnbreakable(current.getBoolean("unbreakable"));
8686
}
8787
if (current.isBoolean("hideFlags") && current.getBoolean("hideFlags")) {
8888
for (ItemFlag flag : ItemFlag.values()) {

0 commit comments

Comments
 (0)