This commit is contained in:
gnembon committed 2020-03-18 18:56:41 -03:00
1 parent 5efbbac663
commit 93806466a8
11 files changed
+31 -31

No files matched your search

@@ -241,7 +241,7 @@ public class OptimizedExplosion
{
if (block.shouldDropItemsOnExplosion(e) && world instanceof ServerWorld)
{
BlockEntity blockEntity = block.hasBlockEntity() ? world.getBlockEntity(blockpos) : null;
BlockEntity blockEntity = block.method_26161() ? world.getBlockEntity(blockpos) : null; //hasBLockENtity
LootContext.Builder lootBuilder = new LootContext.Builder((ServerWorld) eAccess.getWorld())
.setRandom(eAccess.getWorld().random)
@@ -273,9 +273,10 @@ public class OptimizedExplosion
Chunk chunk = world.getChunk(blockpos1.getX() >> 4, blockpos1.getZ() >> 4);
BlockPos down = blockpos1.down(1);
if (chunk.getBlockState(blockpos1).getMaterial() == Material.AIR &&
chunk.getBlockState(down).isFullOpaque(world, down) &&
eAccess.getRandom().nextInt(3) == 0)
if (eAccess.getRandom().nextInt(3) == 0 &&
chunk.getBlockState(blockpos1).getMaterial() == Material.AIR &&
chunk.getBlockState(down).method_26216(world, down) //isFullOPaque
)
{
world.setBlockState(blockpos1, Blocks.FIRE.getDefaultState());
}
@@ -865,7 +865,7 @@ public class RedstoneWireTurbo
// position directly above the node being calculated is always
// at index 1.
UpdateNode center_up = upd.neighbor_nodes[1];
boolean center_up_is_cube = center_up.currentState.isSimpleFullBlock(worldIn, center_up.self);
boolean center_up_is_cube = center_up.currentState.method_26212(worldIn, center_up.self); //isSimpleFUllBLock
for (int m=0; m<4; m++) {
// Get the neighbor array index of each of the four cardinal
@@ -879,7 +879,7 @@ public class RedstoneWireTurbo
// Also check the positions above and below the cardinal
// neighbors
boolean neighbor_is_cube = neighbor.currentState.isSimpleFullBlock(worldIn, neighbor.self);
boolean neighbor_is_cube = neighbor.currentState.method_26212(worldIn, neighbor.self); //isSimpleFUllBLock
if (!neighbor_is_cube) {
UpdateNode neighbor_down = upd.neighbor_nodes[rs_neighbors_dn[m]];
l = getMaxCurrentStrength(neighbor_down, l);
@@ -50,10 +50,10 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
block != Blocks.SPAWNER;
}
@Redirect(method = "isMovable", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;hasBlockEntity()Z"))
@Redirect(method = "isMovable", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Block;method_26161()Z")) // hasBLockENtity
private static boolean ifHasBlockEntity(Block block)
{
if (!block.hasBlockEntity())
if (!block.method_26161()) // hasBlockENtity
{
return false;
}
@@ -76,7 +76,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
for (int i = 0; i < list_1.size(); ++i)
{
BlockPos blockpos = list_1.get(i);
BlockEntity blockEntity = (list_2.get(i).getBlock().hasBlockEntity()) ? world_1.getBlockEntity(blockpos) : null;
BlockEntity blockEntity = (list_2.get(i).getBlock().method_26161()) ? world_1.getBlockEntity(blockpos) : null; //hasBLockENtity
list1_BlockEntities.get().add(blockEntity);
if (blockEntity != null)
{
@@ -103,9 +103,9 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
BlockState blockState_3 = world_1.getBlockState(blockPos_2);
int_3 = this.increasePower(int_3, blockState_3);
BlockPos blockPos_3 = blockPos_1.up();
if (blockState_3.isSimpleFullBlock(world_1, blockPos_2) && !world_1.getBlockState(blockPos_3).isSimpleFullBlock(world_1, blockPos_3)) {
if (blockState_3.method_26212(world_1, blockPos_2) && !world_1.getBlockState(blockPos_3).method_26212(world_1, blockPos_3)) {
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.up()));
} else if (!blockState_3.isSimpleFullBlock(world_1, blockPos_2)) {
} else if (!blockState_3.method_26212(world_1, blockPos_2)) { //isSimpleFUllBLock
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.down()));
}
}
@@ -122,9 +122,9 @@ public abstract class World_movableTEMixin implements WorldInterface
if ((int_1 & 16) == 0)
{
int int_2 = int_1 & -2;
blockState_2.method_11637((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.updateNeighborStates((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_1.method_11637((net.minecraft.world.IWorld) this, blockPos_1, int_2);
blockState_2.method_26198((net.minecraft.world.IWorld) this, blockPos_1, int_2); // method_11637
blockState_1.method_26183((net.minecraft.world.IWorld) this, blockPos_1, int_2); //updateNEtihbourStates
blockState_1.method_26198((net.minecraft.world.IWorld) this, blockPos_1, int_2);
}
this.onBlockChanged(blockPos_1, blockState_2, blockState_3);
@@ -35,10 +35,9 @@ import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.longs.LongSet;
import net.minecraft.block.BarrierBlock;
import net.minecraft.block.BedrockBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.CommandBlock;
import net.minecraft.block.JigsawBlock;
import net.minecraft.block.StructureBlock;
@@ -568,7 +567,7 @@ public class CarpetExpression
});
this.expr.addLazyFunction("solid", -1, (c, t, lv) ->
genericStateTest(c, "solid", lv, (s, p, w) -> new NumericValue(s.isSimpleFullBlock(w, p))));
genericStateTest(c, "solid", lv, (s, p, w) -> new NumericValue(s.method_26212(w, p)))); // isSimpleFullBlock
this.expr.addLazyFunction("air", -1, (c, t, lv) ->
booleanStateTest(c, "air", lv, (s, p) -> s.isAir()));
@@ -732,7 +731,7 @@ public class CarpetExpression
});
this.expr.addLazyFunction("suffocates", -1, (c, t, lv) ->
genericStateTest(c, "suffocates", lv, (s, p, w) -> new NumericValue(s.canSuffocate(w, p))));
genericStateTest(c, "suffocates", lv, (s, p, w) -> new NumericValue(s.method_26228(w, p)))); // canSuffocate
this.expr.addLazyFunction("power", -1, (c, t, lv) ->
genericStateTest(c, "power", lv, (s, p, w) -> new NumericValue(w.getReceivedRedstonePower(p))));
@@ -950,7 +949,7 @@ public class CarpetExpression
BlockState state = locator.block.getBlockState();
Block block = state.getBlock();
boolean success = false;
if (!((block instanceof BedrockBlock || block instanceof BarrierBlock) && player.interactionManager.isSurvivalLike()))
if (!((block == Blocks.BEDROCK || block == Blocks.BARRIER) && player.interactionManager.isSurvivalLike()))
success = tryBreakBlock_copy_from_ServerPlayerInteractionManager(player, where);
if (success)
world.playLevelEvent(null, 2001, where, Block.getRawIdFromState(state));
@@ -1003,7 +1002,7 @@ public class CarpetExpression
this.expr.addLazyFunction("blocks_movement", -1, (c, t, lv) ->
booleanStateTest(c, "blocks_movement", lv, (s, p) ->
!s.canPathfindThrough (((CarpetContext) c).s.getWorld(), p, NavigationType.LAND)));
!s.method_26171 (((CarpetContext) c).s.getWorld(), p, NavigationType.LAND))); // canPathfindThrough
this.expr.addLazyFunction("block_sound", -1, (c, t, lv) ->
stateStringQuery(c, "block_sound", lv, (s, p) ->
@@ -134,7 +134,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
Block block = blockState.getBlock();
if (block instanceof InventoryProvider) {
inventory = ((InventoryProvider)block).getInventory(blockState, world, blockPos);
} else if (block.hasBlockEntity()) {
} else if (block.method_26161()) { // hasBLockENtity
BlockEntity blockEntity = BlockValue.getBlockEntity(world, blockPos);
if (blockEntity instanceof Inventory) {
inventory = (Inventory)blockEntity;
+5 -5
View File
@@ -185,7 +185,7 @@ public class BlockInfo
lst.add(Messenger.s(String.format(" - Sound type: %s", soundName.get(block.getSoundGroup(state)))));
lst.add(Messenger.s(""));
//lst.add(Messenger.s(String.format(" - Full block: %s", block.isShapeFullCube()))); // isFullCube() )));
lst.add(Messenger.s(String.format(" - Normal cube: %s", state.isSimpleFullBlock(world, pos)))); //isNormalCube())));
lst.add(Messenger.s(String.format(" - Normal cube: %s", state.method_26212(world, pos)))); //isNormalCube()))); isSimpleFullBlock
lst.add(Messenger.s(String.format(" - Is liquid: %s", material.isLiquid())));
lst.add(Messenger.s(""));
lst.add(Messenger.s(String.format(" - Light in: %d, above: %d",
@@ -198,10 +198,10 @@ public class BlockInfo
//lst.add(Messenger.s(String.format(" - Emitted light: %d", state.getLightValue())));
//lst.add(Messenger.s(String.format(" - Picks neighbour light value: %s", state.useNeighborBrightness(world, pos))));
lst.add(Messenger.s(""));
lst.add(Messenger.s(String.format(" - Causes suffocation: %s", state.canSuffocate(world, pos))));
lst.add(Messenger.s(String.format(" - Blocks movement on land: %s", !state.canPathfindThrough(world,pos, NavigationType.LAND))));
lst.add(Messenger.s(String.format(" - Blocks movement in air: %s", !state.canPathfindThrough(world,pos, NavigationType.AIR))));
lst.add(Messenger.s(String.format(" - Blocks movement in liquids: %s", !state.canPathfindThrough(world,pos, NavigationType.WATER))));
lst.add(Messenger.s(String.format(" - Causes suffocation: %s", state.method_26228(world, pos)))); //canSuffocate
lst.add(Messenger.s(String.format(" - Blocks movement on land: %s", !state.method_26171(world,pos, NavigationType.LAND)))); // canPathfindThrough
lst.add(Messenger.s(String.format(" - Blocks movement in air: %s", !state.method_26171(world,pos, NavigationType.AIR)))); // canPathfindThrough
lst.add(Messenger.s(String.format(" - Blocks movement in liquids: %s", !state.method_26171(world,pos, NavigationType.WATER)))); // canPathfindThrough
lst.add(Messenger.s(String.format(" - Can burn: %s", material.isBurnable())));
lst.add(Messenger.s(String.format(" - Requires a tool: %s", !material.isReplaceable()))); //?maybe
lst.add(Messenger.s(String.format(" - Hardness: %.2f", state.getHardness(world, pos))));
@@ -110,7 +110,7 @@ public class PerimeterDiagnostics
BlockState iblockstate_down = worldserver.getBlockState(pos.down());
BlockState iblockstate_up = worldserver.getBlockState(pos.up());
if ( iblockstate.getMaterial() == Material.WATER && iblockstate_down.getMaterial() == Material.WATER && !iblockstate_up.isSimpleFullBlock(worldserver, pos))
if ( iblockstate.getMaterial() == Material.WATER && iblockstate_down.getMaterial() == Material.WATER && !iblockstate_up.method_26212(worldserver, pos)) // isSimpleFUllBLock
{
result.liquid++;
if (add_water && diagnostic.check_entity_spawn(pos))
@@ -124,7 +124,7 @@ public class PerimeterDiagnostics
}
else
{
if (iblockstate_down.isSimpleFullBlock(worldserver, pos))
if (iblockstate_down.method_26212(worldserver, pos)) // isSimpleFUllBLock
{
Block block = iblockstate_down.getBlock();
boolean flag = block != Blocks.BEDROCK && block != Blocks.BARRIER;
+1 -1
View File
@@ -96,7 +96,7 @@ public class WoolTool
public static DyeColor getWoolColorAtPosition(World worldIn, BlockPos pos)
{
BlockState state = worldIn.getBlockState(pos);
if (state.getMaterial() != Material.WOOL || !state.isSimpleFullBlock(worldIn, pos))
if (state.getMaterial() != Material.WOOL || !state.method_26212(worldIn, pos)) //isSimpleFullBlock
return null;
return Material2Dye.get(state.getTopMaterialColor(worldIn, pos));
}