1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-18 06:05:12 +00:00

Utilise @Mod.EventBusSubscriber a little more

This offers several advantages

 - Less registration code: the subscribers are reigstered automatically,
   and we don't need to worry about sided-proxies.
 - We no longer have so many .instance() calls.
This commit is contained in:
SquidDev
2019-01-12 16:27:40 +00:00
parent 77666d7399
commit 5d97b9c8f3
13 changed files with 114 additions and 143 deletions

View File

@@ -23,17 +23,24 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import org.lwjgl.opengl.GL11;
public class RenderOverlayCable
@Mod.EventBusSubscriber( modid = ComputerCraft.MOD_ID, value = Side.CLIENT )
public final class RenderOverlayCable
{
private static final float EXPAND = 0.002f;
private static final double MIN = CableBounds.MIN - EXPAND;
private static final double MAX = CableBounds.MAX + EXPAND;
private RenderOverlayCable()
{
}
@SubscribeEvent
public void drawHighlight( DrawBlockHighlightEvent event )
public static void drawHighlight( DrawBlockHighlightEvent event )
{
if( event.getTarget().typeOfHit != RayTraceResult.Type.BLOCK ) return;