From 93806466a81103f1f09dfd668eac7623baf97683 Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 18 Mar 2020 18:56:41 -0300 Subject: [PATCH] 20w12a --- gradle.properties | 4 ++-- src/main/java/carpet/helpers/OptimizedExplosion.java | 9 +++++---- src/main/java/carpet/helpers/RedstoneWireTurbo.java | 4 ++-- .../carpet/mixins/PistonBlock_movableTEMixin.java | 6 +++--- .../java/carpet/mixins/RedstoneWireBlockMixin.java | 4 ++-- src/main/java/carpet/mixins/World_movableTEMixin.java | 6 +++--- src/main/java/carpet/script/CarpetExpression.java | 11 +++++------ .../carpet/script/value/NBTSerializableValue.java | 2 +- src/main/java/carpet/utils/BlockInfo.java | 10 +++++----- src/main/java/carpet/utils/PerimeterDiagnostics.java | 4 ++-- src/main/java/carpet/utils/WoolTool.java | 2 +- 11 files changed, 31 insertions(+), 31 deletions(-) diff --git a/gradle.properties b/gradle.properties index 004ef6e9..4f84fa6c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html - minecraft_version=20w11a - yarn_mappings=20w11a+build.17 + minecraft_version=20w12a + yarn_mappings=20w12a+build.3 loader_version=0.7.8+build.187 # Mod Properties diff --git a/src/main/java/carpet/helpers/OptimizedExplosion.java b/src/main/java/carpet/helpers/OptimizedExplosion.java index a3d0e8ec..a0b75682 100644 --- a/src/main/java/carpet/helpers/OptimizedExplosion.java +++ b/src/main/java/carpet/helpers/OptimizedExplosion.java @@ -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()); } diff --git a/src/main/java/carpet/helpers/RedstoneWireTurbo.java b/src/main/java/carpet/helpers/RedstoneWireTurbo.java index efaf25c4..855d8131 100644 --- a/src/main/java/carpet/helpers/RedstoneWireTurbo.java +++ b/src/main/java/carpet/helpers/RedstoneWireTurbo.java @@ -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); diff --git a/src/main/java/carpet/mixins/PistonBlock_movableTEMixin.java b/src/main/java/carpet/mixins/PistonBlock_movableTEMixin.java index a17f5dff..0221d2f3 100644 --- a/src/main/java/carpet/mixins/PistonBlock_movableTEMixin.java +++ b/src/main/java/carpet/mixins/PistonBlock_movableTEMixin.java @@ -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) { diff --git a/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java b/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java index 096a0e31..78040a88 100644 --- a/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java +++ b/src/main/java/carpet/mixins/RedstoneWireBlockMixin.java @@ -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())); } } diff --git a/src/main/java/carpet/mixins/World_movableTEMixin.java b/src/main/java/carpet/mixins/World_movableTEMixin.java index 374a2721..6e1c7d78 100644 --- a/src/main/java/carpet/mixins/World_movableTEMixin.java +++ b/src/main/java/carpet/mixins/World_movableTEMixin.java @@ -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); diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index 057b9167..a76fd5bd 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -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) -> diff --git a/src/main/java/carpet/script/value/NBTSerializableValue.java b/src/main/java/carpet/script/value/NBTSerializableValue.java index 7011b4f5..84786560 100644 --- a/src/main/java/carpet/script/value/NBTSerializableValue.java +++ b/src/main/java/carpet/script/value/NBTSerializableValue.java @@ -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; diff --git a/src/main/java/carpet/utils/BlockInfo.java b/src/main/java/carpet/utils/BlockInfo.java index ba6e4ce3..5e28da23 100644 --- a/src/main/java/carpet/utils/BlockInfo.java +++ b/src/main/java/carpet/utils/BlockInfo.java @@ -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)))); diff --git a/src/main/java/carpet/utils/PerimeterDiagnostics.java b/src/main/java/carpet/utils/PerimeterDiagnostics.java index 0c17515c..87215fed 100644 --- a/src/main/java/carpet/utils/PerimeterDiagnostics.java +++ b/src/main/java/carpet/utils/PerimeterDiagnostics.java @@ -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; diff --git a/src/main/java/carpet/utils/WoolTool.java b/src/main/java/carpet/utils/WoolTool.java index 480f575d..8e77b13b 100644 --- a/src/main/java/carpet/utils/WoolTool.java +++ b/src/main/java/carpet/utils/WoolTool.java @@ -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)); }