1.10 fixes

This commit is contained in:
MattBDev 2016-06-10 13:23:21 -04:00
parent 482f4d6815
commit 93deebf4ca
4 changed files with 21 additions and 18 deletions

View File

@ -1,6 +1,6 @@
dependencies { dependencies {
compile project(':Core') compile project(':Core')
compile 'org.bukkit:bukkit:1.9.2-R0.1-SNAPSHOT' compile 'org.bukkit:bukkit:1.10-R0.1-SNAPSHOT'
compile 'org.mcstats.bukkit:metrics:R7' compile 'org.mcstats.bukkit:metrics:R7'
compile 'net.milkbowl.vault:VaultAPI:1.6' compile 'net.milkbowl.vault:VaultAPI:1.6'
} }

View File

@ -57,6 +57,7 @@ public class EntityWrapper {
private TameableStats tamed; private TameableStats tamed;
private ArmorStandStats stand; private ArmorStandStats stand;
private HorseStats horse; private HorseStats horse;
private boolean noGravity;
public EntityWrapper(Entity entity, short depth) { public EntityWrapper(Entity entity, short depth) {
this.hash = entity.getEntityId(); this.hash = entity.getEntityId();
@ -85,6 +86,9 @@ public class EntityWrapper {
if (depth == 1) { if (depth == 1) {
return; return;
} }
if (!entity.hasGravity()) {
this.noGravity = true;
}
switch (entity.getType()) { switch (entity.getType()) {
case ARROW: case ARROW:
case BOAT: case BOAT:
@ -136,25 +140,25 @@ public class EntityWrapper {
this.stack = item.getItemStack(); this.stack = item.getItemStack();
return; return;
case ITEM_FRAME: case ITEM_FRAME:
ItemFrame itemframe = (ItemFrame) entity;
this.x = Math.floor(this.x); this.x = Math.floor(this.x);
this.y = Math.floor(this.y); this.y = Math.floor(this.y);
this.z = Math.floor(this.z); this.z = Math.floor(this.z);
this.dataByte = getOrdinal(Rotation.values(), itemframe.getRotation()); ItemFrame itemFrame = (ItemFrame) entity;
this.stack = itemframe.getItem().clone(); this.dataByte = getOrdinal(Rotation.values(), itemFrame.getRotation());
this.stack = itemFrame.getItem().clone();
return; return;
case PAINTING: case PAINTING:
Painting painting = (Painting) entity;
this.x = Math.floor(this.x); this.x = Math.floor(this.x);
this.y = Math.floor(this.y); this.y = Math.floor(this.y);
this.z = Math.floor(this.z); this.z = Math.floor(this.z);
Art a = painting.getArt(); Painting painting = (Painting) entity;
Art art = painting.getArt();
this.dataByte = getOrdinal(BlockFace.values(), painting.getFacing()); this.dataByte = getOrdinal(BlockFace.values(), painting.getFacing());
int h = a.getBlockHeight(); int h = art.getBlockHeight();
if (h % 2 == 0) { if (h % 2 == 0) {
this.y -= 1; this.y -= 1;
} }
this.dataString = a.name(); this.dataString = art.name();
return; return;
// END MISC // // END MISC //
// INVENTORY HOLDER // // INVENTORY HOLDER //
@ -212,7 +216,7 @@ public class EntityWrapper {
storeLiving((LivingEntity) entity); storeLiving((LivingEntity) entity);
return; return;
case SKELETON: case SKELETON:
this.dataByte = (byte) ((Skeleton) entity).getSkeletonType().getId(); this.dataByte = getOrdinal(SkeletonType.values(),((Skeleton)entity).getSkeletonType());
storeLiving((LivingEntity) entity); storeLiving((LivingEntity) entity);
return; return;
case ARMOR_STAND: case ARMOR_STAND:
@ -258,9 +262,6 @@ public class EntityWrapper {
if (!stand.hasBasePlate()) { if (!stand.hasBasePlate()) {
this.stand.noplate = true; this.stand.noplate = true;
} }
if (!stand.hasGravity()) {
this.stand.nogravity = true;
}
if (!stand.isVisible()) { if (!stand.isVisible()) {
this.stand.invisible = true; this.stand.invisible = true;
} }
@ -464,7 +465,7 @@ public class EntityWrapper {
if (this.base.passenger != null) { if (this.base.passenger != null) {
try { try {
entity.setPassenger(this.base.passenger.spawn(world, x_offset, z_offset)); entity.setPassenger(this.base.passenger.spawn(world, x_offset, z_offset));
} catch (Exception ignored) {} } catch (Exception ignored) { }
} }
if (this.base.fall != 0) { if (this.base.fall != 0) {
entity.setFallDistance(this.base.fall); entity.setFallDistance(this.base.fall);
@ -479,6 +480,9 @@ public class EntityWrapper {
if (this.depth == 1) { if (this.depth == 1) {
return entity; return entity;
} }
if (this.noGravity) {
entity.setGravity(false);
}
switch (entity.getType()) { switch (entity.getType()) {
case ARROW: case ARROW:
case BOAT: case BOAT:
@ -583,6 +587,7 @@ public class EntityWrapper {
case VILLAGER: case VILLAGER:
case CHICKEN: case CHICKEN:
case COW: case COW:
case POLAR_BEAR:
case MUSHROOM_COW: case MUSHROOM_COW:
case PIG: case PIG:
restoreAgeable((Ageable) entity); restoreAgeable((Ageable) entity);
@ -656,9 +661,6 @@ public class EntityWrapper {
if (this.stand.arms) { if (this.stand.arms) {
stand.setArms(true); stand.setArms(true);
} }
if (this.stand.nogravity) {
stand.setGravity(false);
}
if (this.stand.noplate) { if (this.stand.noplate) {
stand.setBasePlate(false); stand.setBasePlate(false);
} }
@ -704,7 +706,7 @@ public class EntityWrapper {
} }
restoreLiving((LivingEntity) entity); restoreLiving((LivingEntity) entity);
return entity; return entity;
// END LIVING // // END LIVING
} }
} }

View File

@ -52,6 +52,7 @@ public class SendChunk {
this.methodInitLighting = classChunk.getMethod("initLighting"); this.methodInitLighting = classChunk.getMethod("initLighting");
RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk"); RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk");
if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) { if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), 1, 9, 4)) {
//this works for 1.9.4 and 1.10
tempMapChunk = classMapChunk.getConstructor(classChunk.getRealClass(),int.class); tempMapChunk = classMapChunk.getConstructor(classChunk.getRealClass(),int.class);
} else { } else {
try { try {

View File

@ -78,7 +78,7 @@ public class FastQueue_1_9 extends SlowQueue {
} }
/** /**
* This should be overridden by any specialized queues * This should be overridden by any specialized queues.
* @param plotChunk * @param plotChunk
*/ */
@Override @Override