Switch core to 1.14 (generated via ./gradlew :1.14:setCoreVersion)

This commit is contained in:
Jonas Herzig
2019-05-10 14:09:22 +02:00
parent 7f7d33def8
commit 7cbf7f7c94
183 changed files with 3250 additions and 3250 deletions

View File

@@ -1,32 +1,32 @@
//#if MC<11400
package com.replaymod.compat.oranges17animations;
import com.replaymod.replay.camera.CameraEntity;
import de.johni0702.minecraft.gui.utils.EventRegistrations;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import static com.replaymod.core.versions.MCVer.*;
/**
* Orange seems to have copied vast parts of the RendererLivingEntity into their ArmorAnimation class which cancels the RenderLivingEvent.Pre and calls its own code instead.
* This breaks our mixin which assures that, even though the camera is in spectator mode, it cannot see invisible entities.
*
* To fix this issue, we simply cancel the RenderLivingEvent.Pre before it gets to ArmorAnimation if the entity is invisible.
*/
public class HideInvisibleEntities extends EventRegistrations {
private final Minecraft mc = Minecraft.getInstance();
private final boolean modLoaded = isModLoaded("animations");
@SubscribeEvent(priority = EventPriority.HIGH)
public void preRenderLiving(RenderLivingEvent.Pre event) {
if (modLoaded) {
if (mc.player instanceof CameraEntity && getEntity(event).isInvisible()) {
event.setCanceled(true);
}
}
}
}
//$$ package com.replaymod.compat.oranges17animations;
//$$
//$$ import com.replaymod.replay.camera.CameraEntity;
//$$ import de.johni0702.minecraft.gui.utils.EventRegistrations;
//$$ import net.minecraft.client.Minecraft;
//$$ import net.minecraftforge.client.event.RenderLivingEvent;
//$$ import net.minecraftforge.eventbus.api.EventPriority;
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
//$$
//$$ import static com.replaymod.core.versions.MCVer.*;
//$$
//$$ /**
//$$ * Orange seems to have copied vast parts of the RendererLivingEntity into their ArmorAnimation class which cancels the RenderLivingEvent.Pre and calls its own code instead.
//$$ * This breaks our mixin which assures that, even though the camera is in spectator mode, it cannot see invisible entities.
//$$ *
//$$ * To fix this issue, we simply cancel the RenderLivingEvent.Pre before it gets to ArmorAnimation if the entity is invisible.
//$$ */
//$$ public class HideInvisibleEntities extends EventRegistrations {
//$$ private final Minecraft mc = Minecraft.getInstance();
//$$ private final boolean modLoaded = isModLoaded("animations");
//$$
//$$ @SubscribeEvent(priority = EventPriority.HIGH)
//$$ public void preRenderLiving(RenderLivingEvent.Pre event) {
//$$ if (modLoaded) {
//$$ if (mc.player instanceof CameraEntity && getEntity(event).isInvisible()) {
//$$ event.setCanceled(true);
//$$ }
//$$ }
//$$ }
//$$ }
//#endif