Jump to content

Choonster

Moderators
  • Posts

    5170
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by Choonster

  1. You need to AND the position index with 2 before you look it up in the values array.
  2. Override Item#onEntityItemUpdate . This is called once per tick by every EntityItem containing an ItemStack of your Item . In your override of this method, check that the entity is on the ground (its onGround field is true ), the block at the entity's position isn't fire and fire can be placed at the entity's position ( Block#canPlaceBlockAt returned true ). If this condition is met, set the block at the entity's position to fire. In 1.7.10, use World#getBlock and World#setBlock to get and set the Block at the specified position. Use the posX , posY and posZ fields of Entity to get an entity's position and MathHelper.floor_double to convert them to integers. In 1.8.x, use World#getBlockState and World#setBlockState to get and set the IBlockState at the specified position. Use IBlockState#getBlock to get the state's Block . Use the BlockPos(Entity) constructor to get an entity's position as a BlockPos .
  3. Call EntityPlayer#setItemInUse from Item#onItemRightClick like ItemBow does.
  4. That looks correct, yes.
  5. If you set the item in use from Item#onItemRightClick , the pulling models returned by Item#getModel will be used (you can adjust the timings for each model in that method). Just make sure you override Item#onItemUseStopped to do nothing.
  6. Just register a model for the bow like you would any other item ( ModelBakery.registerItemVariants and ModelLoader.setCustomModelResourceLocation or ModelLoader.setCustomMeshDefinition ). Since it's never set in use, the pulling models will never be used.
  7. Since the player doesn't actually draw back your bow like they do with the vanilla one, I'd just use a fixed charge value.
  8. I suggest storing the FACING values's horizontal index ( EnumFacing#getHorizontalIndex , an integer in the range [0,3] ) in the lower two bits of the metadata and the POSITION value's ordinal ( Position#ordinal , an integer in the range [0,2] ) or a similar index field in the higher two bits of the metadata. Shift the POSITION index left 2 bits ( << ) then OR ( | ) it with the FACING index. To get the FACING value from the metadata, AND ( & ) it with 3 (the maximum index) and use EnumFacing.getHorizontal to convert it to an EnumFacing . To get the POSITION value from the metadata, shift it right 2 bits ( >> ), AND it with 2 (the maximum index) and get the Position at that index of the array returned by Potion#values . I'll try to implement this myself to provide an example of how it's done. Edit: Correctly capitalised AND.
  9. That should be suitable, but you still need to create the BlockState and convert between state and metadata.
  10. Note that if NEI is running, ItemTooltipEvent won't be fired. To modify NEI's tooltips, you need to implement IContainerTooltipHandler and register it using GuiContainerManager.addTooltipHandler instead.
  11. You can probably use an EnumFacing property limited to Plane.HORIZONTAL for the y-axis rotation and a custom enum property with UP , DOWN and SIDEWAYS values for the x-axis rotation. You can integrate the custom enum with EnumFacing and its subclasses if needed.
  12. Forge recently added a model animation system. I have no idea what the video is using and annoyingly he doesn't seem to explain it or provide a map/resource pack download.
  13. I don't think Cricket is maintaining Chisel 2 any more, update to Chisel by Chisel Team (tterag1008, Drullkus, Minecreatr).
  14. You've got a block (pair of braces) surrounding the if statement, which isn't required. You don't need to consume an arrow in the body of the if statement, the InventoryPlayer#consumeInventoryItem call in the conditional already does that. There's no point in setting the maximum use duration ( Item#getMaxItemUseDuration ) and use action ( Item#getItemUseAction ) if you never set the item in use ( EntityPlayer#setItemInUse ). You should rename the variables in onItemRightClick with meaningful names that describe their purpose, e.g. charge instead if i (because that holds the bow's charge). You never declare the variable i . What is it that want to know?
  15. You need to store the last use time ( World#getTotalWorldTime ) in the NBT and compare it against the current time in Item#onItemRightClick . If it's been at least COOLDOWN ticks, update the last use time and fire the arrow. I have an example of a similar weapon here that fires snowballs at a fixed rate while right click is held.
  16. Ah, I got a bit confused. That is indeed the method I meant.
  17. Set the maximum use duration to 0, the use action to NONE and fire the arrows from Item#onItemRightClick instead of Item#onItemUseFinish .
  18. Use JDK 8 for the ForgeGradle-based 1.7.10 and 1.8.x builds. Use JDK 7 for the ForgeGradle-based 1.6.4 builds (960-965) or JDK 8 for the most recent MCP-based 1.6.4 build (1345). This tutorial explains how to get started and set up a ForgeGradle workspace.
  19. The damage dealt by arrows is calculated in EntityArrow#onUpdate , which uses values set in ItemBow#onPlayerStoppedUsing . You can override these methods in your own classes to do whatever you want.
  20. I suggest you post the log anyway, it will probably give LexManos more of an idea of what's happening internally.
  21. Don't bump your threads, especially not after five minutes. It will only serve to annoy the people that can help you, it won't make them post any faster.
  22. You need to set the fire encouragement (a.k.a spread speed) and flammability of the Block yourself. Either call BlockFire#setFireInfo after registering your Block or override Block#getFireSpreadSpeed and Block#getFlammability to return the appropriate values.
  23. What's the full name (including extension) of the file you downloaded? It should be viewable in your browser's download list. I suspect you've somehow set WordPad as the default application of whatever file type you downloaded. All downloads except the changelog are some sort of binary file, so they'd look like a bunch of random characters if opened in a text editor/word processor like WordPad.
  24. ModelLoader.setCustomModelResourceLocation is Forge's replacement for ItemModelMesher#register(Item, int, ModelResourceLocation) , yes.
  25. Ah, that would indeed screw things up. I'm still surprised that there wasn't error in the log telling you that it couldn't find the model with that name.
×
×
  • Create New...

Important Information

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