mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Made Placers be able to place anything again.
Yes. Really.
This commit is contained in:
parent
43c93f2e51
commit
8e93abf05a
1 changed files with 11 additions and 11 deletions
|
@ -138,22 +138,23 @@ public class WorldUtil{
|
||||||
}
|
}
|
||||||
|
|
||||||
//Redstone
|
//Redstone
|
||||||
else if(replaceable && stack.getItem() == Items.REDSTONE){
|
if(replaceable && stack.getItem() == Items.REDSTONE){
|
||||||
PosUtil.setBlock(offsetPos, world, Blocks.REDSTONE_WIRE, 0, 2);
|
PosUtil.setBlock(offsetPos, world, Blocks.REDSTONE_WIRE, 0, 2);
|
||||||
stack.stackSize--;
|
stack.stackSize--;
|
||||||
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Plants
|
//Plants
|
||||||
else if(replaceable && stack.getItem() instanceof IPlantable){
|
if(replaceable && stack.getItem() instanceof IPlantable){
|
||||||
if(((IPlantable)stack.getItem()).getPlant(world, offsetPos).getBlock().canPlaceBlockAt(world, offsetPos)){
|
if(((IPlantable)stack.getItem()).getPlant(world, offsetPos).getBlock().canPlaceBlockAt(world, offsetPos)){
|
||||||
if(world.setBlockState(offsetPos, ((IPlantable)stack.getItem()).getPlant(world, offsetPos), 2)){
|
if(world.setBlockState(offsetPos, ((IPlantable)stack.getItem()).getPlant(world, offsetPos), 2)){
|
||||||
stack.stackSize--;
|
stack.stackSize--;
|
||||||
|
return stack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Everything else
|
//Everything else
|
||||||
else{
|
|
||||||
try{
|
try{
|
||||||
EntityPlayer fake = FakePlayerUtil.getFakePlayer(world);
|
EntityPlayer fake = FakePlayerUtil.getFakePlayer(world);
|
||||||
stack.onItemUse(fake, world, offsetPos, fake.getActiveHand(), side.getOpposite(), 0.5F, 0.5F, 0.5F);
|
stack.onItemUse(fake, world, offsetPos, fake.getActiveHand(), side.getOpposite(), 0.5F, 0.5F, 0.5F);
|
||||||
|
@ -163,7 +164,6 @@ public class WorldUtil{
|
||||||
ModUtil.LOGGER.error("Something that places Blocks at "+offsetPos.getX()+", "+offsetPos.getY()+", "+offsetPos.getZ()+" in World "+world.provider.getDimension()+" threw an Exception! Don't let that happen again!", e);
|
ModUtil.LOGGER.error("Something that places Blocks at "+offsetPos.getX()+", "+offsetPos.getY()+", "+offsetPos.getZ()+" in World "+world.provider.getDimension()+" threw an Exception! Don't let that happen again!", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue