Jump to content

Choonster

Moderators
  • Posts

    5170
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by Choonster

  1. As far as I can tell, this system has been used since 1.7.10. I learned Lua as my first programming language to create World of Warcraft AddOns, I still use it for general-purpose scripting since I'm more familiar with it than other scripting languages.
  2. sounds.json isn't included in the IDE project, so your IDE won't be able to navigate to it. The vanilla assets not included in the forgeSrc library are downloaded to the Gradle cache, ~/.gradle/caches/minecraft/assets. The indexes directory contains a JSON file for each version that lists the hash of each file. The objects directory contains the actual files, with the hash as the file name. Each file is contained in a directory named with the first two characters of the hash. I wrote this Lua script to extract the files from this repository format into regular directories.
  3. Just modify it on the server, the changes will be synced to the necessary clients.
  4. Use the Simple Network Implementation to send a packet to the server telling it that the player clicked the button. In the packet handler, check that the player has permission to spawn the stacks (e.g. is within interaction range of the block) before spawning them.
  5. You can use BON2 to deobfuscate compiled mods before decompiling them with a decompiler like JD-GUI or Bytecode Viewer.
  6. In client-only code, yes.
  7. But what's the reason for doing this? What's the overall goal? If you look the code that saves crash report files (i.e. calls CrashReport#saveToFile), you'll see that the server uses MinecraftServer#getDataDirectory as the parent directory of the crash-reports directory and the client uses Minecraft#mcDataDir.
  8. What are you trying to do?
  9. Vec3.createVectorHelper was removed in 1.8 when the Vec3 constructor was made public. Just use the constructor directly.
  10. There's no direct equivalent to InventoryPlayer#consumeInventoryItem, ItemBow uses ItemBow#findAmmo to find the first ammo ItemStack and then decrements the stack size by 1 and calls InventoryPlayer#deleteStack to remove it from the inventory if the new stack size is 0. EntityPlayer#joinEntityItemWithWorld has been replaced by EntityPlayer#dropItemAndGetStack. I found these by looking at where the methods were used in 1.8.9 and then looking what 1.10.2 uses in the same place. You can also use MCPBot to see if a method/field has been renamed between versions. In future, please include the class name of the methods.
  11. Enchantments were moved to a registry, you can access it with ForgeRegistries.ENCHANTMENTS. You can also access the vanilla instances from the Enchantments class.
  12. Yes, ItemHandlerHelper.
  13. Fluid handler items use CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY instead of CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY. I'm not sure exactly what you're doing with the fluid handler item, but you may want to check if the FluidUtil class already has a method that does what you want.
  14. I'm glad they've helped. Post your new code.
  15. Your onBlockActivated method doesn't override a super method, so it will never be called unless you do so yourself. If you'd annotated the method with @Override, you would have gotten a compilation error telling you this. Use your IDE to auto-generate override methods with the correct signature and annotation.
  16. You're comparing a TileEntity to a Class, the two will never be equal. Use instanceof to check if a value is an instance of a class or other type.
  17. It was renamed to Vec3d in 1.9 for consistency with the other vector class names.
  18. You should be able to check it in your implementation of IBakedModel#getQuads, that's what MultiLayerModel does. It will be null when the model isn't being rendered in the world (e.g. when it's rendered as an item).
  19. PlayerList#getPlayers returns the players in every dimension, so your current code would damage players in any dimension if they happened to be close to the coordinates of the block.
  20. Just report it with the "Report post" link, the moderators will delete the posts and probably ban the user when they come online. Unfortunately the spam seems to build up every day when there aren't any moderators online. Side note: The spam is in Korean, not Chinese.
  21. Block#dropBlockAsItemWithChance is only called on the server. Block#removedByPlayer is called just before that on both the server and the client, but only the client of the player who broke the block. The clients of other nearby players don't know that a block was broken by a player, the server just tells them to play the breaking effects and set the block to air. Why do you need a numeric ID? Packets can send other data types, including strings. Every IForgeRegistryEntry implementation has a numeric ID, which you can access from the corresponding registry with RegistryNamespaced#getIDForObject. Vanilla implementations store their registry as a static field of the entry class, but mod implementations may not. If you only have the registry as an IForgeRegistry, you can't access the numeric IDs directly. There's nothing limiting SPacketSoundEffect to vanilla SoundEvents, it will work with any SoundEvent. Forge's documentation explains the various methods that play sound here. If you create a SoundType and set it as the Block's SoundType with Block#setSoundType, the SoundEvents will be automatically played at the appropriate times (including when the Block is broken). You can also override Block#addDestroyEffects to add any custom effects (and optionally disable the vanilla particles) when the Block is destroyed.
  22. You should only include the item quads for the TRANSLUCENT render layer, this should ensure they're rendered with transparency enabled. You can get the current render layer using MinecraftForgeClient.getRenderLayer. The "flip-v" custom data property (in the blockstates file) is only used by ObjModel, it does nothing for any other type of model.
  23. LivingExperienceDropEvent is fired when a living entity (e.g. a player) is about to drop XP on death, you can cancel it to prevent any XP from dropping.
  24. They don't really do anything themselves, they're just vectors.that store 2 or more coordinates and provide methods for various vector operations (e.g. addition, subtraction, normalisation, dot and cross product). The number in the name is how many coordinates the vector stores (i.e. the number of dimensions). The letter after the number is the numerical data type used by the vector, e.g. i for int, d for double, f for float.
×
×
  • Create New...

Important Information

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