Port to MC 1.19-pre3
This commit is contained in:
@@ -18,7 +18,6 @@ import com.replaymod.replaystudio.studio.ReplayStudio;
|
||||
import com.replaymod.replaystudio.util.I18n;
|
||||
import com.replaymod.simplepathing.ReplayModSimplePathing;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.options.Option;
|
||||
import net.minecraft.resource.DirectoryResourcePack;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Style;
|
||||
@@ -37,6 +36,11 @@ import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
//#if MC>=11900
|
||||
//#else
|
||||
import net.minecraft.client.options.Option;
|
||||
//#endif
|
||||
|
||||
public class ReplayMod implements Module, Scheduler {
|
||||
|
||||
public static final String MOD_ID = "replaymod";
|
||||
@@ -162,7 +166,8 @@ public class ReplayMod implements Module, Scheduler {
|
||||
keyBindingRegistry.register();
|
||||
|
||||
// 1.7.10 crashes when render distance > 16
|
||||
//#if MC>=10800
|
||||
// Post 1.19 this has become non-trivial to do, install Sodium+Bobby or OptiFine if you need it
|
||||
//#if MC>=10800 && MC<11900
|
||||
if (!MCVer.hasOptifine()) {
|
||||
Option.RENDER_DISTANCE.setMax(64f);
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
// 1.19+
|
||||
@@ -158,8 +158,12 @@ public class LangResourcePack extends AbstractFileResourcePack {
|
||||
String namespace,
|
||||
//#endif
|
||||
String path,
|
||||
//#if MC>=11900
|
||||
//$$ Predicate<Identifier> filter
|
||||
//#else
|
||||
int maxDepth,
|
||||
Predicate<String> filter
|
||||
//#endif
|
||||
) {
|
||||
if (resourcePackType == ResourceType.CLIENT_RESOURCES && "lang".equals(path)) {
|
||||
Path base = baseLangPath();
|
||||
@@ -174,8 +178,13 @@ public class LangResourcePack extends AbstractFileResourcePack {
|
||||
.map(LANG_FILE_NAME_PATTERN::matcher)
|
||||
.filter(Matcher::matches)
|
||||
.map(matcher -> String.format("%s_%s.json", matcher.group(1), matcher.group(1)))
|
||||
.filter(filter::test)
|
||||
//#if MC<11900
|
||||
.filter(filter)
|
||||
//#endif
|
||||
.map(name -> new Identifier(ReplayMod.MOD_ID, "lang/" + name))
|
||||
//#if MC>=11900
|
||||
//$$ .filter(filter)
|
||||
//#endif
|
||||
.collect(Collectors.toList());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.client.util.Window;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
//#if MC>=11600
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.resource.language.I18n;
|
||||
@@ -220,7 +221,7 @@ public class MCVer {
|
||||
//#if MC>=11400
|
||||
public static Optional<AbstractButtonWidget> findButton(Iterable<AbstractButtonWidget> buttonList, @SuppressWarnings("unused") String text, @SuppressWarnings("unused") int id) {
|
||||
//#if MC>=11600
|
||||
final TranslatableText message = new TranslatableText(text);
|
||||
final Text message = new TranslatableText(text);
|
||||
//#else
|
||||
//$$ final String message = I18n.translate(text);
|
||||
//#endif
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.replaymod.core.mixin.MinecraftAccessor;
|
||||
import com.replaymod.gradle.remap.Pattern;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.options.GameOptions;
|
||||
import net.minecraft.client.options.KeyBinding;
|
||||
import net.minecraft.client.render.VertexFormat;
|
||||
import net.minecraft.client.texture.TextureManager;
|
||||
@@ -14,6 +15,11 @@ import net.minecraft.client.render.Tessellator;
|
||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||
import net.minecraft.client.sound.PositionedSoundInstance;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.resource.Resource;
|
||||
import net.minecraft.resource.ResourceManager;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.crash.CrashException;
|
||||
import net.minecraft.util.crash.CrashReport;
|
||||
import net.minecraft.util.crash.CrashReportSection;
|
||||
@@ -61,6 +67,7 @@ import net.minecraft.client.render.BufferBuilder;
|
||||
//$$ import net.minecraft.entity.EntityLivingBase;
|
||||
//#endif
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@@ -549,7 +556,9 @@ class Patterns {
|
||||
|
||||
@Pattern
|
||||
private static void setCrashReport(MinecraftClient mc, CrashReport report) {
|
||||
//#if MC>=11800
|
||||
//#if MC>=11900
|
||||
//$$ mc.setCrashReportSupplier(report);
|
||||
//#elseif MC>=11800
|
||||
//$$ mc.setCrashReportSupplier(() -> report);
|
||||
//#else
|
||||
mc.setCrashReport(report);
|
||||
@@ -573,4 +582,91 @@ class Patterns {
|
||||
//$$ return com.replaymod.core.versions.MCVer.getTrackedPosition(entity);
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static Text newTextLiteral(String str) {
|
||||
//#if MC>=11900
|
||||
//$$ return net.minecraft.text.Text.literal(str);
|
||||
//#else
|
||||
return new LiteralText(str);
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static Text newTextTranslatable(String key, Object...args) {
|
||||
//#if MC>=11900
|
||||
//$$ return net.minecraft.text.Text.translatable(key, args);
|
||||
//#else
|
||||
return new TranslatableText(key, args);
|
||||
//#endif
|
||||
}
|
||||
|
||||
//#if MC>=11500
|
||||
@Pattern
|
||||
private static Vec3d getTrackedPos(Entity entity) {
|
||||
//#if MC>=11900
|
||||
//$$ return entity.getTrackedPosition().withDelta(0, 0, 0);
|
||||
//#else
|
||||
return entity.getTrackedPosition();
|
||||
//#endif
|
||||
}
|
||||
//#else
|
||||
//$$ @Pattern private static void getTrackedPos() {}
|
||||
//#endif
|
||||
|
||||
@Pattern
|
||||
private static void setGamma(GameOptions options, double value) {
|
||||
//#if MC>=11900
|
||||
//$$ ((com.replaymod.core.mixin.SimpleOptionAccessor<Double>) (Object) options.getGamma()).setRawValue(value);
|
||||
//#elseif MC>=11400
|
||||
options.gamma = value;
|
||||
//#else
|
||||
//$$ options.gammaSetting = (float) value;
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static double getGamma(GameOptions options) {
|
||||
//#if MC>=11900
|
||||
//$$ return options.getGamma().getValue();
|
||||
//#else
|
||||
return options.gamma;
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static int getViewDistance(GameOptions options) {
|
||||
//#if MC>=11900
|
||||
//$$ return options.getViewDistance().getValue();
|
||||
//#else
|
||||
return options.viewDistance;
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static double getFov(GameOptions options) {
|
||||
//#if MC>=11900
|
||||
//$$ return options.getFov().getValue();
|
||||
//#else
|
||||
return options.fov;
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static int getGuiScale(GameOptions options) {
|
||||
//#if MC>=11900
|
||||
//$$ return options.getGuiScale().getValue();
|
||||
//#else
|
||||
return options.guiScale;
|
||||
//#endif
|
||||
}
|
||||
|
||||
@Pattern
|
||||
private static Resource getResource(ResourceManager manager, Identifier id) throws IOException {
|
||||
//#if MC>=11900
|
||||
//$$ return manager.getResourceOrThrow(id);
|
||||
//#else
|
||||
return manager.getResource(id);
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class FullBrightness extends EventRegistrations implements Extra {
|
||||
Type type = getType();
|
||||
if (type == Type.Gamma || type == Type.Both) {
|
||||
originalGamma = mc.options.gamma;
|
||||
mc.options.gamma = 1000;
|
||||
mc.options.gamma = 1000.0;
|
||||
}
|
||||
if (type == Type.NightVision || type == Type.Both) {
|
||||
if (mc.player != null) {
|
||||
|
||||
@@ -116,7 +116,7 @@ public class PlayerOverviewGui extends GuiScreen implements Closeable {
|
||||
}.setSize(16, 16),
|
||||
new GuiLabel().setText(
|
||||
//#if MC>=11400
|
||||
p.getName().asString()
|
||||
p.getName().getString()
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ p.getName()
|
||||
@@ -181,7 +181,7 @@ public class PlayerOverviewGui extends GuiScreen implements Closeable {
|
||||
if (isSpectator(o1) && !isSpectator(o2)) return 1;
|
||||
if (isSpectator(o2) && !isSpectator(o1)) return -1;
|
||||
//#if MC>=11400
|
||||
return o1.getName().asString().compareToIgnoreCase(o2.getName().asString());
|
||||
return o1.getName().getString().compareToIgnoreCase(o2.getName().getString());
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ return o1.getName().compareToIgnoreCase(o2.getName());
|
||||
|
||||
@@ -42,12 +42,9 @@ import java.util.Collections;
|
||||
|
||||
//#if MC>=10904
|
||||
import net.minecraft.network.packet.s2c.play.EntityTrackerUpdateS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.WorldEventS2CPacket;
|
||||
import net.minecraft.entity.EquipmentSlot;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
@@ -91,7 +88,7 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
//#if MC>=10904
|
||||
public void onPacket(Packet<?> packet) {
|
||||
packetListener.save(packet);
|
||||
}
|
||||
@@ -112,16 +109,6 @@ public class RecordingEventHandler extends EventRegistrations {
|
||||
}
|
||||
|
||||
//#if MC>=10904
|
||||
public void onClientSound(SoundEvent sound, SoundCategory category,
|
||||
double x, double y, double z, float volume, float pitch) {
|
||||
try {
|
||||
// Send to all other players in ServerWorldEventHandler#playSoundToAllNearExcept
|
||||
packetListener.save(new PlaySoundS2CPacket(sound, category, x, y, z, volume, pitch));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void onClientEffect(int type, BlockPos pos, int data) {
|
||||
try {
|
||||
// Send to all other players in ServerWorldEventHandler#playEvent
|
||||
|
||||
@@ -33,7 +33,11 @@ public abstract class MixinDownloadingPackFinder implements ResourcePackRecorder
|
||||
}
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=11900
|
||||
//$$ @Inject(method = "loadServerPack(Ljava/io/File;Lnet/minecraft/resource/ResourcePackSource;)Ljava/util/concurrent/CompletableFuture;", at = @At("HEAD"))
|
||||
//#else
|
||||
@Inject(method = "loadServerPack", at = @At("HEAD"))
|
||||
//#endif
|
||||
private void recordDownloadedPack(
|
||||
File file,
|
||||
//#if MC>=11600
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.replaymod.recording.handler.RecordingEventHandler;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.packet.s2c.play.PlaySoundS2CPacket;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
@@ -61,12 +62,20 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
||||
//#else
|
||||
DimensionType dimensionType,
|
||||
//#endif
|
||||
Supplier<Profiler> profiler, boolean bl, boolean bl2, long l) {
|
||||
Supplier<Profiler> profiler, boolean bl, boolean bl2, long l
|
||||
//#if MC>=11900
|
||||
//$$ , int maxChainedNeighborUpdates
|
||||
//#endif
|
||||
) {
|
||||
super(mutableWorldProperties, registryKey,
|
||||
//#if MC<11602
|
||||
//$$ registryKey2,
|
||||
//#endif
|
||||
dimensionType, profiler, bl, bl2, l);
|
||||
dimensionType, profiler, bl, bl2, l
|
||||
//#if MC>=11900
|
||||
//$$ , maxChainedNeighborUpdates
|
||||
//#endif
|
||||
);
|
||||
}
|
||||
//#else
|
||||
//#if MC>=11400
|
||||
@@ -102,7 +111,10 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
||||
// but are instead played directly by the client. The server only sends these sounds to
|
||||
// other clients so we have to record them manually.
|
||||
// E.g. Block place sounds
|
||||
//#if MC>=11400
|
||||
//#if MC>=11900
|
||||
//$$ @Inject(method = "playSound(Lnet/minecraft/entity/player/PlayerEntity;DDDLnet/minecraft/sound/SoundEvent;Lnet/minecraft/sound/SoundCategory;FFJ)V",
|
||||
//$$ at = @At("HEAD"))
|
||||
//#elseif MC>=11400
|
||||
//#if FABRIC>=1
|
||||
@Inject(method = "playSound(Lnet/minecraft/entity/player/PlayerEntity;DDDLnet/minecraft/sound/SoundEvent;Lnet/minecraft/sound/SoundCategory;FF)V",
|
||||
at = @At("HEAD"))
|
||||
@@ -114,12 +126,23 @@ public abstract class MixinWorldClient extends World implements RecordingEventHa
|
||||
//$$ @Inject(method = "playSound(Lnet/minecraft/entity/player/EntityPlayer;DDDLnet/minecraft/util/SoundEvent;Lnet/minecraft/util/SoundCategory;FF)V",
|
||||
//$$ at = @At("HEAD"))
|
||||
//#endif
|
||||
public void replayModRecording_recordClientSound(PlayerEntity player, double x, double y, double z, SoundEvent sound, SoundCategory category,
|
||||
float volume, float pitch, CallbackInfo ci) {
|
||||
public void replayModRecording_recordClientSound(
|
||||
PlayerEntity player, double x, double y, double z, SoundEvent sound, SoundCategory category,
|
||||
float volume, float pitch,
|
||||
//#if MC>=11900
|
||||
//$$ long seed,
|
||||
//#endif
|
||||
CallbackInfo ci) {
|
||||
if (player == this.client.player) {
|
||||
RecordingEventHandler handler = replayModRecording_getRecordingEventHandler();
|
||||
if (handler != null) {
|
||||
handler.onClientSound(sound, category, x, y, z, volume, pitch);
|
||||
// Sent to all other players in ServerWorldEventHandler#playSoundToAllNearExcept
|
||||
handler.onPacket(new PlaySoundS2CPacket(
|
||||
sound, category, x, y, z, volume, pitch
|
||||
//#if MC>=11900
|
||||
//$$ , seed
|
||||
//#endif
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.replaymod.recording.mixin;
|
||||
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(MobSpawnS2CPacket.class)
|
||||
public interface SPacketSpawnMobAccessor {
|
||||
//#if MC<11500
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ DataTracker getDataManager();
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ void setDataManager(DataTracker value);
|
||||
//#endif
|
||||
}
|
||||
//#if MC<11500
|
||||
//$$ package com.replaymod.recording.mixin;
|
||||
//$$
|
||||
//$$ import net.minecraft.entity.data.DataTracker;
|
||||
//$$ import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||
//$$ import org.spongepowered.asm.mixin.Mixin;
|
||||
//$$ import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
//$$
|
||||
//$$ @Mixin(MobSpawnS2CPacket.class)
|
||||
//$$ public interface SPacketSpawnMobAccessor {
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ DataTracker getDataManager();
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ void setDataManager(DataTracker value);
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package com.replaymod.recording.mixin;
|
||||
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(PlayerSpawnS2CPacket.class)
|
||||
public interface SPacketSpawnPlayerAccessor {
|
||||
//#if MC<11500
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ DataTracker getDataManager();
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ void setDataManager(DataTracker value);
|
||||
//#endif
|
||||
}
|
||||
//#if MC<11500
|
||||
//$$ package com.replaymod.recording.mixin;
|
||||
//$$
|
||||
//$$ import net.minecraft.entity.data.DataTracker;
|
||||
//$$ import net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket;
|
||||
//$$ import org.spongepowered.asm.mixin.Mixin;
|
||||
//$$ import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
//$$
|
||||
//$$ @Mixin(PlayerSpawnS2CPacket.class)
|
||||
//$$ public interface SPacketSpawnPlayerAccessor {
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ DataTracker getDataManager();
|
||||
//$$ @Accessor("dataTracker")
|
||||
//$$ void setDataManager(DataTracker value);
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
@@ -13,8 +13,6 @@ import com.replaymod.recording.ReplayModRecording;
|
||||
import com.replaymod.recording.Setting;
|
||||
import com.replaymod.recording.gui.GuiSavingReplay;
|
||||
import com.replaymod.recording.handler.ConnectionEventHandler;
|
||||
import com.replaymod.recording.mixin.SPacketSpawnMobAccessor;
|
||||
import com.replaymod.recording.mixin.SPacketSpawnPlayerAccessor;
|
||||
import com.replaymod.replaystudio.PacketData;
|
||||
import com.replaymod.replaystudio.data.Marker;
|
||||
import com.replaymod.replaystudio.io.ReplayOutputStream;
|
||||
@@ -30,7 +28,6 @@ import net.minecraft.network.ClientConnection;
|
||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.ItemPickupAnimationS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerSpawnS2CPacket;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.data.DataTracker;
|
||||
@@ -44,6 +41,13 @@ import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=11500
|
||||
//#else
|
||||
//$$ import com.replaymod.recording.mixin.SPacketSpawnMobAccessor;
|
||||
//$$ import com.replaymod.recording.mixin.SPacketSpawnPlayerAccessor;
|
||||
//$$ import net.minecraft.network.packet.s2c.play.MobSpawnS2CPacket;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import net.minecraft.network.packet.s2c.login.LoginSuccessS2CPacket;
|
||||
//#else
|
||||
|
||||
@@ -11,6 +11,11 @@ import net.minecraft.client.resource.ClientBuiltinResourcePackProvider;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=11900
|
||||
//$$ import java.net.MalformedURLException;
|
||||
//$$ import java.net.URL;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import net.minecraft.text.TranslatableText;
|
||||
//#else
|
||||
@@ -192,7 +197,18 @@ public class ResourcePackRecorder {
|
||||
downloadResourcePack(final int requestId, String url, String hash) {
|
||||
ClientBuiltinResourcePackProvider packFinder = mc.getResourcePackDownloader();
|
||||
((IDownloadingPackFinder) packFinder).setRequestCallback(file -> recordResourcePack(file, requestId));
|
||||
//#if MC>=11700
|
||||
//#if MC>=11900
|
||||
//$$ try {
|
||||
//$$ URL theUrl = new URL(url);
|
||||
//$$ String protocol = theUrl.getProtocol();
|
||||
//$$ if (!"http".equals(protocol) && !"https".equals(protocol)) {
|
||||
//$$ throw new MalformedURLException("Unsupported protocol.");
|
||||
//$$ }
|
||||
//$$ return packFinder.download(theUrl, hash, true);
|
||||
//$$ } catch (MalformedURLException e) {
|
||||
//$$ return CompletableFuture.failedFuture(e);
|
||||
//$$ }
|
||||
//#elseif MC>=11700
|
||||
//$$ return packFinder.download(url, hash, true);
|
||||
//#else
|
||||
return packFinder.download(url, hash);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend;
|
||||
|
||||
import com.replaymod.render.blend.data.DMaterial;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.replaymod.render.blend;
|
||||
|
||||
import com.replaymod.render.blend.data.DScene;
|
||||
import com.replaymod.render.blend.data.Serializer;
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
// FIXME 1.15
|
||||
//#if MC<11500
|
||||
//$$ import com.replaymod.render.blend.exporters.ChunkExporter;
|
||||
@@ -53,7 +53,7 @@ public class BlendState implements Exporter {
|
||||
this.blenderFile = BlenderFactory.newBlenderFile(file);
|
||||
this.factory = new BlenderFactory(blenderFile);
|
||||
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
RenderState renderState = new RenderState(this);
|
||||
register(renderState);
|
||||
// FIXME 1.15
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.exporters;
|
||||
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.exporters;
|
||||
|
||||
import com.replaymod.render.blend.BlendMeshBuilder;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.exporters;
|
||||
|
||||
import com.replaymod.render.blend.BlendMeshBuilder;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.exporters;
|
||||
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.exporters;
|
||||
|
||||
import com.replaymod.render.blend.BlendState;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.exporters;
|
||||
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.mixin;
|
||||
|
||||
import com.replaymod.render.blend.BlendState;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.mixin;
|
||||
|
||||
import com.replaymod.render.blend.BlendState;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.mixin;
|
||||
|
||||
import com.replaymod.render.blend.BlendState;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//#if MC>=10800
|
||||
//#if MC>=10800 && MC<11900
|
||||
package com.replaymod.render.blend.mixin;
|
||||
|
||||
import com.replaymod.render.blend.BlendState;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.replaymod.render.mixin;
|
||||
//#if MC>=10904
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import com.replaymod.render.blend.BlendState;
|
||||
import com.replaymod.render.blend.exporters.ParticlesExporter;
|
||||
import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
@@ -12,6 +11,11 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
//#if MC>=11900
|
||||
//#else
|
||||
import com.replaymod.render.blend.exporters.ParticlesExporter;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11500
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.util.math.Quaternion;
|
||||
@@ -52,10 +56,12 @@ public abstract class MixinParticleManager {
|
||||
}
|
||||
|
||||
private void buildGeometry(Particle particle, VertexConsumer vertexConsumer, Camera camera, float partialTicks) {
|
||||
//#if MC<11900
|
||||
BlendState blendState = BlendState.getState();
|
||||
if (blendState != null) {
|
||||
blendState.get(ParticlesExporter.class).onRender(particle, partialTicks);
|
||||
}
|
||||
//#endif
|
||||
particle.buildGeometry(vertexConsumer, camera, partialTicks);
|
||||
}
|
||||
//#else
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user