From 129a437d4ef8f641ce88b1deb4a9752f6f276ca1 Mon Sep 17 00:00:00 2001 From: Krapht Date: Sat, 26 Jan 2013 17:58:06 +0100 Subject: [PATCH] Added onBlockPlacedBy() wrapper to BlockGenericPipe and Pipe --- common/buildcraft/transport/BlockGenericPipe.java | 11 +++++++++++ common/buildcraft/transport/Pipe.java | 3 +++ 2 files changed, 14 insertions(+) diff --git a/common/buildcraft/transport/BlockGenericPipe.java b/common/buildcraft/transport/BlockGenericPipe.java index c1fe8f17..ea1e46ed 100644 --- a/common/buildcraft/transport/BlockGenericPipe.java +++ b/common/buildcraft/transport/BlockGenericPipe.java @@ -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; @@ -362,7 +363,17 @@ 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); diff --git a/common/buildcraft/transport/Pipe.java b/common/buildcraft/transport/Pipe.java index eeeca0e9..9588ed4c 100644 --- a/common/buildcraft/transport/Pipe.java +++ b/common/buildcraft/transport/Pipe.java @@ -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; @@ -122,6 +123,8 @@ public abstract class Pipe implements IPipe, IDropControlInventory { logic.onBlockPlaced(); transport.onBlockPlaced(); } + + public void onBlockPlacedBy(EntityLiving placer) {} public void onNeighborBlockChange(int blockId) { logic.onNeighborBlockChange(blockId);