Skip to content

Commit

Permalink
fix circuit compare
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Jun 7, 2024
1 parent ac2c60c commit 4603d3b
Show file tree
Hide file tree
Showing 14 changed files with 246 additions and 42 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.15p3'
String versionOverride = '0.0.15p4'
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
9 changes: 6 additions & 3 deletions src/main/java/reobf/proghatches/gt/cover/SmartArmCover.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.io.ByteArrayDataInput;
import com.google.gson.Gson;
import com.gtnewhorizons.modularui.api.drawable.Text;
import com.gtnewhorizons.modularui.api.drawable.UITexture;
import com.gtnewhorizons.modularui.api.math.Alignment;
import com.gtnewhorizons.modularui.api.math.Color;
Expand Down Expand Up @@ -455,9 +456,11 @@ protected void addUIWidgets(ModularWindow.Builder builder) {

.setPos(startX + spaceX, startY + spaceY).setSize(14 * 4, 14))

.widget(TextWidget.dynamicString(() -> {
return StatCollector
.translateToLocal("programmable_hatches.cover.smart.io." + getCoverData().io);
.widget(TextWidget.dynamicText(() -> {
return Text.localised("programmable_hatches.cover.smart.io." + getCoverData().io)
//StatCollector.translateToLocal()

;
}).setSynced(false).setTextAlignment(Alignment.CenterLeft).setDefaultColor(COLOR_TEXT_GRAY.get())
.setPos(startX + spaceX, 4 + startY + spaceY * 0))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package reobf.proghatches.gt.metatileentity;

import static gregtech.api.objects.XSTR.XSTR_INSTANCE;

import java.util.EnumSet;
import java.util.Optional;
import java.util.function.Consumer;

import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
Expand All @@ -12,10 +15,12 @@
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidTank;
import reobf.proghatches.gt.metatileentity.BufferedDualInputHatch.DualInvBuffer;
import reobf.proghatches.gt.metatileentity.util.MappingItemHandler;
import reobf.proghatches.lang.LangManager;

Expand Down Expand Up @@ -431,20 +436,21 @@ public boolean canFill(ForgeDirection side, Fluid aFluid) {

return false;
}
public class Inst extends PatternDualInputHatch{

public Inst(String mName, byte mTier, String[] mDescriptionArray, ITexture[][][] mTextures, boolean mMultiFluid,
int bufferNum) {super(mName, mTier, mDescriptionArray, mTextures, mMultiFluid, bufferNum);}
@Override
public boolean supportsFluids() {
return PatternDualInputHatch.this.supportsFluids();
}

}

@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {

return new PatternDualInputHatch(mName, mTier, mDescriptionArray, mTextures, mMultiFluid, bufferNum
){
@Override
public boolean supportsFluids() {
return PatternDualInputHatch.this.supportsFluids();
}

};


return new Inst(mName, mTier, mDescriptionArray, mTextures, mMultiFluid, bufferNum);
}
@Override
public void initTierBasedField() {
Expand Down Expand Up @@ -774,6 +780,30 @@ public void onBlockDestroyed() {
e.printStackTrace();
}
super.onBlockDestroyed();

IGregTechTileEntity te = this.getBaseMetaTileEntity();
World aWorld = te.getWorld();
int aX = te.getXCoord();
short aY = te.getYCoord();
int aZ = te.getZCoord();

for (int i = 0; i < pattern.length; i++) {
final ItemStack tItem = pattern[i];
if ((tItem != null) && (tItem.stackSize > 0)) {
final EntityItem tItemEntity = new EntityItem(aWorld, aX + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F,
aY + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F, aZ + XSTR_INSTANCE.nextFloat() * 0.8F + 0.1F,
new ItemStack(tItem.getItem(), tItem.stackSize, tItem.getItemDamage()));
if (tItem.hasTagCompound()) {
tItemEntity.getEntityItem().setTagCompound((NBTTagCompound) tItem.getTagCompound().copy());
}
tItemEntity.motionX = (XSTR_INSTANCE.nextGaussian() * 0.05D);
tItemEntity.motionY = (XSTR_INSTANCE.nextGaussian() * 0.25D);
tItemEntity.motionZ = (XSTR_INSTANCE.nextGaussian() * 0.05D);
aWorld.spawnEntityInWorld(tItemEntity);
tItem.stackSize = 0;
pattern[i] = null;
}
}
}
public int fluidLimit() {

Expand All @@ -793,4 +823,5 @@ boolean showFluidLimit() {
public int getInventoryFluidLimit() {
return Integer.MAX_VALUE;
}

}
Loading

0 comments on commit 4603d3b

Please sign in to comment.