Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. ServerConfigurationManager was renamed to PlayerList . You can see other name changes in 1.9 by searching here.
  2. The vanilla bow uses ItemBow#findAmmo instead of InventoryPlayer#consumeInventoryItem . I created this method for my mod's bows to do the same thing using the IItemHandler API.
  3. Model registration should be handled in your client proxy or a dedicated class called from it. Referencing client-only classes in a class loaded on both sides can easily crash the dedicated server with a ClassNotFoundException if you're not careful. diesieben07 has a post on why you shouldn't use @SideOnly here.
  4. Set the ItemBlock 's registry name to the Block 's registry name. To handle custom ItemBlock classes, you can use a Function<Block, ItemBlock> argument (i.e. a function that takes a Block and returns an ItemBlock ) as a factory for the ItemBlock instance. I do this here.
  5. Yes, create an IStateMapper and register it by calling ModelLoader.setCustomStateMapper . You can either implement IStateMapper yourself or create a StateMap.Builder , call StateMap.Builder#ignore for each property you want to ignore and then call StateMap.Builder#build .
  6. Your block has two properties ( facing and triggered ), but your blockstates file only specifies variants for one of them ( facing ). You need to include both properties in your blockstates file.
  7. Look at how BlockSapling or BlockDaylightDetector override Block#getBoundingBox .
  8. Create a static final AxisAlignedBB field with the block's bounds and override Block#getBoundingBox to return it.
  9. Call setBlockBounds in your constructor. Look at the method definition in the Block class for the arguments.
  10. Item#getRegistryName already includes your mod ID. Don't add it again.
  11. Refresh the project from the Gradle window (this is needed after running setupDecompWorkspace to allow the project to use the new Forge version), then synchronise the project from the Project window (this is needed after running genIntelliJRuns to bring up the prompt to reopen the IDE and use the new run configurations). You then need to edit the run configurations to use the classpath of the <ProjectName>_main module.
  12. The RenderItem instance is created between preInit and init, so it can't be used in preInit. Instead of using ItemModelMesher#register , use ModelLoader.setCustomModelResourceLocation / setCustomMeshDefinition . These must be called in preInit. Never use getUnlocalizedName().substring(5) in your code. Registry names are IDs, they must not change. Unlocalised names can change at any time. The default model loaded for every Item is the one with its registry name, so use Item#getRegistryName as the default model location.
  13. Right click somewhere in the Project window, then select Git > Repository > Branches in the context menu. Select the branch to checkout from the popup menu that appears.
  14. Clone the repository, then checkout the desired branch using a Git client (e.g. IntelliJ IDEA, GitHub Desktop, command-line Git).
  15. So equipping a vanilla saddle on a vanilla horse shows your subtitle? I can't reproduce this. In the process of writing a reply, I looked at your GitHub repository and noticed you'd already done it. If you encounter further problems with Git, try looking for the solution first. If you can't find it, post here and I may or may not be able to help you. Any further questions not directly related to the custom entity should probably be posted in a separate thread.
  16. So I gave your test code a shot and now I just fall through the block. I do get withered though haha, but I'm passing right through it like it doesn't exist. Are you using 1.8.9 or 1.9? My code is for 1.9, for 1.8.9 you'd need to call Block#setBlockBounds with the coordinates instead of creating a static field and overriding Block#getCollisionBoundingBox .
  17. I just tested this here, the smallest possible offset (to 4 decimal places) is 0.0011. With an offset of 0.0010, the player can only collide by walking into a corner of the block rather than anywhere on any face.
  18. If you want entities to be able to collide on all sides, call Block#setBlockBounds in the constructor with OFFSET as the minimum coordinates and 1 - OFFSET as the maximum coordinates (where OFFSET is some small value like 0.125). This removes the need to override Block#getCollisionBoundingBox . In 1.9, create a static final AxisAlignedBB field with these coordinates instead and override Block#getCollisionBoundingBox to return it.
  19. Please pay closer attention to my posts. I said you should use the minecraft:entity.horse.saddle sound event as a sound in your own sound event, not the minecraft:sounds/entity/horse/saddle.ogg sound file (which doesn't exist, as you've seen). I even gave you an example of what you needed to put in sounds.json. You can see a working example of this here. As for the warning: When the server receives a CPacketVehicleMove , it calls NetHandlerPlayServer#processVehicleMove . This calculates the distance between the mount position sent in the packet and the server's last known mount position. If the difference between this distance and the magnitude of the mount's motion vector is more than 10 (actually if difference between their squares is more than 100), the server logs that warning and sends a SPacketMoveVehicle to the client to reset the mount's position to the server's last known position. If your mount uses the same motion/networking code as the Horse, I'm not entirely sure why this would happen.
  20. Numeric armor slots were replaced by the EntityEquipmentSlot enum. The enum values should be self-explanatory.
  21. An entity can only collide with a block on a given side if the block's bounding box is inset by a small amount on that side. Soul Sand is only inset on the top (i.e. the maximum y coordinate is less than 1), so entities will only collide on the top.
  22. Entity#setCurrentItemOrArmor was replaced by Entity#setItemStackToSlot .
  23. There is no Block#onEntityWalking method in 1.8+, so your method doesn't override a super method and is never called. This is why you should always use the @Override annotation, you would have gotten a compilation error telling you this. Use your IDE to auto-generate override methods. Block#onEntityCollidedWithBlock(World, BlockPos, Entity) is called when an entity that can trigger walking (i.e. returns true from Entity#canTriggerWalking ) walks on top of the block. Block#onEntityCollidedWithBlock(World, BlockPos, IBlockState, Entity) is called when an entity collides with the block in any direction.
  24. I didn't say anything about replacing the minecraft:entity.horse.saddle sound event, though that's not possible to do from a sounds.json file in assets/<modid> anyway. You need to create your own sound event that uses minecraft:entity.horse.saddle as an entry in its sounds array. Put this in sounds.json: "entity.terrakon.saddle": { "sounds": [ { "name": "minecraft:entity.horse.saddle", "type": "event" } ], "subtitle": "subtitles.tetracraft:action.saddle" }, Then register a SoundEvent for tetracraft:entity.terrakon.saddle and play it when a Saddle is equipped. This should play the sounds defined by the minecraft:entity.horse.saddle sound event but use the subtitle of your sound event.
  25. Create a sound event in your sounds.json file, give it a sound with minecraft:entity.horse.saddle as the name and event as the type and then set its subtitle. This will play a sound from the existing event but use your subtitle. See this page for an explanation of the sounds.json format.
×
×
  • Create New...

Important Information

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