Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. It looks like the RightClickItem docs are incorrect, since the RightClickBlock docs explicitly mention that the client will try RightClickItem unless the result is SUCCESS: /** * This event is fired on both sides whenever the player right clicks while targeting a block. * This event controls which of {@link net.minecraft.block.Block#onBlockActivated} and/or {@link net.minecraft.item.Item#onItemUse} * will be called after {@link net.minecraft.item.Item#onItemUseFirst} is called. * Canceling the event will cause none of the above three to be called * * Let result be a return value of the above three methods, or {@link #cancellationResult} if the event is cancelled. * If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link RightClickItem}. * * There are various results to this event, see the getters below. * Note that handling things differently on the client vs server may cause desynchronizations! */ If you perform some action, you should set the event's cancellation result to EnumActionResult.SUCCESS and then cancel the event. This will stop the Vanilla methods from being called and the other event from being fired. That said, there's no need to use events to handle the right click behaviour of your own Item; just override the appropriate methods in the Item class instead.
  2. No. As I said, those ByteBufs aren't PacketBuffers; so that code will never send the unique IDs. When I say "create a new instance", I mean "use the new operator".
  3. The ByteBuf passed to those methods isn't an instance of PacketBuffer, you need to create a new instance of PacketBuffer and pass the ByteBuf to the constructor.
  4. Minecraft normally uses the entity ID (Entity#getEntityId) rather than the unique ID in networking situations (and this is its main purpose). This reduces unnecessary network traffic as the entity ID is a single 32-bit integer (that's actually compressed further) rather than a UUID that's sent as a pair of 64-bit integers. If you absolutely need to send a UUID, you can wrap the ByteBuf in a PacketBuffer and use PacketBuffer#readUniqueId/PacketBuffer#writeUniqueId to read/write UUIDs.
  5. There isn't one by default, you need to create it. This hasn't changed since 1.8.9.
  6. Are your RGB values actually being synced to the client? I suspect that they're always 0 on the client, so the block is being rendered black. There's no need for a TESR here at all. If you register a standard JSON model with a tint index (see the wiki), you can then register an IBlockColor that reads the RGB value from the TileEntity and returns it.
  7. HarvestDropsEvent can be called for any block in the game, 99% of which won't have the BlockOldLeaf.VARIANT property in their block state. As you've seen, calling IBlockState#getValue with an invalid property throws an exception. You need to check the Block itself first, use IBlockState#getBlock to get it and then check that it's equal to Blocks.LEAVES/Blocks.LEAVES2. IBlockState#getBlock returns a Block, which will never be equal to an IBlockState. You need to check the Block and the properties in two separate expressions within the if condition. Edit: It looks like @diesieben07 already explained most of this in your previous threads. Please stop creating new threads for the same topic.
  8. Yes, or just use ItemCloth.
  9. ItemBlock itself isn't suitable for blocks with variants, you need to use a subclass that overrides Item#getMetadata(int) to convert the item metadata to block metadata and calls Item#setHasSubtypes to mark the item as having variants/subtypes. ItemCloth does these and also overrides Item#getTranslationKey(ItemStack) to add the stack's colour as a suffix to the translation key (unlocalised name) so that each colour can have its own translation.
  10. This sounds like an issue with the ItemBlock and/or the model registration for the ItemBlock. Please post the code where you instantiate and register the ItemBlock and the code where you register the models for the ItemBlock(or create a repository so that we can see all of your code).
  11. To reduce the number of files you need to create, you can use Forge's blockstates format to specify a base model (e.g. minecraft:cube_all) and the textures for it without needing to create a model for each block.
  12. What exactly is your current issue? Please post your latest code (or a link to your repository). If it's a model issue, please post your blockstates/model files and your debug.log.
  13. If an item has subtypes like Stone and Dirt do, you need to specify the metadata using the data property when using it in a JSON recipe's ingredient. Look at some of the recipes that use Planks or Stone (e.g. minecraft:acacia_boat) to see examples of this.
  14. If you're following my example, the COLOR property is stored in the metadata and as such is already set when Block#getActualState is called. The FACING property is stored in the TileEntity and is the only property that needs to be set in your override of Block#getActualState.
  15. No. Each version of Forge only supports a single version of Minecraft and won't work on any other version.
  16. Unlisted properties aren't used to determine which model to render for a block, they're used by custom block models to determine how they should render. The correct solution here (while keeping a single block) would be to store the extra data in a TileEntity and use regular properties that have their values set in Block#getActualState. Though Mojang is moving away from having a single block for all colours with The Flattening in 1.13, so it may be best to split the colours into separate blocks now (as Cadiboo suggested). I have an example of a block with a colour and a facing here: Block, TileEntity, blockstates file
  17. There are still some Vanilla methods like Entity#getName that perform translation but aren't client-only. These use the deprecated net.minecraft.util.text.translation.I18n and I don't think there's any real alternative.
  18. I've never played Warframe, so that's not me.
  19. On Unix-like systems, look in ~/.gradle rather than %USER_HOME%\.gradle for the Gradle caches.
  20. Forge 1.12.2-14.23.5.2779 deprecated ReflectionHelper and changed the methods in ObfuscationReflectionHelper to only require an SRG name rather than both an SRG and MCP name. This is what @quadraxis was talking about.
  21. Those are builds for 1.3.2 from 2014, they're not for 1.13.2.
  22. What do you mean "the forge version"? The only place you should download Forge from is the official Files site (https://files.minecraftforge.net/). There are no 1.13.x versions available there.
  23. Where did you download this from? There are no public releases of Forge for 1.13.x yet, and Forge is only being developed for 1.13(.0) at the moment.
  24. This is incorrect. Method and field names are reobfuscated from MCP to SRG names when you compile, but MCP and SRG class names are the same. Forge deobfuscates Minecraft from Notch to SRG names at runtime.
×
×
  • Create New...

Important Information

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