Everything posted by Draco18s
-
[1.12] [Solved] No texture on json model block
It's a Java convention thing, that. Static values are in all upper case, class names are UpperCamelCast, variables and function names are lowerCamelCase. The BlockFoo and BlockBar and ItemBaz are an MCP naming convention, but one that I happen to like. After that, making method calls that invoke more method calls is just ridiculous. The only reason to do that is if the method actually adds something from its scope context (that isn't accessible outside it). For example, if I want to have items that define their model via NBT data I still want to register it as normal, but I need additional information from the class / class instance, so I have this method: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/industry/item/ItemCastingMold.java#L89 Or this method, for custom IStateMapper implementations: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/flowers/block/BlockOreFlower1.java#L160 And when I need those functions I can just cast to the interface. Or use generic covariance magic: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L75 The cast here is actually unnecessary due to said magic (block is of Type T which is defined as block a Block and an IBlockWithMapper): https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L79
-
[1.12] [Solved] No texture on json model block
This is very confusing: https://github.com/THEJean-Kevin/goblin/blob/master/src/main/java/com/mineaurion/tjk/goblin/block/ModBlock.java#L17 1) Class names should start with an upper case letter 2) You really should use the most general-case Type possible (e.g. Block mine0 = new Mine_Lv_0();) so that people reading your code can understand it better. 3) Then if you need to, you can cast (I don't like seeing createItemBlock() in a base block class that all your blocks extend, but it's not that terrible). 4) Even better, make your class names include the base class, e.g. BlockMine_Lv_0 Oh god this is disgusting: https://github.com/THEJean-Kevin/goblin/blob/master/src/main/java/com/mineaurion/tjk/goblin/block/ModBlock.java#L31 You take a client-side-only event, call a piece of code that is not marked Side Only, then just forward the method call to your Proxy. Just do Main.proxy.registerItemRenderer(Item.getItemFromBlock(mine0), 0, name); https://github.com/THEJean-Kevin/goblin/blob/master/src/main/java/com/mineaurion/tjk/goblin/proxy/clientProxy.java#L23 Use item.getRegistryName() instead of References.modid+":"+name
-
[1.12] Spawning Items
Don't spawn items on the client. Only spawn them on the server.
-
[1.12.1] Custom ItemStackhandler.insertItem being called twice per item inserted
Is one of the calls with simulate=true?
-
[1.10.2] NBT on item disappears when getting out of slot
I don't understand your problem. What disappears?
-
Does make sense going over 20 armor points?
Well, the other half is a complex formula (the part inside max(...)) that means that the more damage you take at once, the less each point of armor counts. But yes. The maximum damage reduction you can get is 80% Also, hit points are a float, meaning you can (and will) take 0.01 damage in certain circumstances (death by a thousand tiny cuts).
-
Does make sense going over 20 armor points?
Well, yes, there is a maximum amount of damage reduction. That's what min(...) does.
-
[1.12.2]TileEntity for harvester block
Set a breakpoint and run it in the debugger. Figure out what it's not doing that it should be.
-
Does make sense going over 20 armor points?
The damage formula is damage = damage * ( 1 - min( 20, max( defensePoints / 5, defensePoints - damage / ( 2 + toughness / 4 ) ) ) / 25 ). You can figure it out. Toughness is 0 for all types of (vanilla) armor except diamond (which has 2). Defense points is the number of armor displayed in the UI.
-
[1.12.2] Changing general attack speed without specific item
If the iattributeinstance is null, then get the modifier from the iattributeinstance...
-
[1.12] Dropping 2 Items when breaking a block
BlockFlowerPot line 433. It says: /*============================FORGE START=====================================*/ And then some functions.
-
[1.12] Dropping 2 Items when breaking a block
The fact that the chest being not-empty causes the undesired behavior, we can look at your code and find that you have a conditional for exactly this case: if (!tileentityiubertable.isEmpty()) { Therefore, this code is responsible for dropping one of the two items. spawnAsEntity(worldIn, pos, itemstack); Oh, look, it does. However we know that this is also the version we want to drop therefore it must be something else that's causing the empty copy to drop. Hmm. Empty chest...wait, we get one of these when the chest is empty too! There must be a line that is probably responsible and outside that if-block. Getting a TE...no Casting a TE...no Only one other line: super.breakBlock(worldIn, pos, state); This must be responsible. Unfortunately as you did not include your whole class, I cannot be sure that the parent class is not just Block.
-
[1.10.2] Change item texture based on NBT values
TiC almost certainly uses multiple pieces to create their items. e.g. there's a wooden shaft, a metal blade, and a leather grip. So the item model is actually 3 models combined. They only register 3* images to get baked into models, then the item uses all three when created. Also, TiC is on GitHub: https://github.com/SlimeKnights/TinkersConstruct *Obviously there are more, the "3" in this context is the example three.
-
[1.10.2] Change item texture based on NBT values
Those are both ModelLoader tasks. Which bake models. Which you would still have to do. So yes.
-
[Fixed] Help with metadata blocks and events
Assuming that getItem() returns the Item and not an ItemStack... if(event.crafting.getMetadata() == whatever) { }
-
Idk
int totalCoins = 0; totalCoins = totalCoins + coins; Wot
-
[1.10.2] Change item texture based on NBT values
You would still need to register each image so that it can be baked into a model.
-
[1.12.2] Changing general attack speed without specific item
Create and use your own UUID.
-
How do you remove crafting recipes, specifically anvil recipes?
Anvil? Don't know, never tried.
-
How do you remove crafting recipes, specifically anvil recipes?
Removing a crafting table recipe is easy: Subscribe to the Register<IRecipe> event and (casting the event's registry to IForgeRegistryModifiable) simply remove the desired recipe from the registry via its ResourceLocation Fiddling with the anvil is harder.
-
cps
What version are you working with?
-
cps
Press F3 on your keyboard. Magically, Minecraft displays both of those things for you. That said, it doesn't display a "clicks per second" counter, but I don't even see the point of one. It's either going to read 0 (no clicks this second) or 1. MAYBE you'd get a 2 once in a while. Something something spam-clicking during combat something something completely pointless.
-
[1.10.2] [SOLVED] "In" as a suffix in given parameters?
Well, obviously...
- How to display fps
- How to display fps
IPS spam blocked by CleanTalk.