-
Posts
1830 -
Joined
-
Last visited
-
Days Won
12
Posts posted by DavidM
-
-
9 minutes ago, KdotDevelopment said:
What i did was find the little part that said "holdingBarrier &&" and removed it. I made an abstract option within video settings to toggle it on and off.
You can still do this with the method I described above. Add an if statement before the rendering to check for this option would work.
9 minutes ago, KdotDevelopment said:As a bonus for myself, i created a creative tab just for the items you can only get with commands (like barriers and command blocks).
In Forge, you can create a new ItemGroup and add in the items by overriding ItemGroup#fill.
9 minutes ago, KdotDevelopment said:Also, i didnt make this clear but I need it to work on multiplayer.
Overriding the registry on a specific side is fine as long as the entries still matches up with the server/client. I.e. the server and client can have completely different blocks under the entry "dirt block", but there will be no problem with the game; it would render as the block on the client, while certain server-side functions are handled by the server-side block under the same entry.
Note that overriding registry entries might cause incompatibilities (when 2 mods try to modify the same entry, only one mod will succeed). However it is still better in terms of compatibility than using a core mod as the former still respects the Forge system.
-
15 minutes ago, KdotDevelopment said:
Well, i already made the whole mod from just vanilla code, i was just wondering if I could port it over to forge so I can actually make it run.
Depends. If all you did is created a rendering method that would integrate well into Forge's event driven system, then yes.
15 minutes ago, KdotDevelopment said:And if you wouldnt mind, could you explain how I could do this without modifying the vanilla code?
In vanilla Minecraft, barriers are rendered as particles, and handled inside ClientWorld. This might sound impossible, however you could replace the barrier block itself by overriding the registry and its entry in the Blocks class. After that, you have control over the full block. Simply use a TESR or subscribe to RenderWorldLastEvent and render the barrier sprite or emit the vanilla barrier particle in the block.
If you feel like replacing the block entry may cause incompatibilities, you can also subscribe to RenderWorldLastEvent and render the barrier sprite at the vanilla barrier blocks (or use vanilla particles); however, this method would require you to set up a system to record all the barrier blocks in the world.
-
2 hours ago, KdotDevelopment said:
Anyway, before you respond that editing vanilla code is dead, i need you to realize that this is the only way to do it.
Modifying vanilla isn't supported on these forums.
In your case, modifying vanilla code isn't even necessary (People always say "my case definitely need a core mod", but it is in fact not needed in 99% of their case. You just have to be creative with the system ).
Simply replace the barrier renderer with your own implementation.
-
AFAIK Forge would never do anything like that.
-
Try adding a debug line before rendering and print out the health. What does it say?
-
You need to stitch your texture into the atlas during TextureStitchEvent.Pre.
-
27 minutes ago, lisilew said:
What happens when no one is tracking the entity? Will the entity still get damaged?
Yes.
28 minutes ago, lisilew said:Is this considered a bad practice in terms of performance? If so, what method would you recommend?
It's fine, but stuff like potion effects might be better.
-
You need to apply the Food you created to your item.
-
Create an instance of Food.Builder and build your food item with it.
-
1. I'm not sure if using GL11 in 1.15.2 is a good practice. Since GlStateManager has been made deprecated, there is probably a replacement for that.
2. Try disabling lighting.
-
11 hours ago, Fuffles said:
Welp, I feel like this whole Reflection thing is haunting me at every corner : /
Reflection itself is actually pretty to understand; however, Mojang's obfuscation complicates the matter. I would suggest to look into Java's reflection itself before trying out Forge's API for it.
-
11 hours ago, +=WhatSteve - Forge said:
OF provides capes
Optifine do not provide "Minecraft capes".
All they do is add a render layer to the donators that can only be seen if others have Optifine installed. It has nothing to do with Mojang's cape.
Optifine's adding custom cape is considered a dick move in the community, as Mojang stated that modders should not mess with capes.
-
5 minutes ago, Fuffles said:
Aren't all Vanilla things set to final?
You can use reflection.
-
5 hours ago, Weirdo said:
ok, and how is that helping me?
Don't mean to be rude
Because at this point there is so many things that can go wrong, and it would take ages for other people to guess one by one.
By seeing your code we can stop guessing in the dark and instead figure out what is wrong immediately.
An analogy that is popular on this forum: just like in real life doctors have to examine your body to figure out what is wrong; they can’t magically know what is wrong if all information they have is “doctor it hurts”.
- 1
-
You can override the entire entity with an implementation of your own.
-
I’m pretty sure that a log at debug level would log warn level problems.
-
Please post your code as a GitHub repo.
-
Post your code.
-
Mods aren’t supposed to be zip files. What mod are you using?
-
What version of Minecraft?
What version of Forge?
What language are you playing in?
Please also post your debug.log.
-
30 minutes ago, Turtledove said:
Send a packet to server when it triggers, and negate it there.
Isn't LivingFallEvent also fired on the server side?
-
Clear out BetterFPS then (it is a core mod, so try reporting to its author before reporting to Forge).
-
if (event.side == LogicalSide.SERVER && DaBoisMod.getCapabilityOf(event.player, FallingFromSkyProvider.FALLING_FROM_SKY_CAPABILITY).isFallingFromSky()) { if (!event.player.onGround) event.player.fallDistance = 0F; else DBMPacketHandler.sendToServer(new SSyncFallingFromSkyPacket(false)); }
Assuming that the method names are correct, you are already on the server side in this if statement; however, you are still sending a packet to the server.
Also I think there is an entity land event or something, and it might be better to use that for your case.
-
39 minutes ago, +=WhatSteve - Forge said:
Would Forge also have native support for OF (OptiFine)?
OptiFine would have to add Forge support if they want it to work with Forge.
40 minutes ago, +=WhatSteve - Forge said:I'm wondering if this is just another Badlion
Forge has nothing to do with launcher. It is modifications to the game to provide cross-mod compatibility.
Edit PlayerController Source
in Modder Support
Posted
https://www.geeksforgeeks.org/reflection-in-java/
Since Minecraft code is obfuscated, use ObfuscatedReflectionHelper.