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.

Emerald_Galaxy

Members
  • Joined

  • Last visited

  1. I have moved this to the Support & Bug Reports section.
  2. After much research and scrolling through pages of existing problems, I believe that this bug hasn't been reported yet. Long Version Short Version: Sword rendering weird, please look into it soon. (Pictures in spoiler) Log: https://pastebin.com/Ucsg1kB4
  3. Where can I report this issue?
  4. It would appear that this is an issue with forge. This glitch happens even when no mods are loaded and its just forge.
  5. I been modding in 1.13 for a few days and noticed that there's something off with the sword textures. There's a hole on the top of every sword, vanilla and modded. Now that I've noticed it I can't stand it. Does anyone know what this is and/or how to fix it? Also this is a rendering/texture issue since everything else about the sword is fine (I.E. it functions like a sword should).
  6. Ok, I setup some print functions and I still don't know why it's not generating. So I ended up making a custom generator for the ore using a copy of the genStandardOre1 method. And it works, though it isn't really accurate, but it works.
  7. You know, now that you point it out, I feel stupid for making this the first thing I do when I can't figure something out, or I have a problem. And I feel bad for not doing that first. I'll take your advice and put some print statements, then tweak the code a little to see what I can change.
  8. So I have been tinkering with my new BiomeDecorator for my custom biome, and I noticed that my custom ore hasn't spawned since I changed the decorator. I have no idea how to generate my custom ore with my BiomeDecorator. Can someone please help me? MasoniteDecorator package emerald.emeraldsworld.World.BiomeDecorators; import java.util.Random; import emerald.emeraldsworld.Init.ModBlocks; import emerald.emeraldsworld.World.CustomGrassGenerator; import net.minecraft.block.BlockStone; import net.minecraft.block.state.pattern.BlockMatcher; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.gen.ChunkGeneratorSettings; import net.minecraft.world.gen.feature.WorldGenAbstractTree; import net.minecraft.world.gen.feature.WorldGenLiquids; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType; import net.minecraftforge.event.terraingen.TerrainGen; public class MasoniteDecorator extends BiomeDecorator { public ChunkGeneratorSettings chunkProviderSettings; protected CustomGrassGenerator grassGen = new CustomGrassGenerator(ModBlocks.MASONITE_TALL_GRASS); private WorldGenerator masoniteGen; public int masoniteMinHeight = 0; public int masoniteMaxHeight = 128; public MasoniteDecorator() { super(); } @Override public void decorate(World world, Random rand, Biome biome, BlockPos pos) { if(decorating) { throw new RuntimeException("Already Decorating"); } else { this.chunkProviderSettings = ChunkGeneratorSettings.Factory.jsonToFactory(world.getWorldInfo().getGeneratorOptions()).build(); chunkPos = pos; dirtGen = new WorldGenMinable(Blocks.DIRT.getDefaultState(), chunkProviderSettings.dirtSize); gravelOreGen = new WorldGenMinable(Blocks.GRAVEL.getDefaultState(), chunkProviderSettings.gravelSize); graniteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), chunkProviderSettings.graniteSize); dioriteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), chunkProviderSettings.dioriteSize); andesiteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), chunkProviderSettings.andesiteSize); coalGen = new WorldGenMinable(Blocks.COAL_ORE.getDefaultState(), chunkProviderSettings.coalSize); ironGen = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), chunkProviderSettings.ironSize); goldGen = new WorldGenMinable(Blocks.GOLD_ORE.getDefaultState(), chunkProviderSettings.goldSize); redstoneGen = new WorldGenMinable(Blocks.REDSTONE_ORE.getDefaultState(), chunkProviderSettings.redstoneSize); diamondGen = new WorldGenMinable(Blocks.DIAMOND_ORE.getDefaultState(), chunkProviderSettings.diamondSize); lapisGen = new WorldGenMinable(Blocks.LAPIS_ORE.getDefaultState(), chunkProviderSettings.lapisSize); masoniteGen = new WorldGenMinable(ModBlocks.MASONITE_ORE.getDefaultState(), 16, BlockMatcher.forBlock(Blocks.STONE)); genDecorations(biome, world, rand); decorating = false; } } @Override protected void genDecorations(Biome biome, World world, Random rand) { MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(world, rand, chunkPos)); generateOres(world, rand); generate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.SAND, super.sandGen, super.sandPatchesPerChunk); generate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.CLAY, super.clayGen, super.clayPerChunk); generate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.SAND_PASS2, super.gravelGen, super.gravelPatchesPerChunk); generate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.SAND_PASS2, super.gravelGen, super.gravelPatchesPerChunk); generateGrass(world, biome, rand, chunkPos); generateTrees(world, biome, rand, chunkPos); if (generateFalls) { generateFalls(world, rand, chunkPos); } MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(world, rand, chunkPos)); } private void generate(World world, Random rand, BlockPos chunkPos, EventType event, WorldGenerator generator, int countPerChunk) { if(TerrainGen.decorate(world, rand, chunkPos, event)) { for(int count = 0; count < countPerChunk; count++) { int x = rand.nextInt(16) + 8; int z = rand.nextInt(16) + 8; generator.generate(world, rand, world.getTopSolidOrLiquidBlock(chunkPos.add(x, 0, z))); } } } private void generateFalls(World world, Random rand, BlockPos chunkPos) { if(TerrainGen.decorate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.LAKE_WATER)) { for(int waterCount = 0; waterCount < 50; waterCount++) { int waterX = rand.nextInt(16) + 8; int yRange = rand.nextInt(256) + 8; int waterZ = rand.nextInt(16) + 8; if(yRange > 0) { int waterY = rand.nextInt(yRange); BlockPos waterPos = chunkPos.add(waterX, waterY, waterZ); (new WorldGenLiquids(Blocks.FLOWING_WATER)).generate(world, rand, waterPos); } } } if(TerrainGen.decorate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.LAKE_LAVA)) { for(int lavaCount = 0; lavaCount < 20; lavaCount++) { int lavaX = rand.nextInt(16) + 8; int lavaY = rand.nextInt(rand.nextInt(rand.nextInt(240) + 8) + 8); int lavaZ = rand.nextInt(16) + 8; BlockPos lavaPos = chunkPos.add(lavaX, lavaY, lavaZ); (new WorldGenLiquids(Blocks.FLOWING_LAVA)).generate(world, rand, lavaPos); } } } protected void generateOres(World world, Random rand) { net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Pre(world, rand, chunkPos)); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, dirtGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT)) this.genStandardOre1(world, rand, this.chunkProviderSettings.dirtCount, this.dirtGen, this.chunkProviderSettings.dirtMinHeight, this.chunkProviderSettings.dirtMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, gravelOreGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL)) this.genStandardOre1(world, rand, this.chunkProviderSettings.gravelCount, this.gravelOreGen, this.chunkProviderSettings.gravelMinHeight, this.chunkProviderSettings.gravelMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, dioriteGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIORITE)) this.genStandardOre1(world, rand, this.chunkProviderSettings.dioriteCount, this.dioriteGen, this.chunkProviderSettings.dioriteMinHeight, this.chunkProviderSettings.dioriteMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, graniteGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRANITE)) this.genStandardOre1(world, rand, this.chunkProviderSettings.graniteCount, this.graniteGen, this.chunkProviderSettings.graniteMinHeight, this.chunkProviderSettings.graniteMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, andesiteGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.ANDESITE)) this.genStandardOre1(world, rand, this.chunkProviderSettings.andesiteCount, this.andesiteGen, this.chunkProviderSettings.andesiteMinHeight, this.chunkProviderSettings.andesiteMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, coalGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL)) this.genStandardOre1(world, rand, this.chunkProviderSettings.coalCount, this.coalGen, this.chunkProviderSettings.coalMinHeight, this.chunkProviderSettings.coalMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, ironGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON)) this.genStandardOre1(world, rand, this.chunkProviderSettings.ironCount, this.ironGen, this.chunkProviderSettings.ironMinHeight, this.chunkProviderSettings.ironMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, goldGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD)) this.genStandardOre1(world, rand, this.chunkProviderSettings.goldCount, this.goldGen, this.chunkProviderSettings.goldMinHeight, this.chunkProviderSettings.goldMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, redstoneGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE)) this.genStandardOre1(world, rand, this.chunkProviderSettings.redstoneCount, this.redstoneGen, this.chunkProviderSettings.redstoneMinHeight, this.chunkProviderSettings.redstoneMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, diamondGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND)) this.genStandardOre1(world, rand, this.chunkProviderSettings.diamondCount, this.diamondGen, this.chunkProviderSettings.diamondMinHeight, this.chunkProviderSettings.diamondMaxHeight); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, lapisGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS)) this.genStandardOre2(world, rand, this.chunkProviderSettings.lapisCount, this.lapisGen, this.chunkProviderSettings.lapisCenterHeight, this.chunkProviderSettings.lapisSpread); if (net.minecraftforge.event.terraingen.TerrainGen.generateOre(world, rand, masoniteGen, chunkPos, net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.CUSTOM)) this.genStandardOre1(world, rand, 64, this.masoniteGen, this.masoniteMinHeight, this.masoniteMaxHeight); net.minecraftforge.common.MinecraftForge.ORE_GEN_BUS.post(new net.minecraftforge.event.terraingen.OreGenEvent.Post(world, rand, chunkPos)); } private void generateGrass(World world, Biome biome, Random rand, BlockPos chunkPos) { if(TerrainGen.decorate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.GRASS)) { for(int numGrassPerChunk = 0; numGrassPerChunk < grassPerChunk; numGrassPerChunk++) { int grassX = rand.nextInt(16) + 8; int grassZ = rand.nextInt(16) + 8; int yRange = world.getHeight(chunkPos.add(grassX, 0, grassZ)).getY() * 2; if (yRange > 0) { int grassY = rand.nextInt(yRange); BlockPos grassPos = chunkPos.add(grassX, grassY, grassZ); grassGen.generate(world, rand, grassPos); } } } } /*private void generateFlowers(World world, Biome biome, Random rand, BlockPos chunkPos) { if(TerrainGen.decorate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.FLOWERS)) { for (int numFlowersPerChunk = 0; numFlowersPerChunk < flowersPerChunk; numFlowersPerChunk++) { int flowerX = rand.nextInt(16) + 8; int flowerZ = rand.nextInt(16) + 8; int yRange = world.getHeight(chunkPos.add(flowerX, 0, flowerZ)).getY() + 32; if (yRange > 0) { int flowerY = rand.nextInt(yRange); BlockPos flowerPos = chunkPos.add(flowerX, flowerY, flowerZ); flowerGen.generate(world, rand, flowerPos); } } } }*/ private void generateTrees(World world, Biome biome, Random rand, BlockPos chunkPos) { int treesToGen = treesPerChunk; if (rand.nextFloat() < extraTreeChance) { treesToGen++; } if(TerrainGen.decorate(world, rand, chunkPos, DecorateBiomeEvent.Decorate.EventType.TREE)) { for (int numTreesGenerated = 0; numTreesGenerated < treesToGen; ++numTreesGenerated) { int treeX = rand.nextInt(16) + 8; int treeZ = rand.nextInt(16) + 8; WorldGenAbstractTree treeGen = biome.getRandomTreeFeature(rand); treeGen.setDecorationDefaults(); BlockPos treePos = world.getHeight(chunkPos.add(treeX, 0, treeZ)); if (treeGen.generate(world, rand, treePos)) { treeGen.generateSaplings(world, rand, treePos); } } } } }
  9. Ok, I finally got it to work All it took was a SideOnly annotation and using the leaves results for the render methods but its pretty simple and it works. New Code public class LeafBase extends BlockLeaves implements ModelInterface { private Item fruit; public LeafBase(String name, Item fruit, SoundType sound, Float hardness, Float blastResist, Float brightness, Integer isUnbreakable) { setUnlocalizedName(name); setRegistryName(name); setSoundType(sound); setHardness(hardness); setResistance(blastResist); setLightLevel(brightness); setLightOpacity(1); if(isUnbreakable == 1) { setBlockUnbreakable(); } this.fruit = fruit; setDefaultState(this.blockState.getBaseState().withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false))); ModBlocks.BLOCKS.add(this); ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName())); } public Item getItemDropped(IBlockState state, Random rand, int fortune) { return fruit; } public ItemStack getSilkTouchDrop(IBlockState state) { return new ItemStack(Item.getItemFromBlock(this), 1); } public int quantityDropped(Random random) { if(random.nextInt(200) == 0) { return 1; } else { return 0; } } @Override public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) { return NonNullList.withSize(1, new ItemStack(this, 1)); } @Override public boolean isOpaqueCube(IBlockState state) { return Blocks.LEAVES.isOpaqueCube(state); } @SideOnly(Side.CLIENT) @Override public BlockRenderLayer getBlockLayer() { return Blocks.LEAVES.getBlockLayer(); } @SideOnly(Side.CLIENT) @Override public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) { return Blocks.LEAVES.shouldSideBeRendered(state, world, pos, side); } @Override public EnumType getWoodType(int meta) { return null; } @Override public IBlockState getStateFromMeta(int meta) { return this.getDefaultState(); } @Override public int getMetaFromState(IBlockState state) { return 0; } @Override protected BlockStateContainer createBlockState() { return new BlockStateContainer(this, new IProperty[] {CHECK_DECAY, DECAYABLE}); } @Override public void registerModels() { Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory"); } }
  10. Yes, for now I don't care about it being different based on graphic setting, I just want it to render correctly
  11. all it did was make them solid, like leaves on fast
  12. Ugh, I find this to be quite ugly
  13. No, I have fancy graphics, and overriding it didnt really do anything either :\

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.