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.

Featured Replies

Posted

Hello! I created a biome today, and when i went into the game this is what i saw:

 

XJocxuN.png

 

Here is my Biome gen code :

 

 

 package mod.gmod622.biome;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mod.gmod622.main.mod_ZeCraft;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;

public class BiomeGenZecraft extends BiomeGenBase
{
private WorldGenerator UnDeadworldGeneratorBigTree;
public final Material blockMaterial;
public BiomeGenZecraft(int par1)
{
super(par1);
this.blockMaterial = Material.water;
this.minHeight = 0.1F;
this.maxHeight = 0.6F;
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.topBlock = ((byte)mod_ZeCraft.ZeGrass.blockID);
this.fillerBlock = ((byte)mod_ZeCraft.ZeDirt.blockID);
this.setBiomeName("ZeBiome");

/** this changes the water colour, its set to red now but ggole the java colours **/
this.waterColorMultiplier = 0xE42D17;
}
} 

 

 

Main class

 

 

 

package mod.gmod622.main;

import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import mod.gmod622.Provider.WorldProviderZeCraft;
import mod.gmod622.biome.BiomeGenZecraft;
import mod.gmod622.block.TestBlockClass;
import mod.gmod622.block.ZeDirtBlockClass;
import mod.gmod622.block.ZeGrassBlockClass;
import mod.gmod622.block.ZePortalBlockClass;
import mod.gmod622.block.ZePortalItemClass;
import mod.gmod622.block.ZeStoneBlockClass;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.Property;
import net.minecraftforge.event.ForgeSubscribe;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = mod_ZeCraft.modid, name = "ZeCraft", version = "0.0.0.1a")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class mod_ZeCraft
{
       public static final String modid = "ZeCraft";
       
       public static int DimID = 2;

public static final int TestBlockID = 3615;
    public static final int ZeGrassID = 3620;
    public static final int ZeDirtID = 3618;
    public static final int ZeStoneID = 3619;
    public static final int ZePortalID = 3616;
    public static final int ZePortalItemID = 3617;
    
    public static BiomeGenBase ZeBiome;

       public static Block TestBlock;
       public static Block ZeGrass;
       public static Block ZeDirt;
       public static Block ZeStone;
       public static Block ZePortal;
       public static Item ZePortalItem;
       


    	   

       

       

      
       @Init
       public void load(FMLInitializationEvent event)
       {
    	   
    	   //Block implemtation 
   		TestBlock = new TestBlockClass(TestBlockID, Material.rock).setUnlocalizedName("ZeCraft:TestBlock").setStepSound(Block.soundMetalFootstep).setHardness(0.2F).setResistance(10.0F);

   		ZeDirt = new ZeDirtBlockClass(ZeDirtID, Material.ground).setUnlocalizedName("ZeCraft:ZeDirt").setHardness(0.9F).setStepSound(Block.soundGrassFootstep);              
   		ZeGrass = new ZeGrassBlockClass(ZeGrassID, Material.grass).setUnlocalizedName("ZeCraft:ZeGrass").setHardness(0.9F).setStepSound(Block.soundGrassFootstep);              
   		ZeStone = new ZeStoneBlockClass(ZeStoneID, Material.ground).setUnlocalizedName("ZeCraft:ZeStone").setHardness(0.9F).setStepSound(Block.soundStoneFootstep);              
   		ZePortal = new ZePortalBlockClass(ZePortalID).setUnlocalizedName("ZeCraft:ZePortalBlock").setHardness(-1F).setStepSound(Block.soundGlassFootstep);   
   		
    	//Item implematation
    	ZePortalItem = new ZePortalItemClass(ZePortalItemID).setUnlocalizedName("ZeCraft:ZePortalItem");
   		
   		
   		   //Block Registry
   		
    	   GameRegistry.registerBlock(TestBlock, "Test Block");
    	   LanguageRegistry.addName(TestBlock, "Test Block");
    	   
    	   GameRegistry.registerBlock(ZeGrass, "Ze-Grass");
    	   LanguageRegistry.addName(ZeGrass, "Ze-Grass");
    	   
    	   GameRegistry.registerBlock(ZeStone, "Ze-Stone");
    	   LanguageRegistry.addName(ZeStone, "Ze-Stone");
    	   
    	   GameRegistry.registerBlock(ZeDirt, "Ze-Dirt");
    	   LanguageRegistry.addName(ZeDirt, "Ze-Dirt");
    	   
    	   GameRegistry.registerBlock(ZePortal, "Ze-Portal");
    	   LanguageRegistry.addName(ZePortal, "Ze-Portal");
    	   
    	   //Item Regirty
    	   GameRegistry.registerItem(ZePortalItem, "Ze-Portal Item");
    	   LanguageRegistry.addName(ZePortalItem, "Ze-Portal Item");
    	   
    	   
    	   //other registrys
    	   
    	   ZeBiome = new BiomeGenZecraft(DimID).setBiomeName("Ore Plains");
    	   GameRegistry.addBiome(ZeBiome);
    	   
    	   
    	   //Randoms
    	   
    	   someConfigFlag = false;
    	   
    	   //Dim
    	   /**Register WorldProvider for Dimension **/
    	   DimensionManager.registerProviderType(DimID, WorldProviderZeCraft.class, true);
    	   DimensionManager.registerDimension(DimID, DimID);
       
       }
       
       
       
       
       @PreInit
       public void preInit(FMLPreInitializationEvent event) {
               Configuration config = new Configuration(event.getSuggestedConfigurationFile());

               config.load();

               int randomBlockID = config.getBlock("TestBlock", TestBlockID).getInt();

//               int randomItemID = config.getItem("RandomItem", 20000).getInt();

               // Since this flag is a boolean, we can read it into the variable directly from the config.
               someConfigFlag = config.get(Configuration.CATEGORY_GENERAL, "SomeConfigFlag", false).getBoolean(false);
               
               //Notice there is nothing that gets the value of this property so the expression results in a Property object.
               Property someProperty = config.get(Configuration.CATEGORY_GENERAL, "SomeConfigString", "nothing");
               
               // Here we add a comment to our new property.
               someProperty.comment = "IDK CONFIG";
               
             //  String someConfigString = someProperty.value;
               // this could also be:
               // int someInt = someProperty.getInt();
               // boolean someBoolean = someProperty.getBoolean(true);

               config.save();
       }
    	 
       
       
       
       
       
       
       //Sounds
    /*   
       @ForgeSubscribe
       public void onSound(SoundLoadEvent event)
       {
           try 
           {
               event.manager.soundPoolSounds.addSound("");            
           
           } 
           catch (Exception e)
           {
               System.err.println("Failed to register one or more sounds.");
           }
       }
       
       */
       
       //--

       
       public static boolean someConfigFlag;
}

 

 

 

if you need anything else just tell me :)

Not new to java >> New to modding.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.