-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Different Outline Colors for Input/Output
- Loading branch information
1 parent
e4f6fc8
commit 4b5f341
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/main/java/com/nomiceu/nomilabs/integration/betterp2p/LabsClientCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.nomiceu.nomilabs.integration.betterp2p; | ||
|
||
import it.unimi.dsi.fastutil.objects.ObjectArrayList; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.math.BlockPos; | ||
import kotlin.Pair; | ||
|
||
import java.util.List; | ||
|
||
public class LabsClientCache { | ||
|
||
public static final List<Pair<BlockPos, EnumFacing>> inputLoc = new ObjectArrayList<>(); | ||
public static final List<Pair<BlockPos, EnumFacing>> outputLoc = new ObjectArrayList<>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/com/nomiceu/nomilabs/mixin/betterp2p/RenderHandlerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.nomiceu.nomilabs.mixin.betterp2p; | ||
|
||
import com.nomiceu.nomilabs.integration.betterp2p.LabsClientCache; | ||
import com.projecturanus.betterp2p.client.render.OutlineRenderer; | ||
import com.projecturanus.betterp2p.client.render.RenderHandler; | ||
import kotlin.Pair; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraftforge.client.event.RenderWorldLastEvent; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Adds different overlay colors for Output/Input. | ||
*/ | ||
@Mixin(value = RenderHandler.class, remap = false) | ||
public class RenderHandlerMixin { | ||
|
||
/** | ||
* Replace original outline handler. | ||
*/ | ||
@Redirect(method = "renderOverlays", at = @At(value = "INVOKE", target = "Lcom/projecturanus/betterp2p/client/render/OutlineRenderer;renderOutlinesWithFacing(Lnet/minecraftforge/client/event/RenderWorldLastEvent;Lnet/minecraft/entity/player/EntityPlayer;Ljava/util/Collection;III)V", ordinal = 1), require = 1) | ||
private static void replaceOriginalOutlineHandler(RenderWorldLastEvent evt, EntityPlayer p, Collection<Pair<BlockPos, EnumFacing>> coordinates, int r, int g, int b) { | ||
OutlineRenderer.renderOutlinesWithFacing(evt, p, LabsClientCache.inputLoc, 0x6d, 0x9c, 0xf8); | ||
OutlineRenderer.renderOutlinesWithFacing(evt, p, LabsClientCache.outputLoc, 0xec, 0xb3, 0x6c); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters