Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Choonster

Moderators
  • Joined

  • Last visited

Everything posted by Choonster

  1. World#getBlockMetadata returned the block metadata at the specified position, World#setBlockMetadata set the block metadata at the specified position. Metadata was replaced by the block state system, you can read an introduction to it here. Use World#getBlockState and World#setBlockState instead of World#getBlock/World#getBlockMetadata and World#setBlock/World#setBlockMetadata. Use IBlockState#getValue to get the value of an IProperty in an IBlockState and IBlockState#withProperty to get an IBlockState with the IProperty set to specified value. I would recommend against updating to 1.8, since it's outdated and not really supported by Forge any more. I recommend updating straight to 1.11.2, or at least to 1.8.9 if you have to use a 1.8.x version.
  2. I'm not too sure why that's not working, sorry. It could be something to do with your textures, since I downloaded the model and switched the textures to vanilla ones and the inner sphere was rendered. The screenshot below uses minecraft:blocks/glass as the charm texture and minecraft:blocks/itemframe_background as the element texture.
  3. Put a breakpoint in each of the methods and run Minecraft in debug mode. Are the breakpoints hit? If not, post your mod as a Git repository. Look at my mod and its .gitignore file for an example of which files you should include in the repository.
  4. Have you actually registered an instance of the class that contains those methods?
  5. I think the doc comment is outdated or just incorrect, ItemFireworkCharge and ItemMonsterPlacer are both stackable items that use NBT.
  6. Your client-side code will need to get its data from the ItemStack's compound tag instead of the capability instance.
  7. Looking into this further, the original Item is never returned by the registry iterator used in CreativeTabs#displayAllRelevantItems; the substitution is returned twice. This explains why setting the creative tab of the original Item doesn't work. I'm not sure if there's any way to fix this.
  8. It looks like FMLNetworkEvent.ClientConnectedToServerEvent may be too early to send packets, so you should probably use EntityJoinWorldEvent instead. Something is sending an SPacketEntityStatus when there's no client World. Set a breakpoint in the SPacketEntityStatus(Entity, byte) constructor to see where the packet is being sent from.
  9. He said it's a side effect, not a sided effect. This has nothing to do with the client/server sides.
  10. Try using FMLNetworkEvent.ClientConnectedToServerEvent. Keep in mind that this is fired on a network thread rather than the main thread, so you need to schedule a task to run on the main thread before you can safely interact with normal Minecraft classes. I'm not entirely sure whether a SimpleNetworkWrapper can be safely used from multiple threads at once. You could check that the event's entity is the client player before sending the packet.
  11. Item capabilities are hard to sync properly, as discussed here and in the referenced issues. The best option at the moment may be overriding Item#getNBTShareTag to include the capability data required for display purposes. If you're attaching your capability to external items (from vanilla or other mods), you may have to put the capability data directly in the ItemStack's compound tag.
  12. I reported this here, cpw isn't intending to fix it. You can probably set the vanilla Item's creative tab to null before you substitute it to prevent it from showing up in the creative menu.
  13. Don't rely on numeric IDs of singletons like Block and Item, they're automatically assigned and can be different in every save. Compare the objects directly instead (e.g. state.getBlock() == Blocks.OBSIDIAN).
  14. ItemBlocks are rendered in exactly the same way as any other Item (except if they use a TESR, which the beacon item doesn't). The beacon block and item themselves use regular JSON models, the TESR is only used to render the beam. I added a regular Item that uses the beacon model here and it renders just like the vanilla beacon (as you can see in the screenshot below). @MitchB Post your model and a screenshot demonstrating how it's not working.
  15. Then iterate through the values of SoundManager#playingSounds (or use a Stream) and check if any of the ISounds match the SoundEvent you're checking for.
  16. SoundManager#playingSounds is a Map with String keys and ISound values. Printing it to the log won't help you much, since PositionedSoundRecord (an ISound implementation) doesn't override Object#toString to provide custom output. The ISound#getSoundLocation returns the name of the SoundEvent that the ISound represents, this is the smae name that's returned by SoundEvent#getSoundName, What exactly are you trying to do? Are you trying to take an action when a sound starts playing, or are you trying to detect whether a sound is playing at an arbitrary point in time?
  17. You can probably use the structure system to choose which components are generated and then use the template system to generate each component. It's entirely possible that nobody has done this before, so you'll likely have to figure it out yourself.
  18. You'd need to use an AT or reflection to access the field, yes. I'd personally recommend using reflection to avoid modifying the vanilla code, but either method should work. Another way to gain access to the SoundManager instance without ATs/reflection is by subscribing to SoundSetupEvent and storing the instance. This is probably the best option.
  19. The EventPacket no-argument constructor is private, but it needs to be public so it can be accessed by FML/Netty.
  20. You're trying to access the field through the class (SoundManager) rather than an instance of it (the one stored in the private SoundHandler#sndManager field, you can use Minecraft#getSoundHandler to get the SoundHandler instance). It's not a static field, so you can't do this.
  21. I'm not too sure. Try setting a breakpoint in the first loop in ModelLoader#loadItemModels (for(Item item : items), line 325 in my workspace) with the condition item == <your Item instance> and stepping through the code to see what's going on. If that fails, post your whole mod as a Git repository. Look at my mod and its .gitignore file for an example of the files to include. In the Referenced Libraries (Eclipse) or External Libraries (IDEA) section of the project window, there should be a library called forgeSrc-<forgeVersion>.jar that contains the code and assets from Forge and Minecraft. Eclipse can't actually open most files in JARs by default, you need to associate JSON files with the internal text editor (in Window > Preferences > General > Editors > File Associations) or install a plugin. You also need to install a plugin to view PNG files in JARs. IDEA can open JSON and PNG files in JARs by default and allows you to navigate to a file (including those in JARS) with Ctrl-Shift-N.
  22. I completely missed the fact that this is an Entity rather than a TileEntity. Still, overriding Entity#readFromNBT and Entity#writeToNBT should work (though you're meant to override Entity#readEntityFromNBT and Entity#writeEntityToNBT instead).
  23. That code should work, since TileEntity#writeToNBT writes its data to and then returns its argument.
  24. You need to override Block#isFullCube to return false. This will stop players being pushed out of the block and stop them suffocating in the block.
  25. RegistryEvent.Register and ModelRegistryEvent are both fired before preInit, so they need to be handled by static @SubscribeEvent methods in a class annotated with @Mod.EventBusSubscriber.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.