1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 22:53:22 +00:00

Tiny bits and bobs

Oh my, what good commit discipline!

 - Remove unused method in NetworkHandler.
 - Correctly pass the transformation to ComputerBorderRenderer.
This commit is contained in:
Jonathan Coates 2022-05-30 17:42:33 +01:00
parent 4411756b06
commit cd76425877
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
3 changed files with 3 additions and 17 deletions

View File

@ -74,7 +74,7 @@ public void renderBg( @Nonnull MatrixStack stack, float partialTicks, int mouseX
{
// Draw a border around the terminal
ComputerBorderRenderer.render(
ComputerBorderRenderer.getTexture( family ), terminal.x, terminal.y, getBlitOffset(),
stack.last().pose(), ComputerBorderRenderer.getTexture( family ), terminal.x, terminal.y, getBlitOffset(),
FULL_BRIGHT_LIGHTMAP, terminal.getWidth(), terminal.getHeight()
);
ComputerSidebar.renderBackground( stack, leftPos, topPos + sidebarYOffset );

View File

@ -23,13 +23,6 @@ public class ComputerBorderRenderer
public static final ResourceLocation BACKGROUND_COMMAND = new ResourceLocation( ComputerCraft.MOD_ID, "textures/gui/corners_command.png" );
public static final ResourceLocation BACKGROUND_COLOUR = new ResourceLocation( ComputerCraft.MOD_ID, "textures/gui/corners_colour.png" );
private static final Matrix4f IDENTITY = new Matrix4f();
static
{
IDENTITY.setIdentity();
}
/**
* The margin between the terminal and its border.
*/
@ -91,10 +84,10 @@ public static RenderType getRenderType( ResourceLocation location )
return RenderType.text( location );
}
public static void render( ResourceLocation location, int x, int y, int z, int light, int width, int height )
public static void render( Matrix4f transform, ResourceLocation location, int x, int y, int z, int light, int width, int height )
{
IRenderTypeBuffer.Impl source = IRenderTypeBuffer.immediate( Tessellator.getInstance().getBuilder() );
render( IDENTITY, source.getBuffer( getRenderType( location ) ), x, y, z, light, width, height, false, 1, 1, 1 );
render( transform, source.getBuffer( getRenderType( location ) ), x, y, z, light, width, height, false, 1, 1, 1 );
source.endBatch();
}

View File

@ -23,7 +23,6 @@
import net.minecraftforge.fml.network.simple.SimpleChannel;
import java.util.function.Function;
import java.util.function.Supplier;
public final class NetworkHandler
{
@ -111,10 +110,4 @@ private static <T extends NetworkMessage> void registerMainThread( int id, Netwo
} )
.add();
}
@SuppressWarnings( "unchecked" )
private static <T> Class<T> getType( Supplier<T> supplier )
{
return (Class<T>) supplier.get().getClass();
}
}