1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-30 17:17:55 +00:00

Update to 1.16.4

This commit is contained in:
Jummit
2021-05-16 09:18:02 +02:00
parent bcc0effd00
commit e12ce95b2d
15 changed files with 29 additions and 58 deletions

View File

@@ -55,8 +55,8 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.0' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
modRuntime "me.shedaniel:RoughlyEnoughItems-api:5.2.10" modRuntime "me.shedaniel:RoughlyEnoughItems-api:5.8.9"
modRuntime "me.shedaniel:RoughlyEnoughItems:5.2.10" modRuntime "me.shedaniel:RoughlyEnoughItems:5.8.9"
} }
sourceSets { sourceSets {

View File

@@ -5,13 +5,13 @@ org.gradle.jvmargs=-Xmx1G
mod_version=1.95.1-beta mod_version=1.95.1-beta
# Minecraft properties # Minecraft properties
mc_version=1.16.2 mc_version=1.16.4
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.34.2+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

@@ -590,4 +590,11 @@ c864576619751077a0d8ac1a18123e14b095ec03
Fix impostor recipes for disks Fix impostor recipes for disks
``` ```
[TODO] [JUMT-03] REI still shows white disks, probably because it doesn' show nbt items. [TODO] [JUMT-03] REI still shows white disks, probably because it doesn' show nbt items.
```
c5694ea9661c7a40021ebd280c378bd7bdc56988
Merge branch 'mc-1.15.x' into mc-1.16.x
```
Update to 1.16.4.

View File

@@ -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) { }
@@ -251,10 +251,6 @@ public class FakePlayer extends ServerPlayerEntity {
public void disconnect(Text message) { public void disconnect(Text message) {
} }
@Override
public void setupEncryption(SecretKey key) {
}
@Override @Override
public void disableAutoRead() { public void disableAutoRead() {
} }

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.isValid(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.isValid(pos)) {
return -1; return -1;
} }

View File

@@ -35,13 +35,11 @@ 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.isValid(pos) && !world.isClient ? getPeripheralAt(world, pos, side) : null;
} }
@Nullable @Nullable
private static IPeripheral getPeripheralAt(World world, BlockPos pos, Direction side) { private static IPeripheral getPeripheralAt(World world, BlockPos pos, Direction side) {
BlockEntity block = world.getBlockEntity(pos);
// Try the handlers in order: // Try the handlers in order:
for (IPeripheralProvider peripheralProvider : providers) { for (IPeripheralProvider peripheralProvider : providers) {
try { try {

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.isValid(min) || !World.isValid(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.isValid(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

@@ -316,7 +316,7 @@ public class ServerComputer extends ServerTerminal implements IComputer, IComput
@Nonnull @Nonnull
@Override @Override
public String getHostString() { public String getHostString() {
return String.format("ComputerCraft %s (Minecraft %s)", ComputerCraftAPI.getInstalledVersion(), "1.16.2"); return String.format("ComputerCraft %s (Minecraft %s)", ComputerCraftAPI.getInstalledVersion(), "1.16.4");
} }
@Nonnull @Nonnull

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.isValid(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.isValid(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

@@ -77,7 +77,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();
@@ -91,13 +91,8 @@ public final class TurtlePlayer extends FakePlayer {
} }
public static TurtlePlayer get(ITurtleAccess access) { public static TurtlePlayer get(ITurtleAccess access) {
ServerWorld world = (ServerWorld) access.getWorld();
if( !(access instanceof TurtleBrain) ) return create( access ); if( !(access instanceof TurtleBrain) ) return create( access );
/*if (!(access instanceof TurtleBrain)) {
return new TurtlePlayer(world, access.getOwningPlayer());
}*/
TurtleBrain brain = (TurtleBrain) access; TurtleBrain brain = (TurtleBrain) access;
TurtlePlayer player = brain.m_cachedPlayer; TurtlePlayer player = brain.m_cachedPlayer;
if (player == null || player.getGameProfile() != getProfile(access.getOwningPlayer()) || player.getEntityWorld() != access.getWorld()) { if (player == null || player.getGameProfile() != getProfile(access.getOwningPlayer()) || player.getEntityWorld() != access.getWorld()) {

View File

@@ -14,7 +14,6 @@ import dan200.computercraft.api.turtle.FakePlayer;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener; import io.netty.util.concurrent.GenericFutureListener;
import net.minecraft.network.ClientConnection; import net.minecraft.network.ClientConnection;
import net.minecraft.network.NetworkSide; import net.minecraft.network.NetworkSide;
import net.minecraft.network.NetworkState; import net.minecraft.network.NetworkState;
@@ -25,15 +24,12 @@ import net.minecraft.network.packet.c2s.play.BoatPaddleStateC2SPacket;
import net.minecraft.network.packet.c2s.play.BookUpdateC2SPacket; import net.minecraft.network.packet.c2s.play.BookUpdateC2SPacket;
import net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket; import net.minecraft.network.packet.c2s.play.ButtonClickC2SPacket;
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket; 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.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket; import net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientStatusC2SPacket; 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.CraftRequestC2SPacket;
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket; import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; 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.HandSwingC2SPacket;
import net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket; import net.minecraft.network.packet.c2s.play.KeepAliveC2SPacket;
import net.minecraft.network.packet.c2s.play.PickFromInventoryC2SPacket; import net.minecraft.network.packet.c2s.play.PickFromInventoryC2SPacket;
@@ -48,7 +44,6 @@ import net.minecraft.network.packet.c2s.play.QueryEntityNbtC2SPacket;
import net.minecraft.network.packet.c2s.play.RenameItemC2SPacket; import net.minecraft.network.packet.c2s.play.RenameItemC2SPacket;
import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket; import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
import net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket; 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.SpectatorTeleportC2SPacket;
import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket; import net.minecraft.network.packet.c2s.play.TeleportConfirmC2SPacket;
import net.minecraft.network.packet.c2s.play.UpdateBeaconC2SPacket; import net.minecraft.network.packet.c2s.play.UpdateBeaconC2SPacket;
@@ -127,10 +122,6 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
public void onJigsawUpdate(@Nonnull UpdateJigsawC2SPacket packet) { public void onJigsawUpdate(@Nonnull UpdateJigsawC2SPacket packet) {
} }
@Override
public void onVillagerTradeSelect(@Nonnull SelectVillagerTradeC2SPacket packet) {
}
@Override @Override
public void onBookUpdate(@Nonnull BookUpdateC2SPacket packet) { public void onBookUpdate(@Nonnull BookUpdateC2SPacket packet) {
} }
@@ -207,14 +198,6 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
public void onClientStatus(@Nonnull ClientStatusC2SPacket packet) { public void onClientStatus(@Nonnull ClientStatusC2SPacket packet) {
} }
@Override
public void onGuiClose(@Nonnull GuiCloseC2SPacket packet) {
}
@Override
public void onClickWindow(@Nonnull ClickWindowC2SPacket packet) {
}
@Override @Override
public void onCraftRequest(@Nonnull CraftRequestC2SPacket packet) { public void onCraftRequest(@Nonnull CraftRequestC2SPacket packet) {
} }
@@ -227,10 +210,6 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
public void onCreativeInventoryAction(@Nonnull CreativeInventoryActionC2SPacket packet) { public void onCreativeInventoryAction(@Nonnull CreativeInventoryActionC2SPacket packet) {
} }
@Override
public void onConfirmTransaction(@Nonnull ConfirmGuiActionC2SPacket packet) {
}
@Override @Override
public void onSignUpdate(@Nonnull UpdateSignC2SPacket packet) { public void onSignUpdate(@Nonnull UpdateSignC2SPacket packet) {
} }
@@ -309,10 +288,6 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
this.closeReason = message; this.closeReason = message;
} }
@Override
public void setupEncryption(@Nonnull SecretKey key) {
}
@Nonnull @Nonnull
@Override @Override
public PacketListener getPacketListener() { public PacketListener getPacketListener() {

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.isValid(pos)) {
return false; return false;
} }
return world.getBlockState(pos) return world.getBlockState(pos)