Port to MC 1.19-pre3

This commit is contained in:
Jonas Herzig
2022-05-27 07:03:35 +02:00
parent 9f8957f468
commit 9ce25f711f
41 changed files with 299 additions and 98 deletions

View File

@@ -44,8 +44,6 @@ import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.ScreenHandlerPropertyUpdateS2CPacket;
import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket;
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
import net.minecraft.network.packet.s2c.play.PaintingSpawnS2CPacket;
import net.minecraft.network.packet.s2c.play.ParticleS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerAbilitiesS2CPacket;
import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket;
@@ -59,6 +57,12 @@ import net.minecraft.util.math.Vec3d;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
//#if MC>=11900
//#else
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
import net.minecraft.network.packet.s2c.play.PaintingSpawnS2CPacket;
//#endif
//#if MC>=11600
//#else
//$$ import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
@@ -472,11 +476,13 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
boolean relevantPacket = packet instanceof PlayerSpawnS2CPacket
|| packet instanceof EntitySpawnS2CPacket
//#if MC<11900
|| packet instanceof MobSpawnS2CPacket
|| packet instanceof PaintingSpawnS2CPacket
//#endif
//#if MC<11600
//$$ || packet instanceof EntitySpawnGlobalS2CPacket
//#endif
|| packet instanceof PaintingSpawnS2CPacket
|| packet instanceof ExperienceOrbSpawnS2CPacket
|| packet instanceof EntitiesDestroyS2CPacket;
if (!relevantPacket) {
@@ -688,6 +694,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
, packet.isDebugWorld()
, packet.isFlatWorld()
//#endif
//#if MC>=11900
//$$ , java.util.Optional.empty()
//#endif
);
//#else
//#if MC>=10800
@@ -744,6 +753,9 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
//$$ respawn.getGeneratorType(),
//$$ GameMode.SPECTATOR
//#endif
//#if MC>=11900
//$$ , java.util.Optional.empty()
//#endif
);
//#else
//#if MC>=10809

View File

@@ -31,10 +31,6 @@ import net.minecraft.stat.StatHandler;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Box;
//#if MC>=11802
//$$ import net.minecraft.tag.TagKey;
//#endif
//#if FABRIC>=1
//#else
//$$ import net.minecraftforge.client.event.EntityViewRenderEvent;
@@ -47,7 +43,11 @@ import net.minecraft.util.math.Box;
//#if MC>=11400
import net.minecraft.client.world.ClientWorld;
import net.minecraft.fluid.Fluid;
//#if MC>=11802
//$$ import net.minecraft.tag.TagKey;
//#else
import net.minecraft.tag.Tag;
//#endif
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
//#else
@@ -547,7 +547,11 @@ public class CameraEntity
//#if MC>=11400
@Override
//#if MC>=11900
//$$ public void onEquipStack(EquipmentSlot slot, ItemStack stack, ItemStack itemStack) {
//#else
protected void onEquipStack(ItemStack itemStack_1) {
//#endif
// Suppress equip sounds
}
//#endif

View File

@@ -64,11 +64,11 @@ public class GuiHandler extends EventRegistrations {
mod.getReplayHandler().getReplaySender().setReplaySpeed(0);
//#if MC>=11600
final TranslatableText BUTTON_OPTIONS = new TranslatableText("menu.options");
final TranslatableText BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
final TranslatableText BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
final TranslatableText BUTTON_STATS = new TranslatableText("gui.stats");
final TranslatableText BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
final Text BUTTON_OPTIONS = new TranslatableText("menu.options");
final Text BUTTON_EXIT_SERVER = new TranslatableText("menu.disconnect");
final Text BUTTON_ADVANCEMENTS = new TranslatableText("gui.advancements");
final Text BUTTON_STATS = new TranslatableText("gui.stats");
final Text BUTTON_OPEN_TO_LAN = new TranslatableText("menu.shareToLan");
//#else
//#if MC>=11400
//$$ final String BUTTON_OPTIONS = I18n.translate("menu.options");