- 48
- 1
Доброго времени суток.
Есть код на блокирование ПКМ при открытии деревьяной двери.
Но почему-то просто не работает.
Прошу поправить.
Есть код на блокирование ПКМ при открытии деревьяной двери.
Но почему-то просто не работает.
Прошу поправить.
Java:
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
public class DD_LockDoor {
final World world = this.mc.theWorld;
final Minecraft mc = Minecraft.getMinecraft();
@SubscribeEvent
public void onPlayerInteractBlock(PlayerInteractEvent e) {
EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;
if(!player.capabilities.isCreativeMode) {
}
if(e.action == Action.RIGHT_CLICK_BLOCK) {
}
Block b = this.mc.theWorld.getBlock(e.x, e.y, e.z);
if(b.equals(Blocks.wooden_door )) {
e.setCanceled(true);
}
}
}