Update to Minecraft 1.12.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2017-08-03 23:00:00 +10:00
parent 4ba3003a60
commit 0cda4f9617
19 changed files with 179 additions and 254 deletions

View File

@@ -207,7 +207,7 @@ public class CraftAreaEffectCloud extends CraftEntity implements AreaEffectCloud
}
public ProjectileSource getSource() {
EntityLiving source = getHandle().y(); // PAIL: rename
EntityLiving source = getHandle().getSource();
return (source == null) ? null : (LivingEntity) source.getBukkitEntity();
}

View File

@@ -686,7 +686,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@Override
public PistonMoveReaction getPistonMoveReaction() {
return PistonMoveReaction.getById(getHandle().o_().ordinal()); // PAIL: rename
return PistonMoveReaction.getById(getHandle().getPushReaction().ordinal());
}
protected NBTTagCompound save() {

View File

@@ -134,32 +134,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getEyeHeight();
}
private List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance, int maxLength) {
if (maxDistance > 120) {
maxDistance = 120;
}
ArrayList<Block> blocks = new ArrayList<Block>();
Iterator<Block> itr = new BlockIterator(this, maxDistance);
while (itr.hasNext()) {
Block block = itr.next();
blocks.add(block);
if (maxLength != 0 && blocks.size() > maxLength) {
blocks.remove(0);
}
int id = block.getTypeId();
if (transparent == null) {
if (id != 0) {
break;
}
} else {
if (!transparent.contains((byte) id)) {
break;
}
}
}
return blocks;
}
private List<Block> getLineOfSight(Set<Material> transparent, int maxDistance, int maxLength) {
if (maxDistance > 120) {
maxDistance = 120;
@@ -186,28 +160,15 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return blocks;
}
public List<Block> getLineOfSight(HashSet<Byte> transparent, int maxDistance) {
return getLineOfSight(transparent, maxDistance, 0);
}
public List<Block> getLineOfSight(Set<Material> transparent, int maxDistance) {
return getLineOfSight(transparent, maxDistance, 0);
}
public Block getTargetBlock(HashSet<Byte> transparent, int maxDistance) {
List<Block> blocks = getLineOfSight(transparent, maxDistance, 1);
return blocks.get(0);
}
public Block getTargetBlock(Set<Material> transparent, int maxDistance) {
List<Block> blocks = getLineOfSight(transparent, maxDistance, 1);
return blocks.get(0);
}
public List<Block> getLastTwoTargetBlocks(HashSet<Byte> transparent, int maxDistance) {
return getLineOfSight(transparent, maxDistance, 2);
}
public List<Block> getLastTwoTargetBlocks(Set<Material> transparent, int maxDistance) {
return getLineOfSight(transparent, maxDistance, 2);
}

View File

@@ -245,7 +245,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
break;
}
}
TileEntity te = (blockEntityTag == null) ? null : TileEntity.a(null, blockEntityTag);
TileEntity te = (blockEntityTag == null) ? null : TileEntity.create(null, blockEntityTag);
switch (material) {
case SIGN: