Add 1.7.10 version
This commit is contained in:
@@ -3,12 +3,20 @@ package com.replaymod.compat;
|
||||
import com.replaymod.compat.bettersprinting.DisableBetterSprinting;
|
||||
import com.replaymod.compat.optifine.DisableFastRender;
|
||||
import com.replaymod.compat.oranges17animations.HideInvisibleEntities;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
//#if MC>=10800
|
||||
import com.replaymod.compat.shaders.ShaderBeginRender;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.common.Mod;
|
||||
//$$ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
//$$ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.EventBus;
|
||||
//#endif
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
@@ -16,7 +24,9 @@ import static com.replaymod.core.versions.MCVer.*;
|
||||
version = "@MOD_VERSION@",
|
||||
acceptedMinecraftVersions = "@MC_VERSION@",
|
||||
acceptableRemoteVersions = "*",
|
||||
//#if MC>=10800
|
||||
clientSideOnly = true,
|
||||
//#endif
|
||||
useMetadata = true)
|
||||
public class ReplayModCompat {
|
||||
public static final String MOD_ID = "replaymod-compat";
|
||||
@@ -31,7 +41,9 @@ public class ReplayModCompat {
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
EventBus bus = FML_BUS;
|
||||
//#if MC>=10800
|
||||
bus.register(new ShaderBeginRender());
|
||||
//#endif
|
||||
bus.register(new DisableFastRender());
|
||||
bus.register(new HideInvisibleEntities());
|
||||
DisableBetterSprinting.register();
|
||||
|
||||
@@ -8,13 +8,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
|
||||
import net.minecraftforge.fml.common.versioning.Restriction;
|
||||
import net.minecraftforge.fml.common.versioning.VersionRange;
|
||||
|
||||
//#if MC>=10904
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -26,10 +19,30 @@ import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
//#else
|
||||
//#if MC>= 10800
|
||||
//$$ import net.minecraft.util.BlockPos;
|
||||
//#endif
|
||||
//$$ import net.minecraft.world.IWorldAccess;
|
||||
//#endif
|
||||
|
||||
//#if MC>=10800
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
|
||||
import net.minecraftforge.fml.common.versioning.Restriction;
|
||||
import net.minecraftforge.fml.common.versioning.VersionRange;
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.common.Loader;
|
||||
//$$ import cpw.mods.fml.common.ModContainer;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
//$$ import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
|
||||
//$$ import cpw.mods.fml.common.versioning.Restriction;
|
||||
//$$ import cpw.mods.fml.common.versioning.VersionRange;
|
||||
//#endif
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import static com.replaymod.compat.ReplayModCompat.LOGGER;
|
||||
@@ -106,7 +119,11 @@ public class DisableBetterSprinting {
|
||||
//#endif
|
||||
{
|
||||
@Override
|
||||
//#if MC>=10800
|
||||
public void onEntityRemoved(Entity entityIn) {
|
||||
//#else
|
||||
//$$ public void onEntityDestroy(Entity entityIn) {
|
||||
//#endif
|
||||
if (mc.playerController != null && mc.playerController.getClass().getName().equals(CONTROLLER_OVERRIDE_CLASS_NAME)) {
|
||||
// Someone has secretly swapped out the player controller and is about to substitute their own player entity.
|
||||
// This is the right time to destroy their plan.
|
||||
@@ -115,12 +132,21 @@ public class DisableBetterSprinting {
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void notifyLightSet(BlockPos pos) {}
|
||||
@Override public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2) {}
|
||||
//#if MC>=10800
|
||||
@Override public void notifyLightSet(BlockPos pos) {}
|
||||
@Override public void spawnParticle(int p_180442_1_, boolean p_180442_2_, double p_180442_3_, double p_180442_5_, double p_180442_7_, double p_180442_9_, double p_180442_11_, double p_180442_13_, int... p_180442_15_) {}
|
||||
@Override public void onEntityAdded(Entity entityIn) {}
|
||||
@Override public void broadcastSound(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) {}
|
||||
@Override public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) {}
|
||||
//#else
|
||||
//$$ @Override public void markBlockForRenderUpdate(int x, int y, int z) {}
|
||||
//$$ @Override public void spawnParticle(String p_72708_1_, double p_72708_2_, double p_72708_4_, double p_72708_6_, double p_72708_8_, double p_72708_10_, double p_72708_12_) {}
|
||||
//$$ @Override public void onEntityCreate(Entity entityIn) {}
|
||||
//$$ @Override public void broadcastSound(int p_180440_1_, int x, int y, int z, int p_180440_3_) {}
|
||||
//$$ @Override public void destroyBlockPartially(int breakerId, int x, int y, int z, int progress) {}
|
||||
//$$ @Override public void onStaticEntitiesChanged() {}
|
||||
//#endif
|
||||
//#if MC>=10904
|
||||
@Override public void notifyBlockUpdate(World worldIn, BlockPos pos, IBlockState oldState, IBlockState newState, int flags) {}
|
||||
@Override public void playSoundToAllNearExcept(@Nullable EntityPlayer player, SoundEvent soundIn, SoundCategory category, double x, double y, double z, float volume, float pitch) {}
|
||||
@@ -134,14 +160,23 @@ public class DisableBetterSprinting {
|
||||
//#endif
|
||||
//#endif
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ @Override public void markBlockForUpdate(BlockPos pos) {}
|
||||
//$$ @Override public void playRecord(String recordName, BlockPos blockPosIn) {}
|
||||
//#else
|
||||
//$$ @Override public void markBlockForUpdate(int x, int y, int z) {}
|
||||
//$$ @Override public void playRecord(String recordName, int x, int y, int z) {}
|
||||
//#endif
|
||||
//$$ @Override public void playSound(String soundName, double x, double y, double z, float volume, float pitch) {}
|
||||
//$$ @Override public void playSoundToNearExcept(EntityPlayer except, String soundName, double x, double y, double z, float volume, float pitch) {}
|
||||
//$$ @Override public void playRecord(String recordName, BlockPos blockPosIn) {}
|
||||
//#if MC>=10809
|
||||
//$$ @Override public void playAuxSFX(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos blockPosIn, int p_180439_4_) {}
|
||||
//#else
|
||||
//#if MC>=10800
|
||||
//$$ @Override public void playAusSFX(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos blockPosIn, int p_180439_4_) {}
|
||||
//#else
|
||||
//$$ @Override public void playAuxSFX(EntityPlayer p_72706_1_, int p_72706_2_, int p_72706_3_, int p_72706_4_, int p_72706_5_, int p_72706_6_) {}
|
||||
//#endif
|
||||
//#endif
|
||||
//#endif
|
||||
}
|
||||
|
||||
@@ -3,13 +3,18 @@ package com.replaymod.compat.mapwriter.mixin;
|
||||
import com.replaymod.replay.ReplayModReplay;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
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>=10800
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.common.Loader;
|
||||
//#endif
|
||||
|
||||
/**
|
||||
* Approximately this for <1.12: https://github.com/Vectron/mapwriter/commit/68234520c7a3a0ae8201a085d7e66369900586ac
|
||||
*/
|
||||
|
||||
@@ -2,8 +2,14 @@ package com.replaymod.compat.optifine;
|
||||
|
||||
import com.replaymod.render.events.ReplayRenderEvent;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
//#if MC>=10800
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.client.FMLClientHandler;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
public class DisableFastRender {
|
||||
|
||||
|
||||
@@ -3,9 +3,16 @@ package com.replaymod.compat.oranges17animations;
|
||||
import com.replaymod.replay.camera.CameraEntity;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.client.event.RenderLivingEvent;
|
||||
|
||||
//#if MC>=10800
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
//#else
|
||||
//$$ import cpw.mods.fml.common.Loader;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
//$$ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
//#endif
|
||||
|
||||
import static com.replaymod.core.versions.MCVer.*;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//#if MC>=10800
|
||||
package com.replaymod.compat.shaders;
|
||||
|
||||
import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
@@ -37,3 +38,4 @@ public class ShaderBeginRender {
|
||||
}
|
||||
|
||||
}
|
||||
//#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//#if MC>=10800
|
||||
package com.replaymod.compat.shaders;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -51,3 +52,4 @@ public class ShaderReflection {
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//#if MC>=10800
|
||||
package com.replaymod.compat.shaders.mixin;
|
||||
|
||||
import com.replaymod.compat.shaders.ShaderReflection;
|
||||
@@ -26,3 +27,4 @@ public abstract class MixinShaderEntityRenderer {
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//#if MC>=10800
|
||||
package com.replaymod.compat.shaders.mixin;
|
||||
|
||||
import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
@@ -27,3 +28,4 @@ public abstract class MixinShaderRenderChunk {
|
||||
|
||||
|
||||
}
|
||||
//#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//#if MC>=10800
|
||||
package com.replaymod.compat.shaders.mixin;
|
||||
|
||||
import com.replaymod.compat.shaders.ShaderReflection;
|
||||
@@ -38,3 +39,4 @@ public abstract class MixinShaderRenderGlobal {
|
||||
}
|
||||
|
||||
}
|
||||
//#endif
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//#if MC<=10710
|
||||
//$$ package com.replaymod.compat.shaders.mixin;
|
||||
//$$
|
||||
//$$ import com.replaymod.render.hooks.EntityRendererHandler;
|
||||
//$$ import com.replaymod.replay.ReplayHandler;
|
||||
//$$ import com.replaymod.replay.ReplayModReplay;
|
||||
//$$ import net.minecraft.client.Minecraft;
|
||||
//$$ import org.spongepowered.asm.mixin.Mixin;
|
||||
//$$ import org.spongepowered.asm.mixin.Pseudo;
|
||||
//$$ import org.spongepowered.asm.mixin.Shadow;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.At;
|
||||
//$$ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
//$$
|
||||
//$$ @Pseudo
|
||||
//$$ @Mixin(targets = "shadersmod/client/Shaders", remap = false)
|
||||
//$$ public abstract class MixinShaders {
|
||||
//$$
|
||||
//$$ @Shadow static Minecraft mc;
|
||||
//$$ @Shadow static long systemTime;
|
||||
//$$ @Shadow static long lastSystemTime;
|
||||
//$$ @Shadow static long diffSystemTime;
|
||||
//$$ @Shadow static int frameCounter;
|
||||
//$$ @Shadow static float frameTime;
|
||||
//$$ @Shadow static float frameTimeCounter;
|
||||
//$$
|
||||
//$$ @Redirect(method = "beginRender", at = @At(value = "INVOKE", target = "Ljava/lang/System;currentTimeMillis()J"))
|
||||
//$$ private static long replayModCompat_currentTimeMillis() {
|
||||
//$$ ReplayHandler replayHandler = ReplayModReplay.instance.getReplayHandler();
|
||||
//$$ if (replayHandler != null) {
|
||||
//$$ systemTime = replayHandler.getReplaySender().currentTimeStamp();
|
||||
//$$
|
||||
//$$ // We need to manipulate all the other previous-frame-time-based variables too
|
||||
//$$
|
||||
//$$ lastSystemTime = 0; // Draw all frames as if they were the first ones
|
||||
//$$ // diffSystemTime will be set to 0 by Shaders
|
||||
//$$ // frameTime will be set to 0 by Shaders
|
||||
//$$ frameTimeCounter = systemTime / 1000f; // will be %= 3600f by Shaders
|
||||
//$$
|
||||
//$$ // Set frameCounter only if rendering is in progress
|
||||
//$$ EntityRendererHandler entityRendererHandler =
|
||||
//$$ ((EntityRendererHandler.IEntityRenderer) mc.entityRenderer).replayModRender_getHandler();
|
||||
//$$ if (entityRendererHandler != null) {
|
||||
//$$ frameCounter = entityRendererHandler.getRenderInfo().getFramesDone();
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ return systemTime;
|
||||
//$$ }
|
||||
//$$ return System.currentTimeMillis();
|
||||
//$$ }
|
||||
//$$
|
||||
//$$ }
|
||||
//#endif
|
||||
Reference in New Issue
Block a user