Update to MC 1.14 / Fabric

This commit is contained in:
Jonas Herzig
2019-05-04 14:37:00 +02:00
parent 17fe5b345f
commit 3d009e45c7
151 changed files with 3963 additions and 1455 deletions

View File

@@ -5,13 +5,18 @@ import com.replaymod.replay.camera.CameraEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
//#if MC>=11400
//$$ import net.minecraft.client.world.ClientWorld;
//#else
import net.minecraft.world.World;
//#endif
//#if MC>=11200
//#if MC>=11300
import net.minecraft.client.util.RecipeBookClient;
@@ -47,32 +52,41 @@ public abstract class MixinPlayerControllerMP {
//#if MC>=11300
@Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
private void replayModReplay_createReplayCamera(World worldIn, StatisticsManager statisticsManager, RecipeBookClient recipeBookClient, CallbackInfoReturnable<EntityPlayerSP> ci) {
private void replayModReplay_createReplayCamera(
//#if MC>=11400
//$$ ClientWorld worldIn,
//#else
World worldIn,
//#endif
StatisticsManager statisticsManager,
RecipeBookClient recipeBookClient,
CallbackInfoReturnable<EntityPlayerSP> ci
) {
if (ReplayModReplay.instance.getReplayHandler() != null) {
ci.setReturnValue(new CameraEntity(mc, worldIn, connection, statisticsManager, recipeBookClient));
ci.setReturnValue(new CameraEntity(this.mc, worldIn, this.connection, statisticsManager, recipeBookClient));
//#else
//#if MC>=11200
//$$ @Inject(method = "func_192830_a", at=@At("HEAD"), cancellable = true)
//$$ private void replayModReplay_createReplayCamera(World worldIn, StatisticsManager statisticsManager, RecipeBook recipeBook, CallbackInfoReturnable<EntityPlayerSP> ci) {
//$$ if (ReplayModReplay.instance.getReplayHandler() != null) {
//$$ ci.setReturnValue(new CameraEntity(mc, worldIn, connection, statisticsManager, recipeBook));
//$$ ci.setReturnValue(new CameraEntity(this.mc, worldIn, this.connection, statisticsManager, recipeBook));
//#else
//#if MC>=10904
//$$ @Inject(method = "createClientPlayer", at=@At("HEAD"), cancellable = true)
//$$ private void replayModReplay_createReplayCamera(World worldIn, StatisticsManager statisticsManager, CallbackInfoReturnable<EntityPlayerSP> ci) {
//$$ if (ReplayModReplay.instance.getReplayHandler() != null) {
//$$ ci.setReturnValue(new CameraEntity(mc, worldIn, connection, statisticsManager));
//$$ ci.setReturnValue(new CameraEntity(this.mc, worldIn, this.connection, statisticsManager));
//#else
//#if MC>=10800
//$$ @Inject(method = "func_178892_a", at=@At("HEAD"), cancellable = true)
//$$ private void replayModReplay_createReplayCamera(World worldIn, StatFileWriter statFileWriter, CallbackInfoReturnable<EntityPlayerSP> ci) {
//$$ if (ReplayModReplay.instance.getReplayHandler() != null) {
//$$ ci.setReturnValue(new CameraEntity(mc, worldIn, netClientHandler, statFileWriter));
//$$ ci.setReturnValue(new CameraEntity(this.mc, worldIn, this.netClientHandler, statFileWriter));
//#else
//$$ @Inject(method = "createPlayer", at=@At("HEAD"), cancellable = true)
//$$ private void replayModReplay_createReplayCamera(World worldIn, StatFileWriter statFileWriter, CallbackInfoReturnable<EntityClientPlayerMP> ci) {
//$$ if (ReplayModReplay.instance.getReplayHandler() != null) {
//$$ ci.setReturnValue(new CameraEntity(mc, worldIn, mc.getSession(), netClientHandler, statFileWriter));
//$$ ci.setReturnValue(new CameraEntity(this.mc, worldIn, this.mc.getSession(), this.netClientHandler, statFileWriter));
//#endif
//#endif
//#endif
@@ -88,8 +102,8 @@ public abstract class MixinPlayerControllerMP {
//$$ @Inject(method = "isSpectator", at=@At("HEAD"), cancellable = true)
//#endif
private void replayModReplay_isSpectator(CallbackInfoReturnable<Boolean> ci) {
if (mc.player instanceof CameraEntity) { // this check should in theory not be required
ci.setReturnValue(mc.player.isSpectator());
if (this.mc.player instanceof CameraEntity) { // this check should in theory not be required
ci.setReturnValue(this.mc.player.isSpectator());
}
}
//#endif