From ab232bd6897728cf8f47d3985ba8b5803a1175a4 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Tue, 3 Nov 2020 15:33:10 +0000 Subject: [PATCH] Update to MC 1.16.4 Just some mapping changes really --- gradle.properties | 6 +++--- .../dan200/computercraft/client/ClientTableFormatter.java | 4 ++-- .../java/dan200/computercraft/client/gui/GuiComputer.java | 2 +- .../java/dan200/computercraft/client/gui/GuiDiskDrive.java | 2 +- .../java/dan200/computercraft/client/gui/GuiPrinter.java | 2 +- .../java/dan200/computercraft/client/gui/GuiTurtle.java | 2 +- .../client/proxy/ComputerCraftProxyClient.java | 2 +- .../computercraft/client/render/TurtleMultiModel.java | 4 ++-- .../computercraft/client/render/TurtleSmartItemModel.java | 6 +++--- .../java/dan200/computercraft/data/LootTableProvider.java | 2 +- src/main/java/dan200/computercraft/data/Tags.java | 2 +- .../shared/data/ConstantLootConditionSerializer.java | 4 ++-- .../dan200/computercraft/shared/network/NetworkHandler.java | 2 +- .../shared/peripheral/diskdrive/TileDiskDrive.java | 2 +- .../shared/peripheral/generic/data/ItemData.java | 2 +- .../shared/peripheral/printer/TilePrinter.java | 2 +- .../shared/peripheral/speaker/SpeakerPeripheral.java | 2 +- .../computercraft/shared/turtle/upgrades/TurtleTool.java | 2 +- .../dan200/computercraft/shared/util/FakeNetHandler.java | 6 ------ src/main/resources/META-INF/mods.toml | 4 ++-- 20 files changed, 27 insertions(+), 33 deletions(-) diff --git a/gradle.properties b/gradle.properties index 34e53b70c..fbac2d266 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ mod_version=1.93.1 # Minecraft properties (update mods.toml when changing) -mc_version=1.16.3 -forge_version=34.0.1 -mappings_version=20200723-1.16.1 +mc_version=1.16.4 +forge_version=35.0.1 +mappings_version=20201028-1.16.3 diff --git a/src/main/java/dan200/computercraft/client/ClientTableFormatter.java b/src/main/java/dan200/computercraft/client/ClientTableFormatter.java index 14c471faa..4054f5fc9 100644 --- a/src/main/java/dan200/computercraft/client/ClientTableFormatter.java +++ b/src/main/java/dan200/computercraft/client/ClientTableFormatter.java @@ -23,7 +23,7 @@ public class ClientTableFormatter implements TableFormatter { public static final ClientTableFormatter INSTANCE = new ClientTableFormatter(); - private static Int2IntOpenHashMap lastHeights = new Int2IntOpenHashMap(); + private static final Int2IntOpenHashMap lastHeights = new Int2IntOpenHashMap(); private static FontRenderer renderer() { @@ -55,7 +55,7 @@ public class ClientTableFormatter implements TableFormatter @Override public int getWidth( ITextComponent component ) { - return renderer().func_238414_a_( component ); + return renderer().getStringPropertyWidth( component ); } @Override diff --git a/src/main/java/dan200/computercraft/client/gui/GuiComputer.java b/src/main/java/dan200/computercraft/client/gui/GuiComputer.java index ed46daf49..a1c5babfa 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiComputer.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiComputer.java @@ -141,7 +141,7 @@ public final class GuiComputer extends Containe public void render( @Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks ) { super.render( stack, mouseX, mouseY, partialTicks ); - func_230459_a_( stack, mouseX, mouseY ); + renderHoveredTooltip( stack, mouseX, mouseY ); } @Override diff --git a/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java b/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java index 0eb36af5a..27bd997d2 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiDiskDrive.java @@ -37,6 +37,6 @@ public class GuiDiskDrive extends ContainerScreen { renderBackground( transform ); super.render( transform, mouseX, mouseY, partialTicks ); - func_230459_a_( transform, mouseX, mouseY ); + renderHoveredTooltip( transform, mouseX, mouseY ); } } diff --git a/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java b/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java index a111a6e6a..dd555e85d 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiPrinter.java @@ -47,6 +47,6 @@ public class GuiPrinter extends ContainerScreen { renderBackground( stack ); super.render( stack, mouseX, mouseY, partialTicks ); - func_230459_a_( stack, mouseX, mouseY ); + renderHoveredTooltip( stack, mouseX, mouseY ); } } diff --git a/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java b/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java index 4850ed4ad..0c01f2f6a 100644 --- a/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java +++ b/src/main/java/dan200/computercraft/client/gui/GuiTurtle.java @@ -126,7 +126,7 @@ public class GuiTurtle extends ContainerScreen { renderBackground( stack ); super.render( stack, mouseX, mouseY, partialTicks ); - func_230459_a_( stack, mouseX, mouseY ); + renderHoveredTooltip( stack, mouseX, mouseY ); } @Override diff --git a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java index 79facbaaf..413383e55 100644 --- a/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java +++ b/src/main/java/dan200/computercraft/client/proxy/ComputerCraftProxyClient.java @@ -75,7 +75,7 @@ public final class ComputerCraftProxyClient ResourceLocation id = new ResourceLocation( ComputerCraft.MOD_ID, name ); for( Supplier item : items ) { - ItemModelsProperties.func_239418_a_( item.get(), id, getter ); + ItemModelsProperties.registerProperty( item.get(), id, getter ); } } diff --git a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java index 256c53544..8729bdfdd 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleMultiModel.java @@ -108,9 +108,9 @@ public class TurtleMultiModel implements IBakedModel } @Override - public boolean func_230044_c_() + public boolean isSideLit() { - return m_baseModel.func_230044_c_(); + return m_baseModel.isSideLit(); } @Nonnull diff --git a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java index 3272b6f50..38208c46d 100644 --- a/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java +++ b/src/main/java/dan200/computercraft/client/render/TurtleSmartItemModel.java @@ -109,7 +109,7 @@ public class TurtleSmartItemModel implements IBakedModel { @Nonnull @Override - public IBakedModel func_239290_a_( @Nonnull IBakedModel originalModel, @Nonnull ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity ) + public IBakedModel getOverrideModel( @Nonnull IBakedModel originalModel, @Nonnull ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity ) { ItemTurtle turtle = (ItemTurtle) stack.getItem(); int colour = turtle.getColour( stack ); @@ -184,9 +184,9 @@ public class TurtleSmartItemModel implements IBakedModel } @Override - public boolean func_230044_c_() + public boolean isSideLit() { - return familyModel.func_230044_c_(); + return familyModel.isSideLit(); } @Nonnull diff --git a/src/main/java/dan200/computercraft/data/LootTableProvider.java b/src/main/java/dan200/computercraft/data/LootTableProvider.java index 16be3be38..5ee2b6502 100644 --- a/src/main/java/dan200/computercraft/data/LootTableProvider.java +++ b/src/main/java/dan200/computercraft/data/LootTableProvider.java @@ -51,7 +51,7 @@ public abstract class LootTableProvider implements IDataProvider tables.put( id, table ); } ); - tables.forEach( ( key, value ) -> LootTableManager.func_227508_a_( validation, key, value ) ); + tables.forEach( ( key, value ) -> LootTableManager.validateLootTable( validation, key, value ) ); Multimap problems = validation.getProblems(); if( !problems.isEmpty() ) diff --git a/src/main/java/dan200/computercraft/data/Tags.java b/src/main/java/dan200/computercraft/data/Tags.java index 1dc5692d2..484c3db29 100644 --- a/src/main/java/dan200/computercraft/data/Tags.java +++ b/src/main/java/dan200/computercraft/data/Tags.java @@ -21,7 +21,7 @@ import static dan200.computercraft.data.Tags.CCTags.*; public class Tags extends ItemTagsProvider { - private static final ITag.INamedTag PIGLIN_LOVED = ItemTags.field_232903_N_; + private static final ITag.INamedTag PIGLIN_LOVED = ItemTags.PIGLIN_LOVED; public static class CCTags { diff --git a/src/main/java/dan200/computercraft/shared/data/ConstantLootConditionSerializer.java b/src/main/java/dan200/computercraft/shared/data/ConstantLootConditionSerializer.java index 87182f010..4d2364fc5 100644 --- a/src/main/java/dan200/computercraft/shared/data/ConstantLootConditionSerializer.java +++ b/src/main/java/dan200/computercraft/shared/data/ConstantLootConditionSerializer.java @@ -29,13 +29,13 @@ public final class ConstantLootConditionSerializer imp } @Override - public void func_230424_a_( @Nonnull JsonObject json, @Nonnull T object, @Nonnull JsonSerializationContext context ) + public void serialize( @Nonnull JsonObject json, @Nonnull T object, @Nonnull JsonSerializationContext context ) { } @Nonnull @Override - public T func_230423_a_( @Nonnull JsonObject json, @Nonnull JsonDeserializationContext context ) + public T deserialize( @Nonnull JsonObject json, @Nonnull JsonDeserializationContext context ) { return instance; } diff --git a/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java b/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java index ca391be00..819e4ddfc 100644 --- a/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java +++ b/src/main/java/dan200/computercraft/shared/network/NetworkHandler.java @@ -78,7 +78,7 @@ public final class NetworkHandler public static void sendToAllAround( NetworkMessage packet, World world, Vector3d pos, double range ) { - PacketDistributor.TargetPoint target = new PacketDistributor.TargetPoint( pos.x, pos.y, pos.z, range, world.func_234923_W_() ); + PacketDistributor.TargetPoint target = new PacketDistributor.TargetPoint( pos.x, pos.y, pos.z, range, world.getDimensionKey() ); network.send( PacketDistributor.NEAR.with( () -> target ), packet ); } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java index 0ade6c201..92700f2c1 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/TileDiskDrive.java @@ -125,7 +125,7 @@ public final class TileDiskDrive extends TileGeneric implements DefaultInventory public void read( @Nonnull BlockState state, @Nonnull CompoundNBT nbt ) { super.read( state, nbt ); - customName = nbt.contains( NBT_NAME ) ? ITextComponent.Serializer.func_240643_a_( nbt.getString( NBT_NAME ) ) : null; + customName = nbt.contains( NBT_NAME ) ? ITextComponent.Serializer.getComponentFromJson( nbt.getString( NBT_NAME ) ) : null; if( nbt.contains( NBT_ITEM ) ) { CompoundNBT item = nbt.getCompound( NBT_ITEM ); diff --git a/src/main/java/dan200/computercraft/shared/peripheral/generic/data/ItemData.java b/src/main/java/dan200/computercraft/shared/peripheral/generic/data/ItemData.java index 36d689cf4..c3647d6d8 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/generic/data/ItemData.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/generic/data/ItemData.java @@ -113,7 +113,7 @@ public class ItemData { try { - return ITextComponent.Serializer.func_240643_a_( x.getString() ); + return ITextComponent.Serializer.getComponentFromJson( x.getString() ); } catch( JsonParseException e ) { diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java index f89c842fe..5386e2b3e 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/TilePrinter.java @@ -95,7 +95,7 @@ public final class TilePrinter extends TileGeneric implements DefaultSidedInvent { super.read( state, nbt ); - customName = nbt.contains( NBT_NAME ) ? ITextComponent.Serializer.func_240643_a_( nbt.getString( NBT_NAME ) ) : null; + customName = nbt.contains( NBT_NAME ) ? ITextComponent.Serializer.getComponentFromJson( nbt.getString( NBT_NAME ) ) : null; // Read page synchronized( m_page ) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java index 2e6202ac6..9e83f208a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java @@ -152,7 +152,7 @@ public abstract class SpeakerPeripheral implements IPeripheral float adjVolume = Math.min( volume, 3.0f ); server.getPlayerList().sendToAllNearExcept( - null, pos.x, pos.y, pos.z, adjVolume > 1.0f ? 16 * adjVolume : 16.0, world.func_234923_W_(), + null, pos.x, pos.y, pos.z, adjVolume > 1.0f ? 16 * adjVolume : 16.0, world.getDimensionKey(), new SPlaySoundPacket( name, SoundCategory.RECORDS, pos, adjVolume, pitch ) ); return null; diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index cb322a37d..47d61d033 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -100,7 +100,7 @@ public class TurtleTool extends AbstractTurtleUpgrade protected boolean canBreakBlock( BlockState state, World world, BlockPos pos, TurtlePlayer player ) { Block block = state.getBlock(); - return !state.isAir( world, pos ) + return !state.isAir() && block != Blocks.BEDROCK && state.getPlayerRelativeBlockHardness( player, world, pos ) > 0 && block.canEntityDestroy( state, world, pos, player ); diff --git a/src/main/java/dan200/computercraft/shared/util/FakeNetHandler.java b/src/main/java/dan200/computercraft/shared/util/FakeNetHandler.java index 03450d233..b28e557e7 100644 --- a/src/main/java/dan200/computercraft/shared/util/FakeNetHandler.java +++ b/src/main/java/dan200/computercraft/shared/util/FakeNetHandler.java @@ -16,7 +16,6 @@ import net.minecraftforge.common.util.FakePlayer; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.crypto.SecretKey; public class FakeNetHandler extends ServerPlayNetHandler { @@ -322,11 +321,6 @@ public class FakeNetHandler extends ServerPlayNetHandler this.closeReason = message; } - @Override - public void enableEncryption( @Nonnull SecretKey key ) - { - } - @Nonnull @Override public INetHandler getNetHandler() diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 200610b0a..49042e1d8 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[34,35)" +loaderVersion="[35,36)" issueTrackerURL="https://github.com/SquidDev-CC/CC-Tweaked/issues" displayURL="https://github.com/SquidDev-CC/CC-Tweaked" @@ -20,6 +20,6 @@ CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles a [[dependencies.computercraft]] modId="forge" mandatory=true - versionRange="[34.0.1,35)" + versionRange="[35.0.1,36)" ordering="NONE" side="BOTH"