Remove some more preprocessor statements in favor of remap
This commit is contained in:
@@ -18,12 +18,12 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.network.ClientConnection;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=11300
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
//#endif
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.WorldType_DEBUG_ALL_BLOCK_STATES;
|
||||
//#if MC>=10800
|
||||
import net.minecraft.world.level.LevelGeneratorType;
|
||||
//#endif
|
||||
|
||||
import java.io.File;
|
||||
@@ -61,9 +61,9 @@ public class ConnectionEventHandler {
|
||||
if (local) {
|
||||
//#if MC>=10800
|
||||
//#if MC>=11300
|
||||
if (mc.getServer().getWorld(DimensionType.OVERWORLD).getGeneratorType() == WorldType_DEBUG_ALL_BLOCK_STATES) {
|
||||
if (mc.getServer().getWorld(DimensionType.OVERWORLD).getGeneratorType() == LevelGeneratorType.DEBUG_ALL_BLOCK_STATES) {
|
||||
//#else
|
||||
//$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType_DEBUG_ALL_BLOCK_STATES) {
|
||||
//$$ if (mc.getIntegratedServer().getEntityWorld().getWorldType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
|
||||
//#endif
|
||||
logger.info("Debug World recording is not supported.");
|
||||
return;
|
||||
|
||||
@@ -178,21 +178,18 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
byte newYaw = (byte) ((int) (player.yaw * 256.0F / 360.0F));
|
||||
byte newPitch = (byte) ((int) (player.pitch * 256.0F / 360.0F));
|
||||
|
||||
//#if MC>=10904
|
||||
packet = new EntityS2CPacket.RotateAndMoveRelative(
|
||||
player.getEntityId(),
|
||||
//#if MC>=10904
|
||||
(short) Math.round(dx * 4096), (short) Math.round(dy * 4096), (short) Math.round(dz * 4096),
|
||||
newYaw, newPitch, player.onGround
|
||||
);
|
||||
//#else
|
||||
//$$ packet = new S14PacketEntity.S17PacketEntityLookMove(player.getEntityId(),
|
||||
//$$ (byte) Math.round(dx * 32), (byte) Math.round(dy * 32), (byte) Math.round(dz * 32),
|
||||
//$$ newYaw, newPitch
|
||||
//#if MC>=10800
|
||||
//$$ , player.onGround
|
||||
//#else
|
||||
//$$ (byte) Math.round(dx * 32), (byte) Math.round(dy * 32), (byte) Math.round(dz * 32),
|
||||
//#endif
|
||||
//$$ );
|
||||
//#endif
|
||||
newYaw, newPitch
|
||||
//#if MC>=10800
|
||||
, player.onGround
|
||||
//#endif
|
||||
);
|
||||
}
|
||||
|
||||
packetListener.save(packet);
|
||||
@@ -339,11 +336,7 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
lastActiveHand = player.getActiveHand();
|
||||
DataTracker dataManager = new DataTracker(null);
|
||||
int state = (wasHandActive ? 1 : 0) | (lastActiveHand == Hand.OFF_HAND ? 2 : 0);
|
||||
//#if MC>=11300
|
||||
dataManager.startTracking(EntityLivingBaseAccessor.getLivingFlags(), (byte) state);
|
||||
//#else
|
||||
//$$ dataManager.register(EntityLivingBaseAccessor.getLivingFlags(), (byte) state);
|
||||
//#endif
|
||||
packetListener.save(new EntityTrackerUpdateS2CPacket(player.getEntityId(), dataManager, true));
|
||||
}
|
||||
//#endif
|
||||
|
||||
@@ -19,6 +19,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.network.NetworkState;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.util.PacketByteBuf;
|
||||
@@ -29,23 +30,17 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=11300
|
||||
import net.minecraft.client.network.packet.LoginSuccessS2CPacket;
|
||||
//#else
|
||||
//$$ import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
//#endif
|
||||
|
||||
//#if MC>=10904
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
//#else
|
||||
//$$ import net.minecraft.entity.DataWatcher;
|
||||
//$$
|
||||
//$$ import java.util.List;
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
import net.minecraft.network.NetworkSide;
|
||||
//#if MC<11300
|
||||
//$$ import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
//#endif
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
//#endif
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
@@ -235,12 +230,7 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
|
||||
((ItemPickupAnimationS2CPacket) packet).getEntityId() == mc.player.getEntityId()) {
|
||||
//#else
|
||||
//$$ if(packet instanceof S0DPacketCollectItem) {
|
||||
//$$ if(mc.thePlayer != null ||
|
||||
//#if MC>=10809
|
||||
//$$ ((S0DPacketCollectItem) packet).getEntityID() == mc.thePlayer.getEntityId()) {
|
||||
//#else
|
||||
//$$ ((S0DPacketCollectItem) packet).func_149353_d() == mc.thePlayer.getEntityId()) {
|
||||
//#endif
|
||||
//$$ if(mc.thePlayer != null || ((S0DPacketCollectItem) packet).getEntityID() == mc.thePlayer.getEntityId()) {
|
||||
//#endif
|
||||
super.channelRead(ctx, msg);
|
||||
return;
|
||||
|
||||
@@ -149,11 +149,7 @@ public class ResourcePackRecorder {
|
||||
//$$ //noinspection Convert2Lambda
|
||||
//$$ mc.addScheduledTask(() -> mc.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
|
||||
//$$ @Override
|
||||
//#if MC>=11300
|
||||
//$$ public void confirmResult(boolean result, int id) {
|
||||
//#else
|
||||
//$$ public void confirmClicked(boolean result, int id) {
|
||||
//#endif
|
||||
//$$ public void confirmResult(boolean result, int id) {
|
||||
//#endif
|
||||
if (serverData != null) {
|
||||
serverData.setResourcePackState(result ? ServerEntry.ResourcePackState.ENABLED : ServerEntry.ResourcePackState.DISABLED);
|
||||
|
||||
Reference in New Issue
Block a user