Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MCrafterzz

Members
  • Joined

  • Last visited

Everything posted by MCrafterzz

  1. Got it working with: return worldIn.getBiome(pos).getGrassColorAtPos(pos); Thanks for pointing me in the right direction EDIT: It doesn't seem to work for the itemblock in the inventory, how can I fix this?
  2. Hello, I have created a custom grass block and want it to be coloured like the normal one. How can I implement this? Currently I just have a normal block which uses the grass texture and thefor like exspected is gray.
  3. Does anyone know how to covert the vanilla values to forges? Multiple people have asked but I still haven't found a working answer.
  4. I'm not getting any errors and after changing some values it does seem to work. I just need to continue changing values it hopefully will be good. It's totally guess work so it'll take a while. EDIT: I tried converting the values with code: Main.logger.warn(new TRSRTransformation(new ItemTransformVec3f(new Vector3f(0, 45, 0), new Vector3f(0, 4.2f, 0), new Vector3f(0.4f,0.4f,0.4f))).getTranslation()); But it just printed out the same values as in the constructor :C
  5. Thanks Choonster, I did change it but it seems to ignore everything except the gui part: { "forge_marker": 1, "defaults": { "textures": { "all": "blocks/dirt" } }, "variants": { "layers": { "1": { "model": "ml:layer_2" }, "2": { "model": "ml:layer_4" }, "3": { "model": "ml:layer_6" }, "4": { "model": "ml:layer_8" }, "5": { "model": "ml:layer_10" }, "6": { "model": "ml:layer_12" }, "7": { "model": "ml:layer_14" }, "8": { "model": "ml:layer_16" } }, "inventory": [{ "model": "ml:layer_2", "transform": { "gui": { "rotation": [{ "x": 30 }, { "y": 225 }, { "z": 0 }], "translation": [0, 0, 0], "scale": 0.625 }, "ground": { "rotation": [{ "x": 0 }, { "y": 0 }, { "z": 0 }], "translation": [0, 3, 0], "scale": 0.1 }, "firstperson_righthand": { "rotation": [{ "x": 0 }, { "y": 45 }, { "z": 0 }], "translation": [0, 4.2, 0], "scale": 0.1 }, "firstperson_lefthand": { "rotation": [{ "x": 0 }, { "y": 225 }, { "z": 0 }], "translation": [0, 4.2, 0], "scale": 0.1 } } }] } } The scale is 0.1 but it's still much larger than any other block
  6. Here is the blockstate file: { "forge_marker": 1, "defaults": { "textures": { "all": "blocks/dirt" } }, "variants": { "layers": { "1": { "model": "ml:layer_2" }, "2": { "model": "ml:layer_4" }, "3": { "model": "ml:layer_6" }, "4": { "model": "ml:layer_8" }, "5": { "model": "ml:layer_10" }, "6": { "model": "ml:layer_12" }, "7": { "model": "ml:layer_14" }, "8": { "model": "ml:layer_16" } }, "inventory": [{ "model": "ml:layer_2", "textures": { "all": "blocks/dirt" }, "transform": { "display": { "gui": { "rotation": [30, 225, 0], "translation": [0, 0, 0], "scale": [0.625, 0.625, 0.625] }, "ground": { "rotation": [0, 0, 0], "translation": [0, 3, 0], "scale": [0.25, 0.25, 0.25] }, "firstperson_righthand": { "rotation": [0, 45, 0], "translation": [0, 4.2, 0], "scale": [0.40, 0.40, 0.40] }, "firstperson_lefthand": { "rotation": [0, 225, 0], "translation": [0, 4.2, 0], "scale": [0.40, 0.40, 0.40] } } } }] } } Why doesn't this load correctly? It gives the error: [12:53:03] [main/ERROR] [FML]: Exception loading model for variant ml:dirt_layer#inventory for item "ml:dirt_layer", normal location exception Removing the inventory part makes it load again. Thankful for all help!
  7. I'm trying to register blocks but I can't get it to work. Code: Main: @Mod(modid = "mb", name = "More Blocks", version = "1.0.0") @EventBusSubscriber public class Main { @Instance public static Main instance; public static Logger logger; public static final CreativeTabs creativeTab = new CreativeTabBlocks(); @EventHandler public static void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); BlockInit.addBlocks(); } } BlockInit: public class BlockInit { public static ArrayList<Block> blocks; public static void addBlocks () { blocks = new ArrayList<Block>(); addBlock(new BlockModSlab("copper_slab")); } } RegistryHandler: @EventBusSubscriber(modid = "mb") public class RegistryHandler { @SubscribeEvent public void registerBlocks(Register<Block> event) { event.getRegistry().registerAll(BlockInit.blocks.toArray(new Block[0])); Main.logger.info("Regestring blocks"); } } I haven't bothered with textures/models yet as I first wanted to get the registry part working. Thanks for any help
  8. Ok no longer readding the texture but how should I find the iconName of a block?
  9. Well this is how I register: public void stichTextures(TextureStitchEvent event) { for (int i = 0; i < Misc.textureLocations.size(); i++) { event.getMap().registerSprite(Misc.textureLocations.get(i)); } } textureLocations is a arraylist of resourcelocations This is where I add to list: Misc.textureLocations.add(new ResourceLocation(Minecraft.getMinecraft().getBlockRendererDispatcher() .getModelForState(block.getDefaultState()).getParticleTexture().toString())); in my tileentity class
  10. The forums names are one letter per line so they take an anourmus place
  11. Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(iconName).getMinU() Works but what should iconName be?
  12. Ok but how should I implement that? vertexBuffer.tex(u, v) What should I replace u and v with? Where should I get the TextureAtlasSprite from?
  13. This is what I've got so far: public String texture = BlockRendererDispatcher.getModelForState(Blocks.STONE.getDefaultState()) .getParticleTexture().toString(); The problem is that Blocks.STONE.getDefaultState() gives an error because it's static when the methoud isn't so how should I solve this?
  14. Thanks both of you. Choonster what should I get the IBakedModel from because it can't be used staticly
  15. I want to get the texture from a block, so from it's model then i guess
  16. How do I: Get the U and V coordinates for the stitched texture from the TextureAtlasSprite
  17. The texture location. I found that .getRegistryName() returns a resourceLocation so is that correct?
  18. Hello, is it possible to get the resource location from a block for example stone?
  19. Where should I put the TextureStichEvent? and how do I register a texture. registerSprite doesn't excist in the event or in the class.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.