Search in sources :

Example 6 with Item1N4148

use of club.nsdn.nyasamarailway.item.tool.Item1N4148 in project NyaSamaRailway by NSDN.

the class NSPCT10J method interactFirst.

@Override
public boolean interactFirst(EntityPlayer player) {
    if (MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, player))) {
        return true;
    } else if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != player) {
        return true;
    } else if (this.riddenByEntity != null && this.riddenByEntity != player) {
        return false;
    } else {
        if (player != null) {
            ItemStack stack = player.getCurrentEquippedItem();
            if (stack != null) {
                if (stack.getItem() instanceof Item1N4148 || stack.getItem() instanceof ItemNTP8Bit || stack.getItem() instanceof ItemNTP32Bit) {
                    return true;
                }
                if (stack.getItem() instanceof ItemMinecart)
                    return true;
            }
            if (!this.worldObj.isRemote) {
                player.mountEntity(this);
                player.addChatComponentMessage(new ChatComponentTranslation("info.nsr.x"));
            }
        }
        return true;
    }
}
Also used : ItemNTP32Bit(club.nsdn.nyasamarailway.item.tool.ItemNTP32Bit) ItemNTP8Bit(club.nsdn.nyasamarailway.item.tool.ItemNTP8Bit) Item1N4148(club.nsdn.nyasamarailway.item.tool.Item1N4148) ChatComponentTranslation(net.minecraft.util.ChatComponentTranslation) ItemMinecart(net.minecraft.item.ItemMinecart) MinecartInteractEvent(net.minecraftforge.event.entity.minecart.MinecartInteractEvent) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack)

Aggregations

Item1N4148 (club.nsdn.nyasamarailway.item.tool.Item1N4148)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)6 ItemStack (net.minecraft.item.ItemStack)6 ItemNTP32Bit (club.nsdn.nyasamarailway.item.tool.ItemNTP32Bit)4 ItemNTP8Bit (club.nsdn.nyasamarailway.item.tool.ItemNTP8Bit)4 ItemMinecart (net.minecraft.item.ItemMinecart)3 ChatComponentTranslation (net.minecraft.util.ChatComponentTranslation)3 MinecartInteractEvent (net.minecraftforge.event.entity.minecart.MinecartInteractEvent)3 IHighSpeedCart (club.nsdn.nyasamarailway.entity.IHighSpeedCart)1 NSPCT5 (club.nsdn.nyasamarailway.entity.cart.NSPCT5)1 NSPCT5L (club.nsdn.nyasamarailway.entity.cart.NSPCT5L)1 ItemNSPCT5 (club.nsdn.nyasamarailway.item.cart.ItemNSPCT5)1 ItemNSPCT5L (club.nsdn.nyasamarailway.item.cart.ItemNSPCT5L)1 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)1 Entity (net.minecraft.entity.Entity)1 EntityMinecart (net.minecraft.entity.item.EntityMinecart)1