Everything posted by Draco18s
-
[1.11] Disabling enchantments
reverse your if statement. All you're doing is asking if the book has Mending, Unbreaking, or Fortune, and allowing the whole book to go through. You need to ask if it contains an enchantment that is not one of those.
-
need help w/ textures block and item
try new ModelResourceLocation(item.getRegistryName, lookup.variantnames()); although you may have to reconfigure your json files.
-
[1.11] Disabling enchantments
This took me oh so long to find. /** * Allow or forbid the specific book/item combination as an anvil enchant * * @param stack The item * @param book The book * @return if the enchantment is allowed */ public boolean isBookEnchantable(ItemStack stack, ItemStack book) { return true; } By which I mean I opened up the Item class and searched for "Enchantment" and it was the first result.
-
Renamed: Figured out most of villagers, need help ironing out bugs
Storing the information and syncing with the client. getEntityData() is not a good use for what you are doing.
-
need help w/ textures block and item
new ModelResourceLocation(Reference.RESOURCE.RESOURCE_PREFIX + name + lookup.variantnames()[i], "inventory"); You know... items have a getRegistryName() method... new ModelResourceLocation(item.getRegistryName + lookup.variantnames()[i], "inventory");
-
Renamed: Figured out most of villagers, need help ironing out bugs
Use capabilities.
-
[1.11] Custom tool - custom drop
- [Forge 1.11] Access Transformers not working?
"the mod author"? What mod? If you mean Forge, then yes, Forge is allowed to do it because it's making things public for modders. It's part of Forge's patches. Anyway, this is good reflection: 1) https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/wildlife/WildlifeEventHandler.java#L136 2) https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/wildlife/WildlifeBase.java#L330-L331 3) https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/wildlife/WildlifeEventHandler.java#L1149 Mind, it could be better (I can't find any of my reflection stuff in 1.10 right now). But that should give you an idea. 1) Declare a field 2) Set it to something, and do that once.* 3) Use it a lot *This is where I could do better. I have it set to look for the SRG name, then in the error handling look for the MCP name. I could instead use ReflectionHelper. ReflectionHelper will do a lot for you, it's a great class.- [SOLVED] [1.10.2] Container won't save contents and gives error on login
Notice that his tutorial doesn't display the sword or have a GUI of any kind.- [SOLVED] [1.10.2] Container won't save contents and gives error on login
Baaasically all of this: https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/ores/entities/TileEntityPackager.java#L212-L227- [Forge 1.11] Access Transformers not working?
Not if you do it right. Get the field or method once and save a reference to it. The rest is pretty darn fast.- [Forge 1.11] Access Transformers not working?
Do not make core mods. You do not need Access Transformers: use reflection.- [SOLVED] [1.10.2] Container won't save contents and gives error on login
The client is crashing: [20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:120]: tileEntity numSlots before reading from NBT: 4 [20:26:03] [Client thread/INFO] [sTDOUT]: [com.daeruin.primalcraft.tileentity.PrimalTileEntity:readFromNBT:121]: NBT numSlots before reading from NBT: 0 It does not appear that you are syncing your TE correctly.- [SOLVED] [1.10.2] Container won't save contents and gives error on login
Did you have one placed in the world before you wrote the "save the number of slots" code?- Error when trying to run minecraft from IntelijIDEA after environment setup.
Not just Minecraft apparently:- [1.11] Custom tool - custom drop
.equals() won't work on ItemStacks either, by the way. You need to use ItemStack.areStacksEqual() Or compare the item/metadata directly.- Error when trying to run minecraft from IntelijIDEA after environment setup.
Isn't this problem solved by disabling the loading screen?- [1.11] Custom tool - custom drop
Do what I said in the bulleted list Don't do any of it, do what diesiben07 said.- [1.11] Custom tool - custom drop
"Mess" you mean "mess."- [1.10.2 - 1.11.2] Ores as Metadata
Just so you know: You can't "make Andesite have ore as metadata" because Andesite is already a metadata variant of Smooth Stone. So you're going to need to make your own custom block and texture it appropriately. You have two options: Option 1: Create an overlay texture that is transparent except for the ore bits, use a block model that has two layers, the base layer (andesite, etc.) and the overlay (coal, etc.) Option 2: Create an overlay texture that is transparent except for the ore bits, then use a custom TextureAtlasSprite class to smoosh this overlay onto a copy of the base texture (andesite, etc). I did something like this in 1.7.10, if you're interested. This method took in the block-to-replace (andesite, etc) and created a new block: https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/StoneRegistry.java#L49 This method handled the loading and combining of two textures: https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hardlib/client/TextureAtlasDynamic.java#L53- any tips on stitching terrain?
I haven't done anything with chunk generation and noise, so I can't really help you there.- My capability will not persist.
No. Your capability exists serverside, this is where you make ALL CHANGES. When a change is made you send a packet to the client to update the display.- [SOLVED]SaplingGrowTreeEvent - replace sapling / tree with different block
Probably because the sapling grow event still completes and replaces your block with a tree. (You need to cancel the event)- [1.10.2] Underground structure generation problem
Also wrap your booleans. By having them unwrapped it does this: if (world.getBiomeGenForCoords(new BlockPos(x, 30, z)).equals(Biomes.ICE_MOUNTAINS)... "Hmm, is it ice mountains? Yes, yes it is. This whole statement evaluates to true." And bypasses your random call. https://en.wikipedia.org/wiki/Order_of_operations#Programming_languages A || B && C ≡ A || (B && C)- [1.11.2] Container out of bounds error
No, when you access 36, you access 36. The problem is, arrays are zero-indexed. Yes, it's the 37th item, but that's a different numbering system. - [Forge 1.11] Access Transformers not working?
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.