-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
createTileEntity in Block [1.16.1] any way to auto from registry?
Draco18s replied to jackokring's topic in Modder Support
You're asking to convert from centigrade to pounds. -
You're saying "for every element that gets drawn on the screen, draw my GUI."
-
createTileEntity in Block [1.16.1] any way to auto from registry?
Draco18s replied to jackokring's topic in Modder Support
This statement makes no sense. You can't "convert" a block to a TileEntity. You can't even assume that a block only has one TE it supplies. -
That is not how the game works. The registry name should always be compile-time-constant. The fact that registry events run before your mod has access to Forge-supplied configs is intentional. Do not try and work around the system. If you want an item with a randomized display name, then override the appropriate methods to return a randomized display name, but do not fuck with its registry name.
-
1.16.1 Modding Assistance - Blocks not existing?
Draco18s replied to OneRealKieran's topic in Modder Support
There's a method that I believe is called isReplacable which, if it returns true, allows your blocks to be replaced when placing other blocks. But as d7 says, we need to see your code to know for sure what's going on. -
[SOLVED] [1.16.1] How to check if player can take a stack?
Draco18s replied to RubyNaxela's topic in Modder Support
Its in your external resources. The first one is most of the code, client-extra.jar has a lot of the recipes, blockstates, and such. -
By the way, your mods.toml file is wrong That should be your modid. Ditto commenting out/removing all of the optional values you left with dummy text in them. You should also use MainModClass.MOD_ID for this line (and other similar lines, like your @Mod annotation).
-
Show your asset folder(s)
-
[SOLVED] [1.16.1] How to check if player can take a stack?
Draco18s replied to RubyNaxela's topic in Modder Support
There's also: ItemStackHandler.insert(stack, true).isEmpty() -
https://minecraft.gamepedia.com/Tag
-
[SOLVED] [1.16.1] Block harvest level and tool is ignored.
Draco18s replied to RubyNaxela's topic in Modder Support
0 = none 1 = wood 2 = stone 3 = iron 4 = diamond -
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Draco18s replied to Help!'s topic in Modder Support
This cannot return null. -
That's a function of interpolation. Chrome's pretty good at it. Raw OGL is not. If you scale the images down to the desired size yourself you'll have the most control.
-
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Draco18s replied to Help!'s topic in Modder Support
...and your code -
Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Draco18s replied to Help!'s topic in Modder Support
Seriously, stop pretending to know what the important bits are and post the whole thing. And your code. Preferably as a git repo -
This has nothing to do with the question at hand.
-
[Solved] [1.16.1] Trouble with Capabilities and LazyOptionals
Draco18s replied to majesity's topic in Modder Support
You also have it in PlayerData: Assuming the class still exists (it is unclear, as we don't have your full source code, eg. a github repository). Use your IDE to search for references to the register() method and find where you're calling it in your code and I bet you'll find the offender. -
[Solved] [1.16.1] Trouble with Capabilities and LazyOptionals
Draco18s replied to majesity's topic in Modder Support
This is why orElseThrow is a better idea for the event. -
[Solved] [1.16.1] Trouble with Capabilities and LazyOptionals
Draco18s replied to majesity's topic in Modder Support
Show updated code for that event method. -
[Solved] [1.16.1] Trouble with Capabilities and LazyOptionals
Draco18s replied to majesity's topic in Modder Support
LivingEntity player = event.getEntityLiving(); IPlayerData data = player.getCapability(PlayerDataProvider.capability).orElseThrow(IllegalStateException::new); You only attach data to the player. LivingEntity is not necessarily a PlayerEntity. -
[Solved] [1.16.1] Trouble with Capabilities and LazyOptionals
Draco18s replied to majesity's topic in Modder Support
By the way These two methods on your capability make no sense. If you have the capability, getting a capability from it is nonsense (capabilities are not themselves capability providers, unless they are, in which case you would have to additionally extend that interface). Anyway, I think your classes have gotten confused with each other in what each one's purpose is, so the thing you're attaching and trying to get back out isn't actually the same thing as the object you expect to hold the data. Or it isn't being attached, registered, or retrieved properly. Little unclear because you haven't shown where you're trying to get it at (you've shown the code you're using but not its enclosing scope). Either way, I suggest taking a look at my code: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/api/capability/CapabilityMechanicalPower.java -
[Solved] [1.16.1] Trouble with Capabilities and LazyOptionals
Draco18s replied to majesity's topic in Modder Support
test.getStrength() -
This line: https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/McAndGuns.java#L77 References this class https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/client/StaticClientEventHandler.java Which the JVM needs to insure that it is valid, and does not know which parts, if any, may be executed (thus all further references the JVM needs to make sure have already been loaded, or can be loaded if needed). But it cannot because it references this class: https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/entity/RenderBullet.java which references: https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/entity/RenderBullet.java#L6 Which the JVM cannot find. I should note that this annotation: https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/client/StaticClientEventHandler.java#L20 registers that class to the event bus on the client only. This line: https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/McAndGuns.java#L77 registers the same method on both sides.