1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-28 08:12:18 +00:00

Merge pull request #24 from Toad-Dev/merith-1.16.5-pr

Merith 1.16.5 pr
This commit is contained in:
Merith 2021-05-16 09:44:21 -07:00 committed by GitHub
commit 5c5e510075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 54 additions and 53 deletions

View File

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '0.5-SNAPSHOT' id 'fabric-loom' version '0.6-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -13,6 +13,7 @@ archivesBaseName = "cc-restiched"
repositories { repositories {
mavenCentral() mavenCentral()
jcenter()
maven { maven {
name "SquidDev" name "SquidDev"
url "https://squiddev.cc/maven" url "https://squiddev.cc/maven"

View File

@ -5,13 +5,13 @@ org.gradle.jvmargs=-Xmx1G
mod_version=1.95.3-beta mod_version=1.95.3-beta
# Minecraft properties # Minecraft properties
mc_version=1.16.4 mc_version=1.16.5
mappings_version=9 mappings_version=9
# Dependencies # Dependencies
cloth_config_version=4.8.1 cloth_config_version=4.8.1
fabric_api_version=0.34.2+1.16
fabric_loader_version=0.11.3 fabric_loader_version=0.11.3
fabric_api_version=0.32.0+1.16
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;
@ -251,6 +251,11 @@ public class FakePlayer extends ServerPlayerEntity {
public void disconnect(Text message) { public void disconnect(Text message) {
} }
@Override
public void setupEncryption(Cipher cipher, Cipher cipher2) {
super.setupEncryption(cipher, cipher2);
}
@Override @Override
public void disableAutoRead() { public void disableAutoRead() {
} }

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.isValid(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.isValid(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.isValid(pos) && !world.isClient ? getPeripheralAt(world, pos, side) : null; return World.isInBuildLimit(pos) && !world.isClient ? getPeripheralAt(world, pos, side) : null;
} }
@Nullable @Nullable

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

@ -122,7 +122,7 @@ public class TurtleMoveCommand implements ITurtleCommand {
if (World.isOutOfBuildLimitVertically(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.isValid(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.isValid(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;

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;
@ -19,44 +20,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.ClientCommandC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket;
import net.minecraft.network.packet.c2s.play.ClientStatusC2SPacket;
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.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.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;
@ -122,10 +86,27 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
public void onJigsawUpdate(@Nonnull UpdateJigsawC2SPacket packet) { public void onJigsawUpdate(@Nonnull UpdateJigsawC2SPacket packet) {
} }
@Override
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) {
} }
@ -198,6 +179,14 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
public void onClientStatus(@Nonnull ClientStatusC2SPacket packet) { public void onClientStatus(@Nonnull ClientStatusC2SPacket packet) {
} }
@Override
public void onCloseHandledScreen(CloseHandledScreenC2SPacket packet) {
}
@Override
public void onClickSlot(ClickSlotC2SPacket packet) {
}
@Override @Override
public void onCraftRequest(@Nonnull CraftRequestC2SPacket packet) { public void onCraftRequest(@Nonnull CraftRequestC2SPacket packet) {
} }
@ -210,6 +199,10 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
public void onCreativeInventoryAction(@Nonnull CreativeInventoryActionC2SPacket packet) { public void onCreativeInventoryAction(@Nonnull CreativeInventoryActionC2SPacket packet) {
} }
@Override
public void onConfirmScreenAction(ConfirmScreenActionC2SPacket packet) {
}
@Override @Override
public void onSignUpdate(@Nonnull UpdateSignC2SPacket packet) { public void onSignUpdate(@Nonnull UpdateSignC2SPacket packet) {
} }
@ -288,6 +281,10 @@ public class FakeNetHandler extends ServerPlayNetworkHandler {
this.closeReason = message; this.closeReason = message;
} }
@Override
public void setupEncryption(Cipher cipher, Cipher cipher2) {
}
@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.isValid(pos)) { if (!World.isInBuildLimit(pos)) {
return false; return false;
} }
return world.getBlockState(pos) return world.getBlockState(pos)