Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.liukrast.deployer.lib;


import java.lang.Boolean;
import net.minecraft.resources.ResourceLocation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -10,7 +12,7 @@ private DeployerConstants() {}

public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

public static boolean PSIC_INSTALLED = false;
public static Boolean PSIC_INSTALLED = false;

public static ResourceLocation id(String path, Object... args) {
return ResourceLocation.fromNamespaceAndPath(MOD_ID, String.format(path, args));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.liukrast.deployer.lib.logistics.board;


import java.lang.Boolean;
import java.lang.Integer;
import com.mojang.serialization.Codec;
import com.simibubi.create.content.logistics.factoryBoard.*;
import com.simibubi.create.content.schematics.requirement.ItemRequirement;
Expand Down Expand Up @@ -50,11 +53,11 @@ public abstract class AbstractPanelBehaviour extends FactoryPanelBehaviour {
/**
* Common color used to warn the user that the connection is currently waiting for the next tick to update
* */
protected static final int WAITING = 0xffd541;
protected static final Integer WAITING = 0xffd541;
/**
* Common color used to warn the user that the connection doesn't do anything
* */
protected static final int DISABLED = 0x888898;
protected static final Integer DISABLED = 0x888898;

/**
* This constructor allows to modify the valueBoxTransform to make a custom input system
Expand Down Expand Up @@ -90,44 +93,44 @@ public Set<PanelConnection<?>> getConnections() {
/**
* @return Whether the panel has a precise connection, using forge's deferred holder
* */
public <T> boolean hasConnection(DeferredHolder<PanelConnection<?>, PanelConnection<T>> connection) {
public <T> Boolean hasConnection(DeferredHolder<PanelConnection<?>, PanelConnection<T>> connection) {
return hasConnection(connection.get());
}

/**
* @return Whether this behavior has a precise connection
* */
public boolean hasConnection(PanelConnection<?> connection) {
public Boolean hasConnection(PanelConnection<?> connection) {
return connections.containsKey(connection);
}

/**
* @param shortenNumbers whether the display is in mode "shortened" or "full_number"
* @return The component for display links
* */
public MutableComponent getDisplayLinkComponent(boolean shortenNumbers) {
public MutableComponent getDisplayLinkComponent(Boolean shortenNumbers) {
return Component.empty();
}

/**
* Whether the panel should skip calling {@link FactoryPanelBehaviour#tick()}
* */
public boolean skipOriginalTick() {
public Boolean skipOriginalTick() {
return true;
}

/**
* @return Whether the panel should render its bulb
* */
public boolean shouldRenderBulb(boolean original) {
public Boolean shouldRenderBulb(Boolean original) {
return false;
}

/**
* Since original class extends {@link com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour},
* return true if you want this gauge to have the render from filtering behavior.
* */
public boolean withFilteringBehaviour() {
public Boolean withFilteringBehaviour() {
return false;
}

Expand All @@ -142,16 +145,16 @@ public boolean withFilteringBehaviour() {
public abstract PartialModel getModel(FactoryPanelBlock.PanelState panelState, FactoryPanelBlock.PanelType panelType);

/**
* An easier extension of {@link AbstractPanelBehaviour#write(CompoundTag, HolderLookup.Provider, boolean)}.
* An easier extension of {@link AbstractPanelBehaviour#write(CompoundTag, HolderLookup.Provider, Boolean)}.
* @param nbt The compound tag of the single gauge slot. Save your data into this
* */
public void easyWrite(CompoundTag nbt, HolderLookup.Provider registries, boolean clientPacket) {}
public void easyWrite(CompoundTag nbt, HolderLookup.Provider registries, Boolean clientPacket) {}

/**
* An easier extension of {@link AbstractPanelBehaviour#read(CompoundTag, HolderLookup.Provider, boolean)}.
* An easier extension of {@link AbstractPanelBehaviour#read(CompoundTag, HolderLookup.Provider, Boolean)}.
* @param nbt The compound tag of the single gauge slot. Read your data from this slot
* */
public void easyRead(CompoundTag nbt, HolderLookup.Provider registries, boolean clientPacket) {}
public void easyRead(CompoundTag nbt, HolderLookup.Provider registries, Boolean clientPacket) {}

/**
* Opens the editor screen for this panel
Expand All @@ -169,22 +172,22 @@ public void displayScreen(Player player) {
* since most of the custom gauges do not actually need a custom item inside to connect.
* @return whether it should ignore or not the issue inserted.
* */
public boolean ignoreIssue(@Nullable String issue) {
public Boolean ignoreIssue(@Nullable String issue) {
return "factory_panel.no_item".equals(issue);
}

/**
* Generates color per connections with other gauges.
* @param original the original color a normal gauge would return (just in case you needed)
* */
public int calculatePath(FactoryPanelBehaviour other, int original) {
public Integer calculatePath(FactoryPanelBehaviour other, Integer original) {
return DISABLED;
}

/**
* Generates color per connections with extra panel elements
* */
public int calculateExtraPath(BlockPos pos) {
public Integer calculateExtraPath(BlockPos pos) {
return DISABLED;
}

Expand Down Expand Up @@ -263,19 +266,19 @@ public <T> void consumeForExtra(PanelConnection<T> panelConnection, BiConsumer<B
}

/* UTIL METHODS IMPLEMENTATION */
public int getTimer() {
public Integer getTimer() {
return ((FactoryPanelBehaviourAccessor)this).timer();
}

public int getLastReportedLevelInStorage() {
public Integer getLastReportedLevelInStorage() {
return ((FactoryPanelBehaviourAccessor)this).lastReportedLevelInStorage();
}

public int getLastReportedUnloadedLinks() {
public Integer getLastReportedUnloadedLinks() {
return ((FactoryPanelBehaviourAccessor)this).lastReportedUnloadedLinks();
}

public int getLastReportedPromises() {
public Integer getLastReportedPromises() {
return ((FactoryPanelBehaviourAccessor)this).lastReportedPromises();
}

Expand All @@ -285,7 +288,7 @@ public PanelType<?> getPanelType() {
}

@Override
public AbstractContainerMenu createMenu(int containerId, Inventory playerInventory, Player player) {
public AbstractContainerMenu createMenu(Integer containerId, Inventory playerInventory, Player player) {
return null;
}

Expand All @@ -304,7 +307,7 @@ public void destroy() {
}

@Override
public void read(CompoundTag nbt, HolderLookup.Provider registries, boolean clientPacket) {
public void read(CompoundTag nbt, HolderLookup.Provider registries, Boolean clientPacket) {
super.read(nbt, registries, clientPacket);
CompoundTag panelTag = nbt.getCompound(CreateLang.asId(slot.name()));
if (panelTag.isEmpty()) {
Expand All @@ -325,7 +328,7 @@ public void writeSafe(CompoundTag nbt, HolderLookup.Provider registries) {
}

@Override
public void write(CompoundTag nbt, HolderLookup.Provider registries, boolean clientPacket) {
public void write(CompoundTag nbt, HolderLookup.Provider registries, Boolean clientPacket) {
CompoundTag special = nbt.contains("CustomPanels") ? nbt.getCompound("CustomPanels") : new CompoundTag();
special.putString(CreateLang.asId(slot.name()), Objects.requireNonNull(DeployerRegistries.PANEL.getKey(type)).toString());
nbt.put("CustomPanels", special);
Expand Down Expand Up @@ -359,7 +362,7 @@ public void write(CompoundTag nbt, HolderLookup.Provider registries, boolean cli
}

@Override
public boolean canShortInteract(ItemStack toApply) {
public Boolean canShortInteract(ItemStack toApply) {
return withFilteringBehaviour() && super.canShortInteract(toApply);
}

Expand All @@ -381,7 +384,7 @@ public void notifyRedstoneOutputs() {
}

@Override
public boolean acceptsValueSettings() {
public Boolean acceptsValueSettings() {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package net.liukrast.deployer.lib.logistics.board;


import java.lang.Boolean;
import java.lang.Float;
import java.lang.Integer;
import com.google.common.collect.Lists;
import com.simibubi.create.content.logistics.factoryBoard.FactoryPanelConfigurationPacket;
import com.simibubi.create.content.logistics.factoryBoard.FactoryPanelConnectionHandler;
Expand Down Expand Up @@ -27,7 +31,7 @@ public class BasicPanelScreen<T extends AbstractPanelBehaviour> extends Abstract
public static final ResourceLocation TEXTURE = DeployerConstants.id("textures/gui/generic_gauge.png");

public final T behaviour;
private boolean sendReset;
private Boolean sendReset;

public BasicPanelScreen(T behaviour) {
this(behaviour.getDisplayName(), behaviour);
Expand All @@ -38,24 +42,24 @@ public BasicPanelScreen(Component component, T behaviour) {
this.behaviour = behaviour;
}

public int getWindowWidth() {
public Integer getWindowWidth() {
return 0;
}

public int getWindowHeight() {
public Integer getWindowHeight() {
return 0;
}

@Override
protected void init() {
setWindowSize(getWindowWidth() + 106, getWindowHeight() + 46);
int sizeX = windowWidth;
int sizeY = windowHeight;
Integer sizeX = windowWidth;
Integer sizeY = windowHeight;
super.init();
clearWidgets();

int x = guiLeft;
int y = guiTop;
Integer x = guiLeft;
Integer y = guiTop;

assert minecraft != null;
IconButton confirmButton = new IconButton(x+sizeX-25, y+sizeY-24, AllIcons.I_CONFIRM);
Expand Down Expand Up @@ -98,9 +102,9 @@ public void onConfirm() {
}

@Override
protected void renderWindow(@NotNull GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
int x = guiLeft;
int y = guiTop;
protected void renderWindow(@NotNull GuiGraphics graphics, Integer mouseX, Integer mouseY, Float partialTicks) {
Integer x = guiLeft;
Integer y = guiTop;
graphics.drawCenteredString(font, title, x+windowWidth/2, y + 4, 0x3D3C48);
graphics.blit(TEXTURE,x, y, 0, 0, 53, 16);
graphics.blit(TEXTURE,x+windowWidth-106+53, y, 139, 0, 53, 16);
Expand All @@ -109,9 +113,9 @@ protected void renderWindow(@NotNull GuiGraphics graphics, int mouseX, int mouse
graphics.blit(TEXTURE,x+windowWidth-106+53, y+windowHeight-46+15, 139, 56, 60, 32);

if(windowWidth > 106) {
int r = windowWidth-106;
int r1 = r-3;
int step = 0;
Integer r = windowWidth-106;
Integer r1 = r-3;
Integer step = 0;
if(r > 1) graphics.blit(TEXTURE,x+windowWidth-106+52, y+windowHeight-46+15,138,56,1,32);
graphics.blit(TEXTURE, x+53,y+windowHeight-46+15,53,56,2,32);
while(r > 0 || r1 > 0) {
Expand All @@ -124,13 +128,13 @@ protected void renderWindow(@NotNull GuiGraphics graphics, int mouseX, int mouse
}

if(windowHeight > 47) {
int r = windowHeight-47;
int step = 0;
Integer r = windowHeight-47;
Integer step = 0;
graphics.blit(TEXTURE,x,y+16,0,16,53,Math.min(r, 40));
graphics.blit(TEXTURE,x+windowWidth-106+53,y+16,139,16,53,Math.min(r, 40));
if(windowWidth > 106) {
int r1 = windowWidth-106;
int step1 = 0;
Integer r1 = windowWidth-106;
Integer step1 = 0;
while(r1>0) {
graphics.blit(TEXTURE, x + 53 + step1*86, y+16, 53, 16, Math.min(r1, 86), Math.min(r, 40));
step1++;
Expand All @@ -141,8 +145,8 @@ protected void renderWindow(@NotNull GuiGraphics graphics, int mouseX, int mouse
while(r>0) {
graphics.blit(TEXTURE,x,y+56+step*36,0,20,53,Math.min(r, 36));
graphics.blit(TEXTURE,x+windowWidth-106+53,y+56+step*36,139,20,53,Math.min(r, 36));
int r1 = windowWidth-106;
int step1 = 0;
Integer r1 = windowWidth-106;
Integer step1 = 0;
while(r1>0) {
graphics.blit(TEXTURE, x + 53 + step1*86, y+56+step*36, 53, 20, Math.min(r1, 86), Math.min(r, 36));
step1++;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.liukrast.deployer.lib.logistics.board;


import java.lang.Boolean;
import com.simibubi.create.content.logistics.packagerLink.LogisticallyLinkedBehaviour;
import com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour;
import com.simibubi.create.foundation.utility.CreateLang;
Expand Down Expand Up @@ -28,7 +30,7 @@ public LogisticallyLinkedPanelBlockItem(Supplier<PanelType<?>> type, Properties
}

@Override
public boolean isFoil(@NotNull ItemStack stack) {
public Boolean isFoil(@NotNull ItemStack stack) {
return isTuned(stack);
}

Expand All @@ -45,7 +47,7 @@ public boolean isFoil(@NotNull ItemStack stack) {
return super.useOn(pContext);

LogisticallyLinkedBehaviour link = BlockEntityBehaviour.get(level, pos, LogisticallyLinkedBehaviour.TYPE);
boolean tuned = isTuned(stack);
Boolean tuned = isTuned(stack);

if (link != null) {
if (level.isClientSide)
Expand All @@ -67,7 +69,7 @@ public boolean isFoil(@NotNull ItemStack stack) {
}

@Override
protected boolean updateCustomBlockEntityTag(@NotNull BlockPos pos, @NotNull Level level, Player player, @NotNull ItemStack stack,
protected Boolean updateCustomBlockEntityTag(@NotNull BlockPos pos, @NotNull Level level, Player player, @NotNull ItemStack stack,
@NotNull BlockState state) {
return super.updateCustomBlockEntityTag(pos, level, player, fixCtrlCopiedStack(stack), state);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.liukrast.deployer.lib.logistics.board;


import java.lang.Boolean;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllSoundEvents;
import com.simibubi.create.content.logistics.factoryBoard.FactoryPanelBlock;
Expand Down Expand Up @@ -97,7 +99,7 @@ public void applyExtraPlacementData(BlockPlaceContext context, FactoryPanelBlock
player.displayClientMessage(message, true);
}

public boolean applyToSlot(FactoryPanelBlockEntity blockEntity, FactoryPanelBlock.PanelSlot slot, @Nullable UUID networkId) {
public Boolean applyToSlot(FactoryPanelBlockEntity blockEntity, FactoryPanelBlock.PanelSlot slot, @Nullable UUID networkId) {
var oldBehaviour = blockEntity.panels.get(slot);
if(oldBehaviour == null || !oldBehaviour.isActive()) {
var newBehaviour = getNewBehaviourInstance(blockEntity, slot);
Expand Down
Loading
Loading