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.

Egietje

Forge Modder
  • Joined

  • Last visited

Everything posted by Egietje

  1. It works! Thanks!
  2. I don't know How do I register it?
  3. package com.Egietje.degeweldigemod.biome; import com.Egietje.degeweldigemod.init.CheeseBiomes; import net.minecraft.init.Biomes; import net.minecraft.world.WorldType; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.ChunkProviderSettings; import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.IntCache; public class CheeseGenLayerBiome extends GenLayer { @SuppressWarnings("unchecked") private java.util.List<net.minecraftforge.common.BiomeManager.BiomeEntry>[] biomes = new java.util.ArrayList[net.minecraftforge.common.BiomeManager.BiomeType .values().length]; private final ChunkProviderSettings settings; public CheeseGenLayerBiome(long p_i45560_1_, GenLayer p_i45560_3_, WorldType p_i45560_4_, String p_i45560_5_) { super(p_i45560_1_); this.parent = p_i45560_3_; for (net.minecraftforge.common.BiomeManager.BiomeType type : net.minecraftforge.common.BiomeManager.BiomeType .values()) { com.google.common.collect.ImmutableList<net.minecraftforge.common.BiomeManager.BiomeEntry> biomesToAdd = net.minecraftforge.common.BiomeManager .getBiomes(type); int idx = type.ordinal(); if (biomes[idx] == null) biomes[idx] = new java.util.ArrayList<net.minecraftforge.common.BiomeManager.BiomeEntry>(); if (biomesToAdd != null) biomes[idx].addAll(biomesToAdd); } int desertIdx = net.minecraftforge.common.BiomeManager.BiomeType.DESERT.ordinal(); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.DESERT, 30)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.SAVANNA, 20)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.PLAINS, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(CheeseBiomes.CHEESE_BIOME, 40)); if (p_i45560_4_ == WorldType.DEFAULT_1_1) { biomes[desertIdx].clear(); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.DESERT, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.FOREST, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.EXTREME_HILLS, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.SWAMPLAND, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.PLAINS, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(Biomes.TAIGA, 10)); biomes[desertIdx].add(new net.minecraftforge.common.BiomeManager.BiomeEntry(CheeseBiomes.CHEESE_BIOME, 15)); this.settings = null; } else if (p_i45560_4_ == WorldType.CUSTOMIZED) { this.settings = ChunkProviderSettings.Factory.jsonToFactory(p_i45560_5_).build(); } else { this.settings = null; } } /** * Returns a list of integer values generated by this layer. These may be * interpreted as temperatures, rainfall amounts, or biomeList[] indices * based on the particular GenLayer subclass. */ public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) { int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight); int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight); for (int i = 0; i < areaHeight; ++i) { for (int j = 0; j < areaWidth; ++j) { this.initChunkSeed((long) (j + areaX), (long) (i + areaY)); int k = aint[j + i * areaWidth]; int l = (k & 3840) >> 8; k = k & -3841; if (this.settings != null && this.settings.fixedBiome >= 0) { aint1[j + i * areaWidth] = this.settings.fixedBiome; } else if (isBiomeOceanic(k)) { aint1[j + i * areaWidth] = k; } else if (k == Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND)) { aint1[j + i * areaWidth] = k; } else if (k == 1) { if (l > 0) { if (this.nextInt(3) == 0) { aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MESA_CLEAR_ROCK); } else { aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MESA_ROCK); } } else { aint1[j + i * areaWidth] = Biome.getIdForBiome( getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.DESERT).biome); } } else if (k == 2) { if (l > 0) { aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.JUNGLE); } else { aint1[j + i * areaWidth] = Biome.getIdForBiome( getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.WARM).biome); } } else if (k == 3) { if (l > 0) { aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.REDWOOD_TAIGA); } else { aint1[j + i * areaWidth] = Biome.getIdForBiome( getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.COOL).biome); } } else if (k == 4) { aint1[j + i * areaWidth] = Biome.getIdForBiome( getWeightedBiomeEntry(net.minecraftforge.common.BiomeManager.BiomeType.ICY).biome); } else { aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND); } } } return aint1; } protected net.minecraftforge.common.BiomeManager.BiomeEntry getWeightedBiomeEntry( net.minecraftforge.common.BiomeManager.BiomeType type) { java.util.List<net.minecraftforge.common.BiomeManager.BiomeEntry> biomeList = biomes[type.ordinal()]; int totalWeight = net.minecraft.util.WeightedRandom.getTotalWeight(biomeList); int weight = net.minecraftforge.common.BiomeManager.isTypeListModded(type) ? nextInt(totalWeight) : nextInt(totalWeight / 10) * 10; return (net.minecraftforge.common.BiomeManager.BiomeEntry) net.minecraft.util.WeightedRandom .getRandomItem(biomeList, weight); } } package com.Egietje.degeweldigemod.biome; import net.minecraft.world.WorldType; import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.GenLayerBiome; import net.minecraft.world.gen.layer.GenLayerBiomeEdge; import net.minecraft.world.gen.layer.GenLayerZoom; public class WorldTypeCheese extends WorldType { public WorldTypeCheese(int par1, String name) { super(name); } public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer, String chunkProviderSettingsJson) { GenLayer ret = new CheeseGenLayerBiome(200L, parentLayer, this, chunkProviderSettingsJson); ret = GenLayerZoom.magnify(1000L, ret, 2); ret = new GenLayerBiomeEdge(1000L, ret); return ret; } }
  4. package com.Egietje.degeweldigemod.init; import com.Egietje.degeweldigemod.biome.BiomeCheese; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome.BiomeProperties; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.common.BiomeManager.BiomeEntry; import net.minecraftforge.common.BiomeManager.BiomeType; public class CheeseBiomes { public static Biome CHEESE_BIOME; public CheeseBiomes() { initBiome(); registerBiome(); } public static void initBiome() { CHEESE_BIOME = new BiomeCheese(137, new BiomeProperties("Cheese")); } public static void registerBiome() { BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(CHEESE_BIOME, 3)); } } package com.Egietje.degeweldigemod.biome; import java.util.Random; import com.Egietje.degeweldigemod.entities.cheesecow.EntityCheeseCow; import com.Egietje.degeweldigemod.init.CheeseBlocks; import net.minecraft.block.BlockDoublePlant; import net.minecraft.block.BlockFlower; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.init.Biomes; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.feature.WorldGenAbstractTree; public class BiomeCheese extends Biome { public BiomeCheese(int par1, Biome.BiomeProperties properties) { super(properties); this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCheeseCow.class, 8, 4, 4)); this.theBiomeDecorator.treesPerChunk = 0; this.theBiomeDecorator.field_189870_A = 0.05F; this.theBiomeDecorator.flowersPerChunk = 4; this.theBiomeDecorator.grassPerChunk = 10; this.topBlock = CheeseBlocks.CHEESE_BLOCK.getDefaultState(); } public BlockFlower.EnumFlowerType pickRandomFlower(Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) pos.getX() / 200.0D, (double) pos.getZ() / 200.0D); if (d0 < -0.8D) { int j = rand.nextInt(4); switch (j) { case 0: return BlockFlower.EnumFlowerType.ORANGE_TULIP; case 1: return BlockFlower.EnumFlowerType.RED_TULIP; case 2: return BlockFlower.EnumFlowerType.PINK_TULIP; case 3: default: return BlockFlower.EnumFlowerType.WHITE_TULIP; } } else if (rand.nextInt(3) > 0) { int i = rand.nextInt(3); return i == 0 ? BlockFlower.EnumFlowerType.POPPY : (i == 1 ? BlockFlower.EnumFlowerType.HOUSTONIA : BlockFlower.EnumFlowerType.OXEYE_DAISY); } else { return BlockFlower.EnumFlowerType.DANDELION; } } public void decorate(World worldIn, Random rand, BlockPos pos) { double d0 = GRASS_COLOR_NOISE.getValue((double) (pos.getX() + / 200.0D, (double) (pos.getZ() + / 200.0D); if (d0 < -0.8D) { this.theBiomeDecorator.flowersPerChunk = 15; this.theBiomeDecorator.grassPerChunk = 5; } else { this.theBiomeDecorator.flowersPerChunk = 4; this.theBiomeDecorator.grassPerChunk = 10; DOUBLE_PLANT_GENERATOR.setPlantType(BlockDoublePlant.EnumPlantType.GRASS); for (int i = 0; i < 7; ++i) { int j = rand.nextInt(16) + 8; int k = rand.nextInt(16) + 8; int l = rand.nextInt(worldIn.getHeight(pos.add(j, 0, k)).getY() + 32); DOUBLE_PLANT_GENERATOR.generate(worldIn, rand, pos.add(j, l, k)); } } super.decorate(worldIn, rand, pos); } @Override public void addDefaultFlowers() { BlockFlower red = net.minecraft.init.Blocks.RED_FLOWER; BlockFlower yel = net.minecraft.init.Blocks.YELLOW_FLOWER; addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.ORANGE_TULIP), 3); addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.RED_TULIP), 3); addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.PINK_TULIP), 3); addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.WHITE_TULIP), 3); addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.POPPY), 20); addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.HOUSTONIA), 20); addFlower(red.getDefaultState().withProperty(red.getTypeProperty(), BlockFlower.EnumFlowerType.OXEYE_DAISY), 20); addFlower(yel.getDefaultState().withProperty(yel.getTypeProperty(), BlockFlower.EnumFlowerType.DANDELION), 30); } public WorldGenAbstractTree genBigTreeChance(Random rand) { return (WorldGenAbstractTree) (rand.nextInt(3) == 0 ? BIG_TREE_FEATURE : TREE_FEATURE); } } package com.Egietje.degeweldigemod; import com.Egietje.degeweldigemod.biome.WorldTypeCheese; import com.Egietje.degeweldigemod.entities.*; import com.Egietje.degeweldigemod.handler.*; import com.Egietje.degeweldigemod.init.*; import com.Egietje.degeweldigemod.proxy.*; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntitySpawnPlacementRegistry; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.passive.EntityCow; import net.minecraft.init.Biomes; import net.minecraft.world.WorldType; import net.minecraft.world.biome.Biome; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, acceptedMinecraftVersions = "[1.10.2]") public class DeGeweldigeMod { public static final CheeseTab tabCheeseStuff = new CheeseTab("tabCheeseStuff"); @SidedProxy(clientSide = Reference.CLIENTPROXY, serverSide = Reference.COMMONPROXY) public static CommonProxy proxy; @Instance(Reference.MODID) public static DeGeweldigeMod DGMInstance; @EventHandler public void preInit(FMLPreInitializationEvent event) { new CheeseBlocks(); new CheeseItems(); new CheeseMobs(); new CheeseAchievements(); new CheeseSpawnPlacementRegistry(); new CheeseBiomes(); proxy.registerModels(); proxy.renderEntities(); } @EventHandler public static void init(FMLInitializationEvent event) { new CheeseCraftingAndSmelting(); proxy.registerEventHandler(); NetworkRegistry.INSTANCE.registerGuiHandler(DGMInstance, new CheeseGuiHandler()); GameRegistry.registerWorldGenerator(new CheeseGeneration(), 0); } @EventHandler public static void postInit(FMLPostInitializationEvent event) { WorldType CHEESE = new WorldTypeCheese(4, "Cheese"); } }
  5. Hello, I've added a biome but it doesn't work, so does anyone know a tutorial that still applies (1.9+ I believe)
  6. Oh, wait just found out, thanks!
  7. How can I make sure it doesn't rotate?
  8. In the TESR tutorial I watched it was just straight and not rotated
  9. Those yellow things are the items, the birch thing is the block
  10. https://drive.google.com/open?id=0B0SWK9fZQM-0eU9pRzVXUHVfNnM
  11. they are still rotated in a weird way
  12. It let you down, now it is even more weird
  13. Hello, I have a TESR for my TE but when I render an item it rotates it in a random way, here is the TESR: public class RenderCheeseBoard extends TileEntitySpecialRenderer<TileEntityCheeseBoard> { private static final EntityItem ITEM = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, new ItemStack(CheeseItems.CHEESE)); @Override public void renderTileEntityAt(TileEntityCheeseBoard te, double x, double y, double z, float partialTicks, int destroyStage) { GlStateManager.pushMatrix(); { GlStateManager.translate(x + 0.5, y + 0.066, z + 0.75); GlStateManager.rotate(90F, 1.0F, 0.0F, 0.0F); GlStateManager.scale(0.25F, 0.25F, 0.25F); for (int i = 0; i < te.CHEESE_COUNT; i++) { Minecraft.getMinecraft().getRenderManager().doRenderEntity(ITEM, 0, 0, 0, 0F, 0F, true); GlStateManager.translate(0, -0.4F, 0); } } GlStateManager.popMatrix(); } }
  14. explosion power 4 is the one used by tnt
  15. Look at the blockfurnace class and see how they do it in there
  16. Ah, fixed it by only checking for the main-hand, Thanks!
  17. How should I fix it? (He adds that code at 15:50)
  18. Then how did MrCrayfish's thing work? (He did exactly the same in this: tutorial)
  19. So, I decided to add a cheeseboard in my mod and it somewhat works but when I right-click it with cheese it adds it and also removes it, does anyone have any idea how this happened? Stuff: package com.Egietje.degeweldigemod.blocks; import com.Egietje.degeweldigemod.entities.tileentities.blocks.cheeseboard.TileEntityCheeseBoard; import com.Egietje.degeweldigemod.init.CheeseItems; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class CheeseBoard extends Block implements ITileEntityProvider { public CheeseBoard() { super(Material.WOOD); this.setSoundType(SoundType.WOOD); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if(!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof TileEntityCheeseBoard) { TileEntityCheeseBoard cheeseBoard = (TileEntityCheeseBoard) tileEntity; if(heldItem != null) { if(heldItem.getItem() == CheeseItems.CHEESE) { if(cheeseBoard.addCheese()) { heldItem.stackSize--; return true; } } } cheeseBoard.removeCheese(); } } return false; } @Override public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, IBlockState state) { if(!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof TileEntityCheeseBoard) { TileEntityCheeseBoard cheeseBoard = (TileEntityCheeseBoard) tileEntity; worldIn.spawnEntityInWorld(new EntityItem(worldIn, pos.getX() + 0.5, pos.getY() + 1.0, pos.getZ() + 0.5, new ItemStack(CheeseItems.CHEESE, cheeseBoard.CHEESE_COUNT))); } } } public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.CUTOUT; } public boolean isFullCube(IBlockState state) { return false; } public boolean isOpaqueCube(IBlockState state) { return false; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityCheeseBoard(); } } package com.Egietje.degeweldigemod.entities.tileentities.blocks.cheeseboard; import com.Egietje.degeweldigemod.init.CheeseItems; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; public class TileEntityCheeseBoard extends TileEntity { public int CHEESE_COUNT = 0; public boolean addCheese() { if(this.CHEESE_COUNT < { this.CHEESE_COUNT++; return true; } return false; } public void removeCheese() { if(this.CHEESE_COUNT > 0) { worldObj.spawnEntityInWorld(new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.0, pos.getZ() + 0.5, new ItemStack(CheeseItems.CHEESE))); this.CHEESE_COUNT--; } } @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setInteger("CheeseCount", this.CHEESE_COUNT); return compound; } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); this.CHEESE_COUNT = compound.getInteger("CheeseCount"); } }
  20. U can take a look at the code of the barrier block and learn how it is done the vanilla way
  21. OOOHHHH I need to break
  22. I still don't get it...
  23. Can you tell me what exactly was the issue

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.