• 0

    posted a message on Fix GUI Size for custom container

    I am having trouble fixing the size of my GUI. Here is a picture of the problem, and my code is below as well.



    TileEntity:


    public class TileEntityHardenedCrate extends TileEntity{
    	
    	public static int SIZE = 108;
    
    	//BASIC = 54
    	//HARDENED = 108
    	//SPARKLING = 153
    	//GEMMED = 216
    
        // This item handler will hold our nine inventory slots
        private ItemStackHandler itemStackHandler = new ItemStackHandler(SIZE) {
            @Override
            protected void onContentsChanged(int slot) {
                // We need to tell the tile entity that something has changed so
                // that the chest contents is persisted
            	TileEntityHardenedCrate.this.markDirty();
            }
        };
    
        @Override
    	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
    		compound.setTag("inventory", itemStackHandler.serializeNBT());
    		return super.writeToNBT(compound);
    	}
    	
    	@Override
    	public void readFromNBT(NBTTagCompound compound) {
    		itemStackHandler.deserializeNBT(compound.getCompoundTag("inventory"));
    		super.readFromNBT(compound);
    	}
    
        public boolean canInteractWith(EntityPlayer playerIn) {
            // If we are too far away from this tile entity you cannot use it
            return !isInvalid() && playerIn.getDistanceSq(pos.add(0.5D, 0.5D, 0.5D)) <= 64D;
        }
    
        @Override
        public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
            if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
                return true;
            }
            return super.hasCapability(capability, facing);
        }
    
        @Override
        public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
            if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
                return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemStackHandler);
            }
            return super.getCapability(capability, facing);
        }
    	
    }




    Container:

    public class HardenedCrateContainer extends Container{
    
     private int numRows;
     private TileEntityHardenedCrate te;
    
     public HardenedCrateContainer(IInventory playerInventory, TileEntityHardenedCrate te) {
     this.te = te;
    
     // This container references items out of our own inventory (the 9 slots we hold ourselves)
     // as well as the slots from the player inventory so that the user can transfer items between
     // both inventories. The two calls below make sure that slots are defined for both inventories.
     //addOwnSlots();
     //addPlayerSlots(playerInventory);
     addSlots(playerInventory);
     }
    
     private void addSlots(IInventory playerInventory) {
     IItemHandler itemHandler = this.te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
     this.numRows = te.SIZE/18;
     
     for(int y = 0; y < numRows; ++y) {
     for(int x = 0; x < 18; ++x) {
     this.addSlotToContainer(new SlotItemHandler(itemHandler, x + y * 9, 8 + x * 18, 18 + y * 18));
     }
     }
     
     for(int y = 0; y < 3; y++){
     for(int x = 0; x < 9; x++){
     this.addSlotToContainer(new Slot(playerInventory, x + y * 9 + 9, 8 + x * 18, 140 + y * 18));
     }
     }
     
     for(int x = 0; x < 9; x++){
     this.addSlotToContainer(new Slot(playerInventory, x, 8 + x * 18, 198));
     }
     
     }
    
     private void addPlayerSlots(IInventory playerInventory) {
     // Slots for the main inventory
     for (int row = 0; row < 3; ++row) {
     for (int col = 0; col < 9; ++col) {
     int x = 9 + col * 18;
     int y = row * 18 + 70;
     this.addSlotToContainer(new Slot(playerInventory, col + row * 9 + 10, x, y));
     }
     }
    
     // Slots for the hotbar
     for (int row = 0; row < 9; ++row) {
     int x = 9 + row * 18;
     int y = 58 + 70;
     this.addSlotToContainer(new Slot(playerInventory, row, x, y));
     }
     }
    
     private void addOwnSlots() {
     IItemHandler itemHandler = this.te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
     int numRows = te.SIZE / 9;
     for(int i = 0; i < numRows; ++i){
     for(int j = 0; j < 9; ++j)
     {
     this.addSlotToContainer(new SlotItemHandler(itemHandler, j + i*9, 8 + j*18, 18 + i*18));
     }
     }
     }
    
     @Override
     public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
     ItemStack itemstack = ItemStack.EMPTY;
     Slot slot = this.inventorySlots.get(index);
    
     if (slot != null && slot.getHasStack()) {
     ItemStack itemstack1 = slot.getStack();
     itemstack = itemstack1.copy();
    
     if (index < TileEntityBasicCrate.SIZE) {
     if (!this.mergeItemStack(itemstack1, TileEntityHardenedCrate.SIZE, this.inventorySlots.size(), true)) {
     return ItemStack.EMPTY;
     }
     } else if (!this.mergeItemStack(itemstack1, 0, TileEntityBasicCrate.SIZE, false)) {
     return ItemStack.EMPTY;
     }
    
     if (itemstack1.isEmpty()) {
     slot.putStack(ItemStack.EMPTY);
     } else {
     slot.onSlotChanged();
     }
     }
    
     return itemstack;
     }
    
     @Override
     public boolean canInteractWith(EntityPlayer playerIn) {
     return te.canInteractWith(playerIn);
     }
     
    }
    

    GUI:


    public class HardenedCrateGui extends GuiContainer {
    	//Basic = 175, 221
    	//Hardened = 337, 221
        public static final int WIDTH = 337;
        public static final int HEIGHT = 221;
    
        private static final ResourceLocation background = new ResourceLocation(Reference.MODID, "textures/gui/hardened_crate.png");
        private final InventoryPlayer playerInv;
    	private final TileEntityHardenedCrate te;
        
        
        public HardenedCrateGui(InventoryPlayer playerInv, TileEntityHardenedCrate containerTileEntity, HardenedCrateContainer hardenedCrateContainer) {
            super(hardenedCrateContainer);
            this.te = containerTileEntity;
            this.playerInv = playerInv;
            xSize = WIDTH;
            ySize = HEIGHT;
        }
    
        @Override
        protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
            mc.getTextureManager().bindTexture(background);
            drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
        }
        
        @Override
    	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
    		this.fontRenderer.drawString(OCBlocks.hardenedCrate.getUnlocalizedName(), 8, 6, 000000);
    		this.fontRenderer.drawString(this.playerInv.getDisplayName().getUnformattedText(), 8, this.ySize - 92, 000000);
    	}
        
    }



    Posted in: Modification Development
  • 0

    posted a message on Item with Inventory

    Hey guys, I am trying to make a backpack type item. I have managed to get the item to open a gui but when I put items into the item and close it the items disappear. Can anyone tell me what I'm doing wrong? My code is below..


    PackItem
    GuiHandler

    PackContainer


    I also have a small problem with the GUI slots being about one pixel too far to the left so if you spot the fix for that, then i'll be just as happy! :P

    Any help is appreciated!

    Posted in: Modification Development
  • 0

    posted a message on Looking for team members to help with 1.8 Updates!

    Hello, I am the author of the mods BetterArmor 2, Coal 2 Charcoal, and YARFTLM(Better Rotten Flesh). I am looking for someone to help me with updating BetterArmor 2's Armor and Tools, I know mostly how to do it, but I need help with the .JSON files, and textures. If interested just reply here or PM me!

    Thanks

    Posted in: Mods Discussion
  • 0

    posted a message on CyanideX's Project: Retexture
    My mod, BetterArmor 2 could use some textures! I have some, but I think I want something that stands out, and your textures do that. I love it!

    You can get the mod here: http://www.curse.com/mc-mods/minecraft/better-armor

    You can contact me here: https://twitter.com/bettermods

    I would love for you to make my textures, and I am not going to assume that you will. I am a big fan of you and your mod, and if you could make the textures for my mod I would be even happier! :D

    PS: If you know how to make a twitter texture, and have time. I would love for you to do it, and if you do it I would love you! :D
    Posted in: Mods Discussion
  • 0

    posted a message on Help a fellow modder solve and issue with flight
    Quote from coolAlias
    player.inventory.armorItemInSlot(3) may be null, in which case you crash when you try to call (null).getItem(). The solution is, of course, to check for null before you try to call any methods on it.

    Well I don't crash now, but I can't fly....
    Posted in: Modification Development
  • 0

    posted a message on Help a fellow modder solve and issue with flight
    Quote from CosmicDan
    Whatever is at line 20 in HoverEventHandler.java caused the crash, I can't tell (apparently it's a blank line).

    This is my line 20

    if(player.capabilities.isCreativeMode == true || player.inventory.armorItemInSlot(3).getItem() == HoverBoots.hoverboots){
    Posted in: Modification Development
  • 0

    posted a message on Help a fellow modder solve and issue with flight
    Quote from CosmicDan
    Where's the tick handler? Usually when something crashes and you don't know why, you share the crash log and the code relevant to where it crashed - dumping your whole mod code and making us slog through it is painful.

    One thing I'm asking is to use a EventHandler or TickHandler im using and EventHandler now and this is my crash log


    ---- Minecraft Crash Report ----
    // I'm sorry, Dave.

    Time: 7/18/14 6:58 PM
    Description: Ticking player

    java.lang.NullPointerException: Ticking player
    at com.jonessc6.hoverboots.core.handler.HoverEventHandler.onLivingUpdateEvent(HoverEventHandler.java:20)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_5_HoverEventHandler_onLivingUpdateEvent_LivingUpdateEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
    at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:276)
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1775)
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:341)
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:334)
    at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:329)
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:37)
    at net.minecraft.network.play.client.C03PacketPlayer$C06PacketPlayerPosLook.processPacket(C03PacketPlayer.java:271)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247)
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:736)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)


    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- Head --
    Stacktrace:
    at com.jonessc6.hoverboots.core.handler.HoverEventHandler.onLivingUpdateEvent(HoverEventHandler.java:20)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_5_HoverEventHandler_onLivingUpdateEvent_LivingUpdateEvent.invoke(.dynamic)
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
    at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:276)
    at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1775)
    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:341)

    -- Player being ticked --
    Details:
    Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
    Entity ID: 83
    Entity Name: ForgeDevName
    Entity's Exact location: -121.52, 64.00, -55.48
    Entity's Block location: World: (-122,64,-56), Chunk: (at 6,4,8 in -8,-4; contains blocks -128,0,-64 to -113,255,-49), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
    Entity's Momentum: 0.00, -0.08, 0.00
    Stacktrace:
    at net.minecraft.entity.player.EntityPlayerMP.onUpdateEntity(EntityPlayerMP.java:334)
    at net.minecraft.network.NetHandlerPlayServer.processPlayer(NetHandlerPlayServer.java:329)
    at net.minecraft.network.play.client.C03PacketPlayer.processPacket(C03PacketPlayer.java:37)
    at net.minecraft.network.play.client.C03PacketPlayer$C06PacketPlayerPosLook.processPacket(C03PacketPlayer.java:271)
    at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:247)

    -- Ticking connection --
    Details:
    Connection: [email protected]
    Stacktrace:
    at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:736)
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:624)
    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:495)
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:762)

    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 8 (amd64) version 6.2
    Java Version: 1.7.0_51, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 949755760 bytes (905 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
    FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    hoverboots{0.1.0.0} [Hover Boots] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Player Count: 1 / 8; [EntityPlayerMP['ForgeDevName'/83, l='New World', x=-121.52, y=64.00, z=-55.48]]
    Type: Integrated Server (map_client.txt)
    Is Modded: Definitely; Client brand changed to 'fml,forge'

    Posted in: Modification Development
  • 0

    posted a message on Help a fellow modder solve and issue with flight
    Quote from 4HeadTiger
    First of all, would I be right in assuming that you've declared your event handler somewhere? (it's just not in the main file, soooo...)

    Anyway, why bother with the armor tick in the second part of the code? I'd suggest removing it entirely and seeing if that solves the problem (note that it is redundant, since the living update event takes care of the flying stuff). I wouldn't have thought it would be the problem, but you know; MC is funny and the armor tick could easily be doing something bizarre and firing the last armor tick after the armor has been removed, or something...

    Anyway, because I'm OCD about things like this, there are a few tricks you can use in Java. First, null test isn't necessary with instanceof. Second, you can directly set a boolean value to the result of a logical test (redundant case switch).

     //No need for null test => just use instanceof (since null isn't an instance of anything)
    if (!(event.entityLiving instanceof EntityPlayer)) return;
    
    EntityPlayer player = (EntityPlayer) event.entity;
    
    //Now you can just set the flying in one line
    player.capabilities.allowFlying = player.capabilities.isCreativeMode || 
    (player.inventory.armorItemInSlot(3) != null 
    && player.inventory.armorItemInSlot(3).getItem() == HoverBoots.hoverboots);


    If you remove the armor tick stuff, and the player can still fly, then the problem lies somewhere else entirely.

    Every time I add a TickHandler it crashes Here is my code

    Main:

    package com.jonessc6.hoverboots;

    import net.java.games.input.Keyboard;
    import net.minecraft.client.Minecraft;
    import net.minecraft.client.settings.KeyBinding;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemArmor.ArmorMaterial;
    import net.minecraftforge.common.MinecraftForge;
    import net.minecraftforge.common.util.EnumHelper;

    import com.jonessc6.hoverboots.armor.ItemHoverBoots;
    import com.jonessc6.hoverboots.core.handler.HoverEventHandler;
    import com.jonessc6.hoverboots.core.proxys.CommonProxy;

    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.registry.GameRegistry;

    @Mod(modid="hoverboots", name="Hover Boots", version="0.1.0.0")
    public class HoverBoots {

    public static ArmorMaterial HoverBootsMaterial = EnumHelper.addArmorMaterial("Hover Boots Material", 40, new int[]{5, 6, 5, 4}, 75);

    @SidedProxy(clientSide = "com.jonessc6.hoverboots.core.proxys.ClientProxy", serverSide = "com.jonessc6.hoverboots.core.proxys.CommonProxy")
    public static CommonProxy proxy;

    public static Item hoverboots;

    @EventHandler
    public static void pre(FMLPreInitializationEvent event){

    hoverboots = new ItemHoverBoots(HoverBootsMaterial, HoverBoots.proxy.addArmor("Hover Boots"), 3).setUnlocalizedName("Hover Boots").setCreativeTab(CreativeTabs.tabCombat).setTextureName("hoverboots" + ":" + "Hover Boots");

    GameRegistry.registerItem(hoverboots, "Hover Boots");

    MinecraftForge.EVENT_BUS.register(new HoverEventHandler());

    }

    }




    Item Class:

    com.jonessc6.hoverboots.armor;import java.util.List;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemArmor;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
    import com.jonessc6.hoverboots.HoverBoots;
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    public class ItemHoverBoots extends ItemArmor {
    public ItemHoverBoots(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

    super(p_i45325_1_, p_i45325_2_, p_i45325_3_);
    this.setNoRepair();
    this.setMaxStackSize(1);

    }

    public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par2List, boolean par4){

    par2List.add("\u00a7a" + "Congratulations, you now have boots that fly!");

    }

    }


    EventHandler:

    com.jonessc6.hoverboots.core.handler;import net.minecraft.client.Minecraft;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
    import com.jonessc6.hoverboots.HoverBoots;
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    public class HoverEventHandler {

    @SubscribeEvent
    public void onLivingUpdateEvent(LivingUpdateEvent event){
    if ((event.entityLiving instanceof EntityPlayer)){
    EntityPlayer player = (EntityPlayer) event.entity;
    if(player.capabilities.isCreativeMode == true || player.inventory.armorItemInSlot(3).getItem() == HoverBoots.hoverboots){

    player.capabilities.allowFlying = true;
    }else{

    player.capabilities.allowFlying = false;

    }
    }
    }
    }


    CommonProxy:

    kage com.jonessc6.hoverboots.core.proxys;import cpw.mods.fml.common.gameevent.TickEvent;
    import cpw.mods.fml.relauncher.Side;

    public class CommonProxy {

    public int addArmor(String armor){

    return 0;

    }

    }


    ClientProxy:

    e com.jonessc6.hoverboots.core.proxys;import net.minecraft.client.Minecraft;
    import com.jonessc6.hoverboots.core.handler.HoverEventHandler;
    import cpw.mods.fml.client.registry.RenderingRegistry;
    import cpw.mods.fml.common.FMLCommonHandler;
    public class ClientProxy extends CommonProxy{
    public int addArmor(String armor){

    return RenderingRegistry.addNewArmourRendererPrefix(armor);

    }

    }
    Posted in: Modification Development
  • 0

    posted a message on Help a fellow modder solve and issue with flight
    I have created boots that allow the player to fly, and I want the flight to stop when the armor is taken off, but I'm having an issue where I can still fly with no armor on...



    Here is my source

    Main File:

    e com.jonessc6.hoverboots;import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemArmor.ArmorMaterial;
    import net.minecraftforge.common.util.EnumHelper;
    import com.jonessc6.hoverboots.armor.ItemHoverBoots;
    import com.jonessc6.hoverboots.core.proxys.CommonProxy;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.registry.GameRegistry;
    @Mod(modid="hoverboots", name="Hover Boots", version="0.1.0.0")
    public class HoverBoots {

    public static ArmorMaterial HoverBootsMaterial = EnumHelper.addArmorMaterial("Hover Boots Material", 40, new int[]{5, 6, 5, 4}, 75);

    @SidedProxy(clientSide = "com.jonessc6.hoverboots.core.proxys.ClientProxy", serverSide = "com.jonessc6.hoverboots.core.proxys.CommonProxy")
    public static CommonProxy proxy;

    public static Item hoverboots;

    @EventHandler
    public static void pre(FMLPreInitializationEvent event){

    hoverboots = new ItemHoverBoots(HoverBootsMaterial, HoverBoots.proxy.addArmor("Hover Boots"), 3).setUnlocalizedName("Hover Boots").setCreativeTab(CreativeTabs.tabCombat).setTextureName("hoverboots" + ":" + "Hover Boots");

    GameRegistry.registerItem(hoverboots, "Hover Boots");

    }
    }


    Armor File

    com.jonessc6.hoverboots.armor;import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemArmor;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.World;
    import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
    import com.jonessc6.hoverboots.HoverBoots;
    import cpw.mods.fml.common.eventhandler.SubscribeEvent;
    public class ItemHoverBoots extends ItemArmor {
    public ItemHoverBoots(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {

    super(p_i45325_1_, p_i45325_2_, p_i45325_3_);
    this.setNoRepair();
    this.setMaxStackSize(1);

    }

    @Override
    public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack){

    if(player.capabilities.allowFlying == false){
    player.capabilities.allowFlying=true;
    }
    }

    @SubscribeEvent
    public void onLivingUpdateEvent(LivingUpdateEvent event){

    if(event.entityLiving != null){

    if(event.entityLiving instanceof EntityPlayer){

    if(((EntityPlayer)event.entityLiving).inventory.armorItemInSlot(3) != null && ((EntityPlayer)event.entityLiving).inventory.armorItemInSlot(3).getItem() == HoverBoots.hoverboots){

    ((EntityPlayer)event.entityLiving).capabilities.allowFlying = false;

    }else{

    ((EntityPlayer)event.entityLiving).capabilities.allowFlying = ((EntityPlayer)event.entityLiving).capabilities.isCreativeMode ? true : false;

    }

    }

    }
    }
    }
    Posted in: Modification Development
  • 0

    posted a message on [Request][Free*] BetterModding Service! I will make your mods!
    Quote from irdoom1337
    Can you make a 1.7.2 hover board mod that lets you fly around and needs fuel?

    I think I can scrape something up! I would be glad to!
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on [Request][Free*] BetterModding Service! I will make your mods!
    I'm going to have to decline that would mean editing minecraft source, and that is hard to do in 1.7
    Posted in: Requests / Ideas For Mods
  • 1

    posted a message on [Request][Free*] BetterModding Service! I will make your mods!
    Quote from AnonTheMouse
    Thanks much!

    I think you will be happy to know that I started development
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on [Request][Free*] BetterModding Service! I will make your mods!
    Quote from pginri
    How about a mod to remove time limits from potions & splash potions?

    Like an unlimited potion?
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Rise Of The Automatons v0.1a *CleanedUpSourceCode
    Quote from JTFreeman99
    Quote from Monkeyman2016 »

    Hmm, guessing you mean a place to share code and ideas among the devs. I think I have a place in mind. A friend of mine has a gaming related website with forums we could use.. Which I can PM you the link to it if you wish :)

    That will sure work, and does the mod use forge?
    Posted in: WIP Mods
  • 0

    posted a message on Rise Of The Automatons v0.1a *CleanedUpSourceCode
    Do you have anywhere to share code or ideas openly? with the devs?
    Posted in: WIP Mods
  • To post a comment, please or register a new account.