Upstream Paper
This commit is contained in:
14
pom.xml
14
pom.xml
@@ -84,7 +84,7 @@
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
<version>7.0</version>
|
||||
<version>7.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -210,11 +210,13 @@
|
||||
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation> <!-- Paper -->
|
||||
<createSourcesJar>${shadeSourcesJar}</createSourcesJar>
|
||||
<relocations>
|
||||
<!-- Paper - Workaround for hardcoded path lookup in dependency, easier than forking it - GH-189 -->
|
||||
<!--<relocation>-->
|
||||
<!--<pattern>joptsimple</pattern>-->
|
||||
<!--<shadedPattern>org.bukkit.craftbukkit.libs.joptsimple</shadedPattern>-->
|
||||
<!--</relocation>-->
|
||||
<!-- Cannot be relocated as it breaks translation property keys -->
|
||||
<!--
|
||||
<relocation>
|
||||
<pattern>joptsimple</pattern>
|
||||
<shadedPattern>org.bukkit.craftbukkit.libs.joptsimple</shadedPattern>
|
||||
</relocation>
|
||||
-->
|
||||
<relocation>
|
||||
<pattern>jline</pattern>
|
||||
<shadedPattern>org.bukkit.craftbukkit.libs.jline</shadedPattern>
|
||||
|
||||
@@ -54,8 +54,8 @@ public class ArgumentParserSelector {
|
||||
private int n;
|
||||
private boolean o;
|
||||
private boolean p;
|
||||
private CriterionConditionValue.c q;
|
||||
private CriterionConditionValue.d r;
|
||||
private CriterionConditionValue.FloatRange q;
|
||||
private CriterionConditionValue.IntegerRange r;
|
||||
@Nullable
|
||||
private Double s;
|
||||
@Nullable
|
||||
@@ -97,23 +97,9 @@ public class ArgumentParserSelector {
|
||||
this(stringreader, true);
|
||||
}
|
||||
|
||||
// CraftBukkit start - decompile error
|
||||
private static final CriterionConditionValue.c DEFAULT_q;
|
||||
private static final CriterionConditionValue.d DEFAULT_r;
|
||||
|
||||
static {
|
||||
try {
|
||||
DEFAULT_q = (CriterionConditionValue.c) Class.forName("net.minecraft.server.CriterionConditionValue$c").getDeclaredField("e").get(null);
|
||||
DEFAULT_r = (CriterionConditionValue.d) Class.forName("net.minecraft.server.CriterionConditionValue$d").getDeclaredField("e").get(null);
|
||||
} catch (Exception ex) {
|
||||
throw new AssertionError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public ArgumentParserSelector(StringReader stringreader, boolean flag) {
|
||||
this.q = DEFAULT_q;
|
||||
this.r = DEFAULT_r;
|
||||
// CraftBukkit end
|
||||
this.q = CriterionConditionValue.FloatRange.e;
|
||||
this.r = CriterionConditionValue.IntegerRange.e;
|
||||
this.y = CriterionConditionRange.a;
|
||||
this.z = CriterionConditionRange.a;
|
||||
this.A = (entity) -> {
|
||||
@@ -348,20 +334,20 @@ public class ArgumentParserSelector {
|
||||
this.p = true;
|
||||
}
|
||||
|
||||
public CriterionConditionValue.c h() {
|
||||
public CriterionConditionValue.FloatRange h() {
|
||||
return this.q;
|
||||
}
|
||||
|
||||
public void a(CriterionConditionValue.c criterionconditionvalue_c) {
|
||||
this.q = criterionconditionvalue_c;
|
||||
public void a(CriterionConditionValue.FloatRange criterionconditionvalue_floatrange) {
|
||||
this.q = criterionconditionvalue_floatrange;
|
||||
}
|
||||
|
||||
public CriterionConditionValue.d i() {
|
||||
public CriterionConditionValue.IntegerRange i() {
|
||||
return this.r;
|
||||
}
|
||||
|
||||
public void a(CriterionConditionValue.d criterionconditionvalue_d) {
|
||||
this.r = criterionconditionvalue_d;
|
||||
public void a(CriterionConditionValue.IntegerRange criterionconditionvalue_integerrange) {
|
||||
this.r = criterionconditionvalue_integerrange;
|
||||
}
|
||||
|
||||
public CriterionConditionRange j() {
|
||||
|
||||
@@ -114,7 +114,7 @@ public class Block implements IMaterial {
|
||||
|
||||
@Deprecated
|
||||
public void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, int i) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -124,25 +124,25 @@ public class Block implements IMaterial {
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EnumDirection enumdirection = aenumdirection[k];
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection);
|
||||
IBlockData iblockdata1 = generatoraccess.getType(blockposition_b);
|
||||
IBlockData iblockdata2 = iblockdata1.updateState(enumdirection.opposite(), iblockdata, generatoraccess, blockposition_b, blockposition);
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection);
|
||||
IBlockData iblockdata1 = generatoraccess.getType(blockposition_pooledblockposition);
|
||||
IBlockData iblockdata2 = iblockdata1.updateState(enumdirection.opposite(), iblockdata, generatoraccess, blockposition_pooledblockposition, blockposition);
|
||||
|
||||
a(iblockdata1, iblockdata2, generatoraccess, blockposition_b, i);
|
||||
a(iblockdata1, iblockdata2, generatoraccess, blockposition_pooledblockposition, i);
|
||||
}
|
||||
} catch (Throwable throwable1) {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BlockBeacon extends BlockTileEntity {
|
||||
}
|
||||
|
||||
public static void a(World world, BlockPosition blockposition) {
|
||||
//HttpUtilities.a.submit(() -> { // Paper
|
||||
// HttpUtilities.a.submit(() -> { // CraftBukkit - dangerously threaded
|
||||
Chunk chunk = world.getChunkAtWorldCoords(blockposition);
|
||||
|
||||
for (int i = blockposition.getY() - 1; i >= 0; --i) {
|
||||
@@ -73,6 +73,7 @@ public class BlockBeacon extends BlockTileEntity {
|
||||
});
|
||||
}
|
||||
}
|
||||
// }); // Paper
|
||||
|
||||
// }); // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class BlockIceFrost extends BlockIce {
|
||||
public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) {
|
||||
if (!world.paperConfig.frostedIceEnabled) return; // Paper - add ability to disable frosted ice
|
||||
if ((random.nextInt(3) == 0 || this.a(world, blockposition, 4)) && world.getLightLevel(blockposition) > 11 - (Integer) iblockdata.get(BlockIceFrost.a) - iblockdata.b(world, blockposition) && this.c(iblockdata, world, blockposition)) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -24,27 +24,27 @@ public class BlockIceFrost extends BlockIce {
|
||||
for (int j = 0; j < i; ++j) {
|
||||
EnumDirection enumdirection = aenumdirection[j];
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection);
|
||||
IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition_b); // Paper - don't load chunks
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection);
|
||||
IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition_pooledblockposition); // Paper - don't load chunks
|
||||
if (iblockdata1 == null) continue; // Paper
|
||||
|
||||
if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_b)) {
|
||||
world.getBlockTickList().a(blockposition_b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
|
||||
if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_pooledblockposition)) {
|
||||
world.getBlockTickList().a(blockposition_pooledblockposition, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay
|
||||
}
|
||||
}
|
||||
} catch (Throwable throwable1) {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class BlockIceFrost extends BlockIce {
|
||||
|
||||
private boolean a(IBlockAccess iblockaccess, BlockPosition blockposition, int i) {
|
||||
int j = 0;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -87,8 +87,8 @@ public class BlockIceFrost extends BlockIce {
|
||||
for (int l = 0; l < k; ++l) {
|
||||
EnumDirection enumdirection = aenumdirection[l];
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection);
|
||||
if (((World) iblockaccess).getBlockIfLoaded(blockposition_b) == this) { // Paper - don't load chunks
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection);
|
||||
if (((World) iblockaccess).getBlockIfLoaded(blockposition_pooledblockposition) == this) { // Paper - don't load chunks
|
||||
++j;
|
||||
if (j >= i) {
|
||||
boolean flag = false;
|
||||
@@ -103,15 +103,15 @@ public class BlockIceFrost extends BlockIce {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class BlockLeaves extends Block {
|
||||
|
||||
private static IBlockData a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
int i = 7;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -66,8 +66,8 @@ public class BlockLeaves extends Block {
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EnumDirection enumdirection = aenumdirection[k];
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection);
|
||||
i = Math.min(i, w(generatoraccess.getType(blockposition_b)) + 1);
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection);
|
||||
i = Math.min(i, w(generatoraccess.getType(blockposition_pooledblockposition)) + 1);
|
||||
if (i == 1) {
|
||||
break;
|
||||
}
|
||||
@@ -76,15 +76,15 @@ public class BlockLeaves extends Block {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -240,71 +240,71 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
};
|
||||
}
|
||||
|
||||
public static final class b extends BlockPosition.MutableBlockPosition implements AutoCloseable {
|
||||
public static final class PooledBlockPosition extends BlockPosition.MutableBlockPosition implements AutoCloseable {
|
||||
|
||||
private boolean f;
|
||||
private static final List<BlockPosition.b> g = Lists.newArrayList();
|
||||
private static final List<BlockPosition.PooledBlockPosition> g = Lists.newArrayList();
|
||||
|
||||
private b(int i, int j, int k) {
|
||||
private PooledBlockPosition(int i, int j, int k) {
|
||||
super(i, j, k);
|
||||
}
|
||||
|
||||
public static BlockPosition.b r() {
|
||||
public static BlockPosition.PooledBlockPosition r() {
|
||||
return e(0, 0, 0);
|
||||
}
|
||||
|
||||
public static BlockPosition.b b(Entity entity) {
|
||||
public static BlockPosition.PooledBlockPosition b(Entity entity) {
|
||||
return d(entity.locX, entity.locY, entity.locZ);
|
||||
}
|
||||
|
||||
public static BlockPosition.b d(double d0, double d1, double d2) {
|
||||
public static BlockPosition.PooledBlockPosition d(double d0, double d1, double d2) {
|
||||
return e(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
|
||||
}
|
||||
|
||||
public static BlockPosition.b e(int i, int j, int k) {
|
||||
synchronized (BlockPosition.b.g) {
|
||||
if (!BlockPosition.b.g.isEmpty()) {
|
||||
BlockPosition.b blockposition_b = (BlockPosition.b) BlockPosition.b.g.remove(BlockPosition.b.g.size() - 1);
|
||||
public static BlockPosition.PooledBlockPosition e(int i, int j, int k) {
|
||||
synchronized (BlockPosition.PooledBlockPosition.g) {
|
||||
if (!BlockPosition.PooledBlockPosition.g.isEmpty()) {
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = (BlockPosition.PooledBlockPosition) BlockPosition.PooledBlockPosition.g.remove(BlockPosition.PooledBlockPosition.g.size() - 1);
|
||||
|
||||
if (blockposition_b != null && blockposition_b.f) {
|
||||
blockposition_b.f = false;
|
||||
blockposition_b.c(i, j, k);
|
||||
return blockposition_b;
|
||||
if (blockposition_pooledblockposition != null && blockposition_pooledblockposition.f) {
|
||||
blockposition_pooledblockposition.f = false;
|
||||
blockposition_pooledblockposition.c(i, j, k);
|
||||
return blockposition_pooledblockposition;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new BlockPosition.b(i, j, k);
|
||||
return new BlockPosition.PooledBlockPosition(i, j, k);
|
||||
}
|
||||
|
||||
public BlockPosition.b c(int i, int j, int k) {
|
||||
return (BlockPosition.b) super.c(i, j, k);
|
||||
public BlockPosition.PooledBlockPosition c(int i, int j, int k) {
|
||||
return (BlockPosition.PooledBlockPosition) super.c(i, j, k);
|
||||
}
|
||||
|
||||
public BlockPosition.b c(double d0, double d1, double d2) {
|
||||
return (BlockPosition.b) super.c(d0, d1, d2);
|
||||
public BlockPosition.PooledBlockPosition c(double d0, double d1, double d2) {
|
||||
return (BlockPosition.PooledBlockPosition) super.c(d0, d1, d2);
|
||||
}
|
||||
|
||||
public BlockPosition.b g(BaseBlockPosition baseblockposition) {
|
||||
return (BlockPosition.b) super.g(baseblockposition);
|
||||
public BlockPosition.PooledBlockPosition g(BaseBlockPosition baseblockposition) {
|
||||
return (BlockPosition.PooledBlockPosition) super.g(baseblockposition);
|
||||
}
|
||||
|
||||
public BlockPosition.b c(EnumDirection enumdirection) {
|
||||
return (BlockPosition.b) super.c(enumdirection);
|
||||
public BlockPosition.PooledBlockPosition c(EnumDirection enumdirection) {
|
||||
return (BlockPosition.PooledBlockPosition) super.c(enumdirection);
|
||||
}
|
||||
|
||||
public BlockPosition.b c(EnumDirection enumdirection, int i) {
|
||||
return (BlockPosition.b) super.c(enumdirection, i);
|
||||
public BlockPosition.PooledBlockPosition c(EnumDirection enumdirection, int i) {
|
||||
return (BlockPosition.PooledBlockPosition) super.c(enumdirection, i);
|
||||
}
|
||||
|
||||
public BlockPosition.b d(int i, int j, int k) {
|
||||
return (BlockPosition.b) super.d(i, j, k);
|
||||
public BlockPosition.PooledBlockPosition d(int i, int j, int k) {
|
||||
return (BlockPosition.PooledBlockPosition) super.d(i, j, k);
|
||||
}
|
||||
|
||||
public void close() {
|
||||
synchronized (BlockPosition.b.g) {
|
||||
if (BlockPosition.b.g.size() < 100) {
|
||||
BlockPosition.b.g.add(this);
|
||||
synchronized (BlockPosition.PooledBlockPosition.g) {
|
||||
if (BlockPosition.PooledBlockPosition.g.size() < 100) {
|
||||
BlockPosition.PooledBlockPosition.g.add(this);
|
||||
}
|
||||
|
||||
this.f = true;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class BlockRedstoneWire extends Block {
|
||||
}
|
||||
|
||||
public void b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, int i) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -87,25 +87,25 @@ public class BlockRedstoneWire extends Block {
|
||||
EnumDirection enumdirection = (EnumDirection) iterator.next();
|
||||
BlockPropertyRedstoneSide blockpropertyredstoneside = (BlockPropertyRedstoneSide) iblockdata.get((IBlockState) BlockRedstoneWire.q.get(enumdirection));
|
||||
|
||||
if (blockpropertyredstoneside != BlockPropertyRedstoneSide.NONE && generatoraccess.getType(blockposition_b.g(blockposition).c(enumdirection)).getBlock() != this) {
|
||||
blockposition_b.c(EnumDirection.DOWN);
|
||||
IBlockData iblockdata1 = generatoraccess.getType(blockposition_b);
|
||||
if (blockpropertyredstoneside != BlockPropertyRedstoneSide.NONE && generatoraccess.getType(blockposition_pooledblockposition.g(blockposition).c(enumdirection)).getBlock() != this) {
|
||||
blockposition_pooledblockposition.c(EnumDirection.DOWN);
|
||||
IBlockData iblockdata1 = generatoraccess.getType(blockposition_pooledblockposition);
|
||||
|
||||
if (iblockdata1.getBlock() != Blocks.OBSERVER) {
|
||||
BlockPosition blockposition1 = blockposition_b.shift(enumdirection.opposite());
|
||||
IBlockData iblockdata2 = iblockdata1.updateState(enumdirection.opposite(), generatoraccess.getType(blockposition1), generatoraccess, blockposition_b, blockposition1);
|
||||
BlockPosition blockposition1 = blockposition_pooledblockposition.shift(enumdirection.opposite());
|
||||
IBlockData iblockdata2 = iblockdata1.updateState(enumdirection.opposite(), generatoraccess.getType(blockposition1), generatoraccess, blockposition_pooledblockposition, blockposition1);
|
||||
|
||||
a(iblockdata1, iblockdata2, generatoraccess, blockposition_b, i);
|
||||
a(iblockdata1, iblockdata2, generatoraccess, blockposition_pooledblockposition, i);
|
||||
}
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection).c(EnumDirection.UP);
|
||||
IBlockData iblockdata3 = generatoraccess.getType(blockposition_b);
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection).c(EnumDirection.UP);
|
||||
IBlockData iblockdata3 = generatoraccess.getType(blockposition_pooledblockposition);
|
||||
|
||||
if (iblockdata3.getBlock() != Blocks.OBSERVER) {
|
||||
BlockPosition blockposition2 = blockposition_b.shift(enumdirection.opposite());
|
||||
IBlockData iblockdata4 = iblockdata3.updateState(enumdirection.opposite(), generatoraccess.getType(blockposition2), generatoraccess, blockposition_b, blockposition2);
|
||||
BlockPosition blockposition2 = blockposition_pooledblockposition.shift(enumdirection.opposite());
|
||||
IBlockData iblockdata4 = iblockdata3.updateState(enumdirection.opposite(), generatoraccess.getType(blockposition2), generatoraccess, blockposition_pooledblockposition, blockposition2);
|
||||
|
||||
a(iblockdata3, iblockdata4, generatoraccess, blockposition_b, i);
|
||||
a(iblockdata3, iblockdata4, generatoraccess, blockposition_pooledblockposition, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,15 +113,15 @@ public class BlockRedstoneWire extends Block {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ public class CommandGamerule {
|
||||
Iterator iterator = GameRules.getGameRules().entrySet().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entry<String, GameRules.b> entry = (Entry) iterator.next();
|
||||
Entry<String, GameRules.GameRuleDefinition> entry = (Entry) iterator.next();
|
||||
|
||||
literalargumentbuilder.then(((LiteralArgumentBuilder) CommandDispatcher.a((String) entry.getKey()).executes((commandcontext) -> {
|
||||
return a((CommandListenerWrapper) commandcontext.getSource(), (String) entry.getKey());
|
||||
})).then(((GameRules.b) entry.getValue()).b().a("value").executes((commandcontext) -> {
|
||||
})).then(((GameRules.GameRuleDefinition) entry.getValue()).b().a("value").executes((commandcontext) -> {
|
||||
return a((CommandListenerWrapper) commandcontext.getSource(), (String) entry.getKey(), commandcontext);
|
||||
})));
|
||||
}
|
||||
|
||||
@@ -388,7 +388,7 @@ public class DispenserRegistry {
|
||||
}
|
||||
}
|
||||
}));
|
||||
BlockDispenser.a((IMaterial) Items.FLINT_AND_STEEL, (IDispenseBehavior) (new DispenserRegistry.c() {
|
||||
BlockDispenser.a((IMaterial) Items.FLINT_AND_STEEL, (IDispenseBehavior) (new DispenserRegistry.DispenseBehaviorMaybe() {
|
||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
World world = isourceblock.getWorld();
|
||||
|
||||
@@ -443,7 +443,7 @@ public class DispenserRegistry {
|
||||
return itemstack;
|
||||
}
|
||||
}));
|
||||
BlockDispenser.a((IMaterial) Items.BONE_MEAL, (IDispenseBehavior) (new DispenserRegistry.c() {
|
||||
BlockDispenser.a((IMaterial) Items.BONE_MEAL, (IDispenseBehavior) (new DispenserRegistry.DispenseBehaviorMaybe() {
|
||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
this.a = true;
|
||||
World world = isourceblock.getWorld();
|
||||
@@ -544,19 +544,19 @@ public class DispenserRegistry {
|
||||
return itemstack;
|
||||
}
|
||||
}));
|
||||
DispenserRegistry.c dispenserregistry_c = new DispenserRegistry.c() {
|
||||
DispenserRegistry.DispenseBehaviorMaybe dispenserregistry_dispensebehaviormaybe = new DispenserRegistry.DispenseBehaviorMaybe() {
|
||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
this.a = !ItemArmor.a(isourceblock, itemstack).isEmpty();
|
||||
return itemstack;
|
||||
}
|
||||
};
|
||||
|
||||
BlockDispenser.a((IMaterial) Items.CREEPER_HEAD, (IDispenseBehavior) dispenserregistry_c);
|
||||
BlockDispenser.a((IMaterial) Items.ZOMBIE_HEAD, (IDispenseBehavior) dispenserregistry_c);
|
||||
BlockDispenser.a((IMaterial) Items.DRAGON_HEAD, (IDispenseBehavior) dispenserregistry_c);
|
||||
BlockDispenser.a((IMaterial) Items.SKELETON_SKULL, (IDispenseBehavior) dispenserregistry_c);
|
||||
BlockDispenser.a((IMaterial) Items.PLAYER_HEAD, (IDispenseBehavior) dispenserregistry_c);
|
||||
BlockDispenser.a((IMaterial) Items.WITHER_SKELETON_SKULL, (IDispenseBehavior) (new DispenserRegistry.c() {
|
||||
BlockDispenser.a((IMaterial) Items.CREEPER_HEAD, (IDispenseBehavior) dispenserregistry_dispensebehaviormaybe);
|
||||
BlockDispenser.a((IMaterial) Items.ZOMBIE_HEAD, (IDispenseBehavior) dispenserregistry_dispensebehaviormaybe);
|
||||
BlockDispenser.a((IMaterial) Items.DRAGON_HEAD, (IDispenseBehavior) dispenserregistry_dispensebehaviormaybe);
|
||||
BlockDispenser.a((IMaterial) Items.SKELETON_SKULL, (IDispenseBehavior) dispenserregistry_dispensebehaviormaybe);
|
||||
BlockDispenser.a((IMaterial) Items.PLAYER_HEAD, (IDispenseBehavior) dispenserregistry_dispensebehaviormaybe);
|
||||
BlockDispenser.a((IMaterial) Items.WITHER_SKELETON_SKULL, (IDispenseBehavior) (new DispenserRegistry.DispenseBehaviorMaybe() {
|
||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
World world = isourceblock.getWorld();
|
||||
EnumDirection enumdirection = (EnumDirection) isourceblock.e().get(BlockDispenser.FACING);
|
||||
@@ -603,7 +603,7 @@ public class DispenserRegistry {
|
||||
return itemstack;
|
||||
}
|
||||
}));
|
||||
BlockDispenser.a((IMaterial) Blocks.CARVED_PUMPKIN, (IDispenseBehavior) (new DispenserRegistry.c() {
|
||||
BlockDispenser.a((IMaterial) Blocks.CARVED_PUMPKIN, (IDispenseBehavior) (new DispenserRegistry.DispenseBehaviorMaybe() {
|
||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
World world = isourceblock.getWorld();
|
||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.e().get(BlockDispenser.FACING));
|
||||
@@ -829,7 +829,7 @@ public class DispenserRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
static class d extends DispenserRegistry.c {
|
||||
static class d extends DispenserRegistry.DispenseBehaviorMaybe {
|
||||
|
||||
private d() {}
|
||||
|
||||
@@ -876,11 +876,11 @@ public class DispenserRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class c extends DispenseBehaviorItem {
|
||||
public abstract static class DispenseBehaviorMaybe extends DispenseBehaviorItem {
|
||||
|
||||
protected boolean a = true;
|
||||
|
||||
public c() {}
|
||||
public DispenseBehaviorMaybe() {}
|
||||
|
||||
protected void a(ISourceBlock isourceblock) {
|
||||
isourceblock.getWorld().triggerEffect(this.a ? 1000 : 1001, isourceblock.getBlockPosition(), 0);
|
||||
|
||||
@@ -969,33 +969,33 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
||||
protected void checkBlockCollisions() {
|
||||
AxisAlignedBB axisalignedbb = this.getBoundingBox();
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.d(axisalignedbb.minX + 0.001D, axisalignedbb.minY + 0.001D, axisalignedbb.minZ + 0.001D);
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.d(axisalignedbb.minX + 0.001D, axisalignedbb.minY + 0.001D, axisalignedbb.minZ + 0.001D);
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
BlockPosition.b blockposition_b1 = BlockPosition.b.d(axisalignedbb.maxX - 0.001D, axisalignedbb.maxY - 0.001D, axisalignedbb.maxZ - 0.001D);
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition1 = BlockPosition.PooledBlockPosition.d(axisalignedbb.maxX - 0.001D, axisalignedbb.maxY - 0.001D, axisalignedbb.maxZ - 0.001D);
|
||||
Throwable throwable1 = null;
|
||||
|
||||
try {
|
||||
BlockPosition.b blockposition_b2 = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition2 = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable2 = null;
|
||||
|
||||
try {
|
||||
if (this.world.areChunksLoadedBetween(blockposition_b, blockposition_b1)) {
|
||||
for (int i = blockposition_b.getX(); i <= blockposition_b1.getX(); ++i) {
|
||||
for (int j = blockposition_b.getY(); j <= blockposition_b1.getY(); ++j) {
|
||||
for (int k = blockposition_b.getZ(); k <= blockposition_b1.getZ(); ++k) {
|
||||
blockposition_b2.c(i, j, k);
|
||||
IBlockData iblockdata = this.world.getType(blockposition_b2);
|
||||
if (this.world.areChunksLoadedBetween(blockposition_pooledblockposition, blockposition_pooledblockposition1)) {
|
||||
for (int i = blockposition_pooledblockposition.getX(); i <= blockposition_pooledblockposition1.getX(); ++i) {
|
||||
for (int j = blockposition_pooledblockposition.getY(); j <= blockposition_pooledblockposition1.getY(); ++j) {
|
||||
for (int k = blockposition_pooledblockposition.getZ(); k <= blockposition_pooledblockposition1.getZ(); ++k) {
|
||||
blockposition_pooledblockposition2.c(i, j, k);
|
||||
IBlockData iblockdata = this.world.getType(blockposition_pooledblockposition2);
|
||||
|
||||
try {
|
||||
iblockdata.a(this.world, blockposition_b2, this);
|
||||
iblockdata.a(this.world, blockposition_pooledblockposition2, this);
|
||||
this.a(iblockdata);
|
||||
} catch (Throwable throwable3) {
|
||||
CrashReport crashreport = CrashReport.a(throwable3, "Colliding entity with block");
|
||||
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Block being collided with");
|
||||
|
||||
CrashReportSystemDetails.a(crashreportsystemdetails, blockposition_b2, iblockdata);
|
||||
CrashReportSystemDetails.a(crashreportsystemdetails, blockposition_pooledblockposition2, iblockdata);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
}
|
||||
@@ -1006,15 +1006,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
throwable2 = throwable4;
|
||||
throw throwable4;
|
||||
} finally {
|
||||
if (blockposition_b2 != null) {
|
||||
if (blockposition_pooledblockposition2 != null) {
|
||||
if (throwable2 != null) {
|
||||
try {
|
||||
blockposition_b2.close();
|
||||
blockposition_pooledblockposition2.close();
|
||||
} catch (Throwable throwable5) {
|
||||
throwable2.addSuppressed(throwable5);
|
||||
}
|
||||
} else {
|
||||
blockposition_b2.close();
|
||||
blockposition_pooledblockposition2.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1023,15 +1023,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
throwable1 = throwable6;
|
||||
throw throwable6;
|
||||
} finally {
|
||||
if (blockposition_b1 != null) {
|
||||
if (blockposition_pooledblockposition1 != null) {
|
||||
if (throwable1 != null) {
|
||||
try {
|
||||
blockposition_b1.close();
|
||||
blockposition_pooledblockposition1.close();
|
||||
} catch (Throwable throwable7) {
|
||||
throwable1.addSuppressed(throwable7);
|
||||
}
|
||||
} else {
|
||||
blockposition_b1.close();
|
||||
blockposition_pooledblockposition1.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1040,15 +1040,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
throwable = throwable8;
|
||||
throw throwable8;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable9) {
|
||||
throwable.addSuppressed(throwable9);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1152,26 +1152,26 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
}
|
||||
|
||||
private boolean p() {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.b(this);
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.b(this);
|
||||
Throwable throwable = null;
|
||||
|
||||
boolean flag;
|
||||
|
||||
try {
|
||||
flag = this.world.isRainingAt(blockposition_b) || this.world.isRainingAt(blockposition_b.c(this.locX, this.locY + (double) this.length, this.locZ));
|
||||
flag = this.world.isRainingAt(blockposition_pooledblockposition) || this.world.isRainingAt(blockposition_pooledblockposition.c(this.locX, this.locY + (double) this.length, this.locZ));
|
||||
} catch (Throwable throwable1) {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1980,7 +1980,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
if (this.noclip) {
|
||||
return false;
|
||||
} else {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -1989,9 +1989,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
int k = MathHelper.floor(this.locX + (double) (((float) ((i >> 1) % 2) - 0.5F) * this.width * 0.8F));
|
||||
int l = MathHelper.floor(this.locZ + (double) (((float) ((i >> 2) % 2) - 0.5F) * this.width * 0.8F));
|
||||
|
||||
if (blockposition_b.getX() != k || blockposition_b.getY() != j || blockposition_b.getZ() != l) {
|
||||
blockposition_b.c(k, j, l);
|
||||
if (this.world.getType(blockposition_b).r()) {
|
||||
if (blockposition_pooledblockposition.getX() != k || blockposition_pooledblockposition.getY() != j || blockposition_pooledblockposition.getZ() != l) {
|
||||
blockposition_pooledblockposition.c(k, j, l);
|
||||
if (this.world.getType(blockposition_pooledblockposition).r()) {
|
||||
boolean flag = true;
|
||||
|
||||
return flag;
|
||||
@@ -2004,15 +2004,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3144,15 +3144,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
boolean flag1 = false;
|
||||
Vec3D vec3d = Vec3D.a;
|
||||
int k1 = 0;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int l1 = i; l1 < j; ++l1) {
|
||||
for (int i2 = k; i2 < l; ++i2) {
|
||||
for (int j2 = i1; j2 < j1; ++j2) {
|
||||
blockposition_b.c(l1, i2, j2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_b);
|
||||
blockposition_pooledblockposition.c(l1, i2, j2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_pooledblockposition);
|
||||
|
||||
if (fluid.a(tag)) {
|
||||
double d1 = (double) ((float) i2 + fluid.getHeight());
|
||||
@@ -3161,7 +3161,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
flag1 = true;
|
||||
d0 = Math.max(d1 - axisalignedbb.minY, d0);
|
||||
if (flag) {
|
||||
Vec3D vec3d1 = fluid.a((IWorldReader) this.world, (BlockPosition) blockposition_b);
|
||||
Vec3D vec3d1 = fluid.a((IWorldReader) this.world, (BlockPosition) blockposition_pooledblockposition);
|
||||
|
||||
if (d0 < 0.4D) {
|
||||
vec3d1 = vec3d1.a(d0);
|
||||
@@ -3179,15 +3179,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ public class EntityBoat extends Entity {
|
||||
int l = MathHelper.f(axisalignedbb.maxY - this.aN);
|
||||
int i1 = MathHelper.floor(axisalignedbb.minZ);
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -441,8 +441,8 @@ public class EntityBoat extends Entity {
|
||||
|
||||
for (int l1 = i; l1 < j; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
blockposition_b.c(l1, k1, i2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_b);
|
||||
blockposition_pooledblockposition.c(l1, k1, i2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_pooledblockposition);
|
||||
|
||||
if (fluid.a(TagsFluid.WATER)) {
|
||||
f = Math.max(f, (float) k1 + fluid.getHeight());
|
||||
@@ -455,7 +455,7 @@ public class EntityBoat extends Entity {
|
||||
}
|
||||
|
||||
if (f < 1.0F) {
|
||||
float f1 = (float) blockposition_b.getY() + f;
|
||||
float f1 = (float) blockposition_pooledblockposition.getY() + f;
|
||||
|
||||
return f1;
|
||||
}
|
||||
@@ -468,15 +468,15 @@ public class EntityBoat extends Entity {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -495,7 +495,7 @@ public class EntityBoat extends Entity {
|
||||
VoxelShape voxelshape = VoxelShapes.a(axisalignedbb1);
|
||||
float f = 0.0F;
|
||||
int k1 = 0;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -506,10 +506,10 @@ public class EntityBoat extends Entity {
|
||||
if (j2 != 2) {
|
||||
for (int k2 = k; k2 < l; ++k2) {
|
||||
if (j2 <= 0 || k2 != k && k2 != l - 1) {
|
||||
blockposition_b.c(l1, k2, i2);
|
||||
IBlockData iblockdata = this.world.getType(blockposition_b);
|
||||
blockposition_pooledblockposition.c(l1, k2, i2);
|
||||
IBlockData iblockdata = this.world.getType(blockposition_pooledblockposition);
|
||||
|
||||
if (!(iblockdata.getBlock() instanceof BlockWaterLily) && VoxelShapes.c(iblockdata.getCollisionShape(this.world, blockposition_b).a((double) l1, (double) k2, (double) i2), voxelshape, OperatorBoolean.AND)) {
|
||||
if (!(iblockdata.getBlock() instanceof BlockWaterLily) && VoxelShapes.c(iblockdata.getCollisionShape(this.world, blockposition_pooledblockposition).a((double) l1, (double) k2, (double) i2), voxelshape, OperatorBoolean.AND)) {
|
||||
f += iblockdata.getBlock().n();
|
||||
++k1;
|
||||
}
|
||||
@@ -522,15 +522,15 @@ public class EntityBoat extends Entity {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,15 +550,15 @@ public class EntityBoat extends Entity {
|
||||
boolean flag = false;
|
||||
|
||||
this.aJ = Double.MIN_VALUE;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
blockposition_b.c(k1, l1, i2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_b);
|
||||
blockposition_pooledblockposition.c(k1, l1, i2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_pooledblockposition);
|
||||
|
||||
if (fluid.a(TagsFluid.WATER)) {
|
||||
float f = (float) l1 + fluid.getHeight();
|
||||
@@ -573,15 +573,15 @@ public class EntityBoat extends Entity {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,17 +601,17 @@ public class EntityBoat extends Entity {
|
||||
int i1 = MathHelper.floor(axisalignedbb.minZ);
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
boolean flag = false;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
blockposition_b.c(k1, l1, i2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_b);
|
||||
blockposition_pooledblockposition.c(k1, l1, i2);
|
||||
Fluid fluid = this.world.getFluid(blockposition_pooledblockposition);
|
||||
|
||||
if (fluid.a(TagsFluid.WATER) && d0 < (double) ((float) blockposition_b.getY() + fluid.getHeight())) {
|
||||
if (fluid.a(TagsFluid.WATER) && d0 < (double) ((float) blockposition_pooledblockposition.getY() + fluid.getHeight())) {
|
||||
if (!fluid.d()) {
|
||||
EntityBoat.EnumStatus entityboat_enumstatus = EntityBoat.EnumStatus.UNDER_FLOWING_WATER;
|
||||
|
||||
@@ -629,15 +629,15 @@ public class EntityBoat extends Entity {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,13 +93,13 @@ public class EntityEnderCrystal extends Entity {
|
||||
if (!this.world.isClientSide) {
|
||||
if (!damagesource.isExplosion()) {
|
||||
// CraftBukkit start
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, true);
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, false);
|
||||
this.world.getServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
this.dead = false;
|
||||
return false;
|
||||
}
|
||||
this.world.explode(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire());
|
||||
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), true);
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
||||
|
||||
@@ -1319,12 +1319,16 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
public EntityHuman.EnumBedResult a(BlockPosition blockposition, boolean force) {
|
||||
EnumDirection enumdirection = (EnumDirection) this.world.getType(blockposition).get(BlockFacingHorizontal.FACING);
|
||||
EntityHuman.EnumBedResult bedResult = force ? EnumBedResult.OK : this.getBedResult(blockposition, enumdirection);
|
||||
EntityHuman.EnumBedResult bedResult = this.getBedResult(blockposition, enumdirection);
|
||||
|
||||
if (bedResult == EntityHuman.EnumBedResult.OTHER_PROBLEM) {
|
||||
return bedResult; // return immediately if the result is not bypassable by plugins
|
||||
}
|
||||
|
||||
if (force) {
|
||||
bedResult = EnumBedResult.OK;
|
||||
}
|
||||
|
||||
if (this.getBukkitEntity() instanceof Player) {
|
||||
bedResult = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerBedEnterEvent(this, blockposition, bedResult);
|
||||
|
||||
|
||||
@@ -1987,12 +1987,12 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
} else {
|
||||
float f9 = 0.91F;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.d(this.locX, this.getBoundingBox().minY - 1.0D, this.locZ);
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.d(this.locX, this.getBoundingBox().minY - 1.0D, this.locZ);
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
if (this.onGround) {
|
||||
f9 = this.world.getType(blockposition_b).getBlock().n() * 0.91F;
|
||||
f9 = this.world.getType(blockposition_pooledblockposition).getBlock().n() * 0.91F;
|
||||
}
|
||||
|
||||
f4 = 0.16277137F / (f9 * f9 * f9);
|
||||
@@ -2005,7 +2005,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.a(f, f1, f2, f3);
|
||||
f9 = 0.91F;
|
||||
if (this.onGround) {
|
||||
f9 = this.world.getType(blockposition_b.c(this.locX, this.getBoundingBox().minY - 1.0D, this.locZ)).getBlock().n() * 0.91F;
|
||||
f9 = this.world.getType(blockposition_pooledblockposition.c(this.locX, this.getBoundingBox().minY - 1.0D, this.locZ)).getBlock().n() * 0.91F;
|
||||
}
|
||||
|
||||
if (this.z_()) {
|
||||
@@ -2034,8 +2034,8 @@ public abstract class EntityLiving extends Entity {
|
||||
this.motY += (0.05D * (double) (this.getEffect(MobEffects.LEVITATION).getAmplifier() + 1) - this.motY) * 0.2D;
|
||||
this.fallDistance = 0.0F;
|
||||
} else {
|
||||
blockposition_b.c(this.locX, 0.0D, this.locZ);
|
||||
if (this.world.isClientSide && (!this.world.isLoaded(blockposition_b) || !this.world.getChunkAtWorldCoords(blockposition_b).y())) {
|
||||
blockposition_pooledblockposition.c(this.locX, 0.0D, this.locZ);
|
||||
if (this.world.isClientSide && (!this.world.isLoaded(blockposition_pooledblockposition) || !this.world.getChunkAtWorldCoords(blockposition_pooledblockposition).y())) {
|
||||
if (this.locY > 0.0D) {
|
||||
this.motY = -0.1D;
|
||||
} else {
|
||||
@@ -2053,15 +2053,15 @@ public abstract class EntityLiving extends Entity {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -735,7 +735,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
|
||||
public EntityHuman.EnumBedResult a(BlockPosition blockposition) {
|
||||
EntityHuman.EnumBedResult entityhuman_enumbedresult = super.a(blockposition);
|
||||
// CraftBukkit start - add force parameter
|
||||
return this.a(blockposition, false);
|
||||
}
|
||||
|
||||
public EntityHuman.EnumBedResult a(BlockPosition blockposition, boolean force) {
|
||||
EntityHuman.EnumBedResult entityhuman_enumbedresult = super.a(blockposition, force);
|
||||
// CraftBukkit end
|
||||
|
||||
if (entityhuman_enumbedresult == EntityHuman.EnumBedResult.OK) {
|
||||
this.a(StatisticList.SLEEP_IN_BED);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class EntitySelector {
|
||||
private final boolean b;
|
||||
private final boolean c;
|
||||
private final Predicate<Entity> d;
|
||||
private final CriterionConditionValue.c e;
|
||||
private final CriterionConditionValue.FloatRange e;
|
||||
private final Function<Vec3D, Vec3D> f;
|
||||
@Nullable
|
||||
private final AxisAlignedBB g;
|
||||
@@ -30,12 +30,12 @@ public class EntitySelector {
|
||||
private final Class<? extends Entity> l;
|
||||
private final boolean m;
|
||||
|
||||
public EntitySelector(int i, boolean flag, boolean flag1, Predicate<Entity> predicate, CriterionConditionValue.c criterionconditionvalue_c, Function<Vec3D, Vec3D> function, @Nullable AxisAlignedBB axisalignedbb, BiConsumer<Vec3D, List<? extends Entity>> biconsumer, boolean flag2, @Nullable String s, @Nullable UUID uuid, Class<? extends Entity> oclass, boolean flag3) {
|
||||
public EntitySelector(int i, boolean flag, boolean flag1, Predicate<Entity> predicate, CriterionConditionValue.FloatRange criterionconditionvalue_floatrange, Function<Vec3D, Vec3D> function, @Nullable AxisAlignedBB axisalignedbb, BiConsumer<Vec3D, List<? extends Entity>> biconsumer, boolean flag2, @Nullable String s, @Nullable UUID uuid, Class<? extends Entity> oclass, boolean flag3) {
|
||||
this.a = i;
|
||||
this.b = flag;
|
||||
this.c = flag1;
|
||||
this.d = predicate;
|
||||
this.e = criterionconditionvalue_c;
|
||||
this.e = criterionconditionvalue_floatrange;
|
||||
this.f = function;
|
||||
this.g = axisalignedbb;
|
||||
this.h = biconsumer;
|
||||
|
||||
@@ -41,7 +41,7 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
public Vec3D a(IWorldReader iworldreader, BlockPosition blockposition, Fluid fluid) {
|
||||
double d0 = 0.0D;
|
||||
double d1 = 0.0D;
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
Vec3D vec3d;
|
||||
@@ -52,16 +52,16 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
while (iterator.hasNext()) {
|
||||
EnumDirection enumdirection = (EnumDirection) iterator.next();
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection);
|
||||
Fluid fluid1 = iworldreader.getFluid(blockposition_b);
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection);
|
||||
Fluid fluid1 = iworldreader.getFluid(blockposition_pooledblockposition);
|
||||
|
||||
if (this.g(fluid1)) {
|
||||
float f = fluid1.getHeight();
|
||||
float f1 = 0.0F;
|
||||
|
||||
if (f == 0.0F) {
|
||||
if (!iworldreader.getType(blockposition_b).getMaterial().isSolid()) {
|
||||
Fluid fluid2 = iworldreader.getFluid(blockposition_b.down());
|
||||
if (!iworldreader.getType(blockposition_pooledblockposition).getMaterial().isSolid()) {
|
||||
Fluid fluid2 = iworldreader.getFluid(blockposition_pooledblockposition.down());
|
||||
|
||||
if (this.g(fluid2)) {
|
||||
f = fluid2.getHeight();
|
||||
@@ -89,8 +89,8 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
while (iterator1.hasNext()) {
|
||||
EnumDirection enumdirection1 = (EnumDirection) iterator1.next();
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection1);
|
||||
if (this.a((IBlockAccess) iworldreader, (BlockPosition) blockposition_b, enumdirection1) || this.a((IBlockAccess) iworldreader, blockposition_b.up(), enumdirection1)) {
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection1);
|
||||
if (this.a((IBlockAccess) iworldreader, (BlockPosition) blockposition_pooledblockposition, enumdirection1) || this.a((IBlockAccess) iworldreader, blockposition_pooledblockposition.up(), enumdirection1)) {
|
||||
vec3d1 = vec3d1.a().add(0.0D, -6.0D, 0.0D);
|
||||
break;
|
||||
}
|
||||
@@ -102,15 +102,15 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -230,14 +230,14 @@ public interface IWorldReader extends IBlockAccess {
|
||||
int l = MathHelper.f(axisalignedbb.maxY);
|
||||
int i1 = MathHelper.floor(axisalignedbb.minZ);
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
IBlockData iblockdata = this.getType(blockposition_b.c(k1, l1, i2));
|
||||
IBlockData iblockdata = this.getType(blockposition_pooledblockposition.c(k1, l1, i2));
|
||||
|
||||
if (!iblockdata.s().e()) {
|
||||
boolean flag = true;
|
||||
@@ -253,15 +253,15 @@ public interface IWorldReader extends IBlockAccess {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -347,14 +347,14 @@ public class PathfinderNormal extends PathfinderAbstract {
|
||||
|
||||
public PathType a(IBlockAccess iblockaccess, int i, int j, int k, PathType pathtype) {
|
||||
if (pathtype == PathType.WALKABLE) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int l = -1; l <= 1; ++l) {
|
||||
for (int i1 = -1; i1 <= 1; ++i1) {
|
||||
if (l != 0 || i1 != 0) {
|
||||
Block block = world.getBlockIfLoaded(blockposition_b.c(l + i, j, i1 + k)); // Paper
|
||||
Block block = world.getBlockIfLoaded(blockposition_pooledblockposition.c(l + i, j, i1 + k)); // Paper
|
||||
|
||||
if (block == null) pathtype = PathType.BLOCKED; // Paper
|
||||
else if (block == Blocks.CACTUS) { // Paper
|
||||
@@ -369,15 +369,15 @@ public class PathfinderNormal extends PathfinderAbstract {
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1125,22 +1125,6 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
double z = d2;
|
||||
float yaw = f;
|
||||
float pitch = f1;
|
||||
if (set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X)) {
|
||||
x += from.getX();
|
||||
}
|
||||
if (set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y)) {
|
||||
y += from.getY();
|
||||
}
|
||||
if (set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Z)) {
|
||||
z += from.getZ();
|
||||
}
|
||||
if (set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.Y_ROT)) {
|
||||
yaw += from.getYaw();
|
||||
}
|
||||
if (set.contains(PacketPlayOutPosition.EnumPlayerTeleportFlags.X_ROT)) {
|
||||
pitch += from.getPitch();
|
||||
}
|
||||
|
||||
|
||||
Location to = new Location(this.getPlayer().getWorld(), x, y, z, yaw, pitch);
|
||||
PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), cause);
|
||||
|
||||
@@ -1688,14 +1688,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
int l = MathHelper.f(axisalignedbb.maxY);
|
||||
int i1 = MathHelper.floor(axisalignedbb.minZ);
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
IBlockData iblockdata = this.getType(blockposition_b.c(k1, l1, i2));
|
||||
IBlockData iblockdata = this.getType(blockposition_pooledblockposition.c(k1, l1, i2));
|
||||
|
||||
if (!iblockdata.isAir()) {
|
||||
boolean flag = true;
|
||||
@@ -1711,15 +1711,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1735,14 +1735,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
|
||||
if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
Block block = this.getType(blockposition_b.c(k1, l1, i2)).getBlock();
|
||||
Block block = this.getType(blockposition_pooledblockposition.c(k1, l1, i2)).getBlock();
|
||||
|
||||
if (block == Blocks.FIRE || block == Blocks.LAVA) {
|
||||
boolean flag = true;
|
||||
@@ -1758,15 +1758,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1786,14 +1786,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
|
||||
if (this.isAreaLoaded(i, k, i1, j, l, j1, true)) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
IBlockData iblockdata = this.getType(blockposition_b.c(k1, l1, i2));
|
||||
IBlockData iblockdata = this.getType(blockposition_pooledblockposition.c(k1, l1, i2));
|
||||
|
||||
if (iblockdata.getBlock() == block) {
|
||||
IBlockData iblockdata1 = iblockdata;
|
||||
@@ -1809,15 +1809,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1835,14 +1835,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
int i1 = MathHelper.floor(axisalignedbb.minZ);
|
||||
int j1 = MathHelper.f(axisalignedbb.maxZ);
|
||||
MaterialPredicate materialpredicate = MaterialPredicate.a(material);
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
for (int k1 = i; k1 < j; ++k1) {
|
||||
for (int l1 = k; l1 < l; ++l1) {
|
||||
for (int i2 = i1; i2 < j1; ++i2) {
|
||||
if (materialpredicate.test(this.getType(blockposition_b.c(k1, l1, i2)))) {
|
||||
if (materialpredicate.test(this.getType(blockposition_pooledblockposition.c(k1, l1, i2)))) {
|
||||
boolean flag = true;
|
||||
|
||||
return flag;
|
||||
@@ -1856,15 +1856,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2196,7 +2196,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
} else if (i >= 14) {
|
||||
return i;
|
||||
} else {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -2206,8 +2206,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
for (int l = 0; l < k; ++l) {
|
||||
EnumDirection enumdirection = aenumdirection[l];
|
||||
|
||||
blockposition_b.g(blockposition).c(enumdirection);
|
||||
int i1 = this.getBrightness(enumskyblock, blockposition_b) - j;
|
||||
blockposition_pooledblockposition.g(blockposition).c(enumdirection);
|
||||
int i1 = this.getBrightness(enumskyblock, blockposition_pooledblockposition) - j;
|
||||
|
||||
if (i1 > i) {
|
||||
i = i1;
|
||||
@@ -2225,15 +2225,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2293,7 +2293,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
j3 = MathHelper.a(j2 - j1);
|
||||
k3 = MathHelper.a(k2 - k1);
|
||||
if (i3 + j3 + k3 < 17) {
|
||||
BlockPosition.b blockposition_b = BlockPosition.b.r();
|
||||
BlockPosition.PooledBlockPosition blockposition_pooledblockposition = BlockPosition.PooledBlockPosition.r();
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
@@ -2306,10 +2306,10 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
int l4 = j2 + enumdirection.getAdjacentY();
|
||||
int i5 = k2 + enumdirection.getAdjacentZ();
|
||||
|
||||
blockposition_b.c(k4, l4, i5);
|
||||
int j5 = Math.max(1, this.getType(blockposition_b).b(this, blockposition_b));
|
||||
blockposition_pooledblockposition.c(k4, l4, i5);
|
||||
int j5 = Math.max(1, this.getType(blockposition_pooledblockposition).b(this, blockposition_pooledblockposition));
|
||||
|
||||
l2 = this.getBrightness(enumskyblock, blockposition_b);
|
||||
l2 = this.getBrightness(enumskyblock, blockposition_pooledblockposition);
|
||||
if (l2 == l3 - j5 && j < this.E.length) {
|
||||
this.E[j++] = k4 - i1 + 32 | l4 - j1 + 32 << 6 | i5 - k1 + 32 << 12 | l3 - j5 << 18;
|
||||
}
|
||||
@@ -2318,15 +2318,15 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
||||
throwable = throwable1;
|
||||
throw throwable1;
|
||||
} finally {
|
||||
if (blockposition_b != null) {
|
||||
if (blockposition_pooledblockposition != null) {
|
||||
if (throwable != null) {
|
||||
try {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
} catch (Throwable throwable2) {
|
||||
throwable.addSuppressed(throwable2);
|
||||
}
|
||||
} else {
|
||||
blockposition_b.close();
|
||||
blockposition_pooledblockposition.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -172,8 +172,8 @@ public class Main {
|
||||
}
|
||||
|
||||
float javaVersion = Float.parseFloat(System.getProperty("java.class.version"));
|
||||
if (javaVersion > 55.0) {
|
||||
System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 11 is supported.");
|
||||
if (javaVersion > 56.0) {
|
||||
System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 12 is supported.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getHandle().a(blockposition) != EntityHuman.EnumBedResult.OK) {
|
||||
if (getHandle().a(blockposition, force) != EntityHuman.EnumBedResult.OK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -369,20 +369,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setPlayerListHeader(String header) {
|
||||
this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API
|
||||
this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true);
|
||||
updatePlayerListHeaderFooter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerListFooter(String footer) {
|
||||
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API
|
||||
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true);
|
||||
updatePlayerListHeaderFooter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerListHeaderFooter(String header, String footer) {
|
||||
this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API
|
||||
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API
|
||||
this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true);
|
||||
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true);
|
||||
updatePlayerListHeaderFooter();
|
||||
}
|
||||
|
||||
|
||||
@@ -143,13 +143,11 @@ public final class CraftChatMessage {
|
||||
}
|
||||
|
||||
public static IChatBaseComponent fromStringOrNull(String message) {
|
||||
// Paper start - fix up spigot tab API
|
||||
return fromStringOrNull(message, false);
|
||||
}
|
||||
|
||||
public static IChatBaseComponent fromStringOrNull(String message, boolean keepNewlines) {
|
||||
return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0];
|
||||
// Paper end - fix up spigot tab API
|
||||
}
|
||||
|
||||
public static IChatBaseComponent[] fromString(String message) {
|
||||
|
||||
@@ -160,7 +160,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
* @return string
|
||||
*/
|
||||
public String getMappingsVersion() {
|
||||
return "00ed8e5c39debc3ed194ad7c5645cc45";
|
||||
return "7dd4b3ec31629620c41553e5c142e454";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,9 +21,9 @@ public class GameRuleTest {
|
||||
|
||||
@Test
|
||||
public void testMinecraftRules() {
|
||||
TreeMap<String, GameRules.b> minecraftRules = GameRules.getGameRules();
|
||||
TreeMap<String, GameRules.GameRuleDefinition> minecraftRules = GameRules.getGameRules();
|
||||
|
||||
for (Map.Entry<String, GameRules.b> entry : minecraftRules.entrySet()) {
|
||||
for (Map.Entry<String, GameRules.GameRuleDefinition> entry : minecraftRules.entrySet()) {
|
||||
GameRule<?> bukkitRule = GameRule.getByName(entry.getKey());
|
||||
|
||||
Assert.assertNotNull(bukkitRule);
|
||||
|
||||
Reference in New Issue
Block a user