Added onBlockPlacedBy() wrapper to BlockGenericPipe and Pipe
This commit is contained in:
parent
6ab8a50b64
commit
129a437d4e
2 changed files with 14 additions and 0 deletions
|
@ -19,6 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -363,6 +364,16 @@ public class BlockGenericPipe extends BlockContainer {
|
|||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving placer) {
|
||||
super.onBlockPlacedBy(world, x, y, z, placer);
|
||||
Pipe pipe = getPipe(world, x, y, z);
|
||||
|
||||
if (isValid(pipe)) {
|
||||
pipe.onBlockPlacedBy(placer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
|
||||
super.onBlockActivated(world, i, j, k, entityplayer, par6, par7, par8, par9);
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.Map;
|
|||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -123,6 +124,8 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
|
|||
transport.onBlockPlaced();
|
||||
}
|
||||
|
||||
public void onBlockPlacedBy(EntityLiving placer) {}
|
||||
|
||||
public void onNeighborBlockChange(int blockId) {
|
||||
logic.onNeighborBlockChange(blockId);
|
||||
transport.onNeighborBlockChange(blockId);
|
||||
|
|
Loading…
Reference in a new issue