Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Jun 2, 2024
1 parent 25ee6d4 commit 783a900
Show file tree
Hide file tree
Showing 66 changed files with 23,012 additions and 134 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ catch (Exception ignored) {

// Pulls version first from the VERSION env and then git tag
String identifiedVersion = null
String versionOverride = '0.0.14p3'
String versionOverride = '0.0.15'
try {
// Produce a version based on the tag, or for branches something like 0.2.2-configurable-maven-and-extras.38+43090270b6-dirty
if (versionOverride == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Duplicate methods named getSubBlocks with the parameters (Item, CreativeTabs, Li
*/
public class BlockEUInterface
extends
//DummySuper
appeng.block.AEBaseTileBlock
DummySuper
//appeng.block.AEBaseTileBlock
{

private IIcon back;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.JsonToNBT;
Expand All @@ -48,7 +49,10 @@
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
import com.gtnewhorizons.modularui.api.drawable.ItemDrawable;
import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable;
import com.gtnewhorizons.modularui.api.forge.ItemStackHandler;
import com.gtnewhorizons.modularui.api.forge.ListItemHandler;
import com.gtnewhorizons.modularui.api.math.Alignment;
import com.gtnewhorizons.modularui.api.math.Pos2d;
import com.gtnewhorizons.modularui.api.math.Size;
Expand All @@ -60,6 +64,7 @@
import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
import com.gtnewhorizons.modularui.common.widget.ButtonWidget;
import com.gtnewhorizons.modularui.common.widget.CycleButtonWidget;
import com.gtnewhorizons.modularui.common.widget.DrawableWidget;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget;
import com.gtnewhorizons.modularui.common.widget.Scrollable;
Expand Down Expand Up @@ -205,22 +210,25 @@ public BufferedDualInputHatch(int id, String name, String nameRegional, int tier
(optional.length > 0 ? optional
: reobf.proghatches.main.Config
.get("BDH",
ImmutableMap
.of("bufferNum", bufferNum, "cap",
format.format(fluidLimit(tier,mMultiFluid )),
"mMultiFluid", mMultiFluid, "slots",
itemLimit(tier), "stacksize",
(int) (64 * Math.pow(2, Math.max(tier - 3, 0)))))

))/* ) */;
ImmutableMap.<String,Object>builder()
.put("bufferNum", bufferNum)
.put("cap",format.format(fluidLimit(tier,mMultiFluid )))
.put("mMultiFluid", mMultiFluid)
.put("slots",itemLimit(tier))
.put("stacksize",(int) (64 * Math.pow(2, Math.max(tier - 3, 0))))
.put("fluidSlots", fluidSlots(tier))
.build())


));/* ) */
this.bufferNum = bufferNum;
initBackend();

}

public void initTierBasedField() {

if (mMultiFluid) {
super.initTierBasedField();
/*if (mMultiFluid) {
mStoredFluid = new ListeningFluidTank[] {
new ListeningFluidTank((int) (1000 * Math.pow(2, mTier)), this),
Expand All @@ -234,7 +242,7 @@ public void initTierBasedField() {
mStoredFluid = new ListeningFluidTank[] { new ListeningFluidTank((int) (4000 * Math.pow(2, mTier)), this) };
}

*/
}

public BufferedDualInputHatch(String mName, byte mTier, String[] mDescriptionArray, ITexture[][][] mTextures,
Expand Down Expand Up @@ -769,7 +777,7 @@ public void add1by1Slot(ModularWindow.Builder builder, int index, IDrawable... b
if (background.length == 0) {
background = new IDrawable[] { getGUITextureSet().getItemSlot() };
}
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 1).widgetCreator(get()).startFromSlot(1000)
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 1).startFromSlot(1000)
.endAtSlot(1000).background(background).build().setPos(3, 3));
}

Expand All @@ -779,7 +787,7 @@ public void add2by2Slots(ModularWindow.Builder builder, int index, IDrawable...
if (background.length == 0) {
background = new IDrawable[] { getGUITextureSet().getItemSlot() };
}
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 2).widgetCreator(get()).startFromSlot(1000)
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 2).startFromSlot(1000)
.endAtSlot(1003).background(background).build().setPos(3, 3));
}

Expand All @@ -789,7 +797,7 @@ public void add3by3Slots(ModularWindow.Builder builder, int index, IDrawable...
if (background.length == 0) {
background = new IDrawable[] { getGUITextureSet().getItemSlot() };
}
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3).widgetCreator(get()).startFromSlot(1000)
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 3).startFromSlot(1000)
.endAtSlot(1008).background(background).build().setPos(3, 3));
}

Expand All @@ -799,39 +807,13 @@ public void add4by4Slots(ModularWindow.Builder builder, int index, IDrawable...
if (background.length == 0) {
background = new IDrawable[] { getGUITextureSet().getItemSlot() };
}
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4).widgetCreator(get()).startFromSlot(1000)
builder.widget(SlotGroup.ofItemHandler(inventoryHandler, 4).startFromSlot(1000)
.endAtSlot(1015).background(background).build().setPos(3, 3)

);
}

private Function<BaseSlot, SlotWidget> get() {

return s -> new SlotWidget(s) {

//ItemStack is;

@Override
public void detectAndSendChanges(boolean init) {

// getContext().syncSlotContent(this.getMcSlot());
super.detectAndSendChanges(init);

/*
* ItemStack iss=this.getMcSlot().getStack();
* if(!ItemStack.areItemStacksEqual(is,iss))init=true;
* init=true;
* is=Optional.ofNullable(iss).map(ItemStack::copy).orElse(null)
* ; if (init || this.getMcSlot().isNeedsSyncing()) {
* getContext().syncSlotContent(this.getMcSlot()); if
* (this.getMcSlot().isNeedsSyncing()) { markForUpdate(); }
* this.getMcSlot().resetNeedsSyncing(); }
*/
}

};

}

private Widget createButtonBuffer(int id,int xoffset,int yoffset) {
// for(int i=0;i<bufferNum;i++)
Expand Down Expand Up @@ -865,7 +847,7 @@ private Widget createButtonBuffer(int id,int xoffset,int yoffset) {
}

static private final int BUFFER_0 = 1001;

protected ModularWindow createWindow(final EntityPlayer player, int index) {
DualInvBuffer inv0 = this.inv0.get(index);
final int WIDTH = 18 * 6 + 6;
Expand Down Expand Up @@ -1024,6 +1006,12 @@ public void addUIWidgets(Builder builder, UIBuildContext buildContext) {
buildContext.addSyncedWindow(BUFFER_0 + i, (s) -> createWindow(s, ii));
sc.widget(createButtonBuffer(i,0,0));
}





//.setPos(new Pos2d(getGUIWidth() - 18 - 3, 5)).setSize(16, 16)
builder.widget(sc.setSize(16*3,16*2).setPos(3,3));

builder.widget(createPowerSwitchButton(builder));
Expand Down
Loading

0 comments on commit 783a900

Please sign in to comment.