Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. TLDR your block highlight outline does not have to match your model exactly. Also, if I'm not mistaken, that voxelshape extends outside the 1x1x1 block volume.
  2. Doing these things moves the camera. Your code subtracts the camera's position value from the MatrixStack.
  3. 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).
  4. You're going to have to dig around in the vanilla files for it.
  5. 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.
  6. The code that renders players names above their head effectively does this.
  7. Should be able to spawn the exp during loot modification. Or at least that's what I'd try first.
  8. 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/
  9. 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.
  10. Post your entire TE class. It appears you are using IInventory, which you should not be using.
  11. Shocker, there's a server side copy and a client side copy. $100 says you didn't sync your data.
  12. 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?
  13. 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.
  14. 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.
  15. Yes we know what it looks like. The client and server have desync'd. We need more of your code.
  16. [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)
  17. 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.
  18. 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
  19. Your CapabilityProviderEntities is not a Size capability. Also I don't think your event handler is properly registered with the event bus.
  20. 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.
  21. 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).
  22. 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.
  23. 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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.