Jump to content

Thornack

Members
  • Posts

    629
  • Joined

  • Last visited

Everything posted by Thornack

  1. I printed out movestrafing and move forward and they are both zero
  2. Haha Ya I know I dont want to delete the constructor but in the constructor I set my motion to 0 before and I suspected that was causing an issue. Im not sure I was correct though. Ill try your suggestion and see if I can solve this
  3. I Added The following Print Statement - System.out.println("Moving"); - into the moveEntityWithHeading method As seen below, and now whenever I mount the Bike the word "Moving" gets printed to the Console but the bike still will not move in any direction and you cannot jump with it (but it does rotate with the player when you move the mouse). I thought the problem might have been the method below so I got rid of a few things in it but this didnt have any appreciable effect. I also got rid of some of the undefined weird functions and strings in the class that I have no idea what they do but they didnt seem to help me and didnt seem to make the bike move or do weird things when I got rid of them. Ive included the updated bike class at the bottom. Suspected Problem Method The moveEntityWithHeading Method That has the print statement I mentioned Up top Updated EntityBicycle class
  4. I got rid of a bunch of the useless horse stuff such as head lean and open mouth This is the shortened cleaned up version of my entity file. Still cannot move forward on the Bike but it does rotate with the player when you mount it. EntityBicycle class
  5. If I put the print statement in as you suggested, It seems to print every tick that Movement is blocked and I am not sure why. But it shows up when I place the vehicle on the ground and continues to print even once I mount it. It does not print when I hold the item though. The current isMovementBlocked() Method
  6. I changed isMovementBlocked to protected boolean isMovementBlocked() { return this.riddenByEntity != null; } and got rid of a bunch of the Chested and Eating Hay stuff and also eliminated any references to saddle so this is my Entity File as of right now but still I can mount it but it will not move. One thing that did change is that when I turn the bicycle turns with the player where before only the player turned. where should I put the print line you suggested. Updated EntityBicycle class
  7. I am making a Rideable Vehicle called Bicycle and so Far I have it rendering on the ground and in the players hand as a 3D item. I also have it so that upon right click I "mount the vehicle. But I cannot figure out why it wont move once I have mounted it. I based my code off of the boat code and the horse class. Entity Bicycle class VehicleRenderBicyclce class Bicycle Item Class Any help is very much appreciated. I want my bicycle to work exactly like the horse but I want it to be an item. I have been at it for quite some time trying to understand how it works but currently am at a loss.
  8. I havent had any luck with this does anyone have a solution yet
  9. Hi, I have been messing around with mobs and I have a mob that stands and walks on two legs when f3 (the head rotation yaw parameter) is greater than or equal to zero or when f4 (the rotation pitch parameter) is also greater than or equal to 0. It makes the mob wander around on all fours most of the time and on occasion it will walk on two legs. There is a quirk however, it will randomly stand up and sit down rapidly here n there. To accomplish this I use the .addChild method and have constructed my model so that the head is stationary and gets translated downward by the appropriate amount when the rest of the model is rotated 90 degrees to obtain the walking on all fours animation but the rest of the time it walks on two legs. I was wondering two things, 1) how are the parameters f3 and f4 actually being called/created in minecraft (I am having trouble understanding how animations can be called or how these parameters are created) All I understand is that they are related to the pitch and yaw of the models head. where the head can be animated using //Head Animation HeadMain.rotateAngleX = (float) (rotationPitch / 57.29578F); HeadMain.rotateAngleY = (float) (rotationYaw / 57.29578F); as such I see that they are angles but how are they being called when the entity moves 2) how would I increase the wander frequency of a mob (ie get it to wander around more often and for longer distances)
  10. Currently in the inventory I get Minecrafts purple and black missing texture texture but when I select the item nothing appears in hand
  11. And in my Common Proxy I register the item in the following way public static Item acornHarvester; //this method passes stuff to the main mod class public void preInit(){ registerItems(); } public void registerItems(){ acornHarvester = new AcornHarvester(); this.registerEachItem(acornHarvester, "acornHarvester", "Acorn Harvester"); } public void registerEachItem(Item item, String unlocalizedItemName, String displayName){ item.setUnlocalizedName(unlocalizedItemName); GameRegistry.registerItem(item, displayName); item.setCreativeTab(this.mymodTab); } This file is very large for my mod so I took a bunch out to keep it relevant
  12. I have an item That I wish to change texture on right click and depending on the length that the right click is held for I want the item to change to a differnt colour. (kind of like the bow) I have written the following but the icons are invisible public class AcornHarvester extends CustomItem{ public AcornHarvester(){ super(); setUnlocalizedName("AcornHarvester"); this.maxStackSize = 1; this.setMaxDamage(10); this.setNoRepair(); } private IIcon[] iconArray; public void registerIcons(IIconRegister iconRegister){ iconArray = new IIcon[14]; iconArray[0] = iconRegister.registerIcon("mymodsid:acornHarvestRedOpen"); iconArray[1] = iconRegister.registerIcon("mymodsid:acornHarvestRedClosed"); iconArray[2] = iconRegister.registerIcon("mymodsid:acornHarvestWhiteOpen"); iconArray[3] = iconRegister.registerIcon("mymodsid:acornHarvestWhiteClosed"); iconArray[4] = iconRegister.registerIcon("mymodsid:acornHarvestBlueOpen"); iconArray[5] = iconRegister.registerIcon("mymodsid:acornHarvestBlueClosed"); iconArray[6] = iconRegister.registerIcon("mymodsid:acornHarvestBlackOpen"); iconArray[7] = iconRegister.registerIcon("mymodsid:acornHarvestBlackClosed"); iconArray[8] = iconRegister.registerIcon("mymodsid:acornHarvestYellowOpen"); iconArray[9] = iconRegister.registerIcon("mymodsid:acornHarvestYellowClosed"); iconArray[10] = iconRegister.registerIcon("mymodsid:acornHarvestGreenOpen"); iconArray[11] = iconRegister.registerIcon("mymod:acornHarvestGreenClosed"); iconArray[12] = iconRegister.registerIcon("mymod:acornHarvestPinkOpen"); iconArray[13] = iconRegister.registerIcon("mymod:acornHarvestPinkClosed"); } //How long it takes to use or consume an item public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (itemStack != null && itemStack.getItem() == CommonProxy.acornHarvester){ itemStack.damageItem(1, player); } return itemStack; } @Override @SideOnly(Side.CLIENT) public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { if (usingItem == null) { return itemIcon; } int ticksInUse = stack.getMaxItemUseDuration() - useRemaining; if (ticksInUse > 28) { return iconArray[13]; } else if (ticksInUse > 26) { return iconArray[12]; } else if (ticksInUse > 24) { return iconArray[11]; } else if (ticksInUse > 22) { return iconArray[10]; } else if (ticksInUse > 20) { return iconArray[9]; } else if (ticksInUse > 18) { return iconArray[8]; } else if (ticksInUse > 16) { return iconArray[7]; } else if (ticksInUse > 14) { return iconArray[6]; } else if (ticksInUse > 12) { return iconArray[5]; } else if (ticksInUse > 10) { return iconArray[4]; } else if (ticksInUse > { return iconArray[3]; } else if (ticksInUse > 6) { return iconArray[2]; } else if (ticksInUse > 4) { return iconArray[1]; } else if (ticksInUse > 2) { return iconArray[0]; } else { return itemIcon; } } Where in my CustomItem class I have public class CustomItem extends Item { public CustomItem() { super(); setMaxStackSize(64); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(MyMod.modid + ":" + this.getUnlocalizedName().substring(5)); } } The texture shows up if I get rid of the registerIcon array and getIcon methods. Any help is appreciated
  13. The problem with that method is that I cannot change the amount that durability drops by. I want durability of the item to be affected differently depending on which block the item interacts with. Say drop durability by 5 if you right click cobblestone but drop it by 1 if you right click leaves.
  14. This worked But is there another way @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (itemStack != null && itemStack.getItem() == CommonProxy.applePickingGlove){ itemStack.damageItem(1, player); } return itemStack; }
  15. Still no durability shows up when I hit f3 + H and on each right click the durability is not decreasd by 1
  16. I tried @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (itemStack != null && itemStack.getItem() == CommonProxy.applePickingGlove){ itemStack = new ItemStack(CommonProxy.applePickingGlove, 2, (itemStack.getItemDamage()+1)); if (itemStack.getItemDamage() >= itemStack.getMaxDamage()){ itemStack.stackSize --; } } return itemStack; } and still no durability
  17. I have an Item for which I give a maxDamage. I want to make it a durable item where its health decreases everytime you right click it. For some reason the durability doesnt show up. Here is my class minus the imports public class ApplePickingGlove extends CustomItem{ public ApplePickingGlove(){ super(); setUnlocalizedName("Apple Picking Glove"); this.maxStackSize = 1; this.setMaxDamage(20); this.setNoRepair(); } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { ItemStack itemstack = player.getCurrentEquippedItem(); if (itemstack != null && itemstack.getItem() == CommonProxy.applePickingGlove){ ItemStack item = new ItemStack(CommonProxy.applePickingGlove, 2, (itemstack.getItemDamage()+1)); if (item.getItemDamage() >= item.getMaxDamage()){ item.stackSize --; } } return itemStack; }
  18. How would I implement the storing of the last day that it was clicked this is the part I am unsure about
  19. I have made a block that upon right click drops an item. I wish to implement functionality so that the block can only drop the item once per day. in my block class that extends my custom block class which then extends Minecraft's Block class I wrote the code below to implement the item dropping when the block is right clicked. It works as intended however I am now wishing to add a timed item drop aspect. I was thinking of somehow getting the world time at the time of the right click and equating it to a variable maybe called timeOfBlockClicked and having while or if statements that would forbid the item to drop if the block is right clicked until the World time was again greater than or equal to the timeOfBlockClicked at which point the timeOfBlockClicked variable would be reset to 0 and a new timeOfBlockClicked would be set again and a new item could drop. I am unsure how to get the world time though and how to save the time. @Override @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { { if(world.isRemote == false)//world.isRemote == false - has to be false otherwise you do it twice once for server and once for client { ItemStack myItemStack = new ItemStack(MyMod.customItem, 1); EntityItem entityitem = new EntityItem(world, x, y, z, myItemStack); entityitem.delayBeforeCanPickup = 10; world.spawnEntityInWorld(entityitem); } return false; } }
  20. Ok I figured out how to write the entities name to NBT along with what appears to be the entity itself and have the item stack save the data (from what I can tell the stuff in my console is the entity data). I was wondering how to read that NBT data and then use it to respawn the entity from my item.
  21. I have figured out how to write data to the itemstack. How would I write the entity to the itemstack though I tried entity.writeToNBT(itemstack.stackTagCompound) but I got a weird output where my System.Out.Println placed into the console (DropChances: (0:0.085f,1:0,.....),Age:0,UUIDLeast:-... a bunch of stuff). It would be nice if I could get the name from the entity or something like that
  22. I have a throwable item and I want it to remember the entity it hit whereupon hitting the entity the entity and data associated with it is saved to the item particular item stack that was spawned when the throwable item hit the entity. Is there a way to implement this functionality. I have been looking at @Override public Packet getDescriptionPacket() { NBTTagCompound tag = new NBTTagCompound(); writeToNBT(tag); return new S35PacketUpdateTileEntity(); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { readFromNBT(packet.func_148857_g()); } @Override public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); } @Override public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); } and also at public void addInformation (Itemstack itemstack, EntityPlayer player, List list boolean par4){ super.addInformation (itemstack, player, list, par4) } located in the item class.
  23. I have noticed that inside this onImpact method is that if I remove the if statement if (!this.worldObj.isRemote) { this.setDead();} but leave everything else as is the thrown ball seems to hit the ground then continue falling through blocks until it falls out of the world. My workaround this issue may not be the best solution to the problem of getting my ball entity to hit a living entity and then fall to the ground. If anyone has any ideas on how else to achieve this, I am working on both problems and would appreciate any input.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.