Everything posted by Draco18s
-
[1.8.9] Adding Special Blocks
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
-
[1.8.9] Issue with new Forge Blockstate
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.
-
[1.10.2] How should I make the new Item Variants?
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).
-
Dynamically change inventories size of a chest.
Don't. Just override hasTileEntity and getTileEntity in the Block class.
-
[1.10.2] Complex Variants
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
-
[1.10.2][SOLVED] Modifying a vanilla method
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).
-
[1.10.2] Complex Variants
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.
-
[1.10.2] Complex Variants
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.
-
[1.10.2] Complex Variants
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?
-
[1.10.2][SOLVED] Modifying a vanilla method
And why
-
[1.10.2] Complex Variants
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":{} } } }
-
[17 -> 1.10] Puzzling Hang
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).
-
Missing Texture without error
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.
-
Missing Texture without error
Not to mention that your client proxy then calls ModItems, which is common code, further defeating the purpose of proxies.
-
[1.10.2] Blockstates, models, and files...again
Yep, thanks. Even if it was something dumb on my end. Which, really, is about half of all programming bugs anyway.
-
[1.10.2] Blockstates, models, and files...again
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...)
-
[1.10.2] Blockstates, models, and files...again
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
-
[1.10.2] Blockstates, models, and files...again
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).
-
[17 -> 1.10] Puzzling Hang
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.
-
[1.10.2] [SOLVED] Item and ItemBlock and Block tooltips
I think you meant I18n.format("example.string", TextFormatting.BOLD, TextFormatting.RESET)
-
Missing Texture without error
Your blockstate is wrong. You're telling Minecraft to look for a model that doesn't exist. You should instead override the texture, like so: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/resources/assets/harderores/blockstates/hardiron.json
-
[17 -> 1.10] Puzzling Hang
No, the loop was the main game loop. Everything was functioning as it should, except I couldn't see the game. Ended up just commenting out event handlers until I could get into the game, narrowed it down to one. https://github.com/Draco18s/CustomOreGen/blob/1.10-Update/src/main/java/CustomOreGen/FMLInterface.java#L87-L93 @SubscribeEvent public void onServerTick(ServerTickEvent event) { if (event.phase == TickEvent.Phase.END) { ServerState.checkIfServerChanged(FMLServerHandler.instance().getServer(), (WorldInfo)null); } } Examining this in the debugger is actually difficult, because having the checkIfServerChanged commented lets the game run. Having it uncommented prevents the game from running, but the breakpoint on it is never encountered. Ended up having to round-about get at it (comment, run in debug, uncomment) and found that FMLServerHandler.instance().getServer() is returning null, and only null. Is there another way to get the MinecraftServer instance without access to a World object serverside?
-
[1.10.2] [SOLVED] Item and ItemBlock and Block tooltips
Using the text translation around the bit that isn't the color/formatting. tooltip.add(TextFormatting.BLACK + I18n.translateToLocal("the last of it - the last of them"));
-
[17 -> 1.10] Puzzling Hang
So I thought I'd try my hand at updating Custom Ore Gen from 1.7.10 to 1.10.2, figuring that I can bypass the blockstate issues by just letting COG handle it as metadata as it always has and translate back into blockstate only when it interfaces with vanilla code. Not the greatest solution in the world, but one that would be quick and easy to pull off. 90% of everything else was just figuring out the new name something got. That left me with a UI issue where the buttons and sliders weren't getting their mouse clicks (fixed) and....an issue I have no idea how to even diagnose. The issue is that everything seems to run just fine. Game loads up, I can use all UI, I can create a new world. And that's it. Once a world is created (either by loading a save or creating a new world) it reaches 100% says "Changing view distance to 12, from 10" and then hangs. No further messages are printed, the game just displays a dirt background with "0%" written in the center. I tried going into debug mode and seeing where the execution goes, but it appears to just be ticking the world as normal. In so doing, I got it to print the "Can't keep up! Did the system time change, or is the server overloaded?" message. Hitting escape on this "0%" screen returns me to the main menu and throws a NPE in ForgeChunkManager.unloadWorld (line 620). I have a fork at https://github.com/Draco18s/CustomOreGen/tree/1.10-Update
-
[1.10.2] [SOLVED] Item and ItemBlock and Block tooltips
Add information is client side only. It makes no sense on the server. The advanced boolean, I believe, is true if the player is holding Shift.
IPS spam blocked by CleanTalk.