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 {
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 'net.milkbowl.vault:VaultAPI:1.6'
}

View File

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

View File

@ -52,6 +52,7 @@ public class SendChunk {
this.methodInitLighting = classChunk.getMethod("initLighting");
RefClass classMapChunk = getRefClass("{nms}.PacketPlayOutMapChunk");
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);
} else {
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
*/
@Override