Jump to content

Brainterminator

Members
  • Posts

    14
  • Joined

  • Last visited

Converted

  • URL
    github.com/Brainterminator

Recent Profile Visitors

6358 profile views

Brainterminator's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. 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?
  2. I guess that's what I did. It works totally fine now on Servers and on Single Player
  3. Yes that was the problem. One of the involved Items still had a isClientSide check. Removing it made it work. Thanks a lot!
  4. 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
  5. That actually fixed it! Now my LeafWalls have correct transparency! And the fact that they also adapt according to the graphics settings is also nice! Thanks so much!
  6. 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!
  7. It definitely was! Thank you so much again! It was also really helpful to get it explained for once! I was also on a discord and when I asked them about it they were like "just use lambda", " if you don't even understand this don't even bother making a mc mod"
  8. First of all thank you for all your help I have been stuck with this for a while! Okay so the @EventBusSubscriber makes it so I don't have to call the method, Forge automatically does? EDIT: THANK YOU SO MUCH NOW EVERYTHING WORKS FINE! YOU'RE A GOD DAMN LEGEND
  9. 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.
  10. 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?
  11. 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
  12. 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?
×
×
  • Create New...

Important Information

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