diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index b26911b..e79da7e 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f557092..ab7e98c 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,84 +1,79 @@
-
-
+
+
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
- marriedTo
- solid
-
-
-
-
-
-
-
-
- true
- DEFINITION_ORDER
-
@@ -86,14 +81,11 @@
-
-
-
-
-
-
-
+
+
+
+
@@ -101,7 +93,7 @@
-
+
@@ -142,40 +134,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
@@ -183,7 +148,6 @@
-
@@ -197,260 +161,101 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1528215872017
+
+ 1546273969115
- 1528215872017
-
+ 1546273969115
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
-
+
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
+
-
+
-
-
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index e868a67..a7921f8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
com.lenis0012.bukkit
marriage2
- 2.0.18
+ 2.0.19-SNAPSHOT
jar
Marriage
http://dev.bukkit.org/server-mods/marriage-reloaded/
@@ -32,8 +32,8 @@
org.spigotmc
- spigot-api
- 1.12.2-R0.1-SNAPSHOT
+ spigot
+ 1.13.2-R0.1-SNAPSHOT
provided
@@ -46,13 +46,13 @@
com.lenis0012.bukkit
lenisutils
- 1
+ 1.0
compile
com.lenis0012.updater
updater-api
- 1
+ 1.0
compile
@@ -76,7 +76,7 @@
com.lenis0012.updater
updater-bukkit
- 1
+ 1.0
compile
@@ -84,7 +84,7 @@
maven-shade-plugin
- 2.4
+ 3.7.0
package
@@ -124,7 +124,7 @@
com.lenis0012.updater
updater-spigot
- 1
+ 1.0
compile
diff --git a/src/main/java/com/lenis0012/bukkit/marriage2/listeners/KissListener.java b/src/main/java/com/lenis0012/bukkit/marriage2/listeners/KissListener.java
index 276a529..8d6e7a3 100644
--- a/src/main/java/com/lenis0012/bukkit/marriage2/listeners/KissListener.java
+++ b/src/main/java/com/lenis0012/bukkit/marriage2/listeners/KissListener.java
@@ -8,7 +8,10 @@ import com.lenis0012.bukkit.marriage2.misc.Cooldown;
import com.lenis0012.pluginutils.misc.Reflection;
import com.lenis0012.pluginutils.modules.packets.Packet;
import com.lenis0012.pluginutils.modules.packets.PacketModule;
+import net.minecraft.server.v1_13_R2.Particles;
+import org.bukkit.Bukkit;
import org.bukkit.Location;
+import org.bukkit.Particle;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -20,13 +23,14 @@ import java.util.Random;
import java.util.concurrent.TimeUnit;
public class KissListener implements Listener {
- private final Method GET_PARTICLE_BY_ID = Reflection.getNMSMethod("EnumParticle", "a", int.class);
-
private final Cooldown cooldown;
private final MarriageCore core;
private final Random random = new Random();
public KissListener(MarriageCore core) {
+// Particles
+// Particle.HEART
+
this.core = core;
this.cooldown = new Cooldown<>(Settings.COOLDOWN_KISS.value(), TimeUnit.SECONDS);
}
@@ -62,26 +66,15 @@ public class KissListener implements Listener {
Location l1 = player.getEyeLocation();
Location l2 = clicked.getEyeLocation();
- sendPacket(l1, l2);
+ spawnParticles(l1, l2);
}
- private void sendPacket(Location eye1, Location eye2) {
- Location l = eye1.clone().add((eye2.getX() - eye1.getX()) / 2, (eye2.getY() - eye1.getY()) / 2, (eye2.getZ() - eye1.getZ()) / 2);
+ private void spawnParticles(Location eye1, Location eye2) {
+ Location middle = eye1.clone().add((eye2.getX() - eye1.getX()) / 2, (eye2.getY() - eye1.getY()) / 2, (eye2.getZ() - eye1.getZ()) / 2);
int min = Settings.KISSES_AMOUNT_MIN.value();
int max = Settings.KISSES_AMOUNT_MAX.value();
int amount = min + random.nextInt(max - min + 1);
- PacketModule module = core.getPlugin().getModule(PacketModule.class);
- Packet packet = module.createPacket("PacketPlayOutWorldParticles");
- packet.write("a", Reflection.invokeMethod(GET_PARTICLE_BY_ID, null, 34));
- packet.write("b", (float) l.getX());
- packet.write("c", (float) l.getY());
- packet.write("d", (float) l.getZ());
- packet.write("e", 0.3F);
- packet.write("f", 0.3F);
- packet.write("g", 0.3F);
- packet.write("h", 1F);
- packet.write("i", amount);
- module.broadcastPacket(l.getWorld(), packet);
+ eye1.getWorld().spawnParticle(Particle.HEART, middle, amount, 0.3f, 0.3f, 0.3f, 1f);
}
}