1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-09-08 05:15:58 +00:00

Update to mc 1.16.5 and latest yarn mappings.

This commit is contained in:
David Queneau
2021-03-20 17:48:35 -07:00
committed by David Queneau
parent a8f208c394
commit 27531c161d
13 changed files with 42 additions and 70 deletions

View File

@@ -5,13 +5,13 @@ org.gradle.jvmargs=-Xmx1G
mod_version=1.95.0-beta mod_version=1.95.0-beta
# Minecraft properties # Minecraft properties
mc_version=1.16.2 mc_version=1.16.5
mappings_version=31 mappings_version=9
# Dependencies # Dependencies
cloth_config_version=4.8.1 cloth_config_version=4.8.1
fabric_api_version=0.19.0+build.398-1.16 fabric_api_version=0.32.0+1.16
fabric_loader_version=0.9.2+build.206 fabric_loader_version=0.11.3
jankson_version=1.2.0 jankson_version=1.2.0
modmenu_version=1.14.6+ modmenu_version=1.14.6+
cloth_api_version=1.4.5 cloth_api_version=1.4.5

View File

@@ -11,7 +11,7 @@ import java.util.OptionalInt;
import java.util.UUID; import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.crypto.SecretKey; import javax.crypto.Cipher;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
@@ -48,7 +48,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.collection.DefaultedList; import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.village.TraderOfferList; import net.minecraft.village.TradeOfferList;
import net.minecraft.world.GameMode; import net.minecraft.world.GameMode;
/** /**
@@ -105,7 +105,7 @@ public class FakePlayer extends ServerPlayerEntity {
} }
@Override @Override
public void sendTradeOffers(int id, TraderOfferList list, int level, int experience, boolean levelled, boolean refreshable) { } public void sendTradeOffers(int id, TradeOfferList list, int level, int experience, boolean levelled, boolean refreshable) { }
@Override @Override
public void openHorseInventory(HorseBaseEntity horse, Inventory inventory) { } public void openHorseInventory(HorseBaseEntity horse, Inventory inventory) { }
@@ -252,7 +252,8 @@ public class FakePlayer extends ServerPlayerEntity {
} }
@Override @Override
public void setupEncryption(SecretKey key) { public void setupEncryption(Cipher cipher, Cipher cipher2) {
super.setupEncryption(cipher, cipher2);
} }
@Override @Override

View File

@@ -32,7 +32,7 @@ public class MixinWorld {
@Inject (method = "setBlockEntity", at = @At ("HEAD")) @Inject (method = "setBlockEntity", at = @At ("HEAD"))
public void setBlockEntity(BlockPos pos, @Nullable BlockEntity entity, CallbackInfo info) { public void setBlockEntity(BlockPos pos, @Nullable BlockEntity entity, CallbackInfo info) {
if (!World.isHeightInvalid(pos) && entity != null && !entity.isRemoved() && this.iteratingTickingBlockEntities) { if (!World.isOutOfBuildLimitVertically(pos) && entity != null && !entity.isRemoved() && this.iteratingTickingBlockEntities) {
setWorld(entity, this); setWorld(entity, this);
} }
} }

View File

@@ -31,7 +31,7 @@ public final class BundledRedstone {
} }
public static int getDefaultOutput(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull Direction side) { public static int getDefaultOutput(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull Direction side) {
return World.method_24794(pos) ? DefaultBundledRedstoneProvider.getDefaultBundledRedstoneOutput(world, pos, side) : -1; return World.isInBuildLimit(pos) ? DefaultBundledRedstoneProvider.getDefaultBundledRedstoneOutput(world, pos, side) : -1;
} }
public static int getOutput(World world, BlockPos pos, Direction side) { public static int getOutput(World world, BlockPos pos, Direction side) {
@@ -40,7 +40,7 @@ public final class BundledRedstone {
} }
private static int getUnmaskedOutput(World world, BlockPos pos, Direction side) { private static int getUnmaskedOutput(World world, BlockPos pos, Direction side) {
if (!World.method_24794(pos)) { if (!World.isInBuildLimit(pos)) {
return -1; return -1;
} }

View File

@@ -35,7 +35,7 @@ public final class Peripherals {
@Nullable @Nullable
public static IPeripheral getPeripheral(World world, BlockPos pos, Direction side) { public static IPeripheral getPeripheral(World world, BlockPos pos, Direction side) {
return World.method_24794(pos) && !world.isClient ? getPeripheralAt(world, pos, side) : null; return World.isInBuildLimit(pos) && !world.isClient ? getPeripheralAt(world, pos, side) : null;
} }
@Nullable @Nullable

View File

@@ -17,7 +17,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import dan200.computercraft.api.turtle.FakePlayer; import dan200.computercraft.api.turtle.FakePlayer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.server.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;

View File

@@ -207,7 +207,7 @@ public class CommandAPI implements ILuaAPI {
World world = this.computer.getWorld(); World world = this.computer.getWorld();
BlockPos min = new BlockPos(Math.min(minX, maxX), Math.min(minY, maxY), Math.min(minZ, maxZ)); BlockPos min = new BlockPos(Math.min(minX, maxX), Math.min(minY, maxY), Math.min(minZ, maxZ));
BlockPos max = new BlockPos(Math.max(minX, maxX), Math.max(minY, maxY), Math.max(minZ, maxZ)); BlockPos max = new BlockPos(Math.max(minX, maxX), Math.max(minY, maxY), Math.max(minZ, maxZ));
if (!World.method_24794(min) || !World.method_24794(max)) { if (!World.isInBuildLimit(min) || !World.isInBuildLimit(max)) {
throw new LuaException("Co-ordinates out of range"); throw new LuaException("Co-ordinates out of range");
} }
@@ -284,7 +284,7 @@ public class CommandAPI implements ILuaAPI {
// Get the details of the block // Get the details of the block
World world = this.computer.getWorld(); World world = this.computer.getWorld();
BlockPos position = new BlockPos(x, y, z); BlockPos position = new BlockPos(x, y, z);
if (World.method_24794(position)) { if (World.isInBuildLimit(position)) {
return getBlockInfo(world, position); return getBlockInfo(world, position);
} else { } else {
throw new LuaException("Co-ordinates out of range"); throw new LuaException("Co-ordinates out of range");

View File

@@ -251,7 +251,7 @@ public class TileMonitor extends TileGeneric implements IPeripheralTile {
} }
@Override @Override
public double getSquaredRenderDistance() { public double getRenderDistance() {
return ComputerCraft.monitorDistanceSq; return ComputerCraft.monitorDistanceSq;
} }

View File

@@ -119,10 +119,10 @@ public class TurtleMoveCommand implements ITurtleCommand {
} }
private static TurtleCommandResult canEnter(TurtlePlayer turtlePlayer, World world, BlockPos position) { private static TurtleCommandResult canEnter(TurtlePlayer turtlePlayer, World world, BlockPos position) {
if (World.isHeightInvalid(position)) { if (World.isOutOfBuildLimitVertically(position)) {
return TurtleCommandResult.failure(position.getY() < 0 ? "Too low to move" : "Too high to move"); return TurtleCommandResult.failure(position.getY() < 0 ? "Too low to move" : "Too high to move");
} }
if (!World.method_24794(position)) { if (!World.isInBuildLimit(position)) {
return TurtleCommandResult.failure("Cannot leave the world"); return TurtleCommandResult.failure("Cannot leave the world");
} }

View File

@@ -364,7 +364,7 @@ public class TurtlePlaceCommand implements ITurtleCommand {
private static boolean canDeployOnBlock(@Nonnull ItemPlacementContext context, ITurtleAccess turtle, TurtlePlayer player, BlockPos position, private static boolean canDeployOnBlock(@Nonnull ItemPlacementContext context, ITurtleAccess turtle, TurtlePlayer player, BlockPos position,
Direction side, boolean allowReplaceable, String[] outErrorMessage) { Direction side, boolean allowReplaceable, String[] outErrorMessage) {
World world = turtle.getWorld(); World world = turtle.getWorld();
if (!World.method_24794(position) || world.isAir(position) || (context.getStack() if (!World.isInBuildLimit(position) || world.isAir(position) || (context.getStack()
.getItem() instanceof BlockItem && WorldUtil.isLiquidBlock(world, .getItem() instanceof BlockItem && WorldUtil.isLiquidBlock(world,
position))) { position))) {
return false; return false;

View File

@@ -26,7 +26,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityDimensions; import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityPose; import net.minecraft.entity.EntityPose;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.passive.HorseBaseEntity; import net.minecraft.entity.passive.HorseBaseEntity;
import net.minecraft.inventory.Inventory; import net.minecraft.inventory.Inventory;
@@ -34,7 +33,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.screen.NamedScreenHandlerFactory; import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
@@ -77,7 +75,7 @@ public final class TurtlePlayer extends FakePlayer {
private void setState(ITurtleAccess turtle) { private void setState(ITurtleAccess turtle) {
if (this.currentScreenHandler != playerScreenHandler) { if (this.currentScreenHandler != playerScreenHandler) {
ComputerCraft.log.warn("Turtle has open container ({})", this.currentScreenHandler); ComputerCraft.log.warn("Turtle has open container ({})", this.currentScreenHandler);
closeCurrentScreen(); closeHandledScreen();
} }
BlockPos position = turtle.getPosition(); BlockPos position = turtle.getPosition();

View File

@@ -8,6 +8,7 @@ package dan200.computercraft.shared.util;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import javax.crypto.Cipher;
import javax.crypto.SecretKey; import javax.crypto.SecretKey;
import dan200.computercraft.api.turtle.FakePlayer; import dan200.computercraft.api.turtle.FakePlayer;
@@ -20,48 +21,7 @@ import net.minecraft.network.NetworkSide;
import net.minecraft.network.NetworkState; import net.minecraft.network.NetworkState;
import net.minecraft.network.Packet; import net.minecraft.network.Packet;
import net.minecraft.network.listener.PacketListener; import net.minecraft.network.listener.PacketListener;
import net.minecraft.network.packet.c2s.play.AdvancementTabC2SPacket; import net.minecraft.network.packet.c2s.play.*;
import net.minecraft.network.packet.c2s.play.BoatPaddleStateC2SPacket;
import net.minecraft.network.packet.c2s.play.BookUpdateC2SPacket;
import net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket;
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
import net.minecraft.network.packet.c2s.play.ClickWindowC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientStatusC2SPacket;
import net.minecraft.network.packet.c2s.play.ConfirmGuiActionC2SPacket;
import net.minecraft.network.packet.c2s.play.CraftRequestC2SPacket;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket;
import net.minecraft.network.packet.c2s.play.GuiCloseC2SPacket;
import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket;
import net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket;
import net.minecraft.network.packet.c2s.play.PickFromInventoryC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInputC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.network.packet.c2s.play.QueryBlockNbtC2SPacket;
import net.minecraft.network.packet.c2s.play.QueryEntityNbtC2SPacket;
import net.minecraft.network.packet.c2s.play.RenameItemC2SPacket;
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
import net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket;
import net.minecraft.network.packet.c2s.play.SelectVillagerTradeC2SPacket;
import net.minecraft.network.packet.c2s.play.SpectatorTeleportC2SPacket;
import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateBeaconC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateCommandBlockC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateCommandBlockMinecartC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateDifficultyC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateDifficultyLockC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateJigsawC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdatePlayerAbilitiesC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateStructureBlockC2SPacket;
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.text.Text; import net.minecraft.text.Text;
@@ -128,13 +88,26 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
} }
@Override @Override
public void onVillagerTradeSelect(@Nonnull SelectVillagerTradeC2SPacket packet) { public void onJigsawGenerating(JigsawGeneratingC2SPacket packet) {
}
@Override
public void onMerchantTradeSelect(SelectMerchantTradeC2SPacket packet) {
} }
@Override @Override
public void onBookUpdate(@Nonnull BookUpdateC2SPacket packet) { public void onBookUpdate(@Nonnull BookUpdateC2SPacket packet) {
} }
@Override
public void onRecipeBookData(RecipeBookDataC2SPacket packet) {
}
@Override
public void onRecipeCategoryOptions(RecipeCategoryOptionsC2SPacket packet) {
super.onRecipeCategoryOptions(packet);
}
@Override @Override
public void onQueryEntityNbt(@Nonnull QueryEntityNbtC2SPacket packet) { public void onQueryEntityNbt(@Nonnull QueryEntityNbtC2SPacket packet) {
} }
@@ -208,11 +181,11 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
} }
@Override @Override
public void onGuiClose(@Nonnull GuiCloseC2SPacket packet) { public void onCloseHandledScreen(CloseHandledScreenC2SPacket packet) {
} }
@Override @Override
public void onClickWindow(@Nonnull ClickWindowC2SPacket packet) { public void onClickSlot(ClickSlotC2SPacket packet) {
} }
@Override @Override
@@ -228,7 +201,7 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
} }
@Override @Override
public void onConfirmTransaction(@Nonnull ConfirmGuiActionC2SPacket packet) { public void onConfirmScreenAction(ConfirmScreenActionC2SPacket packet) {
} }
@Override @Override
@@ -310,7 +283,7 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
} }
@Override @Override
public void setupEncryption(@Nonnull SecretKey key) { public void setupEncryption(Cipher cipher, Cipher cipher2) {
} }
@Nonnull @Nonnull

View File

@@ -40,7 +40,7 @@ public final class WorldUtil {
.makeMap(); .makeMap();
public static boolean isLiquidBlock(World world, BlockPos pos) { public static boolean isLiquidBlock(World world, BlockPos pos) {
if (!World.method_24794(pos)) { if (!World.isInBuildLimit(pos)) {
return false; return false;
} }
return world.getBlockState(pos) return world.getBlockState(pos)