Some code cleanup for 1.15 (#6362)

This commit is contained in:
ichttt authored and LexManos committed 2019-12-18 20:39:41 -08:00
1 parent 30b530836a
commit 747cb0f151
7 files changed
+26 -27

No files matched your search

@@ -116,7 +116,7 @@ import net.minecraft.world.ILightReader;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.client.event.ColorHandlerEvent;
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
import net.minecraftforge.client.event.DrawHighlightEvent;
import net.minecraftforge.client.event.EntityViewRenderEvent;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.client.event.GuiScreenEvent;
@@ -164,12 +164,12 @@ public class ForgeHooksClient
switch (target.getType()) {
case BLOCK:
if (!(target instanceof BlockRayTraceResult)) return false;
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent.HighlightBlock(context, info, target, subID, partialTicks));
return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent.HighlightBlock(context, info, target, subID, partialTicks));
case ENTITY:
if (!(target instanceof EntityRayTraceResult)) return false;
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent.HighlightEntity(context, info, target, subID, partialTicks));
return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent.HighlightEntity(context, info, target, subID, partialTicks));
}
return MinecraftForge.EVENT_BUS.post(new DrawBlockHighlightEvent(context, info, target, subID, partialTicks));
return MinecraftForge.EVENT_BUS.post(new DrawHighlightEvent(context, info, target, subID, partialTicks));
}
public static void dispatchRenderLast(WorldRenderer context, MatrixStack mat, float partialTicks)
@@ -31,9 +31,8 @@ import net.minecraft.client.renderer.WorldRenderer;
* An event called whenever the selection highlight around blocks is about to be rendered.
* Canceling this event stops the selection highlight from being rendered.
*/
//TODO: in 1.15 rename to DrawHighlightEvent
@Cancelable
public class DrawBlockHighlightEvent extends Event
public class DrawHighlightEvent extends Event
{
private final WorldRenderer context;
private final ActiveRenderInfo info;
@@ -41,7 +40,7 @@ public class DrawBlockHighlightEvent extends Event
private final int subID;
private final float partialTicks;
public DrawBlockHighlightEvent(WorldRenderer context, ActiveRenderInfo info, RayTraceResult target, int subID, float partialTicks)
public DrawHighlightEvent(WorldRenderer context, ActiveRenderInfo info, RayTraceResult target, int subID, float partialTicks)
{
this.context = context;
this.info = info;
@@ -60,7 +59,7 @@ public class DrawBlockHighlightEvent extends Event
* A variant of the DrawBlockHighlightEvent only called when a block is highlighted.
*/
@Cancelable
public static class HighlightBlock extends DrawBlockHighlightEvent
public static class HighlightBlock extends DrawHighlightEvent
{
public HighlightBlock(WorldRenderer context, ActiveRenderInfo info, RayTraceResult target, int subID, float partialTicks)
{
@@ -79,7 +78,7 @@ public class DrawBlockHighlightEvent extends Event
* Canceling this event has no effect.
*/
@Cancelable
public static class HighlightEntity extends DrawBlockHighlightEvent
public static class HighlightEntity extends DrawHighlightEvent
{
public HighlightEntity(WorldRenderer context, ActiveRenderInfo info, RayTraceResult target, int subID, float partialTicks)
{