mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-27 11:57:38 +00:00
- Remap everything to use MojMap class names too. This is what Forge
uses, so \o/.
This does NOT currently rename any classes to use suffix notation or
BlockEntity. That will come in a later change. We do however rename
references of "World" to "Level".
- Move the test mod into a separate "cctest" source set. As Forge now
works using Jigsaw we cannot have multiple mods defining the same
package, which causes problems with our JUnit test classes.
- Remove our custom test framework and replace it with vanilla's (this
is no longer stripped from the jar). RIP kotlin coroutines.
It's still worth using Kotlin here though, just for extension
methods.
- Other 1.17-related changes:
- Use separate tile/block entity tick methods for server and client
side, often avoiding ticking at all on the client.
- Switch much of the monitor rendering code to use vanilla's
built-in shader system. It's still an incredibly ugly hack, so not
really expecting this to work with any rendering mods, but we'll
cross that bridge when we come to it.
45 lines
1.7 KiB
Java
45 lines
1.7 KiB
Java
/*
|
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
|
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
|
|
* Send enquiries to dratcliffe@gmail.com
|
|
*/
|
|
package dan200.computercraft.client.gui;
|
|
|
|
import com.mojang.blaze3d.systems.RenderSystem;
|
|
import com.mojang.blaze3d.vertex.PoseStack;
|
|
import dan200.computercraft.shared.peripheral.printer.ContainerPrinter;
|
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.resources.ResourceLocation;
|
|
import net.minecraft.world.entity.player.Inventory;
|
|
|
|
import javax.annotation.Nonnull;
|
|
|
|
public class GuiPrinter extends AbstractContainerScreen<ContainerPrinter>
|
|
{
|
|
private static final ResourceLocation BACKGROUND = new ResourceLocation( "computercraft", "textures/gui/printer.png" );
|
|
|
|
public GuiPrinter( ContainerPrinter container, Inventory player, Component title )
|
|
{
|
|
super( container, player, title );
|
|
}
|
|
|
|
@Override
|
|
protected void renderBg( @Nonnull PoseStack transform, float partialTicks, int mouseX, int mouseY )
|
|
{
|
|
RenderSystem.setShaderColor( 1.0F, 1.0F, 1.0F, 1.0F );
|
|
RenderSystem.setShaderTexture( 0, BACKGROUND );
|
|
blit( transform, leftPos, topPos, 0, 0, imageWidth, imageHeight );
|
|
|
|
if( getMenu().isPrinting() ) blit( transform, leftPos + 34, topPos + 21, 176, 0, 25, 45 );
|
|
}
|
|
|
|
@Override
|
|
public void render( @Nonnull PoseStack stack, int mouseX, int mouseY, float partialTicks )
|
|
{
|
|
renderBackground( stack );
|
|
super.render( stack, mouseX, mouseY, partialTicks );
|
|
renderTooltip( stack, mouseX, mouseY );
|
|
}
|
|
}
|