Jump to content

zombiekiller222

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by zombiekiller222

  1. Considering the Biome Decorator is a variable inside my SubClass, my only options to access it are presumably: [*]Using reflection: Slow and very hacky, and as you said, not needed. [*]Changing the Access Level: Breaks compatibility, and if FML hasn't done it, there is likely a reason not to. [*]Making my class in the minecraft.net.src package: Heavily discouraged amongst the forge community, might break compatibility and also makes it hard to keep track of classes. [*]Making my own WorldGenBase, BiomeDecorator (and plenty more) classes: Tedious, messy, and seems unnecessary. [*]Creating some kind of wrapper for BiomeDecorator (and some more) classes: Better option, it seems, but still tedious, messy and unnecessary. All of these seem like a "hack" and suboptimal (not to mention tedious). I must be missing something, because everyone talks about this "Access Transformer" or says that a hack is not needed (not only in this forum post, I did search before posting this).
  2. It doesn't really help if I have no idea how to access it, or what it is If googling it doesn't bring some kind of answer, I doubt it's even what it's called.
  3. Googling provides no information on this access transform.
  4. I've made a custom biome, but I can't access many of the BiomeDecorator's functions, as they are protected. How can I get around this?
  5. The reason I have MapGenVillage is to get the default MC village to generate at my command before trying my own.
  6. I've copied all of the appropriate appropriate classes for Village, but unfortunately, I cannot even get the DEFAULT village to spawn. I understand there is a % chance, but in superflat after flying a long time I've yet to find one (with default MC structures disabled). Here is my code: package plantony.lotrcraft; import java.util.Random; import net.minecraft.src.IChunkProvider; import net.minecraft.src.MapGenVillage; import net.minecraft.src.World; import net.minecraft.src.WorldGenMinable; import cpw.mods.fml.common.IWorldGenerator; public class WorldGeneratorLotrCraft implements IWorldGenerator { MapGenVillage mapGenVillage = new MapGenVillage(1); public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.dimensionId) { case -1: generateNether(world, random, chunkX*16, chunkZ*16); case 0: generateSurface(world, random, chunkX*16, chunkZ*16); } } private void generateSurface(World world, Random random, int blockX, int blockZ) { //int Xcoord1 = blockX + random.nextInt(16); //int Ycoord1 = random.nextInt(80); //int Zcoord1 = blockZ + random.nextInt(16); mapGenVillage.generate(world.getChunkProvider(), world, blockX, blockZ, new byte[32768]); } private void generateNether(World world, Random random, int blockX, int blockZ) { } }
  7. Yes, I do. I did some work and replaced some of mc's code, and now it works: //FMLCommonHandler.instance().showGuiScreen(handler.getClientGuiElement(modGuiId, player, world, x, y, z)); FMLCommonHandler.instance().showGuiScreen(new plantony.lotrcraft.common.GuiHandler().getClientGuiElement(modGuiId, player, world, x, y, z)); I don't want it to be like this in the long run (creates incompatibilities).
  8. Java throws a java.lang.NullPointerException when I try to use player.openGui(LotrCraft.Instance, 1, world, x, y, z); Doing a little stack-following I found it happens when this code is ran: FMLCommonHandler.instance().showGuiScreen(handler.getClientGuiElement(modGuiId, player, world, x, y, z)); So, presumably, my gui handler is returning null? Here is it's code: package mymod.common; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.src.*; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case 1: return new ContainerSmelter(player.inventory, world, x, y, z); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case 1: return new GuiSmelter(player.inventory, world, x, y, z); } return null; } } If you need the code for the container and gui, i'll post it.
  9. Java throws a java.lang.NullPointerException when I try to use player.openGui(LotrCraft.Instance, 1, world, x, y, z); Doing a little stack-following I found it happens when this code is ran: FMLCommonHandler.instance().showGuiScreen(handler.getClientGuiElement(modGuiId, player, world, x, y, z)); So, presumably, my gui handler is returning null? Here is it's code: package mymod.common; import cpw.mods.fml.common.network.IGuiHandler; import net.minecraft.src.*; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case 1: return new ContainerSmelter(player.inventory, world, x, y, z); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case 1: return new GuiSmelter(player.inventory, world, x, y, z); } return null; } } If you need the code for the container and gui, i'll post it.
×
×
  • Create New...

Important Information

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