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.

Draco18s

Members
  • Joined

  • Last visited

Everything posted by Draco18s

  1. Well I can tell you that you made a complete joke of your proxy system. 1) You do not need a separate "ServerProxy" as either things are common or client-only. 2) You put the common half of things in the common proxy and then the client-only stuff in your main mod class! Anyway, your issue is using ModelMesher. You should be using ModelLoader.setCustomModelResourceLocation , which needs to be called during preInit. I recommend taking a look at my library proxies: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/EasyRegistry.java https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java It encapsulates the required actions such that it works similar to the 1.7 method of registering blocks and items.
  2. Is there something wrong with using IBlockstate#getHardness(World, Pos) and passing null? No vanilla block gives a damn about the world and pos values passed. No really. The IBlockState passes off the call to the block method: @Deprecated public float getBlockHardness(IBlockState blockState, World worldIn, BlockPos pos) { return this.blockHardness; } Which is overriden by nothing.
  3. Unlikely. But I don't know what it is you are trying to do.
  4. The data inside the meta files is just info on how to play the animation, there's no "use this file" stuff.
  5. Solution 1: didn't work (still faux 3D) Solution 2: item/block is invisible (no error)
  6. 1) Look at the vanilla furnace TileEntity 2) Add another item slot, create a custom GUI interface 3) Look at the vanilla furnace block and json
  7. Lex means that rotations aren't combinable. Just because one specifies X and the other Y doesn't mean that a combined state will rotate XY, instead it picks "one" and that's why removing it makes the other one work: rotate is really only one field.
  8. I also suggest laying out your common/client proxies to be similar to this: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/EasyRegistry.java https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java I've put mine in a library mod so I can reference the methods from any child mod (hence the static methods and odd name).
  9. Don't. Just override hasTileEntity and getTileEntity in the Block class.
  10. I have discovered that going to sleep and waking up in the morning fixes a lot of problems. It now mostly works. https://s18.postimg.org/gdfc69nu1/2016_10_03_12_25_36.png[/img] Now the item renderer is broke. Edit: Solved. Just had to override getPropertyString in the StateMapper and create another EasyRegistry method to handle using the custom mapper rather than the default state mapper when registering the itemblock renderers. They're still faux-3D though: https://s18.postimg.org/4m2v6w2nd/2016_10_03_13_01_36.png
  11. I do not wish to create a coremod, I would like to modify the content of the vanilla method during application runtime. There is a forum thread about a similar idea here, and it recommends using Access Transformers. Maybe what I am doing is considered creating a coremod, but this is not my intention. Access Transformers are.... A coremod Completely unnecessary as you can use Reflection Don't modify code, only the access level (public, private, protected).
  12. I don't want to hide the property. It's a valid state that effects the block's texture, but only under some circumstances. Two files: oreflowers1.json { "forge_marker": 1, "defaults": { "textures": { }, "model": "oreflowers:flower", "uvlock": true }, "variants": { "normal": [{ "model": "item/generated" }], "inventory": [{ "model": "item/generated" }], "flower_type": { "poorjoe": { "textures": { "cross": "oreflowers:items/poorjoe"} }, "horsetail": { "textures": { "cross": "oreflowers:items/horsetail"} }, "vallozia": { "textures": { "cross": "oreflowers:items/vallozia"} }, "flame_lily": { "textures": { "cross": "oreflowers:items/flame_lily"} }, "tansy": { "textures": { "cross": "oreflowers:items/tansy"} }, "hauman": { "textures": { "cross": "oreflowers:items/hauman"} }, "leadplant": { "textures": { "cross": "oreflowers:items/leadplant"} }, "primrose": { "textures": { "cross": "oreflowers:items/primrose"} } } } } oreflowers1_tall.json { "forge_marker": 1, "defaults": { "textures": { }, "model": "oreflowers:flower", "uvlock": true }, "variants": { "normal": [{ "model": "item/generated" }], "inventory": [{ "model": "item/generated" }], "flower_type": { "poorjoe": { "textures": { "cross": "oreflowers:items/poorjoe"} }, "horsetail": { "textures": { "cross": "oreflowers:items/horsetail"} }, "vallozia": { "textures": { "cross": "oreflowers:items/vallozia"} }, "flame_lily": { "textures": { "cross": "oreflowers:items/flame_lily1"} }, "tansy": { "textures": { "cross": "oreflowers:items/tansy1"} }, "hauman": { "textures": { "cross": "oreflowers:items/hauman"} }, "leadplant": { "textures": { "cross": "oreflowers:items/leadplant"} }, "primrose": { "textures": { "cross": "oreflowers:items/primrose"} } } } } Yes, there is a 2-character difference between the files because only the two states matter.
  13. You can either create a new parent-json that inverts what block-all/block-cross does and use that for the item-block model, or the easier method, simply not use the block-model as a parent, and instead have it render the .png directly, like this: { "parent": "item/generated", "textures": { "layer0": "underworld:items/sugarbeet" } } But I need it to be both. In the world it needs to be block-cross, in-hand it needs to be item/generated.
  14. Do you have an example somewhere? It seems to generate a map that doesn't match what I'm telling it to do, but when I debug my StateMapper, it generates exactly what I want it to find in the json files. Matching A to B: Generating statemap: (default statemap, for comparison) (actual generated) StateMapper: package com.draco18s.flowers.states; import java.util.Map; import java.util.Map.Entry; import com.draco18s.hardlib.blockproperties.Props; import net.minecraft.block.Block; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.DefaultStateMapper; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.util.ResourceLocation; public class StateMapperFlowers extends StateMapperBase { private final IProperty type_prop; public StateMapperFlowers(IProperty prop) { type_prop = prop; } @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { ModelResourceLocation def = _getModelResourceLocation(state); //for debug purposes ResourceLocation loc; if(state.getValue(Props.FLOWER_STALK)) { loc = new ResourceLocation(state.getBlock().getRegistryName() + "_tall"); } else { loc = (ResourceLocation)Block.REGISTRY.getNameForObject(state.getBlock()); } String str = type_prop.getName() + "=" + type_prop.getName(state.getValue(type_prop)); ModelResourceLocation p = new ModelResourceLocation(loc, str); return p; } private ModelResourceLocation _getModelResourceLocation(IBlockState state) { return new ModelResourceLocation((ResourceLocation)Block.REGISTRY.getNameForObject(state.getBlock()), this.getPropertyString(state.getProperties())); } } This is with a blockstate json that does not contain the boolean property. If I add the boolean property the "flower_stalk" placement reverses! It's in the definition#mapvariants but not in the variant string: variant with stalk in json | oreflowers:oreflowers1_tall#flower_type=poorjoe no stalk in json | oreflowers:oreflowers1#flower_stalk=true,flower_type=poorjoe definition#mapvariants with stalk in json | flower_stalk=true,flower_type=poorjoe no stalk in json | flower_type=poorjoe ...Also, how do I get this block to be 2D when it is an item/inhand?
  15. So, I'm trying to puzzle out how to do what I want. I have a block with two properties: A 8-state enum type and a boolean. There are 10 "valid" states as far as what will appear in the world. The boolean is false for all 8 enum states and true for two of them. This allows my custom flower plant to exist as a 2-high block for two of the flower types, but not for the other six. Currently I have this blockstate, which...works, but I can't figure out how to specify that the "flower_stalk=true" texture is dependent on the "flower_type" value as well. I tried doing this as a vanilla variants list and the program just vomited garbage (the variants loaded in as a single variant that was something like "flower_stalk=true,flower_type=poorjoe,flower_type=horsetail,flower_type=vallozia,flower_type=flame_lily,flower_type=tansy,flower_type=hauman,flower_type=leadplant,flower_type=primrose". Removing the forge_flag left me with an empty variants list. { "forge_marker": 1, "defaults": { "textures": { }, "model": "oreflowers:flower", "uvlock": true }, "variants": { "normal": [{ "model": "item/generated" }], "inventory": [{ "model": "item/generated" }], "flower_type": { "poorjoe": { "textures": { "cross": "oreflowers:items/poorjoe"} }, "horsetail": { "textures": { "cross": "oreflowers:items/horsetail"} }, "vallozia": { "textures": { "cross": "oreflowers:items/vallozia"} }, "flame_lily": { "textures": { "cross": "oreflowers:items/flame_lily"} }, "tansy": { "textures": { "cross": "oreflowers:items/tansy"} }, "hauman": { "textures": { "cross": "oreflowers:items/hauman"} }, "leadplant": { "textures": { "cross": "oreflowers:items/leadplant"} }, "primrose": { "textures": { "cross": "oreflowers:items/primrose"} } }, "flower_stalk": { "true":{ "textures": { "cross": "oreflowers:items/flame_lily1"} }, "false":{} } } }
  16. Thanks diesieben07. I'm only trying to help the maintainers get it updated, so I don't know how it does most of what it does, so I was making an educated guess and was wrong, but couldn't find an alternative. The change made it work, which is good. There's still two issues, neither of which I'm qualified to resolve, but the mod runs well enough for my purposes (cancels vanilla or been and does is own).
  17. net.minecraft.block.state.IBlockState state ? Really? Couldn't be arsed to import that? As for the crash... Caused by: java.lang.NullPointerException at io.github.dommihd.blazecraft.items.EmberOrchidSeeds.onItemUse(EmberOrchidSeeds.java:33) ~[EmberOrchidSeeds.class:?] Go to EmberOrchidSeeds line 33. Find the thing that is null, it is very easy.
  18. Not to mention that your client proxy then calls ModItems, which is common code, further defeating the purpose of proxies.
  19. Yep, thanks. Even if it was something dumb on my end. Which, really, is about half of all programming bugs anyway.
  20. Ok, interesting. I had a chunk of blockstate file that was referring to a variant I'd commented out (because I was having trouble and decided to simplify things) and had removed for my post. Removing that chunk and it works (the breakpoint showed me what it was in the blockstate mapping). Lesson learned. Going to try adding back in the other boolean... ...and we're still good. (Now if I could only figure out why Windows can't find any updates to install and just sits there forever...)
  21. Hmm. I do know I was seeing each variant bit twice, I'll give you that. I didn't see anything that stood out other than each variant being logged twice. Let's see... Whole log. I see one due to missing file and another due to ModelBlockDefinition$MissingVariantException
  22. Just when I think I have the system figured out and do exactly the same thing I did for one block with another block and everything falls apart. The error: Blockstate: Model oreflowers/models/block/flower.json Block registration: Note that the error says that it can't find the file oreflowers:models/item/oreflowers1.json , but when I do this exact same registration for another metadata block/itemblock combo it neither complains about nor needs this file: it uses the blockstate json. If I move (or copy) the blockstate json to models/item then I get no errors, but an invisible world-model and a flat MISSING inventory model (and giant cube hand model).
  23. Ah ha, brilliant. I'll give that a bash. Edit: Yup, that prevented the problem. Still some issues deeper on in (a command throws "error: null") but that's one step closer to a port.
  24. I think you meant I18n.format("example.string", TextFormatting.BOLD, TextFormatting.RESET)

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.