-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
972 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/reobf/proghatches/ae/INodeAdditionCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package reobf.proghatches.ae; | ||
|
||
import appeng.api.networking.IGridCache; | ||
|
||
public interface INodeAdditionCallback extends IGridCache { | ||
|
||
} |
97 changes: 97 additions & 0 deletions
97
src/main/java/reobf/proghatches/ae/ItemPartStorageProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package reobf.proghatches.ae; | ||
|
||
|
||
|
||
import java.util.List; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import appeng.api.AEApi; | ||
import appeng.api.parts.IPartItem; | ||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
import net.minecraft.client.renderer.texture.IIconRegister; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
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 reobf.proghatches.eucrafting.PartEUP2PInterface; | ||
|
||
public class ItemPartStorageProxy extends Item implements IPartItem { | ||
|
||
public ItemPartStorageProxy() { | ||
this.setMaxStackSize(64); | ||
|
||
AEApi.instance().partHelper().setItemBusRenderer(this); | ||
} | ||
@Override | ||
public void getSubItems(Item itemIn, CreativeTabs p_150895_2_, List list) { | ||
|
||
list.add(new ItemStack(itemIn, 1, 0)); | ||
list.add(new ItemStack(itemIn, 1, 1)); | ||
list.add(new ItemStack(itemIn, 1, 2)); | ||
} | ||
|
||
@Override | ||
public boolean getHasSubtypes() { | ||
|
||
return true; | ||
} | ||
@Override | ||
public String getUnlocalizedName(ItemStack stack) { | ||
|
||
return super.getUnlocalizedName(stack)+"."+stack.getItemDamage(); | ||
} | ||
@Nullable | ||
@Override | ||
public PartStorageProxy createPartFromItemStack(ItemStack is) { | ||
return new PartStorageProxy(is); | ||
} | ||
@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.amountmaintainer.name.tooltip.0")); | ||
//p_77624_3_.add(StatCollector.translateToLocal("item.amountmaintainer.name.tooltip.1")); | ||
//p_77624_3_.add(StatCollector.translateToLocal("item.amountmaintainer.name.tooltip.2")); | ||
|
||
super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); | ||
} | ||
@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 _iconRegister) { | ||
|
||
itemIcon=_iconRegister.registerIcon("proghatches:proxy_item_part"); | ||
alt=_iconRegister.registerIcon("proghatches:proxy_fluid_part"); | ||
alt2=_iconRegister.registerIcon("proghatches:proxy_item_adv_part"); | ||
} | ||
IIcon alt; | ||
IIcon alt2; | ||
@Override | ||
public IIcon getIconIndex(ItemStack p_77650_1_) { | ||
if(p_77650_1_.getItemDamage()==1)return alt; | ||
if(p_77650_1_.getItemDamage()==0)return alt2; | ||
return super.getIconIndex(p_77650_1_); | ||
} | ||
@Override | ||
@SideOnly(Side.CLIENT) | ||
public int getSpriteNumber() { | ||
return 0; | ||
} | ||
|
||
} | ||
|
93 changes: 93 additions & 0 deletions
93
src/main/java/reobf/proghatches/ae/ItemPartSubnetExciter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package reobf.proghatches.ae; | ||
|
||
import java.util.List; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import appeng.api.AEApi; | ||
import appeng.api.parts.IPartItem; | ||
import cpw.mods.fml.relauncher.Side; | ||
import cpw.mods.fml.relauncher.SideOnly; | ||
import net.minecraft.client.renderer.texture.IIconRegister; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
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; | ||
|
||
public class ItemPartSubnetExciter extends Item implements IPartItem { | ||
|
||
public ItemPartSubnetExciter() { | ||
this.setMaxStackSize(64); | ||
|
||
AEApi.instance().partHelper().setItemBusRenderer(this); | ||
} | ||
@Override | ||
public void getSubItems(Item itemIn, CreativeTabs p_150895_2_, List list) { | ||
|
||
list.add(new ItemStack(itemIn, 1, 0)); | ||
|
||
} | ||
|
||
@Override | ||
public boolean getHasSubtypes() { | ||
|
||
return true; | ||
} | ||
@Override | ||
public String getUnlocalizedName(ItemStack stack) { | ||
|
||
return super.getUnlocalizedName(stack)+"."+stack.getItemDamage(); | ||
} | ||
@Nullable | ||
@Override | ||
public PartSubnetExciter createPartFromItemStack(ItemStack is) { | ||
return new PartSubnetExciter(is); | ||
} | ||
@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.exciter.name.tooltip.0")); | ||
p_77624_3_.add(StatCollector.translateToLocal("item.exciter.name.tooltip.1")); | ||
p_77624_3_.add(StatCollector.translateToLocal("item.exciter.name.tooltip.2")); | ||
p_77624_3_.add(StatCollector.translateToLocal("item.exciter.name.tooltip.3")); | ||
//p_77624_3_.add(StatCollector.translateToLocal("item.amountmaintainer.name.tooltip.1")); | ||
//p_77624_3_.add(StatCollector.translateToLocal("item.amountmaintainer.name.tooltip.2")); | ||
|
||
super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_); | ||
} | ||
@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 _iconRegister) { | ||
|
||
itemIcon=_iconRegister.registerIcon("minecraft:stone"); | ||
|
||
} | ||
|
||
@Override | ||
public IIcon getIconIndex(ItemStack p_77650_1_) { | ||
|
||
return super.getIconIndex(p_77650_1_); | ||
} | ||
@Override | ||
@SideOnly(Side.CLIENT) | ||
public int getSpriteNumber() { | ||
return 0; | ||
} | ||
|
||
} | ||
|
53 changes: 53 additions & 0 deletions
53
src/main/java/reobf/proghatches/ae/NodeAdditionCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package reobf.proghatches.ae; | ||
|
||
import appeng.api.networking.IGrid; | ||
import appeng.api.networking.IGridHost; | ||
import appeng.api.networking.IGridNode; | ||
import appeng.api.networking.IGridStorage; | ||
|
||
public class NodeAdditionCallback implements INodeAdditionCallback{ | ||
|
||
public NodeAdditionCallback(final IGrid g) { | ||
grid=g; | ||
}IGrid grid; | ||
@Override | ||
public void onUpdateTick() { | ||
|
||
|
||
} | ||
|
||
@Override | ||
public void removeNode(IGridNode gridNode, IGridHost machine) { | ||
grid.getMachines(PartSubnetExciter.class).forEach(s-> | ||
((PartSubnetExciter)s.getMachine()).check(gridNode) | ||
); | ||
|
||
} | ||
|
||
@Override | ||
public void onSplit(IGridStorage destinationStorage) { | ||
|
||
|
||
} | ||
|
||
@Override | ||
public void onJoin(IGridStorage sourceStorage) { | ||
|
||
|
||
} | ||
|
||
@Override | ||
public void populateGridStorage(IGridStorage destinationStorage) { | ||
|
||
|
||
} | ||
|
||
@Override | ||
public void addNode(IGridNode gridNode, IGridHost machine) { | ||
grid.getMachines(PartSubnetExciter.class).forEach(s-> | ||
((PartSubnetExciter)s.getMachine()).gridChanged() | ||
); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.