Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reobf committed Mar 1, 2025
1 parent e5f4a56 commit fa87fed
Show file tree
Hide file tree
Showing 18 changed files with 799 additions and 27 deletions.
2 changes: 2 additions & 0 deletions src/main/java/reobf/proghatches/ae/PartAmountMaintainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import appeng.api.networking.ticking.IGridTickable;
import appeng.api.networking.ticking.TickRateModulation;
import appeng.api.networking.ticking.TickingRequest;
import appeng.api.parts.BusSupport;
import appeng.api.parts.IPartCollisionHelper;
import appeng.api.parts.IPartRenderHelper;
import appeng.api.storage.IExternalStorageHandler;
Expand Down Expand Up @@ -1046,4 +1047,5 @@ public void validateLink() {
* return null;
* }
*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
Actionable.SIMULATE,
this.mySrc);
if (itemsToAdd == null) break;
itemsToAdd.setCraftable(false);
this.pushItemIntoTarget(destination, energy, inv, itemsToAdd);

if (itemToSend <= 0) break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public TickRateModulation tickingRequest(IGridNode node, int TicksSinceLastCall)
Actionable.SIMULATE,
this.mySrc);
if (itemsToAdd == null) break;
itemsToAdd.setCraftable(false);
// long before=itemToSend;
this.pushItemIntoTarget(te, energy, inv, itemsToAdd);
// if(before==itemToSend)break;
Expand Down
112 changes: 112 additions & 0 deletions src/main/java/reobf/proghatches/ae/part2/ItemPartCoW.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package reobf.proghatches.ae.part2;

import java.util.List;

import javax.annotation.Nullable;

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.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;

import appeng.api.AEApi;
import appeng.api.parts.IPart;
import appeng.api.parts.IPartItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ItemPartCoW extends Item implements IPartItem {

@SideOnly(Side.CLIENT)
private IIcon icon;

public ItemPartCoW() {
this.setMaxStackSize(64);

AEApi.instance()
.partHelper()
.setItemBusRenderer(this);
setHasSubtypes(true);
}

@Nullable
@Override
public IPart createPartFromItemStack(ItemStack is) {
return new PartCoW(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",GTValues.VN[
* damage-1]);
* }
* if(damage>=16&&damage<=30){
* return
* StatCollector.translateToLocalFormatted("item.proghatches.part.eu.source.normal.name",GTValues.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,
float xOffset, float yOffset, float zOffset) {
return AEApi.instance()
.partHelper()
.placeBus(player.getHeldItem(), x, y, z, side, player, world);
}

/*
* public ItemPartEUSource register() { //if (!Config.fluidIOBus) return
* null; GameRegistry.registerItem(this, NameConst.ITEM_PART_FLUID_EXPORT,
* FluidCraft.MODID); //setCreativeTab(FluidCraftingTabs.INSTANCE); return
* this; }
*/
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister register) {

this.icon = register.registerIcon("proghatches:cow");
}

@SideOnly(Side.CLIENT)
@Override
public IIcon getIconFromDamage(int dmg) {
return icon;
}

/*
* @Override
* public IIcon getIconIndex(ItemStack p_77650_1_) {
* return PartEUSource.a;
* }
*/
@Override
@SideOnly(Side.CLIENT)
public int getSpriteNumber() {
return 0;
}

@SideOnly(value = Side.CLIENT)
@Override
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.cow.tooltips.0"));
p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.cow.tooltips.1"));
p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.cow.tooltips.2"));
p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.cow.tooltips.3"));
p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.cow.tooltips.4"));
// p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.ma.p2p.tooltips.1"));
// p_77624_3_.add(StatCollector.translateToLocal("item.proghatches.part.ma.p2p.tooltips.2"));
//
super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
}

}
Loading

0 comments on commit fa87fed

Please sign in to comment.