Eh, using the apache import is working - just save the class and the errors will go away. There aren't actually any errors in that image (error3).
I did, but it still says that there is a duplicate local variable, that it was expecting a ";" instead of "(" and ")" and that void is an invalid type for the variable.
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class UnMinecraft
{
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
UnMinecraftWorldGeneration eventWorldGen = new UnMinecraftWorldGeneration();
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
@Mod.EventHandler
public void Init(FMLInitializationEvent event)
{
Recipes.init();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
}
Did I put this in right? Because the second time it says "eventWorldGen", it is an error. I don't know how to fix it, because when I hover over it, the quick fixes are "Create constant" and "Create field".
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class UnMinecraft
{
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
UnMinecraftWorldGeneration eventWorldGen = new UnMinecraftWorldGeneration();
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
@Mod.EventHandler
public void Init(FMLInitializationEvent event)
{
Recipes.init();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
}
Did I put this in right? Because the second time it says "eventWorldGen", it is an error. I don't know how to fix it, because when I hover over it, the quick fixes are "Create constant" and "Create field".
Did I put this in right? Because the second time it says "eventWorldGen", it is an error. I don't know how to fix it, because when I hover over it, the quick fixes are "Create constant" and "Create field".
I believe what your going for is...
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class MobBlock {
@SidedProxy(clientSide= "com.Mergis.MobBlock.proxies.ClientProxy", serverSide = "com.Mergis.MobBlock.proxies.CommonProxy")
public static CommonProxy mobblockProxy;
@Instance(Reference.MODID)
public static MobBlock instance;
MobBlockWorldGeneration eventWorldGen = new MobBlockWorldGeneration();
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){ GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
Which points to a world gen class like this one
public class MobBlockWorldGeneration implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId){
case 0: generateSurface(world, random,chunkX * 16, chunkZ * 16);
case -1: generateNether(world, random, chunkX * 16, chunkZ * 16);
case 1: generateEnd(world,random,chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int x, int z){
addOreSpawn(ModBlocks.mob_ore, world, random, x, z, 16, 16, 4 + random.nextInt(5), 9, 16, 70);
}
private void generateNether(World world, Random random, int x, int z){
}
private void generateEnd(World world, Random random, int x, int z){
}
private void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world,random,posX, posY, posZ);
}
}
}
Or another example with lakes, random fluid gen, ores and structures
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class OilandGas {
@SidedProxy(clientSide= "com.Mergis.OilandGas.proxies.ClientProxy", serverSide = "com.Mergis.OilandGas.proxies.CommonProxy")
public static CommonProxy oilandgasProxy;
@Instance(Reference.MODID)
public static OilandGas instance;
OilandGasWorldGeneration eventWorldGen = new OilandGasWorldGeneration();
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){ GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
which points to this class
.
public class OilandGasWorldGeneration implements IWorldGenerator{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId){
case 0: generateSurface(world, random,chunkX * 16, chunkZ * 16);
case -1: generateNether(world, random, chunkX * 16, chunkZ * 16);
case 1: generateEnd(world,random,chunkX * 16, chunkZ * 16);
}
}
private void generateEnd(World world, Random random, int x, int z){
}
private void addOilSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenLiquids(block).generate(world,random,posX, posY, posZ);
}
}
private void addOilPools(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
double chance = Math.random();
if (chance < 0.65){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenLakes(block).generate(world,random,posX, posY, posZ);
}
}
}
private void addUnderGround(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world,random,posX, posY, posZ);
}
}
private void GenStructure(Block block, World world, Random random, int X, int Z, int Y, double percentlow, double percenthigh, int lower, int higher, int loops){
double chance = Math.random();
if (chance > percentlow && chance < percenthigh){
for (int i = Y; (!world.canBlockSeeTheSky(X, i - 1, Z)); i++){
if (world.canBlockSeeTheSky(X, i, Z)){
boolean go = false;
for (int solid = 0; solid < loops; ++solid){
for (int solid1 = 0; solid1 < loops; ++solid1){
if (world.isAirBlock((X - higher) + solid, i, (Z - lower) + solid1) && world.isAirBlock((X - lower) + solid1, i, (Z - higher) + solid) && world.isSideSolid((X - lower) + solid1, i - 1, (Z - higher) + solid, ForgeDirection.UP) && world.isSideSolid((X - higher) + solid, i - 1, (Z - lower) + solid1, ForgeDirection.UP)){
go = true;
}else{
go = false;
break;
}
}
}
if (go){
System.out.println("GenStructure Called at :" + X + " : " + i + " : " + Z + " - - " + block);
world.setBlock(X, i, Z, block);
break;
}else{
break;
}
}
}
}
}
}
I'm sure there are better ways to deal with structures this is just some code from the first time i started messing round with world gen
import com.aol.merlinmagix121.flyingsolomod.blocks.BlockCrystalOre;
import com.aol.merlinmagix121.flyingsolomod.help.RegisterHelper;
import com.aol.merlinmagix121.flyingsolomod.blocks.;
public class ModBlocks ()
{
public static Block crystalOre = new BlockCrystalOre();
public static void init(){
RegisterHelper.RegisterBlock(crystalOre);
This is confusing me I am getting an error asking me to change BlockCrystalOre to CrystalOre come one help!!!!!!!!
import com.aol.merlinmagix121.flyingsolomod.blocks.BlockCrystalOre;
import com.aol.merlinmagix121.flyingsolomod.help.RegisterHelper;
import com.aol.merlinmagix121.flyingsolomod.blocks.;
public class ModBlocks ()
{
public static Block crystalOre = new BlockCrystalOre();
public static void init(){
RegisterHelper.RegisterBlock(crystalOre);
This is confusing me I am getting an error asking me to change BlockCrystalOre to CrystalOre come one help!!!!!!!!
The Meaning of Life, the Universe, and Everything.
Join Date:
11/12/2013
Posts:
60
Member Details
Hello! I'm currently in the setup process and I'm trying to run the gradlew commands. I'm able to run ./gradlew eclipse but not setupDecompWorkspace. Am I doing something wrong?
I did, but it still says that there is a duplicate local variable, that it was expecting a ";" instead of "(" and ")" and that void is an invalid type for the variable.
package com.crazyklubbd.unminecraft;
import com.crazyklubbd.unminecraft.crafting.Recipes;
import com.crazyklubbd.unminecraft.generation.UnMinecraftWorldGeneration;
import com.crazyklubbd.unminecraft.help.Reference;
import com.crazyklubbd.unminecraft.init.ModBlocks;
import com.crazyklubbd.unminecraft.init.ModItems;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class UnMinecraft
{
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
UnMinecraftWorldGeneration eventWorldGen = new UnMinecraftWorldGeneration();
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
@Mod.EventHandler
public void Init(FMLInitializationEvent event)
{
Recipes.init();
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
}
Did I put this in right? Because the second time it says "eventWorldGen", it is an error. I don't know how to fix it, because when I hover over it, the quick fixes are "Create constant" and "Create field".
Asin Akklae DomaYou can have a look at my main registry.
package com.mod.main;
import com.mod.blocks.Mblocks;
import com.mod.creativetabs.McreativeTabs;
import com.mod.entity.Mentity;
import com.mod.item.Mitems;
import com.mod.lib.RefStrings;
import com.mod.world.Mworld;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
@Mod(modid = RefStrings.MODID , name = RefStrings.NAME , version = RefStrings.VERSION)
public class MainRegistry {
@SidedProxy(clientSide = RefStrings.CLIENTSIDE , serverSide = RefStrings.SERVERSIDE)
public static ServerProxy proxy;
@Instance
public static MainRegistry modInstance;
@EventHandler
public static void PreLoad (FMLPreInitializationEvent PreEvent) {
McreativeTabs.initializeTabs();
Mblocks.mainRegistry();
Mentity.mainRegistry();
Mitems.mainRegistry();
Mworld.mainRegistry();
proxy.registerRenderInfo();
}
@EventHandler
public static void load (FMLInitializationEvent event) {
CraftingManager.mainRegistry();
}
@EventHandler
public static void PostLoad (FMLPostInitializationEvent PostEvent) {
}
}
Looks like you do this a little differently to me
I believe what your going for is...
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class MobBlock {
@SidedProxy(clientSide= "com.Mergis.MobBlock.proxies.ClientProxy", serverSide = "com.Mergis.MobBlock.proxies.CommonProxy")
public static CommonProxy mobblockProxy;
@Instance(Reference.MODID)
public static MobBlock instance;
MobBlockWorldGeneration eventWorldGen = new MobBlockWorldGeneration();
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
Which points to a world gen class like this one
public class MobBlockWorldGeneration implements IWorldGenerator {
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId){
case 0: generateSurface(world, random,chunkX * 16, chunkZ * 16);
case -1: generateNether(world, random, chunkX * 16, chunkZ * 16);
case 1: generateEnd(world,random,chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int x, int z){
addOreSpawn(ModBlocks.mob_ore, world, random, x, z, 16, 16, 4 + random.nextInt(5), 9, 16, 70);
}
private void generateNether(World world, Random random, int x, int z){
}
private void generateEnd(World world, Random random, int x, int z){
}
private void addOreSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world,random,posX, posY, posZ);
}
}
}
Or another example with lakes, random fluid gen, ores and structures
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class OilandGas {
@SidedProxy(clientSide= "com.Mergis.OilandGas.proxies.ClientProxy", serverSide = "com.Mergis.OilandGas.proxies.CommonProxy")
public static CommonProxy oilandgasProxy;
@Instance(Reference.MODID)
public static OilandGas instance;
OilandGasWorldGeneration eventWorldGen = new OilandGasWorldGeneration();
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);
}
which points to this class
.
public class OilandGasWorldGeneration implements IWorldGenerator{
@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId){
case 0: generateSurface(world, random,chunkX * 16, chunkZ * 16);
case -1: generateNether(world, random, chunkX * 16, chunkZ * 16);
case 1: generateEnd(world,random,chunkX * 16, chunkZ * 16);
}
}
private void generateSurface(World world, Random random, int x, int z){
addOilSpawn(ModBlocks.crude_oilBlock, world, random, x, z, 24, 24, 3, 13, 90);
addOilPools(ModBlocks.crude_oilBlock, world, random, x, z, 8, 8, 1, 20, 65);
if (world.getBiomeGenForCoords(x, z) == BiomeGenBase.desert || world.getBiomeGenForCoords(x, z) == BiomeGenBase.desertHills || world.getBiomeGenForCoords(x, z) == BiomeGenBase.swampland || world.getBiomeGenForCoords(x, z) == BiomeGenBase.iceMountains || world.getBiomeGenForCoords(x, z) == BiomeGenBase.icePlains || world.getBiomeGenForCoords(x, z) == BiomeGenBase.extremeHills){
GenStructure(ModBlocks.oilpumpgenerator, world, random, x, z, 45, 0.25, 0.45, 2, 6, 9);
}
}
private void generateNether(World world, Random random, int x, int z){
}
private void generateEnd(World world, Random random, int x, int z){
}
private void addOilSpawn(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenLiquids(block).generate(world,random,posX, posY, posZ);
}
}
private void addOilPools(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
double chance = Math.random();
if (chance < 0.65){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenLakes(block).generate(world,random,posX, posY, posZ);
}
}
}
private void addUnderGround(Block block, World world, Random random, int blockXPos, int blockZPos, int maxX, int maxZ, int maxVeinSize, int channceToSpawn, int minY, int maxY){
for (int i = 0; i < channceToSpawn; i++){
int posX = blockXPos + random.nextInt(maxX);
int posY = minY + random.nextInt(maxY - minY);
int posZ = blockZPos + random.nextInt(maxZ);
new WorldGenMinable(block, maxVeinSize).generate(world,random,posX, posY, posZ);
}
}
private void GenStructure(Block block, World world, Random random, int X, int Z, int Y, double percentlow, double percenthigh, int lower, int higher, int loops){
double chance = Math.random();
if (chance > percentlow && chance < percenthigh){
for (int i = Y; (!world.canBlockSeeTheSky(X, i - 1, Z)); i++){
if (world.canBlockSeeTheSky(X, i, Z)){
boolean go = false;
for (int solid = 0; solid < loops; ++solid){
for (int solid1 = 0; solid1 < loops; ++solid1){
if (world.isAirBlock((X - higher) + solid, i, (Z - lower) + solid1) && world.isAirBlock((X - lower) + solid1, i, (Z - higher) + solid) && world.isSideSolid((X - lower) + solid1, i - 1, (Z - higher) + solid, ForgeDirection.UP) && world.isSideSolid((X - higher) + solid, i - 1, (Z - lower) + solid1, ForgeDirection.UP)){
go = true;
}else{
go = false;
break;
}
}
}
if (go){
System.out.println("GenStructure Called at :" + X + " : " + i + " : " + Z + " - - " + block);
world.setBlock(X, i, Z, block);
break;
}else{
break;
}
}
}
}
}
}
I'm sure there are better ways to deal with structures this is just some code from the first time i started messing round with world gen
Hmm. Make sure you are running the right commands and ask the Forge people instead.
Thanks I appreciate your help
ok I got it working but cant find my item
nevermind I figured out my error
can someone tell me what is wrong with this code i dont get it the last 3 lines have errorsnever mind fixed it
package com.aol.merlinmagix121.flyingsolomod.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public class BlockCrystalOre extends Block {
public BlockCrystalOre(){
super (Material.glass);
}
setCreativeTab(CreativeTabs.tabBlocks);
}
package com.aol.merlinmagix121.flyingsolomod.init;
import net.minecraft.block.Block;
import com.aol.merlinmagix121.flyingsolomod.blocks.BlockCrystalOre;
import com.aol.merlinmagix121.flyingsolomod.help.RegisterHelper;
import com.aol.merlinmagix121.flyingsolomod.blocks.;
public class ModBlocks ()
{
public static Block crystalOre = new BlockCrystalOre();
public static void init(){
RegisterHelper.RegisterBlock(crystalOre);
This is confusing me I am getting an error asking me to change BlockCrystalOre to CrystalOre come one help!!!!!!!!
Post your BlockCrystalOre class.
Hello! I'm currently in the setup process and I'm trying to run the gradlew commands. I'm able to run ./gradlew eclipse but not setupDecompWorkspace. Am I doing something wrong?
Pastebin:
http://pastebin.com/evpymghm
Thanks for the help!
Yes, I do YouTube!
https://www.youtube.com/channel/UCFdqZhm0k0Zk21VKi3e3K4A
Yes, I have Twitter!
https://twitter.com/Pickles_Onions
here is my BlockCrystalOre class
package com.aol.merlinmagix121.flyingsolomod.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
public class BlockCrystalOre extends Block {
public BlockCrystalOre(){
super (Material.glass);
setCreativeTab(CreativeTabs.tabBlock);
are the close parenthesis " } " missing your just not copied over?
edit - Don't you need to finalize the block when defining in init?
no they just didnt copy over and what do you mean finalize the block
Ok got that fixed i just deleted and retyped and it was good but the block is being called Tile.null.name
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIf you have not read the 6th tutorial, read it. If you have, read it again.
its the fifth and yeah i was dumb to post that before the fifth tutorial was read
use setBlockName(String)
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumUmm...no.
if its showing up as tile.null.name his block has no name... if he adds a second block without rectifying this it will crash the game on launch.
converting tile.null.name into a display name with lang file doesn't change the name from null