commit
28486c8d65
21
Patches/Bukkit-Patches/0032-Add-Elytra.patch
Normal file
21
Patches/Bukkit-Patches/0032-Add-Elytra.patch
Normal file
@ -0,0 +1,21 @@
|
||||
From 32269ec951791791fe8553f0939c6eaa2b6b472b Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Wed, 30 Dec 2015 19:57:10 +1300
|
||||
Subject: [PATCH] Add Elytra
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
|
||||
index 0fb2605..bc930d1 100644
|
||||
--- a/src/main/java/org/bukkit/Material.java
|
||||
+++ b/src/main/java/org/bukkit/Material.java
|
||||
@@ -443,6 +443,7 @@ public enum Material {
|
||||
JUNGLE_DOOR_ITEM(429),
|
||||
ACACIA_DOOR_ITEM(430),
|
||||
DARK_OAK_DOOR_ITEM(431),
|
||||
+ ELYTRA(443),
|
||||
GOLD_RECORD(2256, 1),
|
||||
GREEN_RECORD(2257, 1),
|
||||
RECORD_3(2258, 1),
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
46
Patches/Bukkit-Patches/0033-Levitation-potion-effect.patch
Normal file
46
Patches/Bukkit-Patches/0033-Levitation-potion-effect.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From 24a5d0cfe1d62e2ff6a3a0a279c63b038a134629 Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Wed, 30 Dec 2015 21:05:47 +1300
|
||||
Subject: [PATCH] Levitation potion effect
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java
|
||||
index 4919d59..e75aa18 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionEffectType.java
|
||||
@@ -126,6 +126,11 @@ public abstract class PotionEffectType {
|
||||
*/
|
||||
public static final PotionEffectType SATURATION = new PotionEffectTypeWrapper(23);
|
||||
|
||||
+ /**
|
||||
+ * Slows the fall rate down
|
||||
+ */
|
||||
+ public static final PotionEffectType LEVITATION = new PotionEffectTypeWrapper(25);
|
||||
+
|
||||
private final int id;
|
||||
|
||||
protected PotionEffectType(int id) {
|
||||
@@ -202,7 +207,7 @@ public abstract class PotionEffectType {
|
||||
return "PotionEffectType[" + id + ", " + getName() + "]";
|
||||
}
|
||||
|
||||
- private static final PotionEffectType[] byId = new PotionEffectType[24];
|
||||
+ private static final PotionEffectType[] byId = new PotionEffectType[26];
|
||||
private static final Map<String, PotionEffectType> byName = new HashMap<String, PotionEffectType>();
|
||||
// will break on updates.
|
||||
private static boolean acceptingNew = true;
|
||||
diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java
|
||||
index 6ad9a91..a3dc228 100644
|
||||
--- a/src/main/java/org/bukkit/potion/PotionType.java
|
||||
+++ b/src/main/java/org/bukkit/potion/PotionType.java
|
||||
@@ -15,6 +15,7 @@ public enum PotionType {
|
||||
INSTANT_DAMAGE(12, PotionEffectType.HARM, 2),
|
||||
WATER_BREATHING(13, PotionEffectType.WATER_BREATHING, 1),
|
||||
INVISIBILITY(14, PotionEffectType.INVISIBILITY, 1),
|
||||
+ LEVITATION(15, PotionEffectType.LEVITATION, 1),
|
||||
;
|
||||
|
||||
private final int damageValue, maxLevel;
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,82 @@
|
||||
From d1cf06c308d35a765cf2d11b170a9d0f8fabb418 Mon Sep 17 00:00:00 2001
|
||||
From: libraryaddict <libraryaddict115@yahoo.co.nz>
|
||||
Date: Wed, 30 Dec 2015 22:38:30 +1300
|
||||
Subject: [PATCH] Some debug and crash fixes
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index b1348b9..147295e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -932,12 +932,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
protected void a(MobEffect mobeffect, boolean flag) {
|
||||
super.a(mobeffect, flag);
|
||||
- this.playerConnection.sendPacket(new PacketPlayOutEntityEffect(this.getId(), mobeffect));
|
||||
+ if (this.playerConnection.networkManager.getVersion() > 47 || mobeffect.getEffectId() != 25)
|
||||
+ this.playerConnection.sendPacket(new PacketPlayOutEntityEffect(this.getId(), mobeffect));
|
||||
}
|
||||
|
||||
protected void b(MobEffect mobeffect) {
|
||||
super.b(mobeffect);
|
||||
- this.playerConnection.sendPacket(new PacketPlayOutRemoveEntityEffect(this.getId(), mobeffect));
|
||||
+ if (this.playerConnection.networkManager.getVersion() > 47 || mobeffect.getEffectId() != 25)
|
||||
+ this.playerConnection.sendPacket(new PacketPlayOutRemoveEntityEffect(this.getId(), mobeffect));
|
||||
}
|
||||
|
||||
public void enderTeleportTo(double d0, double d1, double d2) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index 39f0b73..e5c947f 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -428,7 +428,8 @@ public class EntityTrackerEntry {
|
||||
while (iterator.hasNext()) {
|
||||
MobEffect mobeffect = (MobEffect) iterator.next();
|
||||
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(this.tracker.getId(), mobeffect));
|
||||
+ if (entityplayer.playerConnection.networkManager.getVersion() > 47 || mobeffect.getEffectId() != 25)
|
||||
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(this.tracker.getId(), mobeffect));
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java
|
||||
index ef51cd4..54c1ec9 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java
|
||||
@@ -14,7 +14,7 @@ public class PacketPlayOutMapChunkBulk implements Packet<PacketListenerPlayOut>
|
||||
|
||||
public PacketPlayOutMapChunkBulk() {}
|
||||
|
||||
- public PacketPlayOutMapChunkBulk(List<Chunk> list) {Thread.dumpStack();
|
||||
+ public PacketPlayOutMapChunkBulk(List<Chunk> list) {
|
||||
int i = list.size();
|
||||
mapChunks = list;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 81e231d..42d9e76 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -168,7 +168,8 @@ public abstract class PlayerList {
|
||||
while (iterator.hasNext()) {
|
||||
MobEffect mobeffect = (MobEffect) iterator.next();
|
||||
|
||||
- playerconnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobeffect));
|
||||
+ if (playerconnection.networkManager.getVersion() > 47 || mobeffect.getEffectId() != 25)
|
||||
+ playerconnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobeffect));
|
||||
}
|
||||
|
||||
entityplayer.syncInventory();
|
||||
@@ -615,7 +616,9 @@ public abstract class PlayerList {
|
||||
entityplayer.updateAbilities();
|
||||
for (Object o1 : entityplayer.getEffects()) {
|
||||
MobEffect mobEffect = (MobEffect) o1;
|
||||
- entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobEffect));
|
||||
+
|
||||
+ if (entityplayer.playerConnection.networkManager.getVersion() > 47 || mobEffect.getEffectId() != 25)
|
||||
+ entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobEffect));
|
||||
}
|
||||
// entityplayer1.syncInventory();
|
||||
// CraftBukkit end
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
319
Patches/CraftBukkit-Patches/0180-Current-patch-stuff.patch
Normal file
319
Patches/CraftBukkit-Patches/0180-Current-patch-stuff.patch
Normal file
@ -0,0 +1,319 @@
|
||||
From 0d1bec3dad53441ead8ac0f22e2464a924fb8818 Mon Sep 17 00:00:00 2001
|
||||
From: git <libraryaddict115@yahoo.co.nz>
|
||||
Date: Thu, 25 Feb 2016 18:20:02 +1300
|
||||
Subject: [PATCH] Current patch stuff
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index 5c09068..45a9acb 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
@@ -160,6 +160,8 @@ public class EntityEnderman extends EntityMonster {
|
||||
}
|
||||
|
||||
protected boolean k(double d0, double d1, double d2) {
|
||||
+ if (isVegetated())
|
||||
+ return false;
|
||||
double d3 = this.locX;
|
||||
double d4 = this.locY;
|
||||
double d5 = this.locZ;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index d074110..e9a324a 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -550,13 +550,13 @@ public abstract class EntityLiving extends Entity {
|
||||
protected void B() {
|
||||
if (this.effects.isEmpty()) {
|
||||
this.bj();
|
||||
- this.setInvisible(false);
|
||||
+ this.setInvisible(isMineplexInvisible());
|
||||
} else {
|
||||
int i = PotionBrewer.a(this.effects.values());
|
||||
|
||||
this.datawatcher.watch(8, Byte.valueOf((byte) (PotionBrewer.b(this.effects.values()) ? 1 : 0)), META_AMBIENT_POTION, PotionBrewer.b(this.effects.values()));
|
||||
this.datawatcher.watch(7, Integer.valueOf(i), META_POTION_COLOR, i);
|
||||
- this.setInvisible(this.hasEffect(MobEffectList.INVISIBILITY.id));
|
||||
+ this.setInvisible(isMineplexInvisible() || this.hasEffect(MobEffectList.INVISIBILITY.id));
|
||||
}
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EnumProtocol.java b/src/main/java/net/minecraft/server/EnumProtocol.java
|
||||
index f3877e4..0343bf8 100644
|
||||
--- a/src/main/java/net/minecraft/server/EnumProtocol.java
|
||||
+++ b/src/main/java/net/minecraft/server/EnumProtocol.java
|
||||
@@ -219,7 +219,11 @@ public enum EnumProtocol
|
||||
public Integer a(EnumProtocolDirection enumprotocoldirection, Packet packet, boolean is1_8)
|
||||
{
|
||||
Entry entry = (Entry) ((BiMap)j.get(enumprotocoldirection)).inverse().get(packet.getClass());
|
||||
- if ((Integer) (is1_8 ? entry.getKey() : entry.getValue()) < 0){System.out.print("Trying to send unsupported " + packet.getClass().getSimpleName());Thread.dumpStack();}
|
||||
+ if ((Integer) (is1_8 ? entry.getKey() : entry.getValue()) < 0)
|
||||
+ {
|
||||
+ System.out.print("Trying to send unsupported " + packet.getClass().getSimpleName());
|
||||
+ Thread.dumpStack();
|
||||
+ }
|
||||
return (Integer) (is1_8 ? entry.getKey() : entry.getValue());
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
index 824ec1b..9d27032 100644
|
||||
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
@@ -25,7 +25,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
||||
|
||||
int version = packethandshakinginsetprotocol.b();
|
||||
//System.out.print(version);
|
||||
- boolean supported = version == 47 || version == 94;
|
||||
+ boolean supported = version == 47 || version == 104;
|
||||
|
||||
if (supported)
|
||||
{
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index 702d33d..c3a067e 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
@@ -5,9 +5,9 @@ import java.io.IOException;
|
||||
public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
public int a;
|
||||
- public byte b;
|
||||
- public byte c;
|
||||
- public byte d;
|
||||
+ public short b;
|
||||
+ public short c;
|
||||
+ public short d;
|
||||
public byte e;
|
||||
public byte f;
|
||||
public boolean g;
|
||||
@@ -87,9 +87,18 @@ public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
super.b(packetdataserializer);
|
||||
- packetdataserializer.writeByte(this.b);
|
||||
- packetdataserializer.writeByte(this.c);
|
||||
- packetdataserializer.writeByte(this.d);
|
||||
+ if (packetdataserializer.version != 47)
|
||||
+ {
|
||||
+ packetdataserializer.writeShort(this.b);
|
||||
+ packetdataserializer.writeShort(this.c);
|
||||
+ packetdataserializer.writeShort(this.d);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ packetdataserializer.writeByte(this.b);
|
||||
+ packetdataserializer.writeByte(this.c);
|
||||
+ packetdataserializer.writeByte(this.d);
|
||||
+ }
|
||||
packetdataserializer.writeBoolean(this.g);
|
||||
}
|
||||
}
|
||||
@@ -123,9 +132,18 @@ public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
super.b(packetdataserializer);
|
||||
- packetdataserializer.writeByte(this.b);
|
||||
- packetdataserializer.writeByte(this.c);
|
||||
- packetdataserializer.writeByte(this.d);
|
||||
+ if (packetdataserializer.version != 47)
|
||||
+ {
|
||||
+ packetdataserializer.writeShort(this.b);
|
||||
+ packetdataserializer.writeShort(this.c);
|
||||
+ packetdataserializer.writeShort(this.d);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ packetdataserializer.writeByte(this.b);
|
||||
+ packetdataserializer.writeByte(this.c);
|
||||
+ packetdataserializer.writeByte(this.d);
|
||||
+ }
|
||||
packetdataserializer.writeByte(this.e);
|
||||
packetdataserializer.writeByte(this.f);
|
||||
packetdataserializer.writeBoolean(this.g);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||
index 4730b34..3fa9fe4 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntityTeleport.java
|
||||
@@ -44,9 +44,15 @@ public class PacketPlayOutEntityTeleport implements Packet<PacketListenerPlayOut
|
||||
|
||||
public void b(PacketDataSerializer packetdataserializer) {
|
||||
packetdataserializer.b(this.a);
|
||||
+ if (packetdataserializer.version == 47){
|
||||
packetdataserializer.writeInt(this.b);
|
||||
packetdataserializer.writeInt(this.c);
|
||||
packetdataserializer.writeInt(this.d);
|
||||
+ } else {
|
||||
+ packetdataserializer.writeDouble(this.b/32D);
|
||||
+ packetdataserializer.writeDouble(this.c/32D);
|
||||
+ packetdataserializer.writeDouble(this.d/32D);
|
||||
+ }
|
||||
packetdataserializer.writeByte(this.e);
|
||||
packetdataserializer.writeByte(this.f);
|
||||
packetdataserializer.writeBoolean(this.g);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
|
||||
index 340787a..efc9a08 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedEntitySpawn.java
|
||||
@@ -48,9 +48,15 @@ public class PacketPlayOutNamedEntitySpawn implements Packet<PacketListenerPlayO
|
||||
public void b(PacketDataSerializer packetdataserializer) throws IOException {
|
||||
packetdataserializer.b(this.a);
|
||||
packetdataserializer.a(this.b);
|
||||
- packetdataserializer.writeInt(this.c);
|
||||
- packetdataserializer.writeInt(this.d);
|
||||
- packetdataserializer.writeInt(this.e);
|
||||
+ if (packetdataserializer.version != 47){
|
||||
+ packetdataserializer.writeDouble(this.c/32D);
|
||||
+ packetdataserializer.writeDouble(this.d/32D);
|
||||
+ packetdataserializer.writeDouble(this.e/32D);
|
||||
+ }else {
|
||||
+ packetdataserializer.writeInt(this.c);
|
||||
+ packetdataserializer.writeInt(this.d);
|
||||
+ packetdataserializer.writeInt(this.e);
|
||||
+ }
|
||||
packetdataserializer.writeByte(this.f);
|
||||
packetdataserializer.writeByte(this.g);
|
||||
if (packetdataserializer.version == 47)
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
|
||||
index 6c8c8fa..b72b7d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
|
||||
@@ -279,6 +279,7 @@ public class PacketPlayOutNamedSoundEffect
|
||||
toPlay = sounds.get(toPlay);
|
||||
|
||||
packetdataserializer.a(toPlay);
|
||||
+ packetdataserializer.b(0);
|
||||
packetdataserializer.writeInt(b);
|
||||
packetdataserializer.writeInt(c);
|
||||
packetdataserializer.writeInt(d);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java
|
||||
index 0c60066..c9de471 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntity.java
|
||||
@@ -93,9 +93,15 @@ public class PacketPlayOutSpawnEntity implements Packet<PacketListenerPlayOut> {
|
||||
if (packetdataserializer.version != 47)
|
||||
packetdataserializer.a(this.uuid);
|
||||
packetdataserializer.writeByte(this.j);
|
||||
- packetdataserializer.writeInt(this.b);
|
||||
- packetdataserializer.writeInt(this.c);
|
||||
- packetdataserializer.writeInt(this.d);
|
||||
+ if (packetdataserializer.version != 47){
|
||||
+ packetdataserializer.writeDouble(this.b/32D);
|
||||
+ packetdataserializer.writeDouble(this.c/32D);
|
||||
+ packetdataserializer.writeDouble(this.d/32D);
|
||||
+ }else {
|
||||
+ packetdataserializer.writeInt(this.b);
|
||||
+ packetdataserializer.writeInt(this.c);
|
||||
+ packetdataserializer.writeInt(this.d);
|
||||
+ }
|
||||
packetdataserializer.writeByte(this.h);
|
||||
packetdataserializer.writeByte(this.i);
|
||||
packetdataserializer.writeInt(this.k);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityExperienceOrb.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityExperienceOrb.java
|
||||
index 4f2b03e..0a39433 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityExperienceOrb.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityExperienceOrb.java
|
||||
@@ -42,9 +42,15 @@ public class PacketPlayOutSpawnEntityExperienceOrb
|
||||
throws IOException
|
||||
{
|
||||
packetdataserializer.b(a);
|
||||
- packetdataserializer.writeInt(b);
|
||||
- packetdataserializer.writeInt(c);
|
||||
- packetdataserializer.writeInt(d);
|
||||
+ if (packetdataserializer.version != 47){
|
||||
+ packetdataserializer.writeDouble(this.b/32D);
|
||||
+ packetdataserializer.writeDouble(this.c/32D);
|
||||
+ packetdataserializer.writeDouble(this.d/32D);
|
||||
+ }else {
|
||||
+ packetdataserializer.writeInt(this.b);
|
||||
+ packetdataserializer.writeInt(this.c);
|
||||
+ packetdataserializer.writeInt(this.d);
|
||||
+ }
|
||||
packetdataserializer.writeShort(e);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityLiving.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityLiving.java
|
||||
index 9da448e..ea7c98b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityLiving.java
|
||||
@@ -88,9 +88,15 @@ public class PacketPlayOutSpawnEntityLiving implements Packet<PacketListenerPlay
|
||||
if (packetdataserializer.version != 47)
|
||||
packetdataserializer.a(this.uuid);
|
||||
packetdataserializer.writeByte(this.b & 255);
|
||||
- packetdataserializer.writeInt(this.c);
|
||||
- packetdataserializer.writeInt(this.d);
|
||||
- packetdataserializer.writeInt(this.e);
|
||||
+ if (packetdataserializer.version != 47){
|
||||
+ packetdataserializer.writeDouble(this.c/32D);
|
||||
+ packetdataserializer.writeDouble(this.d/32D);
|
||||
+ packetdataserializer.writeDouble(this.e/32D);
|
||||
+ }else {
|
||||
+ packetdataserializer.writeInt(this.c);
|
||||
+ packetdataserializer.writeInt(this.d);
|
||||
+ packetdataserializer.writeInt(this.e);
|
||||
+ }
|
||||
packetdataserializer.writeByte(this.i);
|
||||
packetdataserializer.writeByte(this.j);
|
||||
packetdataserializer.writeByte(this.k);
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityWeather.java b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityWeather.java
|
||||
index 2ce95fa..51a3a21 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityWeather.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutSpawnEntityWeather.java
|
||||
@@ -44,9 +44,15 @@ public class PacketPlayOutSpawnEntityWeather
|
||||
{
|
||||
packetdataserializer.b(a);
|
||||
packetdataserializer.writeByte(e);
|
||||
- packetdataserializer.writeInt(b);
|
||||
- packetdataserializer.writeInt(c);
|
||||
- packetdataserializer.writeInt(d);
|
||||
+ if (packetdataserializer.version != 47){
|
||||
+ packetdataserializer.writeDouble(this.b/32D);
|
||||
+ packetdataserializer.writeDouble(this.c/32D);
|
||||
+ packetdataserializer.writeDouble(this.d/32D);
|
||||
+ }else {
|
||||
+ packetdataserializer.writeInt(this.b);
|
||||
+ packetdataserializer.writeInt(this.c);
|
||||
+ packetdataserializer.writeInt(this.d);
|
||||
+ }
|
||||
}
|
||||
|
||||
public void a(PacketListenerPlayOut packetlistenerplayout)
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 16f8609..b1400c7 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1212,6 +1212,17 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
|
||||
if (movingobjectposition == null || movingobjectposition.type != MovingObjectPosition.EnumMovingObjectType.BLOCK) {
|
||||
CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_AIR, this.player.inventory.getItemInHand());
|
||||
}
|
||||
+ // Spigot start
|
||||
+ else if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK
|
||||
+ && (player.playerInteractManager.getGameMode() == WorldSettings.EnumGamemode.ADVENTURE || player.playerInteractManager.getGameMode() == WorldSettings.EnumGamemode.SPECTATOR)) {
|
||||
+ // RIGHT_CLICK_BLOCK sets this flag
|
||||
+ if (player.playerInteractManager.firedInteract) {
|
||||
+ player.playerInteractManager.firedInteract = false;
|
||||
+ } else {
|
||||
+ CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, movingobjectposition.a(), movingobjectposition.direction, player.inventory.getItemInHand(), true);
|
||||
+ }
|
||||
+ }
|
||||
+ // Spigot end
|
||||
|
||||
// Arm swing animation
|
||||
PlayerAnimationEvent event = new PlayerAnimationEvent(this.getPlayer());
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
index 0cc8f9b..dd07600 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java
|
||||
@@ -14,9 +14,9 @@ public class CraftSound {
|
||||
set(AMBIENCE_RAIN, "ambient.weather.rain");
|
||||
set(AMBIENCE_THUNDER, "ambient.weather.thunder");
|
||||
// Damage
|
||||
- set(HURT_FLESH, "game.neutral.hurt");
|
||||
- set(FALL_BIG, "game.neutral.hurt.fall.big");
|
||||
- set(FALL_SMALL, "game.neutral.hurt.fall.small");
|
||||
+ set(HURT_FLESH, "game.player.hurt");
|
||||
+ set(FALL_BIG, "game.player.hurt.fall.big");
|
||||
+ set(FALL_SMALL, "game.player.hurt.fall.small");
|
||||
// Dig Sounds
|
||||
set(DIG_WOOL, "dig.cloth");
|
||||
set(DIG_GRASS, "dig.grass");
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
@ -0,0 +1,135 @@
|
||||
From af6ac4b09da7ad63ebb568333807c7621398f0a6 Mon Sep 17 00:00:00 2001
|
||||
From: git <libraryaddict115@yahoo.co.nz>
|
||||
Date: Sun, 28 Feb 2016 00:37:30 +1300
|
||||
Subject: [PATCH] Changed maven version, fixed entity movement, fixed sound
|
||||
packet
|
||||
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 91627ff..1ea9f81 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
- <version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
+ <version>1.8.8-1.9-SNAPSHOT</version>
|
||||
<name>Spigot</name>
|
||||
<url>http://www.spigotmc.org</url>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
index e5c947f..9cd9be6 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
|
||||
@@ -145,6 +145,7 @@ public class EntityTrackerEntry {
|
||||
int k1 = j - this.yLoc;
|
||||
int l1 = k - this.zLoc;
|
||||
Object object = null;
|
||||
+ Object object2 = null;
|
||||
boolean flag = Math.abs(j1) >= 4 || Math.abs(k1) >= 4 || Math.abs(l1) >= 4 || this.m % 60 == 0;
|
||||
boolean flag1 = Math.abs(l - this.yRot) >= 4 || Math.abs(i1 - this.xRot) >= 4;
|
||||
|
||||
@@ -163,10 +164,12 @@ public class EntityTrackerEntry {
|
||||
|
||||
if (this.m > 0 || this.tracker instanceof EntityArrow) {
|
||||
if (j1 >= -128 && j1 < 128 && k1 >= -128 && k1 < 128 && l1 >= -128 && l1 < 128 && this.v <= 400 && !this.x && this.y == this.tracker.onGround) {
|
||||
+ object2 = new PacketPlayOutEntityTeleport(this.tracker.getId(), i, j, k, (byte) l, (byte) i1, this.tracker.onGround);
|
||||
if ((!flag || !flag1) && !(this.tracker instanceof EntityArrow)) {
|
||||
if (flag) {
|
||||
object = new PacketPlayOutEntity.PacketPlayOutRelEntityMove(this.tracker.getId(), (byte) j1, (byte) k1, (byte) l1, this.tracker.onGround);
|
||||
} else if (flag1) {
|
||||
+ object2 = null;
|
||||
object = new PacketPlayOutEntity.PacketPlayOutEntityLook(this.tracker.getId(), (byte) l, (byte) i1, this.tracker.onGround);
|
||||
}
|
||||
} else {
|
||||
@@ -200,7 +203,15 @@ public class EntityTrackerEntry {
|
||||
}
|
||||
|
||||
if (object != null) {
|
||||
- this.broadcast((Packet) object);
|
||||
+
|
||||
+ Iterator iterator = this.trackedPlayers.iterator();
|
||||
+
|
||||
+ while (iterator.hasNext()) {
|
||||
+ EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
+ Packet packetToSend = object2 == null || entityplayer.playerConnection.networkManager.getVersion() == 47 ? (Packet) object : (Packet) object2;
|
||||
+
|
||||
+ entityplayer.playerConnection.sendPacket(packetToSend);
|
||||
+ }
|
||||
}
|
||||
|
||||
this.b();
|
||||
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
index 9d27032..21dbf3b 100644
|
||||
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
@@ -25,7 +25,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
||||
|
||||
int version = packethandshakinginsetprotocol.b();
|
||||
//System.out.print(version);
|
||||
- boolean supported = version == 47 || version == 104;
|
||||
+ boolean supported = version == 47 || version >= 104;
|
||||
|
||||
if (supported)
|
||||
{
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
index c3a067e..8436897 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutEntity.java
|
||||
@@ -5,9 +5,9 @@ import java.io.IOException;
|
||||
public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
|
||||
public int a;
|
||||
- public short b;
|
||||
- public short c;
|
||||
- public short d;
|
||||
+ public byte b;
|
||||
+ public byte c;
|
||||
+ public byte d;
|
||||
public byte e;
|
||||
public byte f;
|
||||
public boolean g;
|
||||
@@ -89,9 +89,9 @@ public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
super.b(packetdataserializer);
|
||||
if (packetdataserializer.version != 47)
|
||||
{
|
||||
- packetdataserializer.writeShort(this.b);
|
||||
- packetdataserializer.writeShort(this.c);
|
||||
- packetdataserializer.writeShort(this.d);
|
||||
+ packetdataserializer.writeShort((short) this.b);
|
||||
+ packetdataserializer.writeShort((short) this.c);
|
||||
+ packetdataserializer.writeShort((short) this.d);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -134,9 +134,9 @@ public class PacketPlayOutEntity implements Packet<PacketListenerPlayOut> {
|
||||
super.b(packetdataserializer);
|
||||
if (packetdataserializer.version != 47)
|
||||
{
|
||||
- packetdataserializer.writeShort(this.b);
|
||||
- packetdataserializer.writeShort(this.c);
|
||||
- packetdataserializer.writeShort(this.d);
|
||||
+ packetdataserializer.writeShort((short) this.b);
|
||||
+ packetdataserializer.writeShort((short) this.c);
|
||||
+ packetdataserializer.writeShort((short) this.d);
|
||||
}
|
||||
else
|
||||
{
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java b/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
|
||||
index b72b7d7..bcfdab9 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayOutNamedSoundEffect.java
|
||||
@@ -279,7 +279,8 @@ public class PacketPlayOutNamedSoundEffect
|
||||
toPlay = sounds.get(toPlay);
|
||||
|
||||
packetdataserializer.a(toPlay);
|
||||
- packetdataserializer.b(0);
|
||||
+ if (packetdataserializer.version > 47)
|
||||
+ packetdataserializer.b(0);
|
||||
packetdataserializer.writeInt(b);
|
||||
packetdataserializer.writeInt(c);
|
||||
packetdataserializer.writeInt(d);
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
@ -0,0 +1,60 @@
|
||||
From 48550b9915d18d2d4a528c4028c8fa35a97a036c Mon Sep 17 00:00:00 2001
|
||||
From: git <libraryaddict115@yahoo.co.nz>
|
||||
Date: Tue, 1 Mar 2016 09:29:32 +1300
|
||||
Subject: [PATCH] Update to 1.9, fix blocking
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 2f52ea2..c2ce92f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1745,6 +1745,14 @@ public abstract class Entity implements ICommandListener {
|
||||
}
|
||||
|
||||
public void f(boolean flag) {
|
||||
+ if (this instanceof EntityPlayer)
|
||||
+ {
|
||||
+ EntityPlayer player = (EntityPlayer) this;
|
||||
+
|
||||
+ if (player.playerConnection.networkManager.getVersion() != 47 && player.bS() && player.getHeldItem().getItem().e(player.getHeldItem()) == EnumAnimation.BLOCK)
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
this.b(4, flag);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 743df69..998ea69 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -124,8 +124,13 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
}
|
||||
|
||||
+ public ItemStack getHeldItem()
|
||||
+ {
|
||||
+ return this.g;
|
||||
+ }
|
||||
+
|
||||
public boolean isBlocking() {
|
||||
- return this.bS() && this.g.getItem().e(this.g) == EnumAnimation.BLOCK;
|
||||
+ return ((EntityPlayer) this).playerConnection.networkManager.getVersion() == 47 && this.bS() && this.g.getItem().e(this.g) == EnumAnimation.BLOCK;
|
||||
}
|
||||
|
||||
public void t_() {
|
||||
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
index 21dbf3b..0d8aff4 100644
|
||||
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
||||
@@ -25,7 +25,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
||||
|
||||
int version = packethandshakinginsetprotocol.b();
|
||||
//System.out.print(version);
|
||||
- boolean supported = version == 47 || version >= 104;
|
||||
+ boolean supported = version == 47 || version == 107;
|
||||
|
||||
if (supported)
|
||||
{
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
@ -39,7 +39,7 @@ public class PlayerCache
|
||||
catch (Exception exception)
|
||||
{
|
||||
System.out.println("Error adding player info in PlayerCache : " + exception.getMessage());
|
||||
// exception.printStackTrace();
|
||||
exception.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,9 +47,8 @@ public class PlayerCache
|
||||
{
|
||||
try
|
||||
{
|
||||
System.out.println("Getting PlayerCache for " + uuid.toString());
|
||||
PlayerInfo playerInfo = _repository.getElement(uuid.toString());
|
||||
System.out.println("Got playerINfo: " + playerInfo);
|
||||
System.out.println("Got playerInfo: " + playerInfo);
|
||||
if (playerInfo != null)
|
||||
{
|
||||
System.out.println("account id: " + playerInfo.getAccountId());
|
||||
|
@ -67,6 +67,11 @@ public class UtilPlayer
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean is1_9(Player player)
|
||||
{
|
||||
return ((CraftPlayer) player).getHandle().playerConnection.networkManager.getVersion() > 47;
|
||||
}
|
||||
|
||||
private static class Vector3D
|
||||
{
|
||||
|
||||
|
@ -1,8 +1,15 @@
|
||||
package mineplex.core.common.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
|
||||
import mineplex.core.common.DummyEntity;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
import net.minecraft.server.v1_8_R3.EntityWither;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutBossBar;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
@ -10,144 +17,220 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class UtilTextTop
|
||||
public class UtilTextTop
|
||||
{
|
||||
//Base Commands
|
||||
// Base Commands
|
||||
public static void display(String text, Player... players)
|
||||
{
|
||||
displayProgress(text, 1, players);
|
||||
}
|
||||
|
||||
|
||||
public static void displayProgress(String text, double progress, Player... players)
|
||||
{
|
||||
for (Player player : players)
|
||||
displayTextBar(player, progress, text);
|
||||
}
|
||||
|
||||
//Logic
|
||||
|
||||
// Logic
|
||||
public static final int EntityDragonId = 777777;
|
||||
public static final int EntityWitherId = 777778;
|
||||
|
||||
//Display
|
||||
public static final UUID BossUUID = UUID.fromString("178f5cde-2fb0-3e73-8296-967ec7e46748");
|
||||
private static HashMap<String, BukkitRunnable> _lastUpdated = new HashMap<String, BukkitRunnable>();
|
||||
|
||||
// Display
|
||||
public static void displayTextBar(final Player player, double healthPercent, String text)
|
||||
{
|
||||
deleteOld(player);
|
||||
|
||||
healthPercent = Math.min(1, healthPercent);
|
||||
|
||||
//Display Dragon
|
||||
if (_lastUpdated.containsKey(player.getName()))
|
||||
{
|
||||
Location loc = player.getLocation().subtract(0, 200, 0);
|
||||
|
||||
UtilPlayer.sendPacket(player, getDragonPacket(text, healthPercent, loc));
|
||||
_lastUpdated.get(player.getName()).cancel();
|
||||
}
|
||||
|
||||
|
||||
//Display Wither (as well as Dragon)
|
||||
Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(24));
|
||||
|
||||
UtilPlayer.sendPacket(player, getWitherPacket(text, healthPercent, loc));
|
||||
|
||||
//Remove
|
||||
Bukkit.getServer().getScheduler().runTaskLater(Bukkit.getPluginManager().getPlugins()[0], new Runnable()
|
||||
healthPercent = Math.max(0, Math.min(1, healthPercent));
|
||||
|
||||
// Remove
|
||||
final BukkitRunnable runnable = new BukkitRunnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
if (_lastUpdated.containsKey(player.getName()) && _lastUpdated.get(player.getName()) != this)
|
||||
return;
|
||||
|
||||
deleteOld(player);
|
||||
|
||||
_lastUpdated.remove(player.getName());
|
||||
}
|
||||
}, 20);
|
||||
};
|
||||
|
||||
runnable.runTaskLater(Bukkit.getPluginManager().getPlugins()[0], 20);
|
||||
|
||||
if (UtilPlayer.is1_9(player))
|
||||
{
|
||||
sendBossBar(player, healthPercent, text);
|
||||
|
||||
_lastUpdated.put(player.getName(), runnable);
|
||||
return;
|
||||
}
|
||||
|
||||
_lastUpdated.put(player.getName(), runnable);
|
||||
|
||||
deleteOld(player);
|
||||
|
||||
// Display Dragon
|
||||
{
|
||||
Location loc = player.getLocation().subtract(0, 200, 0);
|
||||
|
||||
UtilPlayer.sendPacket(player, getDragonPacket(text, healthPercent, loc));
|
||||
}
|
||||
|
||||
// Display Wither (as well as Dragon)
|
||||
Location loc = player.getEyeLocation().add(player.getLocation().getDirection().multiply(24));
|
||||
|
||||
UtilPlayer.sendPacket(player, getWitherPacket(text, healthPercent, loc));
|
||||
|
||||
}
|
||||
|
||||
private static void sendBossBar(Player player, double health, String text)
|
||||
{
|
||||
if (_lastUpdated.containsKey(player.getName()))
|
||||
{
|
||||
PacketPlayOutBossBar bossBar1 = new PacketPlayOutBossBar();
|
||||
|
||||
bossBar1.uuid = BossUUID;
|
||||
bossBar1.action = 2;
|
||||
bossBar1.health = (float) health;
|
||||
|
||||
PacketPlayOutBossBar bossBar2 = new PacketPlayOutBossBar();
|
||||
|
||||
bossBar2.uuid = BossUUID;
|
||||
bossBar2.action = 3;
|
||||
bossBar2.title = text;
|
||||
|
||||
UtilPlayer.sendPacket(player, bossBar1, bossBar2);
|
||||
}
|
||||
else
|
||||
{
|
||||
PacketPlayOutBossBar bossBar = new PacketPlayOutBossBar();
|
||||
|
||||
bossBar.uuid = BossUUID;
|
||||
bossBar.title = text;
|
||||
bossBar.health = (float) health;
|
||||
bossBar.color = 2;
|
||||
|
||||
UtilPlayer.sendPacket(player, bossBar);
|
||||
}
|
||||
}
|
||||
|
||||
private static void deleteOld(Player player)
|
||||
{
|
||||
if (UtilPlayer.is1_9(player))
|
||||
{
|
||||
PacketPlayOutBossBar bossBar = new PacketPlayOutBossBar();
|
||||
|
||||
bossBar.uuid = BossUUID;
|
||||
bossBar.action = 1;
|
||||
|
||||
UtilPlayer.sendPacket(player, bossBar);
|
||||
return;
|
||||
}
|
||||
// Delete Dragon (All Clients)
|
||||
PacketPlayOutEntityDestroy destroyDragonPacket = new PacketPlayOutEntityDestroy(new int[]
|
||||
{
|
||||
EntityDragonId
|
||||
EntityDragonId
|
||||
});
|
||||
UtilPlayer.sendPacket(player, destroyDragonPacket);
|
||||
|
||||
// Delete Wither (1.8+ Only)
|
||||
PacketPlayOutEntityDestroy destroyWitherPacket = new PacketPlayOutEntityDestroy(new int[]
|
||||
{
|
||||
EntityWitherId
|
||||
EntityWitherId
|
||||
});
|
||||
UtilPlayer.sendPacket(player, destroyWitherPacket);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
if (UtilPlayer.is1_9(event.getPlayer()))
|
||||
{
|
||||
deleteOld(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
public static PacketPlayOutSpawnEntityLiving getDragonPacket(String text, double healthPercent, Location loc)
|
||||
{
|
||||
PacketPlayOutSpawnEntityLiving mobPacket = new PacketPlayOutSpawnEntityLiving();
|
||||
|
||||
mobPacket.a = (int) EntityDragonId; //Entity ID
|
||||
mobPacket.b = (byte) EntityType.ENDER_DRAGON.getTypeId(); //Mob type
|
||||
mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); //X position
|
||||
mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); //Y position
|
||||
mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); //Z position
|
||||
mobPacket.f = (byte) 0; //Pitch
|
||||
mobPacket.g = (byte) 0; //Head Pitch
|
||||
mobPacket.h = (byte) 0; //Yaw
|
||||
mobPacket.i = (short) 0; //X velocity
|
||||
mobPacket.j = (short) 0; //Y velocity
|
||||
mobPacket.k = (short) 0; //Z velocity
|
||||
|
||||
//Health
|
||||
mobPacket.a = (int) EntityDragonId; // Entity ID
|
||||
mobPacket.b = (byte) EntityType.ENDER_DRAGON.getTypeId(); // Mob type
|
||||
mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); // X position
|
||||
mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); // Y position
|
||||
mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); // Z position
|
||||
mobPacket.f = (byte) 0; // Pitch
|
||||
mobPacket.g = (byte) 0; // Head Pitch
|
||||
mobPacket.h = (byte) 0; // Yaw
|
||||
mobPacket.i = (short) 0; // X velocity
|
||||
mobPacket.j = (short) 0; // Y velocity
|
||||
mobPacket.k = (short) 0; // Z velocity
|
||||
mobPacket.uuid = UUID.randomUUID();
|
||||
|
||||
// Health
|
||||
double health = healthPercent * 199.9 + 0.1;
|
||||
//if (halfHealth)
|
||||
// health = healthPercent * 99 + 101;
|
||||
|
||||
//Watcher
|
||||
// if (halfHealth)
|
||||
// health = healthPercent * 99 + 101;
|
||||
|
||||
// Watcher
|
||||
DataWatcher watcher = getWatcher(text, health, loc.getWorld());
|
||||
mobPacket.l = watcher;
|
||||
|
||||
return mobPacket;
|
||||
}
|
||||
|
||||
|
||||
public static PacketPlayOutSpawnEntityLiving getWitherPacket(String text, double healthPercent, Location loc)
|
||||
{
|
||||
PacketPlayOutSpawnEntityLiving mobPacket = new PacketPlayOutSpawnEntityLiving();
|
||||
|
||||
mobPacket.a = (int) EntityWitherId; //Entity ID
|
||||
mobPacket.b = (byte) EntityType.WITHER.getTypeId(); //Mob type
|
||||
mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); //X position
|
||||
mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); //Y position
|
||||
mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); //Z position
|
||||
mobPacket.f = (byte) 0; //Pitch
|
||||
mobPacket.g = (byte) 0; //Head Pitch
|
||||
mobPacket.h = (byte) 0; //Yaw
|
||||
mobPacket.i = (short) 0; //X velocity
|
||||
mobPacket.j = (short) 0; //Y velocity
|
||||
mobPacket.k = (short) 0; //Z velocity
|
||||
|
||||
//Health
|
||||
mobPacket.a = (int) EntityWitherId; // Entity ID
|
||||
mobPacket.b = (byte) EntityType.WITHER.getTypeId(); // Mob type
|
||||
mobPacket.c = (int) Math.floor(loc.getBlockX() * 32.0D); // X position
|
||||
mobPacket.d = (int) MathHelper.floor(loc.getBlockY() * 32.0D); // Y position
|
||||
mobPacket.e = (int) Math.floor(loc.getBlockZ() * 32.0D); // Z position
|
||||
mobPacket.f = (byte) 0; // Pitch
|
||||
mobPacket.g = (byte) 0; // Head Pitch
|
||||
mobPacket.h = (byte) 0; // Yaw
|
||||
mobPacket.i = (short) 0; // X velocity
|
||||
mobPacket.j = (short) 0; // Y velocity
|
||||
mobPacket.k = (short) 0; // Z velocity
|
||||
mobPacket.uuid = UUID.randomUUID();
|
||||
|
||||
// Health
|
||||
double health = healthPercent * 299.9 + 0.1;
|
||||
//if (halfHealth)
|
||||
// health = healthPercent * 149 + 151;
|
||||
|
||||
//Watcher
|
||||
// if (halfHealth)
|
||||
// health = healthPercent * 149 + 151;
|
||||
|
||||
// Watcher
|
||||
DataWatcher watcher = getWatcher(text, health, loc.getWorld());
|
||||
mobPacket.l = watcher;
|
||||
|
||||
return mobPacket;
|
||||
}
|
||||
|
||||
|
||||
public static DataWatcher getWatcher(String text, double health, World world)
|
||||
{
|
||||
DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld)world).getHandle()));
|
||||
DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld) world).getHandle()));
|
||||
|
||||
watcher.a(0, (Byte) (byte) 0); //Flags, 0x20 = invisible
|
||||
watcher.a(6, (Float) (float) health);
|
||||
watcher.a(2, (String) text); //Entity name
|
||||
watcher.a(3, (Byte) (byte) 0); //Show name, 1 = show, 0 = don't show
|
||||
watcher.a(16, (Integer) (int) health); //Health
|
||||
watcher.a(20, (Integer) (int) 881); //Inv
|
||||
|
||||
int i1 = watcher.getByte(0);
|
||||
watcher.watch(0, Byte.valueOf((byte)(i1 | 1 << 5)));
|
||||
watcher.a(0, (Byte) (byte) (0 | 1 << 5), Entity.META_ENTITYDATA, (byte) (0 | 1 << 5)); // Flags, 0x20 = invisible
|
||||
watcher.a(6, (Float) (float) health, EntityLiving.META_HEALTH, (float) health);
|
||||
watcher.a(2, (String) text, Entity.META_CUSTOMNAME, text); // Entity name
|
||||
watcher.a(3, (Byte) (byte) 0, Entity.META_CUSTOMNAME_VISIBLE, false); // Show name, 1 = show, 0 = don't show
|
||||
// watcher.a(16, (Integer) (int) health, EntityWither.META); //Health
|
||||
watcher.a(20, (Integer) (int) 881, EntityWither.META_INVUL_TIME, 881); // Inv
|
||||
|
||||
return watcher;
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher.WatchableObject;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
import net.minecraft.server.v1_8_R3.EntityArmorStand;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.EnumEntityUseAction;
|
||||
@ -519,25 +521,20 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
||||
{
|
||||
DataWatcher watcher = new DataWatcher(new DummyEntity(((CraftWorld) owner.getWorld()).getHandle()));
|
||||
|
||||
watcher.a(0, (byte) (0 | 1 << 5)); // Invisible
|
||||
watcher.a(1, Short.valueOf((short) 300));
|
||||
watcher.a(2, finalEntityName);
|
||||
watcher.a(3, (byte) 1);
|
||||
watcher.a(4, Byte.valueOf((byte) 0));
|
||||
watcher.a(7, Integer.valueOf(0));
|
||||
watcher.a(8, Byte.valueOf((byte) 0));
|
||||
watcher.a(9, Byte.valueOf((byte) 0));
|
||||
watcher.a(6, Float.valueOf(1.0F));
|
||||
watcher.a(10, (byte) (0 | 0x1)); // Small
|
||||
watcher.a(0, (byte) (0 | 1 << 5), Entity.META_ENTITYDATA, (byte) (0 | 1 << 5)); // Invisible
|
||||
watcher.a(1, Short.valueOf((short) 300), Entity.META_AIR, 0);
|
||||
watcher.a(2, finalEntityName, Entity.META_CUSTOMNAME, finalEntityName);
|
||||
watcher.a(3, (byte) 1, Entity.META_CUSTOMNAME_VISIBLE, true);
|
||||
watcher.a(10, (byte) (0 | 0x1), EntityArmorStand.META_ARMOR_OPTION, (byte) (0 | 0x1)); // Small
|
||||
|
||||
if (newPacket)
|
||||
{
|
||||
if (squidId >= 0)
|
||||
{
|
||||
watcher.watch(10, (byte) 16);
|
||||
watcher.watch(10, (byte) 16, EntityArmorStand.META_ARMOR_OPTION, (byte) 16);
|
||||
|
||||
DataWatcher squidWatcher = new DataWatcher(new DummyEntity(((CraftWorld) owner.getWorld()).getHandle()));
|
||||
squidWatcher.a(0, (byte) (0 | 1 << 5));
|
||||
squidWatcher.a(0, (byte) (0 | 1 << 5), Entity.META_ENTITYDATA, (byte) (0 | 1 << 5));
|
||||
|
||||
PacketPlayOutSpawnEntityLiving spawnPacket = new PacketPlayOutSpawnEntityLiving();
|
||||
spawnPacket.a = squidId;
|
||||
@ -545,6 +542,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
||||
spawnPacket.c = 1000000;
|
||||
|
||||
spawnPacket.l = squidWatcher;
|
||||
spawnPacket.uuid = UUID.randomUUID();
|
||||
|
||||
UtilPlayer.sendPacket(owner, spawnPacket);
|
||||
|
||||
@ -562,6 +560,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
|
||||
spawnPacket.c = 1000000;
|
||||
|
||||
spawnPacket.l = watcher;
|
||||
spawnPacket.uuid = UUID.randomUUID();
|
||||
|
||||
UtilPlayer.sendPacket(owner, spawnPacket);
|
||||
|
||||
|
@ -11,6 +11,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
@ -30,6 +31,7 @@ import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
@ -202,7 +204,12 @@ public class AntiHack extends MiniPlugin
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player.isFlying() || player.isInsideVehicle() || player.getGameMode() != GameMode.SURVIVAL || UtilPlayer.isSpectator(player))
|
||||
if (player.isFlying() || ((CraftPlayer) player).getHandle().isGliding() || player.isInsideVehicle() || player.getGameMode() != GameMode.SURVIVAL || UtilPlayer.isSpectator(player))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (UtilInv.IsItem(player.getInventory().getArmorContents()[2], Material.ELYTRA, (byte) 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.EntityCreeper;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
|
||||
|
||||
public class BonusManager extends MiniClientPlugin<BonusClientData> implements ILoginProcessor
|
||||
@ -408,7 +409,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
if (!_enabled)
|
||||
return;
|
||||
|
||||
((CraftEntity)_carlNpc.getEntity()).getHandle().getDataWatcher().watch(16, (byte) -1);
|
||||
((CraftEntity)_carlNpc.getEntity()).getHandle().getDataWatcher().watch(16, (byte) -1, EntityCreeper.META_FUSE_STATE, -1);
|
||||
}
|
||||
|
||||
public void IncreaseSize(Entity player)
|
||||
@ -416,7 +417,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
if (!_enabled)
|
||||
return;
|
||||
|
||||
((CraftEntity)_carlNpc.getEntity()).getHandle().getDataWatcher().watch(16, (byte) 1);
|
||||
((CraftEntity)_carlNpc.getEntity()).getHandle().getDataWatcher().watch(16, (byte) 1, EntityCreeper.META_FUSE_STATE, 1);
|
||||
}
|
||||
|
||||
// DAILY BONUS
|
||||
@ -939,9 +940,9 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
{
|
||||
// Charged
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 0);
|
||||
watcher.a(1, (short) 300);
|
||||
watcher.a(17, (byte) 1);
|
||||
watcher.a(0, (byte) 0, EntityCreeper.META_ENTITYDATA, (byte) 0);
|
||||
watcher.a(1, (short) 300, EntityCreeper.META_AIR, 0);
|
||||
watcher.a(17, (byte) 1, EntityCreeper.META_POWERED, true);
|
||||
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata();
|
||||
packet.a = _carlNpc.getEntity().getEntityId();
|
||||
packet.b = watcher.c();
|
||||
@ -958,7 +959,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
{
|
||||
// Charged
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(17, (byte) 0);
|
||||
watcher.a(17, (byte) 0, EntityCreeper.META_POWERED, false);
|
||||
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata();
|
||||
packet.a = _carlNpc.getEntity().getEntityId();
|
||||
packet.b = watcher.c();
|
||||
|
@ -401,17 +401,17 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
||||
disguise(disguise, true, players);
|
||||
}
|
||||
|
||||
public Packet[] getBedChunkLoadPackets(Player player, Location newLoc)
|
||||
public PacketPlayOutMapChunk[] getBedChunkLoadPackets(Player player, Location newLoc)
|
||||
{
|
||||
prepareChunk(newLoc);
|
||||
|
||||
Packet[] packets = new Packet[2];
|
||||
PacketPlayOutMapChunk[] packets = new PacketPlayOutMapChunk[2];
|
||||
|
||||
// Make unload
|
||||
packets[0] = new PacketPlayOutMapChunk(_bedChunk, true, 0);
|
||||
|
||||
// Make load
|
||||
packets[1] = new PacketPlayOutMapChunkBulk(Arrays.asList(_bedChunk));
|
||||
packets[1] = new PacketPlayOutMapChunk(_bedChunk, true, '\uffff');
|
||||
|
||||
return packets;
|
||||
}
|
||||
@ -823,7 +823,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
||||
|
||||
PacketPlayOutNamedEntitySpawn namePacket = pDisguise.spawnBeforePlayer(player.getLocation());
|
||||
|
||||
namePacket.i.watch(0, (byte) 32);
|
||||
namePacket.i.watch(0, (byte) 32, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 32);
|
||||
|
||||
handlePacket(namePacket, packetVerifier);
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityAgeable;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public abstract class DisguiseAgeable extends DisguiseCreature
|
||||
@ -8,14 +10,7 @@ public abstract class DisguiseAgeable extends DisguiseCreature
|
||||
{
|
||||
super(disguiseType, entity);
|
||||
|
||||
DataWatcher.a(12, new Byte((byte)0));
|
||||
}
|
||||
|
||||
public void UpdateDataWatcher()
|
||||
{
|
||||
super.UpdateDataWatcher();
|
||||
|
||||
DataWatcher.watch(12, DataWatcher.getByte(12));
|
||||
DataWatcher.a(12, new Byte((byte)0), EntityAgeable.META_BABY, false);
|
||||
}
|
||||
|
||||
public boolean isBaby()
|
||||
@ -25,6 +20,6 @@ public abstract class DisguiseAgeable extends DisguiseCreature
|
||||
|
||||
public void setBaby()
|
||||
{
|
||||
DataWatcher.watch(12, new Byte((byte) ( -1 )));
|
||||
DataWatcher.watch(12, new Byte((byte) ( -1 )), EntityAgeable.META_BABY, true);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package mineplex.core.disguise.disguises;
|
||||
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityArmorStand;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
@ -13,12 +14,14 @@ public class DisguiseArmorStand extends DisguiseInsentient
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(10, (byte) 0);
|
||||
DataWatcher.a(10, (byte) 0, EntityArmorStand.META_ARMOR_OPTION, (byte) 0);
|
||||
|
||||
for (int i = 11; i < 17; i++)
|
||||
{
|
||||
DataWatcher.a(i, new Vector3f(0, 0, 0));
|
||||
}
|
||||
DataWatcher.a(11, new Vector3f(0, 0, 0), EntityArmorStand.META_HEAD_POSE, new Vector3f(0, 0, 0));
|
||||
DataWatcher.a(12, new Vector3f(0, 0, 0), EntityArmorStand.META_BODY_POSE, new Vector3f(0, 0, 0));
|
||||
DataWatcher.a(13, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_ARM_POSE, new Vector3f(0, 0, 0));
|
||||
DataWatcher.a(14, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_ARM_POSE, new Vector3f(0, 0, 0));
|
||||
DataWatcher.a(15, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_LEG_POSE, new Vector3f(0, 0, 0));
|
||||
DataWatcher.a(16, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_LEG_POSE, new Vector3f(0, 0, 0));
|
||||
|
||||
// Rotations are from -360 to 360
|
||||
}
|
||||
@ -55,6 +58,7 @@ public class DisguiseArmorStand extends DisguiseInsentient
|
||||
packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.uuid = Entity.getUniqueID();
|
||||
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
@ -103,51 +107,55 @@ public class DisguiseArmorStand extends DisguiseInsentient
|
||||
|
||||
public void setBodyPosition(Vector vector)
|
||||
{
|
||||
DataWatcher.watch(12, convert(vector));
|
||||
DataWatcher.watch(12, convert(vector), EntityArmorStand.META_BODY_POSE, convert(vector));
|
||||
}
|
||||
|
||||
public void setHasArms()
|
||||
{
|
||||
DataWatcher.watch(10, (byte) DataWatcher.getByte(10) | 4);
|
||||
DataWatcher.watch(10, (byte) (DataWatcher.getByte(10) | 4), EntityArmorStand.META_ARMOR_OPTION,
|
||||
(byte) (DataWatcher.getByte(10) | 4));
|
||||
}
|
||||
|
||||
public void setHeadPosition(Vector vector)
|
||||
{
|
||||
DataWatcher.watch(11, convert(vector));
|
||||
DataWatcher.watch(11, convert(vector), EntityArmorStand.META_HEAD_POSE, convert(vector));
|
||||
}
|
||||
|
||||
public void setLeftArmPosition(Vector vector)
|
||||
{
|
||||
DataWatcher.watch(13, convert(vector));
|
||||
DataWatcher.watch(13, convert(vector), EntityArmorStand.META_LEFT_ARM_POSE, convert(vector));
|
||||
}
|
||||
|
||||
public void setLeftLegPosition(Vector vector)
|
||||
{
|
||||
DataWatcher.watch(15, convert(vector));
|
||||
DataWatcher.watch(15, convert(vector), EntityArmorStand.META_LEFT_LEG_POSE, convert(vector));
|
||||
}
|
||||
|
||||
public void setRemoveBase()
|
||||
{
|
||||
DataWatcher.watch(10, (byte) DataWatcher.getByte(10) | 8);
|
||||
DataWatcher.watch(10, (byte) (DataWatcher.getByte(10) | 8), EntityArmorStand.META_ARMOR_OPTION,
|
||||
(byte) (DataWatcher.getByte(10) | 8));
|
||||
}
|
||||
|
||||
public void setRightArmPosition(Vector vector)
|
||||
{
|
||||
DataWatcher.watch(14, convert(vector));
|
||||
DataWatcher.watch(14, convert(vector), EntityArmorStand.META_RIGHT_ARM_POSE, convert(vector));
|
||||
}
|
||||
|
||||
public void setRightLegPosition(Vector vector)
|
||||
{
|
||||
DataWatcher.watch(16, convert(vector));
|
||||
DataWatcher.watch(16, convert(vector), EntityArmorStand.META_RIGHT_LEG_POSE, convert(vector));
|
||||
}
|
||||
|
||||
public void setSmall()
|
||||
{
|
||||
DataWatcher.watch(10, (byte) DataWatcher.getByte(10) | 1);
|
||||
DataWatcher.watch(10, (byte) (DataWatcher.getByte(10) | 1), EntityArmorStand.META_ARMOR_OPTION,
|
||||
(byte) (DataWatcher.getByte(10) | 1));
|
||||
}
|
||||
|
||||
public void setGravityEffected()
|
||||
{
|
||||
DataWatcher.watch(10, (byte) DataWatcher.getByte(10) | 2);
|
||||
DataWatcher.watch(10, (byte) (DataWatcher.getByte(10) | 2), EntityArmorStand.META_ARMOR_OPTION,
|
||||
(byte) (DataWatcher.getByte(10) | 2));
|
||||
}
|
||||
}
|
||||
|
@ -31,10 +31,10 @@ public abstract class DisguiseBase
|
||||
}
|
||||
|
||||
DataWatcher = new DataWatcher(new DummyEntity(null));
|
||||
|
||||
DataWatcher.a(0, Byte.valueOf((byte)0));
|
||||
DataWatcher.a(1, Short.valueOf((short)300));
|
||||
|
||||
|
||||
DataWatcher.a(0, Byte.valueOf((byte) 0), Entity.META_ENTITYDATA, (byte) 0);
|
||||
DataWatcher.a(1, Short.valueOf((short) 300), Entity.META_AIR, 300);
|
||||
|
||||
_soundDisguise = this;
|
||||
}
|
||||
|
||||
@ -45,8 +45,8 @@ public abstract class DisguiseBase
|
||||
|
||||
public void UpdateDataWatcher()
|
||||
{
|
||||
DataWatcher.watch(0, Entity.getDataWatcher().getByte(0));
|
||||
DataWatcher.watch(1, Entity.getDataWatcher().getShort(1));
|
||||
DataWatcher.watch(0, Entity.getDataWatcher().getByte(0), Entity.META_ENTITYDATA, Entity.getDataWatcher().getByte(0));
|
||||
DataWatcher.watch(1, Entity.getDataWatcher().getShort(1), Entity.META_AIR, (int) Entity.getDataWatcher().getShort(1));
|
||||
}
|
||||
|
||||
public abstract Packet GetSpawnPacket();
|
||||
|
@ -1,30 +1,32 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityBat;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseBat extends DisguiseAnimal
|
||||
public class DisguiseBat extends DisguiseCreature
|
||||
{
|
||||
public DisguiseBat(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.BAT, entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte)0));
|
||||
|
||||
DataWatcher.a(16, new Byte((byte) 0), EntityBat.META_UPSIDEDOWN, (byte) 0);
|
||||
}
|
||||
|
||||
public boolean isSitting()
|
||||
public boolean isSitting()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x1) != 0;
|
||||
}
|
||||
|
||||
public void setSitting(boolean paramBoolean)
|
||||
public void setSitting(boolean paramBoolean)
|
||||
{
|
||||
int i = DataWatcher.getByte(16);
|
||||
if (paramBoolean)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(i | 0x1)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (i | 0x1)), EntityBat.META_UPSIDEDOWN, (byte) (i | 0x1));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(i & 0xFFFFFFFE)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (i & 0xFFFFFFFE)), EntityBat.META_UPSIDEDOWN, (byte) (i & 0xFFFFFFFE));
|
||||
}
|
||||
|
||||
|
||||
public String getHurtSound()
|
||||
{
|
||||
return "mob.bat.hurt";
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityBlaze;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseBlaze extends DisguiseMonster
|
||||
@ -7,27 +9,27 @@ public class DisguiseBlaze extends DisguiseMonster
|
||||
public DisguiseBlaze(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.BLAZE, entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte)0));
|
||||
|
||||
DataWatcher.a(16, new Byte((byte) 0), EntityBlaze.META_FIRE, (byte) 0);
|
||||
}
|
||||
|
||||
|
||||
public boolean bT()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x01) != 0;
|
||||
}
|
||||
|
||||
|
||||
public void a(boolean flag)
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
|
||||
if (flag)
|
||||
b0 = (byte)(b0 | 0x1);
|
||||
b0 = (byte) (b0 | 0x1);
|
||||
else
|
||||
b0 = (byte)(b0 | 0xFFFFFFFE);
|
||||
|
||||
DataWatcher.watch(16, Byte.valueOf(b0));
|
||||
b0 = (byte) (b0 | 0xFFFFFFFE);
|
||||
|
||||
DataWatcher.watch(16, Byte.valueOf(b0), EntityBlaze.META_FIRE, b0);
|
||||
}
|
||||
|
||||
|
||||
public String getHurtSound()
|
||||
{
|
||||
return "mob.blaze.hit";
|
||||
|
@ -9,26 +9,26 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity;
|
||||
public class DisguiseBlock extends DisguiseBase
|
||||
{
|
||||
private static Random _random = new Random();
|
||||
|
||||
|
||||
private int _blockId;
|
||||
private int _blockData;
|
||||
|
||||
|
||||
public DisguiseBlock(org.bukkit.entity.Entity entity, int blockId, int blockData)
|
||||
{
|
||||
super(entity);
|
||||
|
||||
|
||||
_blockId = blockId;
|
||||
_blockData = blockData;
|
||||
}
|
||||
|
||||
|
||||
public int GetBlockId()
|
||||
{
|
||||
return _blockId;
|
||||
}
|
||||
|
||||
|
||||
public byte GetBlockData()
|
||||
{
|
||||
return (byte)_blockData;
|
||||
return (byte) _blockData;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,38 +43,45 @@ public class DisguiseBlock extends DisguiseBase
|
||||
packet.i = MathHelper.d(Entity.yaw * 256.0F / 360.0F);
|
||||
packet.j = 70;
|
||||
packet.k = _blockId | _blockData << 12;
|
||||
packet.uuid = Entity.getUniqueID();
|
||||
|
||||
double d1 = Entity.motX;
|
||||
double d2 = Entity.motY;
|
||||
double d3 = Entity.motZ;
|
||||
double d4 = 3.9D;
|
||||
|
||||
if (d1 < -d4) d1 = -d4;
|
||||
if (d2 < -d4) d2 = -d4;
|
||||
if (d3 < -d4) d3 = -d4;
|
||||
if (d1 > d4) d1 = d4;
|
||||
if (d2 > d4) d2 = d4;
|
||||
if (d3 > d4) d3 = d4;
|
||||
|
||||
packet.e = ((int)(d1 * 8000.0D));
|
||||
packet.f = ((int)(d2 * 8000.0D));
|
||||
packet.g = ((int)(d3 * 8000.0D));
|
||||
|
||||
if (d1 < -d4)
|
||||
d1 = -d4;
|
||||
if (d2 < -d4)
|
||||
d2 = -d4;
|
||||
if (d3 < -d4)
|
||||
d3 = -d4;
|
||||
if (d1 > d4)
|
||||
d1 = d4;
|
||||
if (d2 > d4)
|
||||
d2 = d4;
|
||||
if (d3 > d4)
|
||||
d3 = d4;
|
||||
|
||||
packet.e = ((int) (d1 * 8000.0D));
|
||||
packet.f = ((int) (d2 * 8000.0D));
|
||||
packet.g = ((int) (d3 * 8000.0D));
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "damage.hit";
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "damage.hit";
|
||||
}
|
||||
|
||||
protected float getPitch()
|
||||
{
|
||||
return (_random.nextFloat() - _random.nextFloat()) * 0.2F + 1.0F;
|
||||
}
|
||||
protected float getVolume()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
protected float getPitch()
|
||||
{
|
||||
return (_random.nextFloat() - _random.nextFloat()) * 0.2F + 1.0F;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityOcelot;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseCat extends DisguiseTameableAnimal
|
||||
@ -8,21 +10,21 @@ public class DisguiseCat extends DisguiseTameableAnimal
|
||||
{
|
||||
super(EntityType.OCELOT, entity);
|
||||
|
||||
DataWatcher.a(18, Byte.valueOf((byte)0));
|
||||
DataWatcher.a(18, Byte.valueOf((byte) 0), EntityOcelot.META_TYPE, 0);
|
||||
}
|
||||
|
||||
|
||||
public int getCatType()
|
||||
{
|
||||
return DataWatcher.getByte(18);
|
||||
}
|
||||
|
||||
public void setCatType(int i)
|
||||
public void setCatType(int i)
|
||||
{
|
||||
DataWatcher.watch(18, Byte.valueOf((byte)i));
|
||||
DataWatcher.watch(18, Byte.valueOf((byte) i), EntityOcelot.META_TYPE, i);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.cat.hitt";
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package mineplex.core.disguise.disguises;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntitySpider;
|
||||
|
||||
public class DisguiseCaveSpider extends DisguiseMonster
|
||||
{
|
||||
|
||||
@ -9,7 +11,7 @@ public class DisguiseCaveSpider extends DisguiseMonster
|
||||
{
|
||||
super(EntityType.CAVE_SPIDER, entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte) 0));
|
||||
DataWatcher.a(16, new Byte((byte) 0), EntitySpider.META_CLIMBING, (byte) 0);
|
||||
}
|
||||
|
||||
public boolean bT()
|
||||
@ -26,7 +28,7 @@ public class DisguiseCaveSpider extends DisguiseMonster
|
||||
else
|
||||
b0 = (byte) (b0 & 0xFFFFFFFE);
|
||||
|
||||
DataWatcher.watch(16, Byte.valueOf(b0));
|
||||
DataWatcher.watch(16, Byte.valueOf(b0), EntitySpider.META_CLIMBING, b0);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
|
@ -33,6 +33,7 @@ public abstract class DisguiseCreature extends DisguiseInsentient
|
||||
packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.uuid = Entity.getUniqueID();
|
||||
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityCreeper;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseCreeper extends DisguiseMonster
|
||||
@ -7,33 +9,33 @@ public class DisguiseCreeper extends DisguiseMonster
|
||||
public DisguiseCreeper(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.CREEPER, entity);
|
||||
|
||||
DataWatcher.a(16, Byte.valueOf((byte)-1));
|
||||
DataWatcher.a(17, Byte.valueOf((byte)0));
|
||||
|
||||
DataWatcher.a(16, Byte.valueOf((byte) -1), EntityCreeper.META_FUSE_STATE, -1);
|
||||
DataWatcher.a(17, Byte.valueOf((byte) 0), EntityCreeper.META_POWERED, false);
|
||||
}
|
||||
|
||||
|
||||
public boolean IsPowered()
|
||||
{
|
||||
return DataWatcher.getByte(17) == 1;
|
||||
}
|
||||
|
||||
|
||||
public void SetPowered(boolean powered)
|
||||
{
|
||||
DataWatcher.watch(17, Byte.valueOf((byte)(powered ? 1 : 0)));
|
||||
DataWatcher.watch(17, Byte.valueOf((byte) (powered ? 1 : 0)), EntityCreeper.META_POWERED, powered);
|
||||
}
|
||||
|
||||
|
||||
public int bV()
|
||||
{
|
||||
return DataWatcher.getByte(16);
|
||||
}
|
||||
|
||||
|
||||
public void a(int i)
|
||||
{
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)i));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) i), EntityCreeper.META_FUSE_STATE, i);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.creeper.say";
|
||||
}
|
||||
}
|
||||
|
@ -2,50 +2,71 @@ package mineplex.core.disguise.disguises;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.Block;
|
||||
import net.minecraft.server.v1_8_R3.Blocks;
|
||||
import net.minecraft.server.v1_8_R3.EntityEnderman;
|
||||
import net.minecraft.server.v1_8_R3.EntityLiving;
|
||||
import net.minecraft.server.v1_8_R3.IBlockData;
|
||||
import net.minecraft.server.v1_8_R3.MobEffect;
|
||||
import net.minecraft.server.v1_8_R3.MobEffectList;
|
||||
import net.minecraft.server.v1_8_R3.PotionBrewer;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
public class DisguiseEnderman extends DisguiseMonster
|
||||
{
|
||||
public DisguiseEnderman(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.ENDERMAN, entity);
|
||||
|
||||
DataWatcher.a(16, new Short( (short) 0));
|
||||
DataWatcher.a(17, new Byte( (byte) 0));
|
||||
DataWatcher.a(18, new Byte( (byte) 0));
|
||||
|
||||
int i = PotionBrewer.a(Arrays.asList(new MobEffect(MobEffectList.FIRE_RESISTANCE.id, 777)));
|
||||
DataWatcher.watch(8, Byte.valueOf((byte)(PotionBrewer.b(Arrays.asList(new MobEffect(MobEffectList.FIRE_RESISTANCE.id, 777))) ? 1 : 0)));
|
||||
DataWatcher.watch(7, Integer.valueOf(i));
|
||||
|
||||
DataWatcher.a(16, new Short((short) 0), EntityEnderman.META_BLOCK, Optional.<IBlockData> absent());
|
||||
DataWatcher.a(17, new Byte((byte) 0), EntityEnderman.META_BLOCK, Optional.<IBlockData> absent());
|
||||
DataWatcher.a(18, new Byte((byte) 0), EntityEnderman.META_ANGRY, false);
|
||||
|
||||
int i = PotionBrewer.a(Arrays.asList(new MobEffect(MobEffectList.FIRE_RESISTANCE.id, 777)));
|
||||
DataWatcher.watch(8, Byte.valueOf((byte) (PotionBrewer.b(Arrays.asList(new MobEffect(MobEffectList.FIRE_RESISTANCE.id,
|
||||
777))) ? 1 : 0)), EntityLiving.META_AMBIENT_POTION, PotionBrewer.b(Arrays.asList(new MobEffect(
|
||||
MobEffectList.FIRE_RESISTANCE.id, 777))));
|
||||
DataWatcher.watch(7, Integer.valueOf(i), EntityLiving.META_POTION_COLOR, i);
|
||||
}
|
||||
|
||||
public void UpdateDataWatcher()
|
||||
{
|
||||
super.UpdateDataWatcher();
|
||||
|
||||
DataWatcher.watch(0, Byte.valueOf((byte)(DataWatcher.getByte(0) & ~(1 << 0))));
|
||||
DataWatcher.watch(16, DataWatcher.getShort(16));
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (DataWatcher.getByte(0) & ~(1 << 0))), Entity.META_ENTITYDATA,
|
||||
(byte) (DataWatcher.getByte(0) & ~(1 << 0)));
|
||||
DataWatcher.watch(16, DataWatcher.getShort(16), EntityEnderman.META_BLOCK, getBlock(DataWatcher.getShort(16)));
|
||||
}
|
||||
|
||||
|
||||
private Optional<IBlockData> getBlock(int i)
|
||||
{
|
||||
Block b = Block.getById(i);
|
||||
if (b != null && b != Blocks.AIR)
|
||||
{
|
||||
return Optional.fromNullable(b.getBlockData());
|
||||
}
|
||||
|
||||
return Optional.fromNullable(null);
|
||||
}
|
||||
|
||||
public void SetCarriedId(int i)
|
||||
{
|
||||
DataWatcher.watch(16, new Short( (short)(i & 0xFF)) );
|
||||
DataWatcher.watch(16, new Short((short) (i & 0xFF)), EntityEnderman.META_BLOCK, getBlock(i));
|
||||
}
|
||||
|
||||
|
||||
public int GetCarriedId()
|
||||
{
|
||||
return DataWatcher.getByte(16);
|
||||
}
|
||||
|
||||
|
||||
public void SetCarriedData(int i)
|
||||
{
|
||||
DataWatcher.watch(17, Byte.valueOf((byte)(i & 0xFF)));
|
||||
DataWatcher.watch(17, Byte.valueOf((byte) (i & 0xFF)), EntityEnderman.META_BLOCK, getBlock(0));
|
||||
}
|
||||
|
||||
|
||||
public int GetCarriedData()
|
||||
{
|
||||
return DataWatcher.getByte(17);
|
||||
@ -55,14 +76,14 @@ public class DisguiseEnderman extends DisguiseMonster
|
||||
{
|
||||
return DataWatcher.getByte(18) > 0;
|
||||
}
|
||||
|
||||
|
||||
public void a(boolean flag)
|
||||
{
|
||||
DataWatcher.watch(18, Byte.valueOf((byte)(flag ? 1 : 0)));
|
||||
DataWatcher.watch(18, Byte.valueOf((byte) (flag ? 1 : 0)), EntityEnderman.META_ANGRY, flag);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.endermen.hit";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.endermen.hit";
|
||||
}
|
||||
}
|
||||
|
@ -2,23 +2,25 @@ package mineplex.core.disguise.disguises;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityGuardian;
|
||||
|
||||
public class DisguiseGuardian extends DisguiseCreature
|
||||
{
|
||||
public DisguiseGuardian(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.GUARDIAN, entity);
|
||||
DataWatcher.a(16, 0);
|
||||
DataWatcher.a(17, 0);
|
||||
DataWatcher.a(16, 0, EntityGuardian.META_ELDER, (byte) 0);
|
||||
DataWatcher.a(17, 0, EntityGuardian.META_TARGET, 0);
|
||||
}
|
||||
|
||||
public void setTarget(int target)
|
||||
{
|
||||
DataWatcher.watch(17, target);
|
||||
DataWatcher.watch(17, target, EntityGuardian.META_TARGET, target);
|
||||
}
|
||||
|
||||
public void setElder(boolean elder)
|
||||
{
|
||||
DataWatcher.watch(16, Integer.valueOf(DataWatcher.getInt(16) | 4));
|
||||
DataWatcher.watch(16, Integer.valueOf(DataWatcher.getInt(16) | 4), EntityGuardian.META_ELDER, (byte) (DataWatcher.getInt(16) | 4));
|
||||
}
|
||||
|
||||
public boolean isElder()
|
||||
|
@ -1,23 +1,29 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityHorse;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
public class DisguiseHorse extends DisguiseAnimal
|
||||
{
|
||||
public DisguiseHorse(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.HORSE, entity);
|
||||
|
||||
DataWatcher.a(16, Integer.valueOf(0));
|
||||
DataWatcher.a(19, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(20, Integer.valueOf(0));
|
||||
DataWatcher.a(21, String.valueOf(""));
|
||||
DataWatcher.a(22, Integer.valueOf(0));
|
||||
DataWatcher.a(16, Integer.valueOf(0), EntityHorse.META_HORSE_STATE, (byte) 0);
|
||||
DataWatcher.a(19, Byte.valueOf((byte) 0), EntityHorse.META_TYPE, 0);
|
||||
DataWatcher.a(20, Integer.valueOf(0), EntityHorse.META_VARIANT, 0);
|
||||
DataWatcher.a(21, String.valueOf(""), EntityHorse.META_OWNER, Optional.<UUID> absent());
|
||||
DataWatcher.a(22, Integer.valueOf(0), EntityHorse.META_ARMOR, 0);
|
||||
}
|
||||
|
||||
public void setType(Horse.Variant horseType)
|
||||
{
|
||||
DataWatcher.watch(19, Byte.valueOf((byte) horseType.ordinal()));
|
||||
DataWatcher.watch(19, Byte.valueOf((byte) horseType.ordinal()), EntityHorse.META_TYPE, horseType.ordinal());
|
||||
}
|
||||
|
||||
public Horse.Variant getType()
|
||||
@ -27,7 +33,7 @@ public class DisguiseHorse extends DisguiseAnimal
|
||||
|
||||
public void setVariant(Horse.Color color)
|
||||
{
|
||||
DataWatcher.watch(20, Integer.valueOf(color.ordinal()));
|
||||
DataWatcher.watch(20, Integer.valueOf(color.ordinal()), EntityHorse.META_VARIANT, color.ordinal());
|
||||
}
|
||||
|
||||
public Horse.Color getVariant()
|
||||
@ -35,49 +41,35 @@ public class DisguiseHorse extends DisguiseAnimal
|
||||
return Horse.Color.values()[DataWatcher.getInt(20)];
|
||||
}
|
||||
|
||||
private boolean w(int i)
|
||||
{
|
||||
return (DataWatcher.getInt(16) & i) != 0;
|
||||
}
|
||||
|
||||
public void kick()
|
||||
{
|
||||
b(32, false);
|
||||
b(64, true);
|
||||
b(32, false);
|
||||
b(64, true);
|
||||
}
|
||||
|
||||
|
||||
public void stopKick()
|
||||
{
|
||||
b(64, false);
|
||||
b(64, false);
|
||||
}
|
||||
|
||||
|
||||
private void b(int i, boolean flag)
|
||||
{
|
||||
int j = DataWatcher.getInt(16);
|
||||
|
||||
if (flag)
|
||||
DataWatcher.watch(16, Integer.valueOf(j | i));
|
||||
DataWatcher.watch(16, Integer.valueOf(j | i), EntityHorse.META_HORSE_STATE, (byte) (j | i));
|
||||
else
|
||||
DataWatcher.watch(16, Integer.valueOf(j & (i ^ 0xFFFFFFFF)));
|
||||
DataWatcher.watch(16, Integer.valueOf(j & (i ^ 0xFFFFFFFF)), EntityHorse.META_HORSE_STATE,
|
||||
(byte) (j & (i ^ 0xFFFFFFFF)));
|
||||
}
|
||||
|
||||
public String getOwnerName()
|
||||
{
|
||||
return DataWatcher.getString(21);
|
||||
}
|
||||
|
||||
public void setOwnerName(String s)
|
||||
{
|
||||
DataWatcher.watch(21, s);
|
||||
}
|
||||
|
||||
public int cf()
|
||||
public int getArmor()
|
||||
{
|
||||
return DataWatcher.getInt(22);
|
||||
}
|
||||
|
||||
public void r(int i)
|
||||
public void setArmor(int i)
|
||||
{
|
||||
DataWatcher.watch(22, Integer.valueOf(i));
|
||||
DataWatcher.watch(22, Integer.valueOf(i), EntityHorse.META_ARMOR, i);
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,16 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||
|
||||
public abstract class DisguiseHuman extends DisguiseLiving
|
||||
{
|
||||
public DisguiseHuman(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(10, (byte) 0); // todo
|
||||
DataWatcher.a(16, (byte) 0);
|
||||
DataWatcher.a(17, Float.valueOf(0.0F));
|
||||
DataWatcher.a(18, Integer.valueOf(0));
|
||||
|
||||
DataWatcher.a(10, (byte) 0, EntityHuman.META_SKIN, (byte) 0); // todo
|
||||
DataWatcher.a(16, (byte) 1, EntityHuman.META_CAPE, (byte) 1);
|
||||
DataWatcher.a(17, Float.valueOf(0.0F), EntityHuman.META_SCALED_HEALTH, 0f);
|
||||
DataWatcher.a(18, Integer.valueOf(0), EntityHuman.META_SCORE, 0);
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,27 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import mineplex.core.common.*;
|
||||
import net.minecraft.server.v1_8_R3.EntityInsentient;
|
||||
|
||||
import org.bukkit.*;
|
||||
|
||||
public abstract class DisguiseInsentient extends DisguiseLiving
|
||||
{
|
||||
private boolean _showArmor;
|
||||
|
||||
private boolean _showArmor;
|
||||
|
||||
public DisguiseInsentient(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(3, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(2, "");
|
||||
DataWatcher.a(3, Byte.valueOf((byte) 0), EntityInsentient.META_CUSTOMNAME_VISIBLE, false);
|
||||
DataWatcher.a(2, "", EntityInsentient.META_CUSTOMNAME, "");
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
setName(name, null);
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name, Rank rank)
|
||||
{
|
||||
if (rank != null)
|
||||
@ -30,35 +32,34 @@ public abstract class DisguiseInsentient extends DisguiseLiving
|
||||
}
|
||||
}
|
||||
|
||||
DataWatcher.watch(2, name);
|
||||
DataWatcher.watch(2, name, EntityInsentient.META_CUSTOMNAME, name);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasCustomName()
|
||||
{
|
||||
return DataWatcher.getString(2).length() > 0;
|
||||
}
|
||||
|
||||
|
||||
public void setCustomNameVisible(boolean visible)
|
||||
{
|
||||
DataWatcher.watch(3, Byte.valueOf((byte)(visible ? 1 : 0)));
|
||||
DataWatcher.watch(3, Byte.valueOf((byte) (visible ? 1 : 0)), EntityInsentient.META_CUSTOMNAME_VISIBLE, visible);
|
||||
}
|
||||
|
||||
|
||||
public boolean getCustomNameVisible()
|
||||
{
|
||||
return DataWatcher.getByte(11) == 1;
|
||||
}
|
||||
|
||||
|
||||
public boolean armorVisible()
|
||||
{
|
||||
return _showArmor;
|
||||
}
|
||||
|
||||
|
||||
public void showArmor()
|
||||
{
|
||||
_showArmor = true;
|
||||
}
|
||||
|
||||
|
||||
public void hideArmor()
|
||||
{
|
||||
_showArmor = false;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityIronGolem;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseIronGolem extends DisguiseGolem
|
||||
@ -8,26 +10,27 @@ public class DisguiseIronGolem extends DisguiseGolem
|
||||
{
|
||||
super(EntityType.IRON_GOLEM, entity);
|
||||
|
||||
DataWatcher.a(16, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
public boolean bW()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x1) != 0;
|
||||
DataWatcher.a(16, Byte.valueOf((byte) 0), EntityIronGolem.META_PLAYER_CREATED, (byte) 0);
|
||||
}
|
||||
|
||||
public void setPlayerCreated(boolean flag)
|
||||
public boolean bW()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x1) != 0;
|
||||
}
|
||||
|
||||
public void setPlayerCreated(boolean flag)
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
|
||||
if (flag)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 | 0x1)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (b0 | 0x1)), EntityIronGolem.META_PLAYER_CREATED, (byte) (b0 | 0x1));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 & 0xFFFFFFFE)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (b0 & 0xFFFFFFFE)), EntityIronGolem.META_PLAYER_CREATED,
|
||||
(byte) (b0 & 0xFFFFFFFE));
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.irongolem.hit";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.irongolem.hit";
|
||||
}
|
||||
}
|
||||
|
@ -21,10 +21,10 @@ public abstract class DisguiseLiving extends DisguiseBase
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(6, Float.valueOf(1.0F));
|
||||
DataWatcher.a(7, Integer.valueOf(0));
|
||||
DataWatcher.a(8, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(9, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(6, Float.valueOf(1.0F), EntityLiving.META_HEALTH, 1F);
|
||||
DataWatcher.a(7, Integer.valueOf(0), EntityLiving.META_POTION_COLOR, 0);
|
||||
DataWatcher.a(8, Byte.valueOf((byte) 0), EntityLiving.META_AMBIENT_POTION, false);
|
||||
DataWatcher.a(9, Byte.valueOf((byte) 0), EntityLiving.META_ARROWS, 0);
|
||||
}
|
||||
|
||||
public ItemStack[] getEquipment()
|
||||
@ -106,16 +106,20 @@ public abstract class DisguiseLiving extends DisguiseBase
|
||||
byte b0 = DataWatcher.getByte(0);
|
||||
|
||||
if (_invisible)
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 | 1 << 5)));
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 | 1 << 5)), EntityLiving.META_ENTITYDATA, (byte) (b0 | 1 << 5));
|
||||
else
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 & ~(1 << 5))));
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 & ~(1 << 5))), EntityLiving.META_ENTITYDATA, (byte) (b0 & ~(1 << 5)));
|
||||
|
||||
if (Entity instanceof EntityLiving)
|
||||
{
|
||||
DataWatcher.watch(6, Entity.getDataWatcher().getFloat(6));
|
||||
DataWatcher.watch(7, Entity.getDataWatcher().getInt(7));
|
||||
DataWatcher.watch(8, Entity.getDataWatcher().getByte(8));
|
||||
DataWatcher.watch(9, Entity.getDataWatcher().getByte(9));
|
||||
DataWatcher.watch(6, Entity.getDataWatcher().getFloat(6), EntityLiving.META_HEALTH,
|
||||
Entity.getDataWatcher().getFloat(6));
|
||||
DataWatcher.watch(7, Entity.getDataWatcher().getInt(7), EntityLiving.META_POTION_COLOR, Entity.getDataWatcher()
|
||||
.getInt(7));
|
||||
DataWatcher.watch(8, Entity.getDataWatcher().getByte(8), EntityLiving.META_AMBIENT_POTION, Entity.getDataWatcher()
|
||||
.getByte(8) == 1);
|
||||
DataWatcher.watch(9, Entity.getDataWatcher().getByte(9), EntityLiving.META_ARROWS, (int) Entity.getDataWatcher()
|
||||
.getByte(9));
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +150,7 @@ public abstract class DisguiseLiving extends DisguiseBase
|
||||
|
||||
public void setHealth(float health)
|
||||
{
|
||||
DataWatcher.watch(6, Float.valueOf(health));
|
||||
DataWatcher.watch(6, Float.valueOf(health), EntityLiving.META_HEALTH, health);
|
||||
}
|
||||
|
||||
public float getHealth()
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntitySlime;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
@ -10,14 +11,14 @@ public class DisguiseMagmaCube extends DisguiseInsentient
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte)1));
|
||||
DataWatcher.a(16, new Byte((byte) 1), EntitySlime.META_SIZE, 1);
|
||||
}
|
||||
|
||||
|
||||
public void SetSize(int i)
|
||||
{
|
||||
DataWatcher.watch(16, new Byte((byte)i));
|
||||
DataWatcher.watch(16, new Byte((byte) i), EntitySlime.META_SIZE, i);
|
||||
}
|
||||
|
||||
|
||||
public int GetSize()
|
||||
{
|
||||
return DataWatcher.getByte(16);
|
||||
@ -28,65 +29,66 @@ public class DisguiseMagmaCube extends DisguiseInsentient
|
||||
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
|
||||
packet.a = Entity.getId();
|
||||
packet.b = (byte) 62;
|
||||
packet.c = (int)MathHelper.floor(Entity.locX * 32D);
|
||||
packet.d = (int)MathHelper.floor(Entity.locY * 32.0D);
|
||||
packet.e = (int)MathHelper.floor(Entity.locZ * 32D);
|
||||
packet.c = (int) MathHelper.floor(Entity.locX * 32D);
|
||||
packet.d = (int) MathHelper.floor(Entity.locY * 32.0D);
|
||||
packet.e = (int) MathHelper.floor(Entity.locZ * 32D);
|
||||
packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.uuid = Entity.getUniqueID();
|
||||
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
double var6 = 0;
|
||||
double var8 = 0;
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
double var6 = 0;
|
||||
double var8 = 0;
|
||||
|
||||
if (var4 < -var2)
|
||||
{
|
||||
var4 = -var2;
|
||||
}
|
||||
if (var4 < -var2)
|
||||
{
|
||||
var4 = -var2;
|
||||
}
|
||||
|
||||
if (var6 < -var2)
|
||||
{
|
||||
var6 = -var2;
|
||||
}
|
||||
if (var6 < -var2)
|
||||
{
|
||||
var6 = -var2;
|
||||
}
|
||||
|
||||
if (var8 < -var2)
|
||||
{
|
||||
var8 = -var2;
|
||||
}
|
||||
if (var8 < -var2)
|
||||
{
|
||||
var8 = -var2;
|
||||
}
|
||||
|
||||
if (var4 > var2)
|
||||
{
|
||||
var4 = var2;
|
||||
}
|
||||
if (var4 > var2)
|
||||
{
|
||||
var4 = var2;
|
||||
}
|
||||
|
||||
if (var6 > var2)
|
||||
{
|
||||
var6 = var2;
|
||||
}
|
||||
if (var6 > var2)
|
||||
{
|
||||
var6 = var2;
|
||||
}
|
||||
|
||||
if (var8 > var2)
|
||||
{
|
||||
var8 = var2;
|
||||
}
|
||||
if (var8 > var2)
|
||||
{
|
||||
var8 = var2;
|
||||
}
|
||||
|
||||
packet.f = (int) (var4 * 8000.0D);
|
||||
packet.g = (int) (var6 * 8000.0D);
|
||||
packet.h = (int) (var8 * 8000.0D);
|
||||
|
||||
packet.l = DataWatcher;
|
||||
packet.m = DataWatcher.b();
|
||||
|
||||
packet.f = (int)(var4 * 8000.0D);
|
||||
packet.g = (int)(var6 * 8000.0D);
|
||||
packet.h = (int)(var8 * 8000.0D);
|
||||
|
||||
packet.l = DataWatcher;
|
||||
packet.m = DataWatcher.b();
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.slime." + (GetSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 0.4F * (float)GetSize();
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.slime." + (GetSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 0.4F * (float) GetSize();
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.block.BlockFace;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import mineplex.core.common.skin.SkinData;
|
||||
import net.minecraft.server.v1_8_R3.EntityHuman;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutNamedEntitySpawn;
|
||||
@ -17,31 +18,31 @@ import net.minecraft.server.v1_8_R3.WorldSettings;
|
||||
|
||||
public class DisguisePlayer extends DisguiseHuman
|
||||
{
|
||||
private GameProfile _profile;
|
||||
private boolean _sneaking;
|
||||
private BlockFace _sleeping;
|
||||
private GameProfile _profile;
|
||||
private boolean _sneaking;
|
||||
private BlockFace _sleeping;
|
||||
private boolean _sendSkinToSelf;
|
||||
|
||||
public DisguisePlayer(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
}
|
||||
public DisguisePlayer(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
}
|
||||
|
||||
public DisguisePlayer(org.bukkit.entity.Entity entity, GameProfile profile)
|
||||
{
|
||||
this(entity);
|
||||
public DisguisePlayer(org.bukkit.entity.Entity entity, GameProfile profile)
|
||||
{
|
||||
this(entity);
|
||||
|
||||
setProfile(profile);
|
||||
}
|
||||
setProfile(profile);
|
||||
}
|
||||
|
||||
public void setProfile(GameProfile profile)
|
||||
{
|
||||
GameProfile newProfile = new GameProfile(UUID.randomUUID(), profile.getName());
|
||||
public void setProfile(GameProfile profile)
|
||||
{
|
||||
GameProfile newProfile = new GameProfile(UUID.randomUUID(), profile.getName());
|
||||
|
||||
newProfile.getProperties().putAll(profile.getProperties());
|
||||
newProfile.getProperties().putAll(profile.getProperties());
|
||||
|
||||
_profile = newProfile;
|
||||
}
|
||||
_profile = newProfile;
|
||||
}
|
||||
|
||||
public GameProfile getProfile()
|
||||
{
|
||||
@ -66,28 +67,28 @@ public class DisguisePlayer extends DisguiseHuman
|
||||
return _sendSkinToSelf;
|
||||
}
|
||||
|
||||
public BlockFace getSleepingDirection()
|
||||
{
|
||||
return _sleeping;
|
||||
}
|
||||
public BlockFace getSleepingDirection()
|
||||
{
|
||||
return _sleeping;
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't use this if the disguise is already on as it will not work the way
|
||||
* you want it to. Contact libraryaddict if you need that added.
|
||||
*/
|
||||
public void setSleeping(BlockFace sleeping)
|
||||
{
|
||||
_sleeping = sleeping;
|
||||
}
|
||||
/**
|
||||
* Don't use this if the disguise is already on as it will not work the way you want it to. Contact libraryaddict if you need
|
||||
* that added.
|
||||
*/
|
||||
public void setSleeping(BlockFace sleeping)
|
||||
{
|
||||
_sleeping = sleeping;
|
||||
}
|
||||
|
||||
public void setSneaking(boolean sneaking)
|
||||
{
|
||||
_sneaking = sneaking;
|
||||
}
|
||||
|
||||
public boolean getSneaking()
|
||||
{
|
||||
return _sneaking;
|
||||
public void setSneaking(boolean sneaking)
|
||||
{
|
||||
_sneaking = sneaking;
|
||||
}
|
||||
|
||||
public boolean getSneaking()
|
||||
{
|
||||
return _sneaking;
|
||||
}
|
||||
|
||||
public Packet getNewInfoPacket(boolean add)
|
||||
@ -103,56 +104,55 @@ public class DisguisePlayer extends DisguiseHuman
|
||||
return newDisguiseInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void UpdateDataWatcher()
|
||||
{
|
||||
super.UpdateDataWatcher();
|
||||
@Override
|
||||
public void UpdateDataWatcher()
|
||||
{
|
||||
super.UpdateDataWatcher();
|
||||
|
||||
byte b0 = DataWatcher.getByte(0);
|
||||
DataWatcher.watch(10, (Object)(byte)0x40);
|
||||
|
||||
if(_sneaking)
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 | 1 << 1)));
|
||||
else
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 & ~(1 << 1))));
|
||||
}
|
||||
byte b0 = DataWatcher.getByte(0);
|
||||
|
||||
public PacketPlayOutNamedEntitySpawn spawnBeforePlayer(Location spawnLocation)
|
||||
{
|
||||
Location loc = spawnLocation.add(spawnLocation.getDirection().normalize().multiply(30));
|
||||
loc.setY(Math.max(loc.getY(), 0));
|
||||
if (_sneaking)
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 | 1 << 1)), EntityHuman.META_ENTITYDATA, (byte) (b0 | 1 << 1));
|
||||
else
|
||||
DataWatcher.watch(0, Byte.valueOf((byte) (b0 & ~(1 << 1))), EntityHuman.META_ENTITYDATA, (byte) (b0 & ~(1 << 1)));
|
||||
}
|
||||
|
||||
PacketPlayOutNamedEntitySpawn packet = new PacketPlayOutNamedEntitySpawn();
|
||||
packet.a = Entity.getId();
|
||||
packet.b = _profile.getId();
|
||||
packet.c = MathHelper.floor(loc.getX() * 32.0D);
|
||||
packet.d = MathHelper.floor(loc.getY() * 32.0D);
|
||||
packet.e = MathHelper.floor(loc.getZ() * 32.0D);
|
||||
packet.f = (byte) ((int) (loc.getYaw() * 256.0F / 360.0F));
|
||||
packet.g = (byte) ((int) (loc.getPitch() * 256.0F / 360.0F));
|
||||
packet.i = DataWatcher;
|
||||
public PacketPlayOutNamedEntitySpawn spawnBeforePlayer(Location spawnLocation)
|
||||
{
|
||||
Location loc = spawnLocation.add(spawnLocation.getDirection().normalize().multiply(30));
|
||||
loc.setY(Math.max(loc.getY(), 0));
|
||||
|
||||
return packet;
|
||||
}
|
||||
PacketPlayOutNamedEntitySpawn packet = new PacketPlayOutNamedEntitySpawn();
|
||||
packet.a = Entity.getId();
|
||||
packet.b = _profile.getId();
|
||||
packet.c = MathHelper.floor(loc.getX() * 32.0D);
|
||||
packet.d = MathHelper.floor(loc.getY() * 32.0D);
|
||||
packet.e = MathHelper.floor(loc.getZ() * 32.0D);
|
||||
packet.f = (byte) ((int) (loc.getYaw() * 256.0F / 360.0F));
|
||||
packet.g = (byte) ((int) (loc.getPitch() * 256.0F / 360.0F));
|
||||
packet.i = DataWatcher;
|
||||
|
||||
@Override
|
||||
public PacketPlayOutNamedEntitySpawn GetSpawnPacket()
|
||||
{
|
||||
PacketPlayOutNamedEntitySpawn packet = new PacketPlayOutNamedEntitySpawn();
|
||||
packet.a = Entity.getId();
|
||||
packet.b = _profile.getId();
|
||||
packet.c = MathHelper.floor(Entity.locX * 32.0D);
|
||||
packet.d = MathHelper.floor(Entity.locY * 32.0D);
|
||||
packet.e = MathHelper.floor(Entity.locZ * 32.0D);
|
||||
packet.f = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.g = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.i = DataWatcher;
|
||||
return packet;
|
||||
}
|
||||
|
||||
return packet;
|
||||
}
|
||||
@Override
|
||||
public PacketPlayOutNamedEntitySpawn GetSpawnPacket()
|
||||
{
|
||||
PacketPlayOutNamedEntitySpawn packet = new PacketPlayOutNamedEntitySpawn();
|
||||
packet.a = Entity.getId();
|
||||
packet.b = _profile.getId();
|
||||
packet.c = MathHelper.floor(Entity.locX * 32.0D);
|
||||
packet.d = MathHelper.floor(Entity.locY * 32.0D);
|
||||
packet.e = MathHelper.floor(Entity.locZ * 32.0D);
|
||||
packet.f = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.g = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.i = DataWatcher;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return _profile.getName();
|
||||
}
|
||||
return packet;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return _profile.getName();
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,20 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityRabbit;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
public class DisguiseRabbit extends DisguiseInsentient
|
||||
public class DisguiseRabbit extends DisguiseAnimal
|
||||
{
|
||||
|
||||
public DisguiseRabbit(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(entity);
|
||||
super(EntityType.RABBIT, entity);
|
||||
|
||||
DataWatcher.a(4, Byte.valueOf((byte) 0));
|
||||
|
||||
DataWatcher.a(12, (byte) 0);
|
||||
DataWatcher.a(15, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(18, Byte.valueOf((byte) 0));
|
||||
DataWatcher.a(18, Byte.valueOf((byte) 0), EntityRabbit.META_TYPE, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -30,6 +29,7 @@ public class DisguiseRabbit extends DisguiseInsentient
|
||||
packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.uuid = Entity.getUniqueID();
|
||||
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntitySheep;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
@ -9,34 +11,35 @@ public class DisguiseSheep extends DisguiseAnimal
|
||||
{
|
||||
super(EntityType.SHEEP, entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte)0));
|
||||
DataWatcher.a(16, new Byte((byte) 0), EntitySheep.META_WOOL_STATE, (byte) 0);
|
||||
}
|
||||
|
||||
|
||||
public boolean isSheared()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 16) != 0;
|
||||
}
|
||||
|
||||
|
||||
public void setSheared(boolean sheared)
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
if (sheared)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 | 16)));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 & -17)));
|
||||
if (sheared)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (b0 | 16)), EntitySheep.META_WOOL_STATE, (byte) (b0 | 16));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (b0 & -17)), EntitySheep.META_WOOL_STATE, (byte) (b0 & -17));
|
||||
}
|
||||
|
||||
public int getColor()
|
||||
|
||||
public int getColor()
|
||||
{
|
||||
return DataWatcher.getByte(16) & 15;
|
||||
return DataWatcher.getByte(16) & 15;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void setColor(DyeColor color)
|
||||
public void setColor(DyeColor color)
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 & 240 | color.getWoolData() & 15)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (b0 & 240 | color.getWoolData() & 15)), EntitySheep.META_WOOL_STATE,
|
||||
(byte) (b0 & 240 | color.getWoolData() & 15));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntitySkeleton;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.entity.Skeleton.SkeletonType;
|
||||
|
||||
@ -8,22 +10,22 @@ public class DisguiseSkeleton extends DisguiseMonster
|
||||
public DisguiseSkeleton(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.SKELETON, entity);
|
||||
|
||||
DataWatcher.a(13, Byte.valueOf((byte)0));
|
||||
|
||||
DataWatcher.a(13, Byte.valueOf((byte) 0), EntitySkeleton.META_TYPE, 0);
|
||||
}
|
||||
|
||||
|
||||
public void SetSkeletonType(SkeletonType skeletonType)
|
||||
{
|
||||
DataWatcher.watch(13, Byte.valueOf((byte)skeletonType.getId()));
|
||||
DataWatcher.watch(13, Byte.valueOf((byte) skeletonType.getId()), EntitySkeleton.META_TYPE, skeletonType.getId());
|
||||
}
|
||||
|
||||
|
||||
public int GetSkeletonType()
|
||||
{
|
||||
return DataWatcher.getByte(13);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.skeleton.hurt";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.skeleton.hurt";
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntitySlime;
|
||||
import net.minecraft.server.v1_8_R3.MathHelper;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
@ -10,14 +11,14 @@ public class DisguiseSlime extends DisguiseInsentient
|
||||
{
|
||||
super(entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte)1));
|
||||
DataWatcher.a(16, new Byte((byte) 1), EntitySlime.META_SIZE, 1);
|
||||
}
|
||||
|
||||
|
||||
public void SetSize(int i)
|
||||
{
|
||||
DataWatcher.watch(16, new Byte((byte)i));
|
||||
DataWatcher.watch(16, new Byte((byte) i), EntitySlime.META_SIZE, i);
|
||||
}
|
||||
|
||||
|
||||
public int GetSize()
|
||||
{
|
||||
return DataWatcher.getByte(16);
|
||||
@ -29,63 +30,64 @@ public class DisguiseSlime extends DisguiseInsentient
|
||||
packet.a = Entity.getId();
|
||||
packet.b = (byte) 55;
|
||||
packet.c = (int) MathHelper.floor(Entity.locX * 32D);
|
||||
packet.d = (int)MathHelper.floor(Entity.locY * 32.0D);
|
||||
packet.e = (int)MathHelper.floor(Entity.locZ * 32D);
|
||||
packet.d = (int) MathHelper.floor(Entity.locY * 32.0D);
|
||||
packet.e = (int) MathHelper.floor(Entity.locZ * 32D);
|
||||
packet.i = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.j = (byte) ((int) (Entity.pitch * 256.0F / 360.0F));
|
||||
packet.k = (byte) ((int) (Entity.yaw * 256.0F / 360.0F));
|
||||
packet.uuid = Entity.getUniqueID();
|
||||
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
double var6 = 0;
|
||||
double var8 = 0;
|
||||
double var2 = 3.9D;
|
||||
double var4 = 0;
|
||||
double var6 = 0;
|
||||
double var8 = 0;
|
||||
|
||||
if (var4 < -var2)
|
||||
{
|
||||
var4 = -var2;
|
||||
}
|
||||
if (var4 < -var2)
|
||||
{
|
||||
var4 = -var2;
|
||||
}
|
||||
|
||||
if (var6 < -var2)
|
||||
{
|
||||
var6 = -var2;
|
||||
}
|
||||
if (var6 < -var2)
|
||||
{
|
||||
var6 = -var2;
|
||||
}
|
||||
|
||||
if (var8 < -var2)
|
||||
{
|
||||
var8 = -var2;
|
||||
}
|
||||
if (var8 < -var2)
|
||||
{
|
||||
var8 = -var2;
|
||||
}
|
||||
|
||||
if (var4 > var2)
|
||||
{
|
||||
var4 = var2;
|
||||
}
|
||||
if (var4 > var2)
|
||||
{
|
||||
var4 = var2;
|
||||
}
|
||||
|
||||
if (var6 > var2)
|
||||
{
|
||||
var6 = var2;
|
||||
}
|
||||
if (var6 > var2)
|
||||
{
|
||||
var6 = var2;
|
||||
}
|
||||
|
||||
if (var8 > var2)
|
||||
{
|
||||
var8 = var2;
|
||||
}
|
||||
if (var8 > var2)
|
||||
{
|
||||
var8 = var2;
|
||||
}
|
||||
|
||||
packet.f = (int)(var4 * 8000.0D);
|
||||
packet.g = (int)(var6 * 8000.0D);
|
||||
packet.h = (int)(var8 * 8000.0D);
|
||||
packet.f = (int) (var4 * 8000.0D);
|
||||
packet.g = (int) (var6 * 8000.0D);
|
||||
packet.h = (int) (var8 * 8000.0D);
|
||||
packet.l = DataWatcher;
|
||||
packet.m = DataWatcher.b();
|
||||
|
||||
|
||||
return packet;
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.slime." + (GetSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 0.4F * (float)GetSize();
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.slime." + (GetSize() > 1 ? "big" : "small");
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 0.4F * (float) GetSize();
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntitySpider;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseSpider extends DisguiseMonster
|
||||
@ -8,7 +10,7 @@ public class DisguiseSpider extends DisguiseMonster
|
||||
{
|
||||
super(EntityType.SPIDER, entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte) 0));
|
||||
DataWatcher.a(16, new Byte((byte) 0), EntitySpider.META_CLIMBING, (byte) 0);
|
||||
}
|
||||
|
||||
public boolean bT()
|
||||
@ -20,12 +22,12 @@ public class DisguiseSpider extends DisguiseMonster
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
if(flag)
|
||||
if (flag)
|
||||
b0 = (byte) (b0 | 0x1);
|
||||
else
|
||||
b0 = (byte) (b0 & 0xFFFFFFFE);
|
||||
|
||||
DataWatcher.watch(16, Byte.valueOf(b0));
|
||||
DataWatcher.watch(16, Byte.valueOf(b0), EntitySpider.META_CLIMBING, b0);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
|
@ -7,34 +7,15 @@ public class DisguiseSquid extends DisguiseMonster
|
||||
public DisguiseSquid(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.SQUID, entity);
|
||||
|
||||
DataWatcher.a(16, new Byte((byte)0));
|
||||
}
|
||||
|
||||
public boolean bT()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x01) != 0;
|
||||
}
|
||||
|
||||
public void a(boolean flag)
|
||||
protected String getHurtSound()
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
if (flag)
|
||||
b0 = (byte)(b0 | 0x1);
|
||||
else
|
||||
b0 = (byte)(b0 & 0xFFFFFFFE);
|
||||
|
||||
DataWatcher.watch(16, Byte.valueOf(b0));
|
||||
return "damage.hit";
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 0.4F;
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "damage.hit";
|
||||
}
|
||||
|
||||
protected float getVolume()
|
||||
{
|
||||
return 0.4F;
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +1,53 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityTameableAnimal;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
public abstract class DisguiseTameableAnimal extends DisguiseAnimal
|
||||
{
|
||||
public DisguiseTameableAnimal(EntityType disguiseType, org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(disguiseType, entity);
|
||||
|
||||
DataWatcher.a(16, Byte.valueOf((byte)0));
|
||||
DataWatcher.a(17, "");
|
||||
|
||||
DataWatcher.a(16, Byte.valueOf((byte) 0), EntityTameableAnimal.META_SITTING_TAMED, (byte) 0);
|
||||
DataWatcher.a(17, "", EntityTameableAnimal.META_OWNER, Optional.<UUID> absent());
|
||||
}
|
||||
|
||||
|
||||
public boolean isTamed()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x4) != 0;
|
||||
}
|
||||
|
||||
|
||||
public void setTamed(boolean tamed)
|
||||
{
|
||||
int i = DataWatcher.getByte(16);
|
||||
|
||||
|
||||
if (tamed)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(i | 0x4)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (i | 0x4)), EntityTameableAnimal.META_SITTING_TAMED, (byte) (i | 0x4));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(i | 0xFFFFFFFB)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (i | 0xFFFFFFFB)), EntityTameableAnimal.META_SITTING_TAMED,
|
||||
(byte) (i | 0xFFFFFFFB));
|
||||
}
|
||||
|
||||
|
||||
public boolean isSitting()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x1) != 0;
|
||||
}
|
||||
|
||||
|
||||
public void setSitting(boolean sitting)
|
||||
{
|
||||
int i = DataWatcher.getByte(16);
|
||||
|
||||
|
||||
if (sitting)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(i | 0x1)));
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (i | 0x1)), EntityTameableAnimal.META_SITTING_TAMED, (byte) (i | 0x1));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(i | 0xFFFFFFFE)));
|
||||
}
|
||||
|
||||
public void setOwnerName(String name)
|
||||
{
|
||||
DataWatcher.watch(17, name);
|
||||
}
|
||||
|
||||
public String getOwnerName()
|
||||
{
|
||||
return DataWatcher.getString(17);
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (i | 0xFFFFFFFE)), EntityTameableAnimal.META_SITTING_TAMED,
|
||||
(byte) (i | 0xFFFFFFFE));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityWitch;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseWitch extends DisguiseMonster
|
||||
@ -8,21 +10,21 @@ public class DisguiseWitch extends DisguiseMonster
|
||||
{
|
||||
super(EntityType.WITCH, entity);
|
||||
|
||||
DataWatcher.a(21, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
public String getHurtSound()
|
||||
{
|
||||
return "mob.witch.hurt";
|
||||
DataWatcher.a(21, Byte.valueOf((byte) 0), EntityWitch.META_AGGRESSIVE, false);
|
||||
}
|
||||
|
||||
public void a(boolean flag)
|
||||
public String getHurtSound()
|
||||
{
|
||||
DataWatcher.watch(21, Byte.valueOf((byte)(flag ? 1 : 0)));
|
||||
return "mob.witch.hurt";
|
||||
}
|
||||
|
||||
public boolean bT()
|
||||
|
||||
public void a(boolean flag)
|
||||
{
|
||||
return DataWatcher.getByte(21) == 1;
|
||||
DataWatcher.watch(21, Byte.valueOf((byte) (flag ? 1 : 0)), EntityWitch.META_AGGRESSIVE, flag);
|
||||
}
|
||||
|
||||
public boolean bT()
|
||||
{
|
||||
return DataWatcher.getByte(21) == 1;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityWither;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
@ -8,30 +10,25 @@ public class DisguiseWither extends DisguiseMonster
|
||||
public DisguiseWither(org.bukkit.entity.Entity entity)
|
||||
{
|
||||
super(EntityType.WITHER, entity);
|
||||
|
||||
DataWatcher.a(17, new Integer(0));
|
||||
DataWatcher.a(18, new Integer(0));
|
||||
DataWatcher.a(19, new Integer(0));
|
||||
DataWatcher.a(20, new Integer(0));
|
||||
|
||||
DataWatcher.a(17, new Integer(0), EntityWither.META_INVUL_TIME, 0);
|
||||
DataWatcher.a(18, new Integer(0), EntityWither.META_TARGET_1, 0);
|
||||
DataWatcher.a(19, new Integer(0), EntityWither.META_TARGET_2, 0);
|
||||
DataWatcher.a(20, new Integer(0), EntityWither.META_TARGET_3, 0);
|
||||
}
|
||||
|
||||
public int getInvulTime()
|
||||
{
|
||||
return DataWatcher.getInt(20);
|
||||
}
|
||||
|
||||
public void setInvulTime(int i)
|
||||
{
|
||||
DataWatcher.watch(20, Integer.valueOf(i));
|
||||
}
|
||||
|
||||
public int t(int i)
|
||||
{
|
||||
return DataWatcher.getInt(17 + i);
|
||||
}
|
||||
public int getInvulTime()
|
||||
{
|
||||
return DataWatcher.getInt(20);
|
||||
}
|
||||
|
||||
public void b(int i, int j)
|
||||
{
|
||||
DataWatcher.watch(17 + i, Integer.valueOf(j));
|
||||
}
|
||||
public void setInvulTime(int i)
|
||||
{
|
||||
DataWatcher.watch(20, Integer.valueOf(i), EntityWither.META_INVUL_TIME, i);
|
||||
}
|
||||
|
||||
public int t(int i)
|
||||
{
|
||||
return DataWatcher.getInt(17 + i);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityWolf;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseWolf extends DisguiseTameableAnimal
|
||||
@ -8,51 +10,52 @@ public class DisguiseWolf extends DisguiseTameableAnimal
|
||||
{
|
||||
super(EntityType.WOLF, entity);
|
||||
|
||||
DataWatcher.a(18, new Float(20F));
|
||||
DataWatcher.a(19, new Byte((byte)0));
|
||||
DataWatcher.a(20, new Byte((byte)14));
|
||||
DataWatcher.a(18, new Float(20F), EntityWolf.META_WOLF_HEALTH, 20F);
|
||||
DataWatcher.a(19, new Byte((byte) 0), EntityWolf.META_BEGGING, false);
|
||||
DataWatcher.a(20, new Byte((byte) 14), EntityWolf.META_COLLAR, 14);
|
||||
}
|
||||
|
||||
public boolean isAngry()
|
||||
|
||||
public boolean isAngry()
|
||||
{
|
||||
return (DataWatcher.getByte(16) & 0x2) != 0;
|
||||
}
|
||||
|
||||
|
||||
public void setAngry(boolean angry)
|
||||
{
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
byte b0 = DataWatcher.getByte(16);
|
||||
|
||||
if (angry)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 | 0x2)));
|
||||
else
|
||||
DataWatcher.watch(16, Byte.valueOf((byte)(b0 & 0xFFFFFFFD)));
|
||||
if (angry)
|
||||
DataWatcher.watch(16, Byte.valueOf((byte) (b0 | 0x2)), EntityWolf.META_SITTING_TAMED, (byte) (b0 | 0x2));
|
||||
else
|
||||
DataWatcher
|
||||
.watch(16, Byte.valueOf((byte) (b0 & 0xFFFFFFFD)), EntityWolf.META_SITTING_TAMED, (byte) (b0 & 0xFFFFFFFD));
|
||||
}
|
||||
|
||||
public int getCollarColor()
|
||||
public int getCollarColor()
|
||||
{
|
||||
return DataWatcher.getByte(20) & 0xF;
|
||||
return DataWatcher.getByte(20) & 0xF;
|
||||
}
|
||||
|
||||
public void setCollarColor(int i)
|
||||
public void setCollarColor(int i)
|
||||
{
|
||||
DataWatcher.watch(20, Byte.valueOf((byte)(i & 0xF)));
|
||||
DataWatcher.watch(20, Byte.valueOf((byte) (i & 0xF)), EntityWolf.META_COLLAR, (i & 0xF));
|
||||
}
|
||||
|
||||
|
||||
public void m(boolean flag)
|
||||
{
|
||||
if (flag)
|
||||
DataWatcher.watch(19, Byte.valueOf((byte)1));
|
||||
else
|
||||
DataWatcher.watch(19, Byte.valueOf((byte)0));
|
||||
if (flag)
|
||||
DataWatcher.watch(19, Byte.valueOf((byte) 1), EntityWolf.META_BEGGING, flag);
|
||||
else
|
||||
DataWatcher.watch(19, Byte.valueOf((byte) 0), EntityWolf.META_BEGGING, flag);
|
||||
}
|
||||
|
||||
|
||||
public boolean ce()
|
||||
{
|
||||
return DataWatcher.getByte(19) == 1;
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.wolf.hurt";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.wolf.hurt";
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.disguise.disguises;
|
||||
|
||||
import net.minecraft.server.v1_8_R3.EntityZombie;
|
||||
|
||||
import org.bukkit.entity.*;
|
||||
|
||||
public class DisguiseZombie extends DisguiseMonster
|
||||
@ -12,34 +14,34 @@ public class DisguiseZombie extends DisguiseMonster
|
||||
public DisguiseZombie(EntityType disguiseType, Entity entity)
|
||||
{
|
||||
super(disguiseType, entity);
|
||||
|
||||
DataWatcher.a(12, Byte.valueOf((byte)0));
|
||||
DataWatcher.a(13, Byte.valueOf((byte)0));
|
||||
DataWatcher.a(14, Byte.valueOf((byte)0));
|
||||
|
||||
DataWatcher.a(12, Byte.valueOf((byte) 0), EntityZombie.META_CHILD, false);
|
||||
DataWatcher.a(13, Byte.valueOf((byte) 0), EntityZombie.META_VILLAGER, false);
|
||||
DataWatcher.a(14, Byte.valueOf((byte) 0), EntityZombie.META_CONVERTING, false);
|
||||
}
|
||||
|
||||
|
||||
public boolean IsBaby()
|
||||
{
|
||||
return DataWatcher.getByte(12) == 1;
|
||||
}
|
||||
|
||||
|
||||
public void SetBaby(boolean baby)
|
||||
{
|
||||
DataWatcher.watch(12, Byte.valueOf((byte)(baby ? 1 : 0)));
|
||||
DataWatcher.watch(12, Byte.valueOf((byte) (baby ? 1 : 0)), EntityZombie.META_CHILD, baby);
|
||||
}
|
||||
|
||||
|
||||
public boolean IsVillager()
|
||||
{
|
||||
return DataWatcher.getByte(13) == 1;
|
||||
}
|
||||
|
||||
|
||||
public void SetVillager(boolean villager)
|
||||
{
|
||||
DataWatcher.watch(13, Byte.valueOf((byte)(villager ? 1 : 0)));
|
||||
DataWatcher.watch(13, Byte.valueOf((byte) (villager ? 1 : 0)), EntityZombie.META_VILLAGER, villager);
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.zombie.hurt";
|
||||
}
|
||||
|
||||
protected String getHurtSound()
|
||||
{
|
||||
return "mob.zombie.hurt";
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import mineplex.core.disguise.disguises.DisguiseChicken;
|
||||
import mineplex.core.gadget.event.GadgetBlockEvent;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Effect;
|
||||
@ -30,25 +31,25 @@ public class BlockForm
|
||||
{
|
||||
private MorphBlock _host;
|
||||
private Player _player;
|
||||
|
||||
|
||||
private Material _mat;
|
||||
private Block _block;
|
||||
private Location _loc;
|
||||
|
||||
public BlockForm(MorphBlock host, Player player, Material mat)
|
||||
public BlockForm(MorphBlock host, Player player, Material mat)
|
||||
{
|
||||
_host = host;
|
||||
_player = player;
|
||||
|
||||
|
||||
_mat = mat;
|
||||
_loc = player.getLocation();
|
||||
|
||||
|
||||
Apply();
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
|
||||
public void Apply()
|
||||
{
|
||||
//Remove Old
|
||||
// Remove Old
|
||||
if (_player.getPassenger() != null)
|
||||
{
|
||||
Recharge.Instance.useForce(_player, "PassengerChange", 100);
|
||||
@ -57,36 +58,42 @@ public class BlockForm
|
||||
_player.eject();
|
||||
}
|
||||
|
||||
((CraftEntity)_player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 32));
|
||||
((CraftEntity) _player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 32), Entity.META_ENTITYDATA, (byte) 32);
|
||||
|
||||
//Player > Chicken
|
||||
// Player > Chicken
|
||||
DisguiseChicken disguise = new DisguiseChicken(_player);
|
||||
disguise.setBaby();
|
||||
disguise.setBaby();
|
||||
disguise.setSoundDisguise(new DisguiseCat(_player));
|
||||
disguise.setInvisible(true);
|
||||
_host.Manager.getDisguiseManager().disguise(disguise);
|
||||
|
||||
//Apply Falling Block
|
||||
// Apply Falling Block
|
||||
FallingBlockCheck();
|
||||
|
||||
//Inform
|
||||
String blockName = F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false));
|
||||
// Inform
|
||||
String blockName = F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false));
|
||||
if (!blockName.contains("Block"))
|
||||
UtilPlayer.message(_player, F.main("Morph", "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false) + " Block") + "!"));
|
||||
UtilPlayer
|
||||
.message(
|
||||
_player,
|
||||
F.main("Morph",
|
||||
"You are now a "
|
||||
+ F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false) + " Block") + "!"));
|
||||
else
|
||||
UtilPlayer.message(_player, F.main("Morph", "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte)0, false)) + "!"));
|
||||
UtilPlayer.message(_player,
|
||||
F.main("Morph", "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false)) + "!"));
|
||||
|
||||
//Sound
|
||||
// Sound
|
||||
_player.playSound(_player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
public void Remove()
|
||||
{
|
||||
SolidifyRemove();
|
||||
|
||||
_host.Manager.getDisguiseManager().undisguise(_player);
|
||||
|
||||
//Remove FB
|
||||
// Remove FB
|
||||
if (_player.getPassenger() != null)
|
||||
{
|
||||
Recharge.Instance.useForce(_player, "PassengerChange", 100);
|
||||
@ -95,97 +102,99 @@ public class BlockForm
|
||||
_player.eject();
|
||||
}
|
||||
|
||||
((CraftEntity)_player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
|
||||
((CraftEntity) _player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), Entity.META_ENTITYDATA, (byte) 0);
|
||||
}
|
||||
|
||||
public void SolidifyUpdate()
|
||||
{
|
||||
if (!_player.isSprinting())
|
||||
((CraftEntity)_player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 32));
|
||||
|
||||
//Not a Block
|
||||
((CraftEntity) _player).getHandle().getDataWatcher()
|
||||
.watch(0, Byte.valueOf((byte) 32), Entity.META_ENTITYDATA, (byte) 32);
|
||||
|
||||
// Not a Block
|
||||
if (_block == null)
|
||||
{
|
||||
//Moved
|
||||
// Moved
|
||||
if (!_loc.getBlock().equals(_player.getLocation().getBlock()))
|
||||
{
|
||||
_player.setExp(0);
|
||||
_loc = _player.getLocation();
|
||||
}
|
||||
//Unmoved
|
||||
// Unmoved
|
||||
else
|
||||
{
|
||||
double hideBoost = 0.025;
|
||||
|
||||
_player.setExp((float) Math.min(0.999f, _player.getExp() + hideBoost));
|
||||
|
||||
//Set Block
|
||||
// Set Block
|
||||
if (_player.getExp() >= 0.999f)
|
||||
{
|
||||
Block block = _player.getLocation().getBlock();
|
||||
|
||||
List<Block> blockList = new ArrayList<Block>();
|
||||
blockList.add(block);
|
||||
|
||||
|
||||
GadgetBlockEvent event = new GadgetBlockEvent(_host, blockList);
|
||||
|
||||
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
//Not Able
|
||||
if (block.getType() != Material.AIR || !UtilBlock.solid(block.getRelative(BlockFace.DOWN)) || event.getBlocks().isEmpty() || event.isCancelled())
|
||||
|
||||
// Not Able
|
||||
if (block.getType() != Material.AIR || !UtilBlock.solid(block.getRelative(BlockFace.DOWN))
|
||||
|| event.getBlocks().isEmpty() || event.isCancelled())
|
||||
{
|
||||
UtilPlayer.message(_player, F.main("Morph", "You cannot become a Solid Block here."));
|
||||
_player.setExp(0f);
|
||||
return;
|
||||
}
|
||||
|
||||
//Set Block
|
||||
// Set Block
|
||||
_block = block;
|
||||
|
||||
//Effect
|
||||
// Effect
|
||||
_player.playEffect(_player.getLocation(), Effect.STEP_SOUND, _mat);
|
||||
//block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, _mat);
|
||||
// block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, _mat);
|
||||
|
||||
//Display
|
||||
// Display
|
||||
SolidifyVisual();
|
||||
|
||||
//Invisible
|
||||
//Host.Manager.GetCondition().Factory().Cloak("Disguised as Block", Player, Player, 60000, false, false);
|
||||
// Invisible
|
||||
// Host.Manager.GetCondition().Factory().Cloak("Disguised as Block", Player, Player, 60000, false, false);
|
||||
|
||||
//Sound
|
||||
// Sound
|
||||
_player.playSound(_player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Is a Block
|
||||
// Is a Block
|
||||
else
|
||||
{
|
||||
//Moved
|
||||
// Moved
|
||||
if (!_loc.getBlock().equals(_player.getLocation().getBlock()))
|
||||
{
|
||||
SolidifyRemove();
|
||||
}
|
||||
//Send Packets
|
||||
// Send Packets
|
||||
else
|
||||
{
|
||||
SolidifyVisual();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SolidifyRemove()
|
||||
{
|
||||
if (_block != null)
|
||||
{
|
||||
MapUtil.QuickChangeBlockAt(_block.getLocation(), 0, (byte)0);
|
||||
MapUtil.QuickChangeBlockAt(_block.getLocation(), 0, (byte) 0);
|
||||
_block = null;
|
||||
}
|
||||
|
||||
_player.setExp(0f);
|
||||
|
||||
//Host.Manager.GetCondition().EndCondition(Player, null, "Disguised as Block");
|
||||
// Host.Manager.GetCondition().EndCondition(Player, null, "Disguised as Block");
|
||||
|
||||
//Inform
|
||||
// Inform
|
||||
_player.playSound(_player.getLocation(), Sound.NOTE_PLING, 1f, 0.5f);
|
||||
|
||||
FallingBlockCheck();
|
||||
@ -197,7 +206,7 @@ public class BlockForm
|
||||
if (_block == null)
|
||||
return;
|
||||
|
||||
//Remove Old
|
||||
// Remove Old
|
||||
if (_player.getPassenger() != null)
|
||||
{
|
||||
Recharge.Instance.useForce(_player, "PassengerChange", 100);
|
||||
@ -206,49 +215,49 @@ public class BlockForm
|
||||
_player.eject();
|
||||
}
|
||||
|
||||
//Others
|
||||
// Others
|
||||
for (Player other : UtilServer.getPlayers())
|
||||
other.sendBlockChange(_player.getLocation(), _mat, (byte)0);
|
||||
other.sendBlockChange(_player.getLocation(), _mat, (byte) 0);
|
||||
|
||||
//Self
|
||||
_player.sendBlockChange(_player.getLocation(), 36, (byte)0);
|
||||
// Self
|
||||
_player.sendBlockChange(_player.getLocation(), 36, (byte) 0);
|
||||
|
||||
FallingBlockCheck();
|
||||
}
|
||||
|
||||
public void FallingBlockCheck()
|
||||
public void FallingBlockCheck()
|
||||
{
|
||||
//Block Form (Hide Falling)
|
||||
// Block Form (Hide Falling)
|
||||
if (_block != null)
|
||||
return;
|
||||
|
||||
//Recreate Falling
|
||||
// Recreate Falling
|
||||
if (_player.getPassenger() == null || !_player.getPassenger().isValid())
|
||||
{
|
||||
if (!Recharge.Instance.use(_player, "PassengerChange", 100, false, false))
|
||||
return;
|
||||
|
||||
//Falling Block
|
||||
FallingBlock block = _player.getWorld().spawnFallingBlock(_player.getEyeLocation(), _mat, (byte)0);
|
||||
|
||||
//No Arrow Collision
|
||||
((CraftFallingSand)block).getHandle().spectating = true;
|
||||
|
||||
// Falling Block
|
||||
FallingBlock block = _player.getWorld().spawnFallingBlock(_player.getEyeLocation(), _mat, (byte) 0);
|
||||
|
||||
// No Arrow Collision
|
||||
((CraftFallingSand) block).getHandle().spectating = true;
|
||||
|
||||
_player.setPassenger(block);
|
||||
|
||||
|
||||
_host.fallingBlockRegister(block);
|
||||
}
|
||||
|
||||
//Ensure Falling doesnt Despawn
|
||||
// Ensure Falling doesnt Despawn
|
||||
else
|
||||
{
|
||||
((CraftFallingSand)_player.getPassenger()).getHandle().ticksLived = 1;
|
||||
((CraftFallingSand) _player.getPassenger()).getHandle().ticksLived = 1;
|
||||
_player.getPassenger().setTicksLived(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Block GetBlock()
|
||||
public Block GetBlock()
|
||||
{
|
||||
return _block;
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -13,6 +14,7 @@ import org.bukkit.util.Vector;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.EntityArmorStand;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||
@ -291,15 +293,16 @@ public class Hologram
|
||||
packet.d = (int) ((getLocation().getY() + (_hideBoundingBox ? 0 : -2.1) + ((double) textRow * 0.285)) * 32);
|
||||
packet.e = (int) (getLocation().getZ() * 32);
|
||||
packet.l = watcher;
|
||||
packet.uuid = UUID.randomUUID();
|
||||
|
||||
// Setup datawatcher for armor stand
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(2, lineOfText);
|
||||
watcher.a(3, (byte) 1);
|
||||
watcher.a(0, (byte) 32, EntityArmorStand.META_ENTITYDATA, (byte) 32);
|
||||
watcher.a(2, lineOfText, EntityArmorStand.META_CUSTOMNAME, lineOfText);
|
||||
watcher.a(3, (byte) 1, EntityArmorStand.META_CUSTOMNAME_VISIBLE, true);
|
||||
|
||||
if (_hideBoundingBox)
|
||||
{
|
||||
watcher.a(10, (byte) 16); // TODO Uncomment after we can enforce 1.8.3
|
||||
watcher.a(10, (byte) 16, EntityArmorStand.META_ARMOR_OPTION, (byte) 16); // TODO Uncomment after we can enforce 1.8.3
|
||||
}
|
||||
// Also correct hologram positioning
|
||||
|
||||
@ -527,9 +530,9 @@ public class Hologram
|
||||
|
||||
DataWatcher watcher1_8 = new DataWatcher(null);
|
||||
|
||||
watcher1_8.a(0, (byte) 32);
|
||||
watcher1_8.a(2, newText[i]);
|
||||
watcher1_8.a(3, (byte) 1);
|
||||
watcher1_8.a(0, (byte) 32, EntityArmorStand.META_ENTITYDATA, (byte) 32);
|
||||
watcher1_8.a(2, newText[i], EntityArmorStand.META_CUSTOMNAME, newText[i]);
|
||||
watcher1_8.a(3, (byte) 1, EntityArmorStand.META_CUSTOMNAME_VISIBLE, true);
|
||||
// watcher1_8.a(10, (byte) 16);// TODO Uncomment after we can enforce 1.8.3
|
||||
// Also correct hologram positioning
|
||||
metadata1_8.b = watcher1_8.c();
|
||||
|
@ -172,7 +172,7 @@ public class Recharge extends MiniPlugin
|
||||
//Recharging
|
||||
if (Get(player).containsKey(ability))
|
||||
{
|
||||
if (inform)
|
||||
if (inform && !Get(player).get(ability).DisplayForce && !Get(player).get(ability).AttachItem)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Recharge", "You cannot use " + F.skill(abilityFull) + " for " +
|
||||
F.time(UtilTime.convertString((Get(player).get(ability).GetRemaining()), 1, TimeUnit.FIT)) + "."));
|
||||
@ -217,7 +217,7 @@ public class Recharge extends MiniPlugin
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inform)
|
||||
if (inform && !Get(player).get(ability).DisplayForce && !Get(player).get(ability).AttachItem)
|
||||
UtilPlayer.message(player, F.main("Recharge", "You cannot use " + F.skill(ability) + " for " +
|
||||
F.time(UtilTime.convertString((Get(player).get(ability).GetRemaining()), 1, TimeUnit.FIT)) + "."));
|
||||
|
||||
|
@ -40,6 +40,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
@Override
|
||||
protected void buildPage()
|
||||
{
|
||||
/*
|
||||
addButton(2, new ItemBuilder(Material.RED_ROSE).setTitle(C.cYellowB + "Valentines Vendetta " + C.cGray + "Save Valentines!").addLore(new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "LIMITED TIME GAME",
|
||||
@ -50,8 +51,9 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "",
|
||||
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("VV") + C.Reset + " other players!",
|
||||
}).setHideInfo(true).build(), new SelectVVButton(this));
|
||||
*/
|
||||
|
||||
addButton(4, new ItemBuilder(Material.QUARTZ_BLOCK).setTitle(C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building").addLore(new String[]
|
||||
addButton(2, new ItemBuilder(Material.QUARTZ_BLOCK).setTitle(C.cYellowB + "Speed Builders " + C.cGray + "Competitive Building").addLore(new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW GAME",
|
||||
C.Reset + "",
|
||||
@ -62,6 +64,28 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("SB") + C.Reset + " other players!",
|
||||
}).setHideInfo(true).build(), new SelectSBButton(this));
|
||||
|
||||
addButton(4, new ItemBuilder(Material.BOOK_AND_QUILL).setTitle(C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary").addLore(new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATE",
|
||||
C.Reset + "",
|
||||
C.Reset + "Players take turns at drawing a random",
|
||||
C.Reset + "word. Whoever guesses it within the time",
|
||||
C.Reset + "limit gets some points!",
|
||||
C.Reset + "",
|
||||
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!",
|
||||
}).setHideInfo(true).build(), new SelectDMTButton(this));
|
||||
|
||||
addButton(6, new ItemBuilder(Material.TNT).setTitle(C.cYellowB + "Dragon Escape " + C.cGray + "Fast Paced Parkour").addLore(new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME",
|
||||
C.Reset + "",
|
||||
C.Reset + "Douglas the Dragon is angry",
|
||||
C.Reset + "You better RUNNNNN!",
|
||||
C.Reset + "Last player alive wins",
|
||||
C.Reset + "",
|
||||
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("DE") + C.Reset + " other players!"
|
||||
}).setHideInfo(true).build(), new SelectFEATButton(this, "Dragon Escape"));
|
||||
|
||||
/*
|
||||
addButton(6, new ItemBuilder(Material.IRON_SWORD).setTitle(C.cYellowB + "Gladiators" + C.cGray + " Bracketted Deathmatch").addLore(new String[]
|
||||
{
|
||||
@ -88,6 +112,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
}).setHideInfo(true).build(), new SelectFEATButton(this, "Micro Battle"));
|
||||
*/
|
||||
|
||||
/*
|
||||
addButton(6, new ItemBuilder(Material.TNT).setTitle(C.cYellowB + "Bomb Lobbers " + C.cGray + "TNT Mayhem").addLore(new String[]
|
||||
{
|
||||
(_extraValue ? C.cAquaB : C.cWhiteB) + "FEATURED ARCADE GAME",
|
||||
@ -97,6 +122,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "",
|
||||
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BL") + C.Reset + " other players!"
|
||||
}).setHideInfo(true).build(), new SelectFEATButton(this, "Bomb Lobbers"));
|
||||
*/
|
||||
|
||||
addButton(9, new ItemBuilder(Material.IRON_PICKAXE).setTitle(C.cYellowB + "The Bridges " + C.cGray + "4 Team Survival").addLore(new String[]
|
||||
{
|
||||
@ -201,7 +227,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("BH") + C.Reset + " other players!",
|
||||
}).setHideInfo(true).build(), new SelectBHButton(this));
|
||||
|
||||
addButton(27, new ItemBuilder(Material.TNT).setTitle(C.cYellowB + "MineStrike " + C.cGray + "Team Survival").addLore(new String[]
|
||||
addButton(28, new ItemBuilder(Material.TNT).setTitle(C.cYellowB + "MineStrike " + C.cGray + "Team Survival").addLore(new String[]
|
||||
{
|
||||
C.Reset + "",
|
||||
C.Reset + "One team must defend two bomb sites from",
|
||||
@ -211,21 +237,11 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
|
||||
C.Reset + "Join " + C.cGreen + getPlugin().getGroupTagPlayerCount("MS") + C.Reset + " other players!",
|
||||
}).setHideInfo(true).build(), new SelectMSButton(this));
|
||||
|
||||
addButton(29, new ItemBuilder(Material.BOOK_AND_QUILL).setTitle(C.cYellowB + "Draw My Thing " + C.cGray + "Pictionary").addLore(new String[]
|
||||
{
|
||||
C.Reset + "",
|
||||
C.Reset + "Players take turns at drawing a random",
|
||||
C.Reset + "word. Whoever guesses it within the time",
|
||||
C.Reset + "limit gets some points!",
|
||||
C.Reset + "",
|
||||
C.Reset + "Join " + ChatColor.GREEN + getPlugin().getGroupTagPlayerCount("DMT") + C.Reset + " other players!",
|
||||
}).setHideInfo(true).build(), new SelectDMTButton(this));
|
||||
addButton(30, _superSmashCycle.get(_ssmIndex), new SelectSSMButton(this));
|
||||
|
||||
addButton(31, _superSmashCycle.get(_ssmIndex), new SelectSSMButton(this));
|
||||
addButton(32, _minigameCycle.get(_minigameIndex), new SelectMINButton(this));
|
||||
|
||||
addButton(33, _minigameCycle.get(_minigameIndex), new SelectMINButton(this));
|
||||
|
||||
addButton(35, new ItemBuilder(Material.WOOD).setTitle(C.cYellowB + "Master Builders " + C.cGray + "Creative Build").setLore(new String[]
|
||||
addButton(34, new ItemBuilder(Material.WOOD).setTitle(C.cYellowB + "Master Builders " + C.cGray + "Creative Build").setLore(new String[]
|
||||
{
|
||||
C.Reset + "",
|
||||
C.Reset + "Players are given a Build Theme and ",
|
||||
|
@ -2,6 +2,7 @@ package mineplex.minecraft.game.core.boss.ironwizard.abilities;
|
||||
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||
@ -52,8 +53,8 @@ public class BlockHailBlock
|
||||
PacketPlayOutSpawnEntityLiving packet1 = new PacketPlayOutSpawnEntityLiving();
|
||||
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(0, (byte) 32, Entity.META_ENTITYDATA, (byte) 0);
|
||||
watcher.a(1, 0, Entity.META_AIR, 0);
|
||||
|
||||
packet1.a = _silverfish;
|
||||
packet1.b = EntityType.SILVERFISH.getTypeId();
|
||||
|
@ -172,8 +172,8 @@ public class GolemExplodingAura extends BossAbility<GolemCreature, IronGolem>
|
||||
PacketPlayOutSpawnEntityLiving packet1 = new PacketPlayOutSpawnEntityLiving();
|
||||
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(0, (byte) 32, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 0);
|
||||
watcher.a(1, 0, net.minecraft.server.v1_8_R3.Entity.META_AIR, 0);
|
||||
|
||||
packet1.a = key;
|
||||
packet1.b = EntityType.SILVERFISH.getTypeId();
|
||||
|
@ -395,8 +395,8 @@ public class GolemExplosiveBlock extends BossAbility<GolemCreature, IronGolem>
|
||||
PacketPlayOutSpawnEntityLiving packet1 = new PacketPlayOutSpawnEntityLiving();
|
||||
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(0, (byte) 32, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 0);
|
||||
watcher.a(1, 0, net.minecraft.server.v1_8_R3.Entity.META_AIR, 0);
|
||||
|
||||
packet1.a = id;
|
||||
packet1.b = EntityType.SILVERFISH.getTypeId();
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.minecraft.game.core.boss.snake;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -8,12 +10,14 @@ import org.bukkit.util.Vector;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.EntityArmorStand;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityEquipment;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
import net.minecraft.server.v1_8_R3.Vector3f;
|
||||
|
||||
public class SnakeSegment
|
||||
{
|
||||
@ -92,16 +96,16 @@ public class SnakeSegment
|
||||
_prevDir = vec;
|
||||
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(10, (byte) 0);
|
||||
|
||||
watcher.a(11, vec);
|
||||
|
||||
for (int i = 12; i < 17; i++)
|
||||
{
|
||||
watcher.a(i, new Vector(0, 0, 0));
|
||||
}
|
||||
watcher.a(0, (byte) 32, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 0);
|
||||
watcher.a(1, 0, net.minecraft.server.v1_8_R3.Entity.META_AIR, 0);
|
||||
watcher.a(10, (byte) 0, EntityArmorStand.META_ARMOR_OPTION, (byte) 0);
|
||||
watcher.a(11, new Vector3f(0, 0, 0), EntityArmorStand.META_HEAD_POSE,
|
||||
new Vector3f((float) vec.getX(), (float) vec.getY(), (float) vec.getZ()));
|
||||
watcher.a(12, new Vector3f(0, 0, 0), EntityArmorStand.META_BODY_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(13, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_ARM_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(14, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_ARM_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(15, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_LEG_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(16, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_LEG_POSE, new Vector3f(0, 0, 0));
|
||||
|
||||
PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata();
|
||||
|
||||
@ -129,23 +133,25 @@ public class SnakeSegment
|
||||
PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving();
|
||||
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(1, 0, net.minecraft.server.v1_8_R3.Entity.META_AIR, 0);
|
||||
|
||||
packet.a = getId();
|
||||
packet.c = (int) Math.floor(_entityLocation.getX() * 32);
|
||||
packet.d = (int) Math.floor(_entityLocation.getY() * 32);
|
||||
packet.e = (int) Math.floor(_entityLocation.getZ() * 32);
|
||||
packet.l = watcher;
|
||||
packet.uuid = UUID.randomUUID();
|
||||
|
||||
if (_item != null)
|
||||
{
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(10, (byte) 0);
|
||||
|
||||
for (int i = 11; i < 17; i++)
|
||||
{
|
||||
watcher.a(i, new Vector(0, 0, 0));
|
||||
}
|
||||
watcher.a(0, (byte) 32, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 32);
|
||||
watcher.a(10, (byte) 0, EntityArmorStand.META_ARMOR_OPTION, (byte) 0);
|
||||
watcher.a(11, new Vector3f(0, 0, 0), EntityArmorStand.META_HEAD_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(12, new Vector3f(0, 0, 0), EntityArmorStand.META_BODY_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(13, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_ARM_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(14, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_ARM_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(15, new Vector3f(0, 0, 0), EntityArmorStand.META_LEFT_LEG_POSE, new Vector3f(0, 0, 0));
|
||||
watcher.a(16, new Vector3f(0, 0, 0), EntityArmorStand.META_RIGHT_LEG_POSE, new Vector3f(0, 0, 0));
|
||||
|
||||
packet.b = 30;
|
||||
|
||||
@ -162,7 +168,7 @@ public class SnakeSegment
|
||||
}
|
||||
else
|
||||
{
|
||||
watcher.a(0, (byte) 0);
|
||||
watcher.a(0, (byte) 0, net.minecraft.server.v1_8_R3.Entity.META_ENTITYDATA, (byte) 0);
|
||||
packet.b = EntityType.MAGMA_CUBE.getTypeId();
|
||||
|
||||
return new Packet[]
|
||||
|
@ -870,7 +870,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
UtilInv.Clear(player);
|
||||
|
||||
((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
|
||||
((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), EntityLiving.META_ENTITYDATA, (byte) 0);
|
||||
|
||||
player.setCustomName("");
|
||||
player.setCustomNameVisible(false);
|
||||
|
@ -1,6 +1,7 @@
|
||||
package nautilus.game.arcade.game.games.christmas;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -18,6 +19,8 @@ import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
import net.minecraft.server.v1_8_R3.EntityArmorStand;
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
@ -162,11 +165,13 @@ public class SleighHorse
|
||||
packet.d = (int) (loc.getY() * 32);
|
||||
packet.e = (int) (loc.getZ() * 32) + this._previousDir[(i * 2) + 1];
|
||||
packet.f = ((byte) (int) (loc.getYaw() * 256.0F / 360.0F));
|
||||
packet.uuid = UUID.randomUUID();
|
||||
|
||||
// Setup datawatcher for armor stand
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(10, (byte) 4);
|
||||
watcher.a(11, new Vector3f(0, i * 180, (i == 0 ? -1 : 1) * 60f));
|
||||
watcher.a(0, (byte) 32, Entity.META_ENTITYDATA, (byte) 32);
|
||||
watcher.a(10, (byte) 4, EntityArmorStand.META_ARMOR_OPTION, (byte) 4);
|
||||
watcher.a(11, new Vector3f(0, i * 180, (i == 0 ? -1 : 1) * 60f), EntityArmorStand.META_HEAD_POSE, new Vector3f(0, i * 180, (i == 0 ? -1 : 1) * 60f));
|
||||
packet.l = watcher;
|
||||
PacketPlayOutEntityEquipment enquipPacket = new PacketPlayOutEntityEquipment();
|
||||
enquipPacket.a = id;
|
||||
|
@ -40,6 +40,9 @@ public abstract class Tool
|
||||
|
||||
public void start(PlayerInteractEvent event)
|
||||
{
|
||||
if (_start != null)
|
||||
return;
|
||||
|
||||
if (!UtilEvent.isAction(event, ActionType.R))
|
||||
return;
|
||||
|
||||
|
@ -259,7 +259,7 @@ public class HideSeek extends TeamGame
|
||||
.sendPacket(
|
||||
player,
|
||||
blockForm
|
||||
.getBlockPackets());
|
||||
.getBlockPackets(UtilPlayer.is1_9(player)));
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package nautilus.game.arcade.game.games.hideseek.forms;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.MapUtil;
|
||||
@ -15,10 +17,12 @@ import mineplex.core.recharge.Recharge;
|
||||
import nautilus.game.arcade.game.games.hideseek.HideSeek;
|
||||
import nautilus.game.arcade.game.games.hideseek.kits.KitHiderQuick;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
import net.minecraft.server.v1_8_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_8_R3.EntityTrackerEntry;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutNewAttachEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityTeleport;
|
||||
@ -68,23 +72,23 @@ public class BlockForm extends Form
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Apply()
|
||||
{
|
||||
// Remove Old
|
||||
if (Player.getPassenger() != null)
|
||||
{
|
||||
Player.getPassenger().remove();
|
||||
Player.eject();
|
||||
}
|
||||
public void Apply()
|
||||
{
|
||||
// Remove Old
|
||||
if (Player.getPassenger() != null)
|
||||
{
|
||||
Player.getPassenger().remove();
|
||||
Player.eject();
|
||||
}
|
||||
|
||||
EntityPlayer player = ((CraftPlayer) Player).getHandle();
|
||||
player.getDataWatcher().watch(0, Byte.valueOf((byte) 32));
|
||||
EntityPlayer player = ((CraftPlayer) Player).getHandle();
|
||||
player.getDataWatcher().watch(0, Byte.valueOf((byte) 32), Entity.META_ENTITYDATA, (byte) 32);
|
||||
|
||||
// Player > Chicken
|
||||
DisguiseChicken disguise = new DisguiseChicken(Player);
|
||||
disguise.setBaby();
|
||||
|
||||
disguise.setInvisible(true);
|
||||
// Player > Chicken
|
||||
DisguiseChicken disguise = new DisguiseChicken(Player);
|
||||
disguise.setBaby();
|
||||
|
||||
disguise.setInvisible(true);
|
||||
disguise.setSoundDisguise(new DisguiseCat(Player));
|
||||
Host.Manager.GetDisguise().disguise(disguise);
|
||||
|
||||
@ -102,65 +106,94 @@ public class BlockForm extends Form
|
||||
packet1.d = (int) Math.floor(_lastSaw.getY() * 32);
|
||||
packet1.e = (int) Math.floor(_lastSaw.getZ() * 32);
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(0, (byte) 32, Entity.META_ENTITYDATA, (byte) 32);
|
||||
watcher.a(1, 0, Entity.META_AIR, 0);
|
||||
packet1.l = watcher;
|
||||
packet1.uuid = UUID.randomUUID();
|
||||
packets[0] = packet1;
|
||||
|
||||
PacketPlayOutAttachEntity packet3 = new PacketPlayOutAttachEntity();
|
||||
if (UtilPlayer.is1_9(Player))
|
||||
{
|
||||
packets[2] = new PacketPlayOutNewAttachEntity(_selfEntityId1, new int[]
|
||||
{
|
||||
_selfEntityId2
|
||||
});
|
||||
|
||||
packet3.b = _selfEntityId2;
|
||||
packet3.c = _selfEntityId1;
|
||||
packets[2] = packet3;
|
||||
}
|
||||
else
|
||||
{
|
||||
PacketPlayOutAttachEntity packet3 = new PacketPlayOutAttachEntity();
|
||||
|
||||
PacketPlayOutSpawnEntity packet2 = new PacketPlayOutSpawnEntity(player,
|
||||
70, _mat.getId());
|
||||
packet3.b = _selfEntityId2;
|
||||
packet3.c = _selfEntityId1;
|
||||
|
||||
packets[2] = packet3;
|
||||
}
|
||||
|
||||
PacketPlayOutSpawnEntity packet2 = new PacketPlayOutSpawnEntity(player, 70, _mat.getId());
|
||||
packet2.a = _selfEntityId2;
|
||||
packet2.uuid = UUID.randomUUID();
|
||||
packets[1] = packet2;
|
||||
|
||||
UtilPlayer.sendPacket(Player, packets);
|
||||
|
||||
// Inform
|
||||
String blockName = F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false));
|
||||
if (!blockName.contains("Block"))
|
||||
UtilPlayer.message(
|
||||
Player,
|
||||
F.main("Game",
|
||||
C.cWhite + "You are now a "
|
||||
+ F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false) + " Block") + "!"));
|
||||
else
|
||||
UtilPlayer.message(
|
||||
Player,
|
||||
F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false))
|
||||
+ "!"));
|
||||
if (!blockName.contains("Block"))
|
||||
UtilPlayer.message(
|
||||
Player,
|
||||
F.main("Game",
|
||||
C.cWhite + "You are now a "
|
||||
+ F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false) + " Block") + "!"));
|
||||
else
|
||||
UtilPlayer.message(
|
||||
Player,
|
||||
F.main("Game", C.cWhite + "You are now a " + F.elem(ItemStackFactory.Instance.GetName(_mat, (byte) 0, false))
|
||||
+ "!"));
|
||||
|
||||
// Give Item
|
||||
Player.getInventory().setItem(8, new ItemStack(Host.GetItemEquivilent(_mat)));
|
||||
UtilInv.Update(Player);
|
||||
// Give Item
|
||||
Player.getInventory().setItem(8, new ItemStack(Host.GetItemEquivilent(_mat)));
|
||||
UtilInv.Update(Player);
|
||||
|
||||
// Sound
|
||||
Player.playSound(Player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
|
||||
}
|
||||
|
||||
public Packet[] getBlockPackets()
|
||||
{
|
||||
PacketPlayOutSpawnEntity packet2 = new PacketPlayOutSpawnEntity(((CraftPlayer) Player).getHandle(),
|
||||
70, _mat.getId());
|
||||
packet2.a = _blockId;
|
||||
|
||||
PacketPlayOutAttachEntity packet3 = new PacketPlayOutAttachEntity();
|
||||
|
||||
packet3.b = _blockId;
|
||||
packet3.c = Player.getEntityId();
|
||||
|
||||
return new Packet[] {packet2, packet3};
|
||||
// Sound
|
||||
Player.playSound(Player.getLocation(), Sound.ZOMBIE_UNFECT, 2f, 2f);
|
||||
}
|
||||
|
||||
|
||||
public Packet[] getBlockPackets(boolean is19)
|
||||
{
|
||||
Packet[] packets = new Packet[2];
|
||||
|
||||
PacketPlayOutSpawnEntity packet2 = new PacketPlayOutSpawnEntity(((CraftPlayer) Player).getHandle(), 70, _mat.getId());
|
||||
packet2.a = _blockId;
|
||||
packet2.uuid = UUID.randomUUID();
|
||||
|
||||
packets[0] = packet2;
|
||||
|
||||
if (is19)
|
||||
{
|
||||
packets[2] = new PacketPlayOutNewAttachEntity(_blockId, new int[]
|
||||
{
|
||||
Player.getEntityId()
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
PacketPlayOutAttachEntity packet3 = new PacketPlayOutAttachEntity();
|
||||
|
||||
packet3.b = _blockId;
|
||||
packet3.c = Player.getEntityId();
|
||||
packets[1] = packet3;
|
||||
}
|
||||
|
||||
return packets;
|
||||
}
|
||||
|
||||
public int getBlockId()
|
||||
{
|
||||
return _blockId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void Remove()
|
||||
{
|
||||
@ -169,19 +202,20 @@ public class BlockForm extends Form
|
||||
Host.Manager.GetDisguise().undisguise(Player);
|
||||
|
||||
UtilPlayer.sendPacket(Player, new PacketPlayOutEntityDestroy(new int[]
|
||||
{
|
||||
_selfEntityId1, _selfEntityId2, _blockId
|
||||
}));
|
||||
{
|
||||
_selfEntityId1,
|
||||
_selfEntityId2,
|
||||
_blockId
|
||||
}));
|
||||
|
||||
((CraftEntity) Player).getHandle().getDataWatcher()
|
||||
.watch(0, Byte.valueOf((byte) 0));
|
||||
((CraftEntity) Player).getHandle().getDataWatcher().watch(0, (byte) 0, Entity.META_ENTITYDATA, (byte) 0);
|
||||
}
|
||||
|
||||
public void SolidifyUpdate()
|
||||
{
|
||||
if (!Player.isSprinting())
|
||||
((CraftEntity) Player).getHandle().getDataWatcher()
|
||||
.watch(0, Byte.valueOf((byte) 32));
|
||||
.watch(0, Byte.valueOf((byte) 32), Entity.META_ENTITYDATA, (byte) 32);
|
||||
|
||||
// Not a Block
|
||||
if (_block == null)
|
||||
@ -199,8 +233,7 @@ public class BlockForm extends Form
|
||||
if (Host.GetKit(Player) instanceof KitHiderQuick)
|
||||
hideBoost = 0.1;
|
||||
|
||||
Player.setExp((float) Math.min(0.999f, Player.getExp()
|
||||
+ hideBoost));
|
||||
Player.setExp((float) Math.min(0.999f, Player.getExp() + hideBoost));
|
||||
|
||||
// Set Block
|
||||
if (Player.getExp() >= 0.999f)
|
||||
@ -208,25 +241,20 @@ public class BlockForm extends Form
|
||||
Block block = Player.getLocation().getBlock();
|
||||
|
||||
// Not Able
|
||||
if (block.getType() != Material.AIR
|
||||
|| !UtilBlock.solid(block
|
||||
.getRelative(BlockFace.DOWN)))
|
||||
if (block.getType() != Material.AIR || !UtilBlock.solid(block.getRelative(BlockFace.DOWN)))
|
||||
{
|
||||
UtilPlayer.message(Player, F.main("Game",
|
||||
"You cannot become a Solid Block here."));
|
||||
UtilPlayer.message(Player, F.main("Game", "You cannot become a Solid Block here."));
|
||||
Player.setExp(0f);
|
||||
return;
|
||||
}
|
||||
|
||||
Bukkit.getPluginManager().callEvent(
|
||||
new HideSeek.PlayerSolidifyEvent(Player));
|
||||
Bukkit.getPluginManager().callEvent(new HideSeek.PlayerSolidifyEvent(Player));
|
||||
|
||||
// Set Block
|
||||
_block = block;
|
||||
|
||||
// Effect
|
||||
Player.playEffect(Player.getLocation(), Effect.STEP_SOUND,
|
||||
_mat);
|
||||
Player.playEffect(Player.getLocation(), Effect.STEP_SOUND, _mat);
|
||||
// block.getWorld().playEffect(block.getLocation(),
|
||||
// Effect.STEP_SOUND, _mat);
|
||||
|
||||
@ -238,19 +266,16 @@ public class BlockForm extends Form
|
||||
// Player, Player, 60000, false, false);
|
||||
|
||||
// Sound
|
||||
Player.playSound(Player.getLocation(), Sound.NOTE_PLING,
|
||||
1f, 2f);
|
||||
Player.playSound(Player.getLocation(), Sound.NOTE_PLING, 1f, 2f);
|
||||
|
||||
// Teleport falling block to the position.
|
||||
Vector blockLoc = _block.getLocation()
|
||||
.add(0.5, -.21875, 0.5).toVector();
|
||||
Vector blockLoc = _block.getLocation().add(0.5, -.21875, 0.5).toVector();
|
||||
|
||||
_sawDiff.add(blockLoc.clone().subtract(_lastSaw));
|
||||
|
||||
Packet packet = this.getPacket(_sawDiff, blockLoc);
|
||||
|
||||
_lastSaw = Player.getLocation().toVector()
|
||||
.subtract(new Vector(0, 0.15625, 0));
|
||||
_lastSaw = Player.getLocation().toVector().subtract(new Vector(0, 0.15625, 0));
|
||||
_sawDiff = _lastSaw.clone().subtract(blockLoc);
|
||||
|
||||
if (packet != null)
|
||||
@ -260,17 +285,15 @@ public class BlockForm extends Form
|
||||
_sawDiff = new Vector();
|
||||
}
|
||||
|
||||
((CraftPlayer) Player).getHandle().playerConnection
|
||||
.sendPacket(packet);
|
||||
((CraftPlayer) Player).getHandle().playerConnection.sendPacket(packet);
|
||||
}
|
||||
|
||||
for (Player player : UtilServer.getPlayers())
|
||||
{
|
||||
UtilPlayer.sendPacket(player,
|
||||
new PacketPlayOutEntityDestroy(new int[]
|
||||
{
|
||||
getBlockId()
|
||||
}));
|
||||
UtilPlayer.sendPacket(player, new PacketPlayOutEntityDestroy(new int[]
|
||||
{
|
||||
getBlockId()
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -298,16 +321,14 @@ public class BlockForm extends Form
|
||||
MapUtil.QuickChangeBlockAt(_block.getLocation(), 0, (byte) 0);
|
||||
_block = null;
|
||||
|
||||
EntityTrackerEntry tracker = (EntityTrackerEntry) ((WorldServer) ((CraftEntity) Player)
|
||||
.getHandle().world).tracker.trackedEntities.get(Player
|
||||
.getEntityId());
|
||||
EntityTrackerEntry tracker = (EntityTrackerEntry) ((WorldServer) ((CraftEntity) Player).getHandle().world).tracker.trackedEntities
|
||||
.get(Player.getEntityId());
|
||||
|
||||
if (tracker != null)
|
||||
{
|
||||
for (EntityPlayer entity : tracker.trackedPlayers)
|
||||
{
|
||||
UtilPlayer.sendPacket(entity.getBukkitEntity(),
|
||||
getBlockPackets());
|
||||
UtilPlayer.sendPacket(entity.getBukkitEntity(), getBlockPackets(UtilPlayer.is1_9(entity.getBukkitEntity())));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -348,13 +369,10 @@ public class BlockForm extends Form
|
||||
|
||||
if (_lastSaw != null)
|
||||
{
|
||||
this._sawDiff.add(Player.getLocation()
|
||||
.subtract(0, 0.15625, 0).toVector()
|
||||
.subtract(_lastSaw));
|
||||
this._sawDiff.add(Player.getLocation().subtract(0, 0.15625, 0).toVector().subtract(_lastSaw));
|
||||
}
|
||||
|
||||
_lastSaw = Player.getLocation().subtract(0, 0.15625, 0)
|
||||
.toVector();
|
||||
_lastSaw = Player.getLocation().subtract(0, 0.15625, 0).toVector();
|
||||
|
||||
Packet packet = this.getPacket(_sawDiff, _lastSaw);
|
||||
|
||||
@ -363,8 +381,7 @@ public class BlockForm extends Form
|
||||
if (packet instanceof PacketPlayOutRelEntityMove)
|
||||
{
|
||||
PacketPlayOutRelEntityMove relPacket = (PacketPlayOutRelEntityMove) packet;
|
||||
_sawDiff.subtract(new Vector(relPacket.b / 32D,
|
||||
relPacket.c / 32D, relPacket.d / 32D));
|
||||
_sawDiff.subtract(new Vector(relPacket.b / 32D, relPacket.c / 32D, relPacket.d / 32D));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -384,8 +401,7 @@ public class BlockForm extends Form
|
||||
|
||||
if (x != 0 || y != 0 || z != 0)
|
||||
{
|
||||
if (x >= -128 && x <= 127 && y >= -128 && y <= 127 && z >= -128
|
||||
&& z <= 127)
|
||||
if (x >= -128 && x <= 127 && y >= -128 && y <= 127 && z >= -128 && z <= 127)
|
||||
{
|
||||
PacketPlayOutRelEntityMove relMove = new PacketPlayOutRelEntityMove();
|
||||
relMove.a = this._selfEntityId1;
|
||||
|
@ -7,6 +7,7 @@ import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.disguise.disguises.*;
|
||||
import nautilus.game.arcade.game.games.hideseek.HideSeek;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -43,7 +44,7 @@ public class CreatureForm extends Form
|
||||
_disguise.setSoundDisguise(new DisguiseCat(Player));
|
||||
Host.Manager.GetDisguise().disguise(_disguise);
|
||||
|
||||
((CraftEntity)Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
|
||||
((CraftEntity)Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), Entity.META_ENTITYDATA, (byte) 0);
|
||||
|
||||
//Inform
|
||||
UtilPlayer.message(Player, F.main("Game", C.cWhite + "You are now a " + F.elem(UtilEnt.getName(_type)) + "!"));
|
||||
@ -61,6 +62,6 @@ public class CreatureForm extends Form
|
||||
{
|
||||
Host.Manager.GetDisguise().undisguise(Player);
|
||||
|
||||
((CraftEntity)Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0));
|
||||
((CraftEntity)Player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0), Entity.META_ENTITYDATA, (byte) 0);
|
||||
}
|
||||
}
|
||||
|
@ -11,11 +11,13 @@ import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import net.minecraft.server.v1_8_R3.DataWatcher;
|
||||
import net.minecraft.server.v1_8_R3.Entity;
|
||||
import net.minecraft.server.v1_8_R3.Packet;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity.PacketPlayOutRelEntityMove;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutNewAttachEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntity;
|
||||
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
|
||||
|
||||
@ -176,9 +178,10 @@ public class Wall
|
||||
packet1.d = (int) Math.floor((entry.getKey().getY() - 0.15625) * 32);
|
||||
packet1.e = (int) Math.floor(entry.getKey().getZ() * 32);
|
||||
DataWatcher watcher = new DataWatcher(null);
|
||||
watcher.a(0, (byte) 32);
|
||||
watcher.a(1, 0);
|
||||
watcher.a(0, (byte) 32, Entity.META_ENTITYDATA, (byte) 32);
|
||||
watcher.a(1, 0, Entity.META_AIR, 0);
|
||||
packet1.l = watcher;
|
||||
packet1.uuid = UUID.randomUUID();
|
||||
|
||||
PacketPlayOutSpawnEntity packet2 = new PacketPlayOutSpawnEntity(((CraftPlayer) player).getHandle(), 70,
|
||||
Material.STAINED_GLASS.getId() | ids.data << 16);
|
||||
@ -186,11 +189,26 @@ public class Wall
|
||||
packet2.b = (int) Math.floor(entry.getKey().getX() * 32);
|
||||
packet2.c = (int) Math.floor(entry.getKey().getY() * 32);
|
||||
packet2.d = (int) Math.floor(entry.getKey().getZ() * 32);
|
||||
packet2.uuid = UUID.randomUUID();
|
||||
|
||||
PacketPlayOutAttachEntity packet3 = new PacketPlayOutAttachEntity();
|
||||
Packet packet3;
|
||||
|
||||
packet3.b = ids.block;
|
||||
packet3.c = ids.chicken;
|
||||
if (UtilPlayer.is1_9(player))
|
||||
{
|
||||
packet3 = new PacketPlayOutNewAttachEntity( ids.chicken, new int[]
|
||||
{
|
||||
ids.block
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
PacketPlayOutAttachEntity packet = new PacketPlayOutAttachEntity();
|
||||
|
||||
packet.b = ids.block;
|
||||
packet.c = ids.chicken;
|
||||
|
||||
packet3 = packet;
|
||||
}
|
||||
|
||||
packets[i++] = packet1;
|
||||
packets[i++] = packet2;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package nautilus.game.arcade.game.games.wizards.spells;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.UUID;
|
||||
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
@ -325,6 +326,7 @@ public class SpellRumble extends Spell implements SpellClickBlock, SpellClick
|
||||
fallingSpawn.i = 70;
|
||||
fallingSpawn.k = block.getTypeId() | block.getData() << 16;
|
||||
fallingSpawn.f = 10000;
|
||||
fallingSpawn.uuid = UUID.randomUUID();
|
||||
|
||||
final Collection<? extends Player> players = Bukkit.getOnlinePlayers();
|
||||
|
||||
|
@ -134,7 +134,7 @@
|
||||
<dependency>
|
||||
<groupId>com.mineplex</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8.8-R0.1-SNAPSHOT</version>
|
||||
<version>1.8.8-1.9-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
Loading…
Reference in New Issue
Block a user