Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Budget CRIBus #105

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b8623b4
CRIB!!!!
Zorbatron Jul 29, 2024
fc19e43
textures oops
Zorbatron Jul 29, 2024
436c28f
extra debug
Zorbatron Jul 30, 2024
c09eb02
server checks
Zorbatron Jul 30, 2024
1e799d4
ghost circuit issues
Zorbatron Jul 30, 2024
088394b
guhhh
Zorbatron Aug 1, 2024
22f1ef1
IT WORKS
Zorbatron Aug 30, 2024
dda8e2b
Less debugging stuff
Zorbatron Aug 30, 2024
52e67b6
Re-add to MTEs from merge conflict
Zorbatron Aug 30, 2024
b50ca52
CRIB now notifies properly
Zorbatron Aug 30, 2024
e28d6ba
Add blocking to CRIBs and allow slots to hold up to MAX_INT amount of…
Zorbatron Aug 30, 2024
041c45c
Make the item amount more readable
Zorbatron Aug 30, 2024
d460a19
Only load the Budget CRIB if AE2 is present
Zorbatron Aug 30, 2024
6da587a
Drop the pattern when broken
Zorbatron Aug 31, 2024
95d3c98
Make the Budget CRIB EV tiered
Zorbatron Aug 31, 2024
f350fec
Whoops
Zorbatron Aug 31, 2024
98a1043
Spotless
Zorbatron Aug 31, 2024
d0412a4
Fixed the crib not properly checking if it had a connection to a netw…
Zorbatron Aug 31, 2024
592613f
Less icky UI
Zorbatron Aug 31, 2024
0c5d7bd
Less icky UI
Zorbatron Aug 31, 2024
5991b10
Add returning the items on button press or when the CRIB is broken
Zorbatron Aug 31, 2024
6a29502
CRIB proxy!!!!
Zorbatron Aug 31, 2024
c39441f
I guess it mostly works
Zorbatron Sep 1, 2024
da3d460
Merge branch 'main' into budget-crib
Zorbatron Dec 6, 2024
92ad00e
Merge in main and fix pattern not being reset when removed
Zorbatron Dec 6, 2024
300f468
Dynamic linking and proper notifying
Zorbatron Dec 7, 2024
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
10 changes: 10 additions & 0 deletions src/main/java/com/zorbatron/zbgt/api/render/ZBGTTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ public class ZBGTTextures {
public static SimpleOverlayRenderer SWIRLY_INFINITY;
public static SimpleOverlayRenderer YOTTANK_ME_HATCH;
public static SimpleOverlayRenderer MAINTENANCE_OVERLAY_STERILE;
public static SimpleOverlayRenderer CRIB_ACTIVE;
public static SimpleOverlayRenderer CRIB_INACTIVE;
public static SimpleOverlayRenderer CRIB_PROXY;

// GUI overlays
public static TextureArea ITEM_FLUID_OVERLAY;
public static TextureArea AUTO_PULL;
public static TextureArea PME;
public static TextureArea AE2_RW_STATES;
public static TextureArea SLIME_BALL;
public static TextureArea ME_PATTERN_OVERLAY;
public static TextureArea EXPORT;

public static TextureArea PROGRESS_BAR_CoAL;

Expand All @@ -44,12 +49,17 @@ public static void preInit() {
SWIRLY_INFINITY = new SimpleOverlayRenderer("overlay/machine/swirly_infinity");
YOTTANK_ME_HATCH = new SimpleOverlayRenderer("overlay/machine/yottank_me_hatch");
MAINTENANCE_OVERLAY_STERILE = new SimpleOverlayRenderer("overlay/machine/overlay_maintenance_sterile");
CRIB_ACTIVE = new SimpleOverlayRenderer("overlay/machine/OVERLAY_ME_CRAFTING_INPUT_BUFFER");
CRIB_INACTIVE = new SimpleOverlayRenderer("overlay/machine/OVERLAY_ME_CRAFTING_INPUT_BUS");
CRIB_PROXY = new SimpleOverlayRenderer("overlay/machine/OVERLAY_ME_CRAFTING_INPUT_SLAVE");

ITEM_FLUID_OVERLAY = TextureArea.fullImage("textures/gui/widget/item_fluid.png");
AUTO_PULL = TextureArea.fullImage("textures/gui/widget/auto_pull.png");
PME = TextureArea.fullImage("textures/gui/widget/pme.png");
AE2_RW_STATES = TextureArea.fullImage("textures/gui/widget/ae2_rw_states.png");
SLIME_BALL = TextureArea.fullImage("textures/gui/widget/slimeball.png");
ME_PATTERN_OVERLAY = TextureArea.fullImage("textures/gui/widget/pattern_me.png");
EXPORT = TextureArea.fullImage("textures/gui/widget/export.png");

PROGRESS_BAR_CoAL = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_component_al.png");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package com.zorbatron.zbgt.client.widgets;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
Expand All @@ -17,9 +13,10 @@
import gregtech.api.util.Position;
import gregtech.api.util.Size;

public class PhantomSlotNoTextWidget extends PhantomSlotWidget {
public class PhantomSlotNoAmountTextWidget extends PhantomSlotWidget {

public PhantomSlotNoTextWidget(IItemHandlerModifiable itemHandler, int slotIndex, int xPosition, int yPosition) {
public PhantomSlotNoAmountTextWidget(IItemHandlerModifiable itemHandler, int slotIndex, int xPosition,
int yPosition) {
super(itemHandler, slotIndex, xPosition, yPosition);
}

Expand Down Expand Up @@ -50,42 +47,13 @@ public void drawInBackground(int mouseX, int mouseY, float partialTicks, IRender
}
}
if (!itemStack.isEmpty()) {
GlStateManager.enableBlend();
GlStateManager.enableDepth();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
RenderHelper.disableStandardItemLighting();
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
GlStateManager.pushMatrix();
RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
// itemStack.setCount(1);
itemRender.renderItemAndEffectIntoGUI(itemStack, pos.x + 1, pos.y + 1);
// itemRender.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, itemStack, pos.x + 1, pos.y +
// 1,
// null);
GlStateManager.enableAlpha();
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
// Set the stack count to 1 which doesn't show the amount text
itemStack.setCount(1);
drawItemStack(itemStack, pos.x + 1, pos.y + 1, null);
}
if (isActive()) {
if (slotReference instanceof ISlotWidget) {
if (isMouseOverElement(mouseX, mouseY)) {
GlStateManager.disableDepth();
GlStateManager.colorMask(true, true, true, false);
drawSolidRect(getPosition().x + 1, getPosition().y + 1, 16, 16, -2130706433);
GlStateManager.colorMask(true, true, true, true);
GlStateManager.enableDepth();
GlStateManager.enableBlend();
}
}
} else {
GlStateManager.disableDepth();
GlStateManager.colorMask(true, true, true, false);
drawSolidRect(getPosition().x + 1, getPosition().y + 1, 16, 16, 0xbf000000);
GlStateManager.colorMask(true, true, true, true);
GlStateManager.enableDepth();
GlStateManager.enableBlend();

if (isMouseOverElement(mouseX, mouseY)) {
drawSelectionOverlay(pos.x + 1, pos.y + 1, 16, 16);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class ZBGTMetaTileEntities {
public static MetaTileEntityLargeParallelHatch[] ZBGT_PARALLEL_HATCHES = new MetaTileEntityLargeParallelHatch[7];
public static MetaTileEntityYOTTankMEHatch YOTTANK_ME_HATCH;
public static MetaTileEntitySterileCleaningHatch STERILE_CLEANING_HATCH;
public static MetaTileEntityBudgetCRIB BUDGET_CRIB;
public static MetaTileEntityBudgetCRIBProxy BUDGET_CRIB_PROXY;

public static MetaTileEntityMegaEBF MEGA_EBF;
public static MetaTileEntityMegaLCR MEGA_LCR;
Expand Down Expand Up @@ -104,6 +106,11 @@ public static void init() {
STERILE_CLEANING_HATCH = registerMetaTileEntity(18018,
new MetaTileEntitySterileCleaningHatch(zbgtId("sterile_cleaning_hatch")));

BUDGET_CRIB = registerMetaTileEntity(18019,
new MetaTileEntityBudgetCRIB(zbgtId("budget_crib")));
BUDGET_CRIB_PROXY = registerMetaTileEntity(18020,
new MetaTileEntityBudgetCRIBProxy(zbgtId("budget_crib_proxy")));

// 18050-18099 (50) reserved for multiblocks
MEGA_EBF = registerMetaTileEntity(18050,
new MetaTileEntityMegaEBF(zbgtId("mega_ebf")));
Expand Down
Loading
Loading