Everything posted by Choonster
-
So I am going back to Modding.
I'm not entirely sure why they're fired before preInit; but they're fired right before it (see Loader#preinitializeMods ), so you have access to all the same data as you would in preInit (excluding stuff from the preInit phases of other mods). The configuration system is currently being reworked to be automatic and annotation-based, this commit added the initial pass. The config is read and the values injected at mod construction, before the registry events are fired.
-
[1.10.2] [UNSOLVED] Player item crafting or creative tab?
Well, how can I check if a random text was already generated? (I'm currently saving the id of the text in NBT Data for the item, so it get's not lost) Your getLoreIndex method checks if the ItemStack 's compound tag has the "lore" key, use the same check in addInformation . Well, what would be the benefit of having the same check I've got in getLoreIndex in addInformation as of my addInformation method is currently calling the getLoreIndex method. So you can avoid generating the random lore index from addInformation . In pseudocode: String tooltipLine; if (hasLoreIndex(stack)) { tooltipLine = getLoreText(getLoreIndex(stack)); // The lore index has already been generated, so display the corresponding lore text in the tooltip } else { tooltipLine = getDefaultText(); // The lore index hasn't been generated yet, so don't generate it by calling getLoreIndex; display the default text instead }
-
So I am going back to Modding.
RegistryEvent.Register<T> is fired once for each registry type (e.g. Block , Item , Biome ), this is when you should register your objects of that type. ModelRegistryEvent is fired on the client side when ModelLoader is ready to receive registrations, this is when you should register your item models and state mappers. These are both fired before preInit, so you can only subscribe to them using static @SubscribeEvent methods in a class annotated with @Mod.EventBusSubscriber . For examples of RegistryEvent.Register , look at my ModBlocks class or my other init classes. For an example of ModelRegistryEvent , look at my ModModelManager class.
-
[1.10.2] [UNSOLVED] Player item crafting or creative tab?
Well, how can I check if a random text was already generated? (I'm currently saving the id of the text in NBT Data for the item, so it get's not lost) Your getLoreIndex method checks if the ItemStack 's compound tag has the "lore" key, use the same check in addInformation .
-
Updating Block Renderer (TE properties) after inventory change
You may want to store a reference to the TileEntity in ItemLeatherHandler and override ItemStackHandler#onContentsChanged to trigger the update packet. I'm not entirely sure why your current code isn't working properly.
-
[SOLVED] Generate textures at runtime
If all that changes is the colour of the contents, use a model that extends builtin/generated (e.g. item/generated or item/handheld ) with the tube texture as one layer and the white contents texture as another. To colour the contents at runtime, you need to create an implementation of IItemColor and register it for your Item by calling ItemColors#registerItemColorHandler on Minecraft#getItemColors in init. IItemColor#getColorFromItemstack gives you the ItemStack and the tint index, which tells you the part of the model that's being coloured. For models that extend builtin/generated , the tint index is the layer index (e.g. "layer0" is tint index 0). For the contents layer, return the colour in 0xRRGGBB format (you may want to store the colour of each contents type); for the tube layer, return -1 (white). If the contents actually have separate textures, you'll need to generate the textures and model at runtime. See ModelDynBucket for an example of this.
-
how to implement right click on block?
Block#onBlockActivated can be called up to four times per click: once per hand on both the client and server. Return true when an action has been taken to prevent the next hand from being processed; return false if nothing was done and the next hand should be processed.
-
[1.10.2] add recipes to Brewing Stand ??
For simple, vanilla-style recipes, you can also use vanilla's conversion system: PotionHelper#registerPotionItemConversion and PotionHelper#registerPotionTypeConversion .
-
[1.10.2] [UNSOLVED] Player item crafting or creative tab?
In Item#addInformation , check if the ItemStack has already had its random text generated. If it has, display that text; else display the default text.
-
[SOLVED] [1.10.2] Questions about the new config system
I updated to the new config system to test it out. The new system automatically creates the Configuration instance when you annotate a class with @Config . Each public static field of this class is a property (if it's a primitive, primitive wrapper, String , Map or Enum ) or sub-category (if it's a custom class that directly extends Object ). You can annotate these fields with the sub-annotations of @Config to set the language key, comment or numeric range of the property. ConfigManager creates the properties and categories for you, you don't call any methods of Configuration yourself. The difficulty is that GuiConfig still expects you to have access to the Configuration instance so you can create the IConfigElement s from the properties and categories; but ConfigManager doesn't give you this access without resorting to reflection.
-
[SOLVED] [1.10.2] Questions about the new config system
Lex responded here. I ended up with this.
-
Add categories and default values to new config system
Thanks, I ended up with this. Is there a way to do this without using reflection to access ConfigManager#CONFIGS ?
-
Odd Missing Texture Error
Will that delete the bin folder? I've had issues with the bin folder retaining old code before. IDEA clears the output directories when you run Rebuild Project, Eclipse probably does something similar.
-
Odd Missing Texture Error
It's possible that your IDE is caching an older version of your compiled code. Try rebuilding the project (Build > Rebuild Project in IDEA) before running Minecraft again.
-
[1.10.2] diferent metadata of the same itemstacking together when must'n[SOLVED]
You're telling Minecraft that hierba doesn't have any subtypes, so it allows different metadata values to stack with each other. Change false to true and different metadata values won't be allowed to stack.
-
Add categories and default values to new config system
Can GuiConfig be used with the new system? Would you be able to answer my questions about this here?
-
[SOLVED] [1.10.2] Questions about the new config system
I'm asking about the config system added in this commit, which automatically creates the Configuration object and doesn't give you direct access to it. This means you can't simply call Configuration#get for each property when changes have been made in the config GUI and you can't call Configuration#getCategoryNames to get a list of category names.
-
[SOLVED] [1.10.2] Questions about the new config system
Is calling ConfigManager.load the correct way to save the config and inject the new values when ConfigChangedEvent.OnConfigChangedEvent is fired? Is there any way to get a list of ConfigCategory or IConfigElement from the new config system for use with GuiConfig ?
-
Add categories and default values to new config system
Thanks, that makes sense.
-
Add categories and default values to new config system
I just tried to port my old configuration to the new annotation-based system and noticed two missing features: default values and categories. I understand the new system is still a WIP, so these may already be on the roadmap.
-
MC 1.10+ Custom wall JSON issue
The "particle" texture can be a reference to another texture (like in my example) or defined separately for each value of the type property. Setting it to "#wall" should use the "wall" texture for the particles.
-
MC 1.10+ Custom wall JSON issue
You should be able to create an empty model like this to use as the default and then specify the "particle" texture in the blockstates file like this.
-
[1.10.2] Sync ItemStack Capability [Solved]
Note that Item#onUpdate is called when the item is in any of the player's three inventory sections (main, armour, off hand) and the slot argument will be relative to the start of that inventory; e.g. slot 0 could be slot 0 of the main inventory, slot 0 of the armour inventory or slot 0 of the off hand inventory. You need to search through each inventory section and check if the ItemStack in the specified slot is the same as the ItemStack argument. I use this method to perform an operation for the specified inventory sections in Item#onUpdate . You can see the usages here, here and here.
-
Entity doesn't spawn
I don't really agree with this. Implementing them both on a single class is a bad idea and can lead to confusion (which instance is the handler and which is the message?), but implementing one in a nested class of the other (like the OP has done) isn't likely to cause much confusion. You've still got two separate classes, but they're grouped together in one file instead of two. To the OP: 1.7.10 is no longer supported here. You should update to 1.10.2.
-
[1.10] Coloring only one texture layer in a Block's json
I already told the OP how to do this and the OP posted a model that worked apart from the render layer (which I told them how to fix). Did you read the thread?
IPS spam blocked by CleanTalk.