Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Jul 4, 2024
1 parent 422989d commit ddba450
Show file tree
Hide file tree
Showing 21 changed files with 519 additions and 48 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.17p3'
String versionOverride = '0.0.17p4'
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
12 changes: 12 additions & 0 deletions src/main/java/reobf/proghatches/eucrafting/EUUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
Expand Down Expand Up @@ -76,10 +77,16 @@ public static void open(EntityPlayer player, World world, int x, int y, int z, F
if (NetworkUtils.isClient() || player instanceof FakePlayer) {
return;
}


NBTTagCompound tag = player.getEntityData();
tag.setInteger(key, dir.ordinal());
MyMod.scheduled.addFirst(()->
{
MyMod.net.sendTo(new OpenPartGuiMessage(x, y, z, dir), (EntityPlayerMP) player);
EUUtil.PART_MODULAR_UI.open(player, player.worldObj, x, y, z);
}
);
}

public static void open(EntityPlayer player, World world, int x, int y, int z, ForgeDirection dir, boolean isout) {
Expand All @@ -89,8 +96,13 @@ public static void open(EntityPlayer player, World world, int x, int y, int z, F
NBTTagCompound tag = player.getEntityData();
tag.setInteger(key, dir.ordinal());
tag.setBoolean("extraarg", isout);
MyMod.scheduled.addFirst(()->
{
MyMod.net.sendTo(new OpenPartGuiMessage(x, y, z, dir).mark(isout), (EntityPlayerMP) player);
EUUtil.PART_MODULAR_UI.open(player, player.worldObj, x, y, z);
}
);

}

public static final UIInfo<?, ?> PART_MODULAR_UI = UIBuilder.of().container((player, world, x, y, z) -> {
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/reobf/proghatches/eucrafting/ILazer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package reobf.proghatches.eucrafting;

import com.github.technus.tectech.mechanics.pipe.IConnectsToEnergyTunnel;

import gregtech.api.interfaces.tileentity.IColoredTileEntity;

public interface ILazer extends IConnectsToEnergyTunnel,IColoredTileEntity{

}
17 changes: 17 additions & 0 deletions src/main/java/reobf/proghatches/eucrafting/ItemPartEUSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,42 @@
import appeng.api.parts.IPartItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.enums.GT_Values;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;

public class ItemPartEUSource extends Item implements IPartItem {

/**
*
*/
public ItemPartEUSource() {
this.setMaxStackSize(64);
// this.setUnlocalizedName(NameConst.ITEM_PART_FLUID_EXPORT);
AEApi.instance().partHelper().setItemBusRenderer(this);
setHasSubtypes(true);
}

@Nullable
@Override
public PartEUSource createPartFromItemStack(ItemStack is) {
return new PartEUSource(is);
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
int damage=stack.getItemDamage();
if(damage>=1&&damage<=15){
return StatCollector.translateToLocalFormatted("item.proghatches.part.eu.source.superconduct.name",GT_Values.VN[damage-1]);
}
if(damage>=16&&damage<=30){
return StatCollector.translateToLocalFormatted("item.proghatches.part.eu.source.normal.name",GT_Values.VN[damage-16]);
}
return super.getItemStackDisplayName(stack);
}

@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ public static class WailaDataProvider extends BasePartWailaDataProvider {
@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, IPart part, TileEntity te, NBTTagCompound tag,
World world, int x, int y, int z) {
if (PartEUP2PInterface.class.isInstance(part)) {
if (PartEUP2PInterface.class.isInstance(part)==false) {return super.getNBTData(player, part, te, tag, world, x, y, z);}



PartEUP2PInterface pt = PartEUP2PInterface.class.cast(part);
Expand Down Expand Up @@ -185,16 +186,16 @@ public NBTTagCompound getNBTData(EntityPlayerMP player, IPart part, TileEntity t
s.append(suc[0]);
tag.setString("io_pass", s.toString());
}
}


return tag;
}

@Override
public List<String> getWailaBody(IPart part, List<String> currentToolTip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
if (PartEUP2PInterface.class.isInstance(part)) {
currentToolTip.add(StatCollector.translateToLocalFormatted("proghatches.eu.interface.waila.V",
if (PartEUP2PInterface.class.isInstance(part)==false) {return super.getWailaBody(part, currentToolTip, accessor, config);}
currentToolTip.add(StatCollector.translateToLocalFormatted("proghatches.eu.interface.waila.V",
accessor.getNBTData().getLong("V")));
currentToolTip.add(StatCollector.translateToLocalFormatted("proghatches.eu.interface.waila.EA",
accessor.getNBTData().getLong("EA")));
Expand Down Expand Up @@ -266,7 +267,7 @@ public List<String> getWailaBody(IPart part, List<String> currentToolTip, IWaila
StatCollector.translateToLocalFormatted("proghatches.eu.interface.waila.pass.p2p")+
accessor.getNBTData().getString("io_pass"));
}
}

return super.getWailaBody(part, currentToolTip, accessor, config);
}

Expand Down Expand Up @@ -540,6 +541,7 @@ public TickRateModulation tickingRequest(IGridNode node, int ticksSinceLastCall)

returnItems();
duality.tickingRequest(node, ticksSinceLastCall);
dualityFluid.tickingRequest(node, ticksSinceLastCall);
boolean ok = false;
/* if (!this.isOutput()) {
Expand Down
Loading

0 comments on commit ddba450

Please sign in to comment.