blob: 1a355f9ec56e07f2b74e09cdb57127a4843b168b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package ihl.collector;
import ic2.api.item.ElectricItem;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class CollectorHeavyItem extends CollectorItem {
public CollectorHeavyItem()
{
super();
this.tier=2;
this.maxCharge=200000;
}
@Override
public boolean spawnEntityInWorld(World world, ItemStack itemStack,int x, int y ,int z)
{
CollectorHeavyEntity se = new CollectorHeavyEntity(world,x, y+1, z);
se.setEnergy(ElectricItem.manager.getCharge(itemStack), this.getMaxCharge(itemStack));
if(itemStack.stackTagCompound!=null)
{
se.hopperx = itemStack.stackTagCompound.getInteger("hopperx");
se.hoppery = itemStack.stackTagCompound.getInteger("hoppery");
se.hopperz = itemStack.stackTagCompound.getInteger("hopperz");
}
else
{
se.hopperx = x;
se.hoppery = y;
se.hopperz = z;
}
return world.spawnEntityInWorld(se);
}
}
|