-
Posts
14 -
Joined
-
Last visited
Converted
-
URL
github.com/Brainterminator
Recent Profile Visitors
6437 profile views
Brainterminator's Achievements
Tree Puncher (2/8)
1
Reputation
-
In the default Textures, there is a folder colormap with a png file called foliage. I want to know how I can use that custom Foliage. But I don't know which class to look at These classes do not directly access any png files. Any Idea which class possibly does that?
-
Hey guys I made an Item that can store an Ore Location as NBT Data. The Problem is now that when I drop the Item or move it inside of my Inventory the NBT Data is lost. Also for some reason when I open a chest or an anvil the NBT Data is lost as well. Now comes the weird part: When I open my Inventory in Creative Mode for about 2 seconds it permanently saves the NBT Data. Then I can drop it move it in my inventory and open chests. Does anybody have an Idea what's going on? I'm clearly not understanding how the Inventory is handled and I also understand that dropping an Item must mean it will be somewhat converted into a different entity. Thanks in regards for your help! The Github Repository is: https://github.com/Brainterminator/utilityblocks
-
Brainterminator changed their profile photo
-
Hey, I'm fairly new to the modding community and I'm coding a Mod that includes Vertical Slabs for 1.18. Coding the Slabs I pretty much took the way Stairs are made and just removed the bottom extended part. I wanted to take the Original Minecraft textures and after hours of getting the ColorMaps and Tinting to work I realized, that Blocks behind the full Block Side are not rendered. I read something about "culling" but I didn't quite understand. It looks like this: I suspect that the problem is not in my .json Files but in my custom class "ConnectableWallBlock" because it doesn't really matter, even if I take the original oak leaves json it doesn't work. I also tried taking the getVisualShape (like in the AbstractGlassBlock class) and making it return shapes.empty but that didn't work either. I have .noOcclusion() in my Constructor Chain and in my ClientSetup I also call RenderType cutout. At the moment I have no clue what else I could try to make it work. GitHub: https://github.com/Brainterminator/utilityblocks (look at the MoreWallBlocks Branch) I hope you guys have some ideas!
-
Brainterminator started following X-Lomir
-
I tried replicating your steps with my mod: package net.brain.utilityblocks.handler; import net.brain.utilityblocks.block.ModBuildingBlocks; import net.minecraft.client.renderer.BiomeColors; import net.minecraft.world.level.FoliageColor; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; import net.minecraft.client.color.item.ItemColor; import net.minecraft.world.item.ItemStack; import net.minecraftforge.client.event.ColorHandlerEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.api.distmarker.Dist; @EventBusSubscriber(value = Dist.CLIENT, bus = Bus.MOD) public class ColorHandlerEventHandler { @SubscribeEvent public void registerBlockColors(ColorHandlerEvent.Block event){ event.getBlockColors().register((p_92626_, p_92627_, p_92628_, p_92629_) -> { return p_92627_ != null && p_92628_ != null ? BiomeColors.getAverageFoliageColor(p_92627_, p_92628_) : FoliageColor.getDefaultColor(); }, ModBuildingBlocks.CONNECTABLE_OAK_LEAF_WALL.get()); } @SubscribeEvent public void registerItemColors(ColorHandlerEvent.Item event){ event.getItemColors().register(new ItemColor() { @Override public int getColor(ItemStack pStack, int pTintIndex) { return FoliageColor.getDefaultColor(); } }, ModBuildingBlocks.CONNECTABLE_OAK_LEAF_WALL.get()); } } but somehow it doesn't work. When I declare the registerBlockColors function in my Main Class and call "eventBus.addListener(this::registerBlockColors);" from the Constructor it works.
-
In case of the Server How did you workaround that? I heard you can use the DistExecutor but lambda expression still overwhelm me so... I'm having problems with that. My Constructor looks like this: public UtilityBlocks() { IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); ModItems.register(eventBus); ModBlocks.register(eventBus); ModBuildingBlocks.register(eventBus); eventBus.addListener(this::setup); eventBus.addListener(this::clientSetup); eventBus.addListener(this::registerBlockColors); eventBus.addListener(this::registerItemColors); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } But as you already said this way it is not runnable on a server. Do you know an easy way to outsource that?
-
First of all, thank you so much for your quick and detailed reply!!! A lot of things got a lot clearer to me but my blocks still are rendered in gray. I don't get why and when I wanted to look into your code I realized there are no tinted blocks in your mod. At least I couldn't find any leaves slabs or grass slabs so I'm still a little lost but your answer was by far the best I got in the last 2 weeks I spent trying to find a solution to this problem p.s.: I just realised I'm stupid and I forgot to call it in the Main Constructor ..... sigh
-
Brainterminator joined the community
-
I'm actually working on a similar kind of mod, that adds vertical slabs. I made them so they can connect like stairs. GitHub Branch Now I have a "Connectable_Oak_Leaf_Wall" that get's registered in my ModBuildingBlocks Class. The Forge Documentation on tinting is pretty minimalistic: https://mcforge.readthedocs.io/en/1.18.x/resources/client/models/tinting/#blockcoloritemcolor So I call this in my Main: Why does it not work? I'm obviously doing something very wrong since you wrote like 30 lines to change the color. But since your Half Slabs probably are getting created in a very different way I thought maybe you could help?