mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 08:54:12 +00:00
Prevent breaking of tank air blocks in creative + survival
This commit is contained in:
1 parent
0213cd9206
commit
56e975335e
3 files changed
+27
-3
No files matched your search
@@ -1,5 +1,11 @@
|
||||
package tconstruct.util;
|
||||
|
||||
import tconstruct.blocks.TankAirBlock;
|
||||
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -1554,4 +1560,15 @@ public class TEventHandler
|
||||
}
|
||||
}
|
||||
|
||||
//Player interact event - prevent breaking of tank air blocks in creative
|
||||
@ForgeSubscribe
|
||||
public void playerInteract(PlayerInteractEvent event){
|
||||
if(event.action == Action.LEFT_CLICK_BLOCK){
|
||||
Block block = Block.blocksList[event.entity.worldObj.getBlockId(event.x, event.y, event.z)];
|
||||
if(block instanceof TankAirBlock){
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user