-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Doing these things moves the camera. Your code subtracts the camera's position value from the MatrixStack.
-
Particles have color fields that are used to set their color. As for spawning (client side only), Minecraft.getInstance().particles.addEffect(particle); (Note, I last messed with this in 1.14, and while I don't think it has changed much, the update to use Mojang's mappings may have changed the names).
-
You're going to have to dig around in the vanilla files for it.
-
Coremods are a specific type of modding hook that burrows down into the Java bytecode by way of the ASM package. Coremodding is heavily discouraged and little documentation exists for instructing people how to make coremods because of how easy it is to write code that looks like it works, but when your mod intersects with someone else's mod, the game catches fire, dies, and points the blame at Mojang (or the other modder), making users head to the wrong place to report a bug. You can do literally anything via a coremode and that's why it's discouraged: you can do ANYTHING and that includes unsafe things.
-
The code that renders players names above their head effectively does this.
-
[1.16.5] Cannot get data from TileEntity in TileEntityRenderer
Draco18s replied to MIssNalgas's topic in Modder Support
Yep, you're using IInventory. Check the class hierarchy for LockableTileEntity. You should be using Capabilities instead. https://mcforge.readthedocs.io/en/1.16.x/tileentities/tileentity/ https://mcforge.readthedocs.io/en/1.16.x/datastorage/capabilities/ -
You should post your code as code so that we can examine it in our own development environment without having to retype it. You should also post whole classes so we know where this code is.
-
[1.16.5] Cannot get data from TileEntity in TileEntityRenderer
Draco18s replied to MIssNalgas's topic in Modder Support
Post your entire TE class. It appears you are using IInventory, which you should not be using. -
[1.16.5] Cannot get data from TileEntity in TileEntityRenderer
Draco18s replied to MIssNalgas's topic in Modder Support
Shocker, there's a server side copy and a client side copy. $100 says you didn't sync your data. -
Is there some reason you took a picture of your code (which is text) instead of including your code in your post's text content?
-
[Solved] world.setBlockState not updating all blocks
Draco18s replied to Tut's topic in Modder Support
Because the server is not the client. They are different threads (and in the case of multiplayer, may be on different machines!) I'm not sure why the usual block state change isn't being propagated as normal, but I would do as Luis says and just remove the side check. -
Your first instinct when trying to do something should be to ask yourself "is there anything in vanilla minecraft that does this?" And in this case, there is! Both the hopper and the pressure plate look for items "on top of" themselves and do something. The hopper is a better resource in this instance, as the top of the block is at the boundary (i.e. it acts like a full cube in the direction we care about). You can then go look at the vanilla source and see how vanilla does it.
-
You also haven't done this:
-
[Solved] world.setBlockState not updating all blocks
Draco18s replied to Tut's topic in Modder Support
Yes we know what it looks like. The client and server have desync'd. We need more of your code. -
[Solved] world.setBlockState not updating all blocks
Draco18s replied to Tut's topic in Modder Support
Probably this. -
[12.05 15:44:21] [Server] java.util.concurrent.ExecutionExceptionjava.lang.RuntimeException: Attempted to load class net/minecraft/client/entity/player/ClientPlayerEntity for invalid dist DEDICATED_SERVER via: me.desht.pneumaticcraft.common.recipes.PneumaticCraftRecipeType.getRecipes(PneumaticCraftRecipeType.java:119)
-
You don't have this. Not strictly needed, as you're registering the implementation class directly which is fine. You just can't share your Capability to other mods, IIRC. You will still need to implement the serialization interfaces, however. This is why your CapabilityProviderEntities is useless. You don't need it. Entities already are ICapabilityProviders. Also most of that ICapabilityProvider information is out of date: Size::new is sufficient.
-
MinecraftForge.EVENT_BUS.register(CapabilityProviderEntities.class); That does not register the CustomSizeAddEvent class.... Nor does your CapabilityProviderEntities class have any event handling methods.... In order to reference your CAPABILITY_SIZE compatible capability you need to attach a CAPABILITY_SIZE compatible capability to the entity. Your SizeCapability class is not your capability, it is merely a static class that holds a reference to the CAPABILITY_SIZE registry entry, similiar to ModBlocks or ModItems. That is, your class names are awful. Size -> your capability SizeCapability -> your registry object reference CapabilityProviderEntities -> a capability provider (that is completely useless) CustomSizeAddEvent -> your event handler
-
Your CapabilityProviderEntities is not a Size capability. Also I don't think your event handler is properly registered with the event bus.
-
You should use ifPresent (if there's a likelyhood that the capability won't be present) or use orElseThrow (if you know the capability should always be present) rather than orElse(null) and not null-check. Your problem is that you never attach the capability to any entities and your CapabilityProviderEntities class is both (a) unnecessary because entities are already capability providers and (b) unused, as your code never calls any of its methods.
-
One idea is to look for existing usage of the class and replicate it. The problem is that you can't just "get a block's drops" because it might depend on who's harvesting the block (or for that matter, it might be random!) What effect are you trying to achieve? (answer from what the player observes happening, not your attempt to code it).
-
[1.16]How to hide the block's CollisionBoundingBox in 1.16?
Draco18s replied to middangeardim's topic in Modder Support
If only there was some documentation... https://mcforge.readthedocs.io/en/1.16.x/events/intro/ That said, middangeardim, I'm not sure why you're going about doing this with events when the "method to override" path is available to you and all you need to do is return an empty VoxelShape instead of a null one. -
[Solved] [1.16.5] Render line between two blocks
Draco18s replied to Block's topic in Modder Support
IIRC the LINE drawing mode of OpenGL doesn't actually draw anything. (I think that's what the 3 specifies in your begin() call). It's been a long time since I messed with this, but the drawing mode I used was QUADS (you should use the constants around...somewhere, but numerically it's probably 7) and give your line some amount of thickness. This is some really old code, but has the relevant math. https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/hazards/client/HazardsClientEventHandler.java#L422-L451 -
"This method cannot return null." "Return null." Yes I'm sure that'll compile. 😒 There just might be a good reason...