Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Jan 30, 2025
1 parent 8031c93 commit 34f13b3
Show file tree
Hide file tree
Showing 16 changed files with 245 additions and 84 deletions.
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ dependencies {
compileOnly('com.github.GTNewHorizons:SC2:2.2.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Binnie:2.4.4:dev') {transitive = false}
api('curse.maven:PlayerAPI-228969:2248928') {transitive=false}
api('com.github.GTNewHorizons:BlockRenderer6343:1.2.16:dev'){transitive=false}
api('com.github.GTNewHorizons:BlockRenderer6343:1.3.2:dev'){transitive=false}

compileOnly("com.google.auto.value:auto-value-annotations:1.10.1") { transitive = false }
annotationProcessor("com.google.auto.value:auto-value:1.10.1")
Expand All @@ -123,7 +123,7 @@ dependencies {
// functionalTestImplementation('org.junit.platform:junit-platform-launcher')
// functionalTestImplementation('org.junit.platform:junit-platform-reporting')

runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
api('com.github.GTNewHorizons:EnderIO:2.8.22:dev')

// For testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.util.List;
import java.util.Map;
import java.util.Random;

import com.gtnewhorizons.modularui.api.UIInfos;
import com.gtnewhorizons.modularui.common.internal.network.NetworkUtils;
Expand All @@ -16,12 +17,15 @@
import appeng.items.tools.quartz.ToolQuartzCuttingKnife;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IIcon;
Expand All @@ -34,6 +38,7 @@

import net.minecraftforge.event.ForgeEventFactory;
import reobf.proghatches.block.INameAndTooltips;
import reobf.proghatches.oc.TileCardReader;

public class BlockCyclicPatternSubmitter extends BlockContainer implements INameAndTooltips{

Expand Down Expand Up @@ -202,4 +207,50 @@ public String getName(ItemStack p_77624_1_) {
// TODO Auto-generated method stub
return null;
}
Random field_149955_b=new Random();
public void breakBlock(World worldIn, int x, int y, int z, Block blockBroken, int meta)
{
TileCyclicPatternSubmitter tileentitychest = (TileCyclicPatternSubmitter)worldIn.getTileEntity(x, y, z);

if (tileentitychest != null)
{
for (int i1 = 0; i1 < tileentitychest.upgrade.length; ++i1)
{
ItemStack itemstack = tileentitychest.upgrade[i1];

if (itemstack != null)
{
float f = this.field_149955_b.nextFloat() * 0.8F + 0.1F;
float f1 = this.field_149955_b.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem;

for (float f2 = this.field_149955_b.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; worldIn.spawnEntityInWorld(entityitem))
{
int j1 = this.field_149955_b.nextInt(21) + 10;

if (j1 > itemstack.stackSize)
{
j1 = itemstack.stackSize;
}

itemstack.stackSize -= j1;
entityitem = new EntityItem(worldIn, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
float f3 = 0.05F;
entityitem.motionX = (double)((float)this.field_149955_b.nextGaussian() * f3);
entityitem.motionY = (double)((float)this.field_149955_b.nextGaussian() * f3 + 0.2F);
entityitem.motionZ = (double)((float)this.field_149955_b.nextGaussian() * f3);

if (itemstack.hasTagCompound())
{
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
}
}
}
}

worldIn.func_147453_f(x, y, z, blockBroken);
}

super.breakBlock(worldIn, x, y, z, blockBroken, meta);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ public void loadNBTData(NBTTagCompound aNBT) {
merge = aNBT.getBoolean("merge");
justHadNewItems = aNBT.getBoolean("justHadNewItems");
updateEveryTick = aNBT.getBoolean("updateEveryTick");
if(aNBT.hasKey("useNewGTPatternCachel"))useNewGTPatternCachel=aNBT.getBoolean("useNewGTPatternCachel");
if(aNBT.hasKey("useNewGTPatternCache"))useNewGTPatternCache=aNBT.getBoolean("useNewGTPatternCache");
preventSleep = aNBT.getInteger("preventSleep");
currentID=aNBT.getInteger("currentID" );

Expand Down Expand Up @@ -1465,7 +1465,7 @@ public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setBoolean("merge", merge);
aNBT.setBoolean("justHadNewItems", justHadNewItems);
aNBT.setBoolean("updateEveryTick", updateEveryTick);
aNBT.setBoolean("useNewGTPatternCachel", useNewGTPatternCachel);
aNBT.setBoolean("useNewGTPatternCache", useNewGTPatternCache);


aNBT.setInteger("preventSleep", preventSleep);
Expand Down Expand Up @@ -1632,11 +1632,11 @@ public Iterator<? extends IDualInputInventory> inventories() {

}

boolean useNewGTPatternCachel=true;
boolean useNewGTPatternCache=false;


private IDualInputInventory wrap(DualInvBuffer to){
if(to.PID>0&&useNewGTPatternCachel){
if(to.PID>0&&useNewGTPatternCache){

return new PatternDualInv(to);
}
Expand Down Expand Up @@ -2005,7 +2005,7 @@ public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDat
}
}
String prefix="";
if(sub.getInteger("patternID")>0){prefix=""+sub.getInteger("patternID");}
if(sub.getInteger("patternID")>0){prefix="<"+sub.getInteger("patternID")+">";}
if(sub.getInteger("patternID")==0&&!sub.getBoolean("empty")){prefix="△";}


Expand Down Expand Up @@ -2486,27 +2486,34 @@ protected ModularWindow createWindowEx(final EntityPlayer player) {
);



builder.widget(new CycleButtonWidget().setToggle(() -> useNewGTPatternCachel, (s) -> {
{useNewGTPatternCachel = s;

builder.widget(new CycleButtonWidget().setToggle(() -> useNewGTPatternCache, (s) -> {
{
if(MyMod.newGTCache){
useNewGTPatternCache = s;
if(useNewGTPatternCache==false){
resetMulti();
detailmap.clear();
inv0.forEach(sX->sX.PID=0);

}
}

if(useNewGTPatternCachel==false){
resetMulti();
detailmap.clear();
inv0.forEach(sX->sX.PID=0);

}
}

}).setStaticTexture(GTUITextures.OVERLAY_BUTTON_CHECKMARK)
.setVariableBackground(GTUITextures.BUTTON_STANDARD_TOGGLE).setTooltipShowUpDelay(TOOLTIP_DELAY)
.setPos(3 + 18 * 4, 3 + 18 * 0).setSize(18, 18)
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.0"))
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.1"))
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.2"))
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.3") )
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.3"))
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.4"))
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.5") ))
.addTooltip(StatCollector.translateToLocal("programmable_hatches.gt.newcrib.5"))
.addTooltip((MyMod.newGTCache)?"":StatCollector.translateToLocal("programmable_hatches.gt.newcrib.nosupport"))

)



Expand Down Expand Up @@ -2682,6 +2689,7 @@ public boolean enableCM() {

public void recordRecipe(DualInvBuffer thiz){
if(thiz.PID>0)return;
if(useNewGTPatternCache==false){return;}
Integer check = detailmap.getOrDefault(Recipe.fromBuffer(thiz, false),null);
if(check==null){
currentID++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,30 @@

import static gregtech.api.enums.Textures.BlockIcons.*;
import static gregtech.api.metatileentity.BaseTileEntity.TOOLTIP_DELAY;
import static reobf.proghatches.gt.metatileentity.DualInputHatch.INSERTION;

import java.io.IOException;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.IntConsumer;
import java.util.function.Supplier;
import java.util.stream.IntStream;
import java.util.stream.Stream;

import org.spongepowered.include.com.google.common.collect.ImmutableSet;

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.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
Expand All @@ -48,18 +34,13 @@
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraft.util.Tuple;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidTank;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.gson.internal.Streams;
import com.gtnewhorizons.modularui.api.ModularUITextures;
import com.gtnewhorizons.modularui.api.drawable.AdaptableUITexture;
import com.gtnewhorizons.modularui.api.drawable.IDrawable;
Expand All @@ -75,14 +56,12 @@
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.api.widget.Interactable;
import com.gtnewhorizons.modularui.api.widget.Widget;
import com.gtnewhorizons.modularui.api.widget.Widget.ClickData;
import com.gtnewhorizons.modularui.common.fluid.FluidStackTank;
import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot;
import com.gtnewhorizons.modularui.common.internal.wrapper.ModularUIContainer;
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.DynamicTextWidget;
import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget;
import com.gtnewhorizons.modularui.common.widget.FluidSlotWidget;
import com.gtnewhorizons.modularui.common.widget.Scrollable;
Expand All @@ -91,37 +70,23 @@
import com.gtnewhorizons.modularui.common.widget.SyncedWidget;
import com.gtnewhorizons.modularui.common.widget.TextWidget;

import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.config.Actionable;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridCache;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.IActionHost;
import appeng.api.networking.security.MachineSource;
import appeng.api.networking.storage.IStorageGrid;
import appeng.api.parts.IPartHost;
import appeng.api.storage.IExternalStorageHandler;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AECableType;
import appeng.core.Api;
import appeng.helpers.IInterfaceHost;
import appeng.me.helpers.IGridProxyable;
import appeng.util.item.AEFluidStack;
import appeng.util.item.AEItemStack;
import appeng.util.item.AEStack;
import gregtech.api.GregTechAPI;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
import gregtech.api.gui.modularui.GTUITextures;
import gregtech.api.interfaces.IConfigurationCircuitSupport;
import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.modularui.IAddGregtechLogo;
import gregtech.api.interfaces.modularui.IAddUIWidgets;
Expand All @@ -141,10 +106,8 @@
import gregtech.api.util.shutdown.ShutDownReasonRegistry;
import gregtech.common.tileentities.machines.IDualInputHatch;
import gregtech.common.tileentities.machines.IDualInputInventory;
import gregtech.common.tileentities.machines.MTEHatchCraftingInputME.PatternSlot;
import reobf.proghatches.eucrafting.AECover;
import reobf.proghatches.gt.metatileentity.util.BaseSlotPatched;
import reobf.proghatches.gt.metatileentity.util.IMultiCircuitSupport;
import reobf.proghatches.gt.metatileentity.util.IOnFillCallback;
import reobf.proghatches.gt.metatileentity.util.IProgrammingCoverBlacklisted;
import reobf.proghatches.gt.metatileentity.util.IRecipeProcessingAwareDualHatch;
Expand All @@ -157,7 +120,6 @@
import reobf.proghatches.main.MyMod;
import reobf.proghatches.main.registration.Registration;
import reobf.proghatches.net.UpgradesMessage;
import reobf.proghatches.util.ProghatchesUtil;

/**
* @author zyf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,10 @@ public static boolean addBus(IngredientDistributor thiz, IGregTechTileEntity aTi
protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {

super.drawTexts(screenElements, inventorySlot);

screenElements.setSpace(0);
screenElements.setPos(0, 0);
//make it look same on 2.7.2-
//2.7.2- set it to a non zero value
screenElements.widget(
new TextWidget().setStringSupplier(()->
lastfail==null?"":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,10 @@ public Collection<ItemStack> getCircuit() {
protected void drawTexts(DynamicPositionedColumn screenElements, SlotWidget inventorySlot) {

super.drawTexts(screenElements, inventorySlot);

screenElements.setSpace(0);
screenElements.setPos(0, 0);
//make it look same on 2.7.2-
//2.7.2- set it to a non zero value
screenElements.widget(
TextWidget.dynamicString(()->

Expand Down
Loading

0 comments on commit 34f13b3

Please sign in to comment.