mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-18 07:27:39 +00:00
style: some spaces
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
package dan200.computercraft;
|
||||
|
||||
import dan200.computercraft.api.turtle.event.TurtleAction;
|
||||
import dan200.computercraft.client.render.MonitorTextureBufferShader;
|
||||
import dan200.computercraft.core.apis.http.options.Action;
|
||||
import dan200.computercraft.core.apis.http.options.AddressRule;
|
||||
import dan200.computercraft.shared.common.ColourableRecipe;
|
||||
@@ -31,7 +30,6 @@ import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
|
||||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
||||
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
@@ -39,7 +37,6 @@ import net.minecraft.util.registry.Registry;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
|
@@ -23,20 +23,16 @@ import net.minecraft.network.packet.c2s.play.RequestCommandCompletionsC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.VehicleMoveC2SPacket;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.screen.NamedScreenHandlerFactory;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerInteractionManager;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.village.TradeOfferList;
|
||||
import net.minecraft.world.GameMode;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.crypto.Cipher;
|
||||
|
@@ -21,7 +21,7 @@ public class SoundManager
|
||||
{
|
||||
private static final Map<UUID, MoveableSound> sounds = new HashMap<>();
|
||||
|
||||
public static void playSound(UUID source, Vec3d position, SoundEvent event, float volume, float pitch )
|
||||
public static void playSound( UUID source, Vec3d position, SoundEvent event, float volume, float pitch )
|
||||
{
|
||||
var soundManager = MinecraftClient.getInstance().getSoundManager();
|
||||
|
||||
|
@@ -29,7 +29,8 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ComputerScreenBase <T extends ContainerComputerBase> extends HandledScreen<T> {
|
||||
public abstract class ComputerScreenBase<T extends ContainerComputerBase> extends HandledScreen<T>
|
||||
{
|
||||
|
||||
private static final Text OK = new TranslatableText( "gui.ok" );
|
||||
private static final Text CANCEL = new TranslatableText( "gui.cancel" );
|
||||
@@ -41,7 +42,7 @@ public abstract class ComputerScreenBase <T extends ContainerComputerBase> exten
|
||||
|
||||
protected final int sidebarYOffset;
|
||||
|
||||
public ComputerScreenBase(T container, PlayerInventory player, Text title, int sidebarYOffset )
|
||||
public ComputerScreenBase( T container, PlayerInventory player, Text title, int sidebarYOffset )
|
||||
{
|
||||
super( container, player, title );
|
||||
computer = (ClientComputer) container.getComputer();
|
||||
@@ -89,7 +90,7 @@ public abstract class ComputerScreenBase <T extends ContainerComputerBase> exten
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void render(@Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks )
|
||||
public final void render( @Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks )
|
||||
{
|
||||
renderBackground( stack );
|
||||
super.render( stack, mouseX, mouseY, partialTicks );
|
||||
@@ -113,7 +114,7 @@ public abstract class ComputerScreenBase <T extends ContainerComputerBase> exten
|
||||
public void filesDragged( @Nonnull List<Path> files )
|
||||
{
|
||||
// TODO: this thing doesn't work in Tweaked at this moment
|
||||
if (true) return;
|
||||
if ( true ) return;
|
||||
if( files.isEmpty() ) return;
|
||||
|
||||
if( computer == null || !computer.isOn() )
|
||||
|
@@ -6,22 +6,18 @@
|
||||
|
||||
package dan200.computercraft.client.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import dan200.computercraft.ComputerCraft;
|
||||
import dan200.computercraft.client.FrameInfo;
|
||||
import dan200.computercraft.client.render.MonitorTextureBufferShader;
|
||||
import dan200.computercraft.client.render.RenderTypes;
|
||||
import dan200.computercraft.core.terminal.Terminal;
|
||||
import dan200.computercraft.core.terminal.TextBuffer;
|
||||
//import dan200.computercraft.fabric.mixin.RenderLayerAccessor;
|
||||
import dan200.computercraft.shared.util.Colour;
|
||||
import dan200.computercraft.shared.util.Palette;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.*;
|
||||
import net.minecraft.util.math.AffineTransformation;
|
||||
import net.minecraft.client.render.VertexConsumer;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.AffineTransformation;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -162,32 +158,32 @@ public final class FixedWidthFontRenderer
|
||||
buffer.vertex( transform, x, y, 0f )
|
||||
.color( r, g, b, 1.0f )
|
||||
.texture( xStart / WIDTH, yStart / WIDTH )
|
||||
.light(light)
|
||||
.light( light )
|
||||
.next();
|
||||
buffer.vertex( transform, x, y + FONT_HEIGHT, 0f )
|
||||
.color( r, g, b, 1.0f )
|
||||
.texture( xStart / WIDTH, (yStart + FONT_HEIGHT) / WIDTH )
|
||||
.light(light)
|
||||
.light( light )
|
||||
.next();
|
||||
buffer.vertex( transform, x + FONT_WIDTH, y, 0f )
|
||||
.color( r, g, b, 1.0f )
|
||||
.texture( (xStart + FONT_WIDTH) / WIDTH, yStart / WIDTH )
|
||||
.light(light)
|
||||
.light( light )
|
||||
.next();
|
||||
buffer.vertex( transform, x + FONT_WIDTH, y, 0f )
|
||||
.color( r, g, b, 1.0f )
|
||||
.texture( (xStart + FONT_WIDTH) / WIDTH, yStart / WIDTH )
|
||||
.light(light)
|
||||
.light( light )
|
||||
.next();
|
||||
buffer.vertex( transform, x, y + FONT_HEIGHT, 0f )
|
||||
.color( r, g, b, 1.0f )
|
||||
.texture( xStart / WIDTH, (yStart + FONT_HEIGHT) / WIDTH )
|
||||
.light(light)
|
||||
.light( light )
|
||||
.next();
|
||||
buffer.vertex( transform, x + FONT_WIDTH, y + FONT_HEIGHT, 0f )
|
||||
.color( r, g, b, 1.0f )
|
||||
.texture( (xStart + FONT_WIDTH) / WIDTH, (yStart + FONT_HEIGHT) / WIDTH )
|
||||
.light(light)
|
||||
.light( light )
|
||||
.next();
|
||||
}
|
||||
|
||||
@@ -323,8 +319,6 @@ public final class FixedWidthFontRenderer
|
||||
public static void drawTerminal( @Nonnull Matrix4f transform, float x, float y, @Nonnull Terminal terminal, boolean greyscale, float topMarginSize,
|
||||
float bottomMarginSize, float leftMarginSize, float rightMarginSize )
|
||||
{
|
||||
// bindFont();
|
||||
|
||||
VertexConsumerProvider.Immediate renderer = MinecraftClient.getInstance()
|
||||
.getBufferBuilders()
|
||||
.getEntityVertexConsumers();
|
||||
@@ -347,8 +341,6 @@ public final class FixedWidthFontRenderer
|
||||
|
||||
public static void drawEmptyTerminal( @Nonnull Matrix4f transform, float x, float y, float width, float height )
|
||||
{
|
||||
// bindFont();
|
||||
|
||||
VertexConsumerProvider.Immediate renderer = MinecraftClient.getInstance()
|
||||
.getBufferBuilders()
|
||||
.getEntityVertexConsumers();
|
||||
@@ -366,6 +358,6 @@ public final class FixedWidthFontRenderer
|
||||
public static void drawBlocker( @Nonnull Matrix4f transform, @Nonnull VertexConsumerProvider renderer, float x, float y, float width, float height )
|
||||
{
|
||||
Colour colour = Colour.BLACK;
|
||||
drawQuad( transform, renderer.getBuffer(RenderTypes.TERMINAL_BLOCKER), x, y, width, height, colour.getR(), colour.getG(), colour.getB() );
|
||||
drawQuad( transform, renderer.getBuffer( RenderTypes.TERMINAL_BLOCKER ), x, y, width, height, colour.getR(), colour.getG(), colour.getB() );
|
||||
}
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ public final class GuiComputer<T extends ContainerComputerBase> extends Computer
|
||||
public void drawBackground( @Nonnull MatrixStack stack, float partialTicks, int mouseX, int mouseY )
|
||||
{
|
||||
ComputerBorderRenderer.render(
|
||||
getTexture(family), terminal.x, terminal.y, getZOffset(),
|
||||
getTexture( family ), terminal.x, terminal.y, getZOffset(),
|
||||
RenderTypes.FULL_BRIGHT_LIGHTMAP, terminal.getWidth(), terminal.getHeight() );
|
||||
ComputerSidebar.renderBackground( stack, x, y + sidebarYOffset );
|
||||
}
|
||||
|
@@ -7,7 +7,6 @@
|
||||
package dan200.computercraft.client.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import dan200.computercraft.client.render.ComputerBorderRenderer;
|
||||
import dan200.computercraft.shared.peripheral.diskdrive.ContainerDiskDrive;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
@@ -38,9 +37,9 @@ public class GuiDiskDrive extends HandledScreen<ContainerDiskDrive>
|
||||
@Override
|
||||
protected void drawBackground( @Nonnull MatrixStack transform, float partialTicks, int mouseX, int mouseY )
|
||||
{
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.setShaderTexture(0, BACKGROUND);
|
||||
RenderSystem.setShader( GameRenderer::getPositionTexShader );
|
||||
RenderSystem.setShaderColor( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
RenderSystem.setShaderTexture( 0, BACKGROUND );
|
||||
drawTexture( transform, x, y, 0, 0, backgroundWidth, backgroundHeight );
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ public class NoTermComputerScreen<T extends ContainerComputerBase> extends Scree
|
||||
private final T menu;
|
||||
private WidgetTerminal terminal;
|
||||
|
||||
public NoTermComputerScreen(T menu, PlayerInventory player, Text title )
|
||||
public NoTermComputerScreen( T menu, PlayerInventory player, Text title )
|
||||
{
|
||||
super( title );
|
||||
this.menu = menu;
|
||||
@@ -102,7 +102,7 @@ public class NoTermComputerScreen<T extends ContainerComputerBase> extends Scree
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack transform, int mouseX, int mouseY, float partialTicks )
|
||||
public void render( MatrixStack transform, int mouseX, int mouseY, float partialTicks )
|
||||
{
|
||||
super.render( transform, mouseX, mouseY, partialTicks );
|
||||
|
||||
|
@@ -40,7 +40,7 @@ public final class OptionScreen extends Screen
|
||||
|
||||
private final Screen originalScreen;
|
||||
|
||||
private OptionScreen(Text title, Text message, List<ClickableWidget> buttons, Runnable exit, Screen originalScreen )
|
||||
private OptionScreen( Text title, Text message, List<ClickableWidget> buttons, Runnable exit, Screen originalScreen )
|
||||
{
|
||||
super( title );
|
||||
this.message = message;
|
||||
@@ -87,7 +87,7 @@ public final class OptionScreen extends Screen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(@Nonnull MatrixStack transform, int mouseX, int mouseY, float partialTicks )
|
||||
public void render( @Nonnull MatrixStack transform, int mouseX, int mouseY, float partialTicks )
|
||||
{
|
||||
renderBackground( transform );
|
||||
|
||||
|
@@ -45,7 +45,7 @@ public final class ComputerSidebar
|
||||
{
|
||||
}
|
||||
|
||||
public static void addButtons(Screen screen, ClientComputer computer, Consumer<ClickableWidget> add, int x, int y )
|
||||
public static void addButtons( Screen screen, ClientComputer computer, Consumer<ClickableWidget> add, int x, int y )
|
||||
{
|
||||
x += CORNERS_BORDER + 1;
|
||||
y += CORNERS_BORDER + ICON_MARGIN;
|
||||
@@ -55,10 +55,10 @@ public final class ComputerSidebar
|
||||
TEXTURE, TEX_SIZE, TEX_SIZE, b -> toggleComputer( computer ),
|
||||
() -> computer.isOn() ? Arrays.asList(
|
||||
new TranslatableText( "gui.computercraft.tooltip.turn_off" ),
|
||||
ChatHelpers.coloured(new TranslatableText( "gui.computercraft.tooltip.turn_off.key" ), Formatting.GRAY)
|
||||
ChatHelpers.coloured( new TranslatableText( "gui.computercraft.tooltip.turn_off.key" ), Formatting.GRAY )
|
||||
) : Arrays.asList(
|
||||
new TranslatableText( "gui.computercraft.tooltip.turn_on" ),
|
||||
ChatHelpers.coloured(new TranslatableText( "gui.computercraft.tooltip.turn_off.key" ), Formatting.GRAY)
|
||||
ChatHelpers.coloured( new TranslatableText( "gui.computercraft.tooltip.turn_off.key" ), Formatting.GRAY )
|
||||
)
|
||||
) );
|
||||
|
||||
@@ -69,12 +69,12 @@ public final class ComputerSidebar
|
||||
TEXTURE, TEX_SIZE, TEX_SIZE, b -> computer.queueEvent( "terminate" ),
|
||||
Arrays.asList(
|
||||
new TranslatableText( "gui.computercraft.tooltip.terminate" ),
|
||||
ChatHelpers.coloured(new TranslatableText( "gui.computercraft.tooltip.terminate.key" ), Formatting.GRAY)
|
||||
ChatHelpers.coloured( new TranslatableText( "gui.computercraft.tooltip.terminate.key" ), Formatting.GRAY )
|
||||
)
|
||||
) );
|
||||
}
|
||||
|
||||
public static void renderBackground(MatrixStack transform, int x, int y )
|
||||
public static void renderBackground( MatrixStack transform, int x, int y )
|
||||
{
|
||||
Screen.drawTexture( transform,
|
||||
x, y, 0, 102, WIDTH, FULL_BORDER,
|
||||
|
@@ -6,9 +6,7 @@
|
||||
package dan200.computercraft.client.gui.widgets;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.tooltip.TooltipComponent;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.LiteralText;
|
||||
@@ -19,7 +17,6 @@ import javax.annotation.Nonnull;
|
||||
import java.util.List;
|
||||
import java.util.function.IntSupplier;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Version of {@link net.minecraft.client.gui.widget.TexturedButtonWidget} which allows changing some properties
|
||||
@@ -68,7 +65,7 @@ public class DynamicImageButton extends ButtonWidget
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(@Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks )
|
||||
public void renderButton( @Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks )
|
||||
{
|
||||
RenderSystem.setShaderTexture( 0, texture );
|
||||
RenderSystem.disableDepthTest();
|
||||
@@ -90,7 +87,7 @@ public class DynamicImageButton extends ButtonWidget
|
||||
return tooltip.isEmpty() ? LiteralText.EMPTY : tooltip.get( 0 );
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @Override
|
||||
public void renderToolTip( @Nonnull MatrixStack stack, int mouseX, int mouseY )
|
||||
{
|
||||
List<Text> tooltip = this.tooltip.get();
|
||||
|
@@ -8,30 +8,25 @@ package dan200.computercraft.client.gui.widgets;
|
||||
|
||||
import dan200.computercraft.client.gui.FixedWidthFontRenderer;
|
||||
import dan200.computercraft.core.terminal.Terminal;
|
||||
import dan200.computercraft.shared.command.text.ChatHelpers;
|
||||
import dan200.computercraft.shared.computer.core.ClientComputer;
|
||||
import dan200.computercraft.shared.computer.core.IComputer;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.Element;
|
||||
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
|
||||
import net.minecraft.client.gui.widget.ClickableWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.ChatUtil;
|
||||
import net.minecraft.util.math.Matrix4f;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.BitSet;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static dan200.computercraft.client.gui.FixedWidthFontRenderer.FONT_HEIGHT;
|
||||
import static dan200.computercraft.client.gui.FixedWidthFontRenderer.FONT_WIDTH;
|
||||
import static dan200.computercraft.client.render.ComputerBorderRenderer.MARGIN;
|
||||
|
||||
public class WidgetTerminal extends ClickableWidget {
|
||||
public class WidgetTerminal extends ClickableWidget
|
||||
{
|
||||
private static final float TERMINATE_TIME = 0.5f;
|
||||
|
||||
private final ClientComputer computer;
|
||||
@@ -54,7 +49,7 @@ public class WidgetTerminal extends ClickableWidget {
|
||||
|
||||
public WidgetTerminal( @Nonnull ClientComputer computer, int x, int y, int termWidth, int termHeight )
|
||||
{
|
||||
super( x, y, termWidth * FONT_WIDTH + MARGIN * 2, termHeight * FONT_HEIGHT + MARGIN * 2, LiteralText.EMPTY);
|
||||
super( x, y, termWidth * FONT_WIDTH + MARGIN * 2, termHeight * FONT_HEIGHT + MARGIN * 2, LiteralText.EMPTY );
|
||||
|
||||
this.computer = computer;
|
||||
|
||||
@@ -70,7 +65,7 @@ public class WidgetTerminal extends ClickableWidget {
|
||||
if( ch >= 32 && ch <= 126 || ch >= 160 && ch <= 255 ) // printable chars in byte range
|
||||
{
|
||||
// Queue the "char" event
|
||||
queueEvent( "char", Character.toString( ch ));
|
||||
queueEvent( "char", Character.toString( ch ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -351,7 +346,7 @@ public class WidgetTerminal extends ClickableWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(@Nonnull MatrixStack transform, int mouseX, int mouseY, float partialTicks )
|
||||
public void render( @Nonnull MatrixStack transform, int mouseX, int mouseY, float partialTicks )
|
||||
{
|
||||
if( !visible ) return;
|
||||
Matrix4f matrix = transform.peek().getModel();
|
||||
@@ -367,7 +362,8 @@ public class WidgetTerminal extends ClickableWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendNarrations(NarrationMessageBuilder builder) {
|
||||
public void appendNarrations( NarrationMessageBuilder builder )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@@ -19,14 +19,11 @@ import dan200.computercraft.shared.ComputerCraftRegistry;
|
||||
import dan200.computercraft.shared.common.ContainerHeldItem;
|
||||
import dan200.computercraft.shared.common.IColouredItem;
|
||||
import dan200.computercraft.shared.common.TileGeneric;
|
||||
import dan200.computercraft.shared.computer.blocks.TileComputer;
|
||||
//import dan200.computercraft.shared.computer.inventory.ContainerComputer;
|
||||
import dan200.computercraft.shared.computer.inventory.ContainerComputerBase;
|
||||
import dan200.computercraft.shared.computer.inventory.ContainerViewComputer;
|
||||
import dan200.computercraft.shared.peripheral.diskdrive.ContainerDiskDrive;
|
||||
import dan200.computercraft.shared.peripheral.monitor.ClientMonitor;
|
||||
import dan200.computercraft.shared.peripheral.printer.ContainerPrinter;
|
||||
//import dan200.computercraft.shared.pocket.inventory.ContainerPocketComputer;
|
||||
import dan200.computercraft.shared.pocket.items.ItemPocketComputer;
|
||||
import dan200.computercraft.shared.turtle.inventory.ContainerTurtle;
|
||||
import dan200.computercraft.shared.util.Config;
|
||||
@@ -36,14 +33,12 @@ import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientBlockEntityEvents;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
|
||||
//import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
||||
import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry;
|
||||
import net.minecraft.client.item.ModelPredicateProvider;
|
||||
import net.minecraft.client.item.UnclampedModelPredicateProvider;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -137,7 +132,7 @@ public final class ComputerCraftProxyClient implements ClientModInitializer
|
||||
Identifier id = new Identifier( ComputerCraft.MOD_ID, name );
|
||||
for( Supplier<? extends Item> item : items )
|
||||
{
|
||||
FabricModelPredicateProviderRegistry.register( item.get(), id, getter );
|
||||
FabricModelPredicateProviderRegistry.register( item.get(), id, getter );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -54,7 +54,8 @@ public final class CableHighlightRenderer
|
||||
Matrix4f matrix4f = stack.peek()
|
||||
.getModel();
|
||||
Matrix3f normal = stack.peek().getNormal();
|
||||
shape.forEachEdge( ( x1, y1, z1, x2, y2, z2 ) -> { float xDelta = (float) (x2 - x1);
|
||||
shape.forEachEdge( ( x1, y1, z1, x2, y2, z2 ) -> {
|
||||
float xDelta = (float) (x2 - x1);
|
||||
float yDelta = (float) (y2 - y1);
|
||||
float zDelta = (float) (z2 - z1);
|
||||
float len = MathHelper.sqrt( xDelta * xDelta + yDelta * yDelta + zDelta * zDelta );
|
||||
@@ -64,11 +65,11 @@ public final class CableHighlightRenderer
|
||||
|
||||
consumer.vertex( matrix4f, (float) (x1 + xOffset), (float) (y1 + yOffset), (float) (z1 + zOffset) )
|
||||
.color( 0, 0, 0, 0.4f )
|
||||
.normal(normal, xDelta, yDelta, zDelta)
|
||||
.normal( normal, xDelta, yDelta, zDelta )
|
||||
.next();
|
||||
consumer.vertex( matrix4f, (float) (x2 + xOffset), (float) (y2 + yOffset), (float) (z2 + zOffset) )
|
||||
.color( 0, 0, 0, 0.4f )
|
||||
.normal(normal, xDelta, yDelta, zDelta)
|
||||
.normal( normal, xDelta, yDelta, zDelta )
|
||||
.next();
|
||||
} );
|
||||
|
||||
|
Reference in New Issue
Block a user