
OwnAgePau
Forge Modder-
Posts
217 -
Joined
-
Last visited
Everything posted by OwnAgePau
-
Java Heap Space, Help Much Appreciated, Can't Figure it out thus far
OwnAgePau replied to OwnAgePau's topic in Modder Support
Well the problem here is, i had a crash after i wanted to add liquids in my creation of this tree and it indeed wanted to create lots of it. So i then immidiately removed it and it seemed to work fine after it, untill it suddenly didn't want to load a new world anymore. Please help me figure this out. -
Java Heap Space, Help Much Appreciated, Can't Figure it out thus far
OwnAgePau replied to OwnAgePau's topic in Modder Support
Okay i have removed the Hardwoodtree file, and set the java heap space back to what it was before i started increasing it to get rid of the java heap space error.. This is still a java heap space error but it might be a bit more usefull. -
Java Heap Space, Help Much Appreciated, Can't Figure it out thus far
OwnAgePau replied to OwnAgePau's topic in Modder Support
No i kept the same machine all the time, so something in my code must make it so that it needs infinte memory or whatever so that it crashes. -
[Custom Biomes][Custom Dimension] Multiple Biomes how?
OwnAgePau replied to OwnAgePau's topic in Modder Support
Well the problem lies a bit different as i try to do the multiple biomes in a Nether type generated landscape so its a bit different, if someone points me to the stuff i should change inside the ChunkProvider then im good. -
Hi there, i have been trying to find out what the problem is that causes my minecraft java to run out of heap space. I read on the forums that theres a way to increase the Eclipse heap space although this had no effect on it. Also tried using a fresh jar which didn't help anything aswell the problem stayed, i also tried making a new project which didn't fix it aswell. I think the problem lies somewhere within my code but i don't know where the only thing that i have created is a custom tree gen file which i will paste in underneath. But when i comment out my code inside this file the heap space error stays, so i don't see what the problem is as it was working before. This is the crash report : This is my custom tree gen file:
-
[Custom Biomes][Custom Dimension] Multiple Biomes how?
OwnAgePau replied to OwnAgePau's topic in Modder Support
Well first of all if you know how to add multiple biomes to your custom dimension then please tell us. You say i shouldn't use minecraft code but that doesn't make any sense in any way. Although it is true that i should not code inside the minecraft base classes which i ofcourse try to avoid. I am not sure if you mean that by "jar mod". -
Packing "ItemPickaxes" in one class, how to do best?
OwnAgePau replied to OwnAgePau's topic in Modder Support
To answer your "question" i do understand the basics of java and i indeed started by watching tuts especially when it comes to forge stuff, Next to the tuts i also look through every method i see and try to understand what it does the best it can. I can find myself watching minecraft classes for a bit too long sometimes . What troubles me the most is that i do'nt simple make a method in this base class because thats what a normal game maker would do, but i would need a subclass or an extended class. That's were it gets to me to look at ItemPickaxe and ItemHoe, but when i look inside those i do see quite some methods that i don't have to copy over to my extended class. I also have some knowledge of c# ( i know its a lot different from java) but i will get to learn java better next year on my school. But there are also a lot of things that work the same as for constructors. Thanks for your reply and i will look into that tomorrow because i don't have much time to do so now. Jeah i was indeed not intending to do a 5 in one tool class. Thanks for the help though. Also i had been looking into "Multiple biomes in custom dimension" which is one of my biggest problems at the moment which has kept me stuck for over 2 weeks now. I have been going through every chain class in that from WorldChunkManager to BiomeCache, GenLayer and all the way to the base of base classes World. So i thought let's just take a break of this quite complicated stuff at the moment and just do something much much much simpler and clean up my code a lot. Overall i thank you all for your help, i think i will go (as i sayd earlier) create the ItemPickaxe etc and i will be able to delete about a 100 classes should've done that alot earlier but i simple never did -
So i was searching through the list of item classes i have and its about 100 of them as i have 12 types of pickaxes, hoes axes etc. I was taking a look at ItemPickaxe and such trying to see what they did. And as i only have this code in almost each of the files : I thought why not wrap it up into one classfile for each type of tool ? How can i do that the best way. public class ItemBronzeAxe extends ItemAxe { public ItemBronzeAxe(int i, EnumToolMaterial bronze) { super(i, bronze); } public String getTextureFile() { return "/mod_Ores/gui/ItemsMe.png"; } } Thanks for your time and effort!
-
So you say to fix my fluid i just change my SoulFluid to extend BlockFluid and my custom water to extend the minecraft water and such, but how is my custom water going to know that i want to use SoulFluid and not BlockFluid by just declaring both of the blocks as BlockFluid or is the declaration of mine currently correct? And also when i do that 1 it still crashes, and it doesn't get my textures.
-
Hello there, I am still stuck with this biomes in dimension and i know that creating another post for the same item is not that usefull, but i also have a few points where i simple got stuck... I always try to figure stuff out myself, but this Biome thing has kept me busy for over 2 weeks now and it's still not working. I hope that someone knows how to do this. I have created a bunch of classes like WorldTypeEvent, BiomeCache, GenLayer, WorldChunkManager etc etc, and yet not working still. The 2e thing i got stuck at is the custom liquid i am creating i made 2 classes for each still and stationary water and also one called SoulFluid which is basically my custom BlockFluid. this is what i got in my mod_* class: before @Init public static SoulFluid SoulWaterMoving; public static Block SoulWater; inside @Init { SoulWaterMoving = (SoulFluid)(new SoulWaterFlowing(232)); ModLoader.registerBlock(SoulWaterMoving); // Id must be under 256 ModLoader.addName(SoulWaterMoving,"Flowing Soulwater"); SoulWater = (new SoulWaterStationary(233)); // I have heard that the Stationary water should always be one higher then flowing so that you don't have to change the method that -- id. ModLoader.registerBlock(SoulWater); // Id must be under 256 ModLoader.addName(SoulWater,"Stationary Soulwater"); } This is my SoulFluid: SoulWaterFlowing And SoulWaterStationary package Mod_Ores.Blocks.Special; import java.util.Random; import Mod_Ores.SoulForestMaterials; import Mod_Ores.mod_Ores; import net.minecraft.block.Block; import net.minecraft.block.BlockFlowing; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.liquids.ILiquid; public class SoulWaterFlowing extends SoulFluid { public SoulWaterFlowing(int par1) { super(par1, SoulForestMaterials.soulWater); this.blockHardness = 100F; this.setLightOpacity(3); this.disableStats(); this.setCreativeTab(CreativeTabs.tabMisc); this.setUnlocalizedName("Soul_Water_Flow"); } /** * Number of horizontally adjacent liquid source blocks. Diagonal doesn't count. Only source blocks of the same * liquid as the block using the field are counted. */ int numAdjacentSources = 0; /** * Indicates whether the flow direction is optimal. Each array index corresponds to one of the four cardinal * directions. */ boolean[] isOptimalFlowDirection = new boolean[4]; /** * The estimated cost to flow in a given direction from the current point. Each array index corresponds to one of * the four cardinal directions. */ int[] flowCost = new int[4]; /** * Updates the flow for the BlockFlowing object. */ private void updateFlow(World par1World, int par2, int par3, int par4) { int l = par1World.getBlockMetadata(par2, par3, par4); par1World.setBlock(par2, par3, par4, this.blockID + 1, l, 2); } public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { return this.blockMaterial != Material.lava; } /** * Ticks the block if it's been scheduled */ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { int l = this.getFlowDecay(par1World, par2, par3, par4); byte b0 = 1; if (this.blockMaterial == Material.lava && !par1World.provider.isHellWorld) { b0 = 2; } boolean flag = true; int i1; if (l > 0) { byte b1 = -100; this.numAdjacentSources = 0; int j1 = this.getSmallestFlowDecay(par1World, par2 - 1, par3, par4, b1); j1 = this.getSmallestFlowDecay(par1World, par2 + 1, par3, par4, j1); j1 = this.getSmallestFlowDecay(par1World, par2, par3, par4 - 1, j1); j1 = this.getSmallestFlowDecay(par1World, par2, par3, par4 + 1, j1); i1 = j1 + b0; if (i1 >= 8 || j1 < 0) { i1 = -1; } if (this.getFlowDecay(par1World, par2, par3 + 1, par4) >= 0) { int k1 = this.getFlowDecay(par1World, par2, par3 + 1, par4); if (k1 >= { i1 = k1; } else { i1 = k1 + 8; } } if (this.numAdjacentSources >= 2 && this.blockMaterial == SoulForestMaterials.soulWater) { if (par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid()) { i1 = 0; } else if (par1World.getBlockMaterial(par2, par3 - 1, par4) == this.blockMaterial && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0) { i1 = 0; } } if (this.blockMaterial == Material.lava && l < 8 && i1 < 8 && i1 > l && par5Random.nextInt(4) != 0) { i1 = l; flag = false; } if (i1 == l) { if (flag) { this.updateFlow(par1World, par2, par3, par4); } } else { l = i1; if (i1 < 0) { par1World.setBlockToAir(par2, par3, par4); } else { par1World.setBlockMetadataWithNotify(par2, par3, par4, i1, 2); par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); } } } else { this.updateFlow(par1World, par2, par3, par4); } if (this.liquidCanDisplaceBlock(par1World, par2, par3 - 1, par4)) { if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 - 1, par4) == SoulForestMaterials.soulWater) { par1World.setBlock(par2, par3 - 1, par4, Block.stone.blockID); this.triggerLavaMixEffects(par1World, par2, par3 - 1, par4); return; } if (l >= { this.flowIntoBlock(par1World, par2, par3 - 1, par4, l); } else { this.flowIntoBlock(par1World, par2, par3 - 1, par4, l + ; } } else if (l >= 0 && (l == 0 || this.blockBlocksFlow(par1World, par2, par3 - 1, par4))) { boolean[] aboolean = this.getOptimalFlowDirections(par1World, par2, par3, par4); i1 = l + b0; if (l >= { i1 = 1; } if (i1 >= { return; } if (aboolean[0]) { this.flowIntoBlock(par1World, par2 - 1, par3, par4, i1); } if (aboolean[1]) { this.flowIntoBlock(par1World, par2 + 1, par3, par4, i1); } if (aboolean[2]) { this.flowIntoBlock(par1World, par2, par3, par4 - 1, i1); } if (aboolean[3]) { this.flowIntoBlock(par1World, par2, par3, par4 + 1, i1); } } } /** * flowIntoBlock(World world, int x, int y, int z, int newFlowDecay) - Flows into the block at the coordinates and * changes the block type to the liquid. */ private void flowIntoBlock(World par1World, int par2, int par3, int par4, int par5) { if (this.liquidCanDisplaceBlock(par1World, par2, par3, par4)) { int i1 = par1World.getBlockId(par2, par3, par4); if (i1 > 0) { if (this.blockMaterial == Material.lava) { this.triggerLavaMixEffects(par1World, par2, par3, par4); } else { Block.blocksList[i1].dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); } } par1World.setBlock(par2, par3, par4, this.blockID, par5, 3); } } /** * calculateFlowCost(World world, int x, int y, int z, int accumulatedCost, int previousDirectionOfFlow) - Used to * determine the path of least resistance, this method returns the lowest possible flow cost for the direction of * flow indicated. Each necessary horizontal flow adds to the flow cost. */ private int calculateFlowCost(World par1World, int par2, int par3, int par4, int par5, int par6) { int j1 = 1000; for (int k1 = 0; k1 < 4; ++k1) { if ((k1 != 0 || par6 != 1) && (k1 != 1 || par6 != 0) && (k1 != 2 || par6 != 3) && (k1 != 3 || par6 != 2)) { int l1 = par2; int i2 = par4; if (k1 == 0) { l1 = par2 - 1; } if (k1 == 1) { ++l1; } if (k1 == 2) { i2 = par4 - 1; } if (k1 == 3) { ++i2; } if (!this.blockBlocksFlow(par1World, l1, par3, i2) && (par1World.getBlockMaterial(l1, par3, i2) != this.blockMaterial || par1World.getBlockMetadata(l1, par3, i2) != 0)) { if (!this.blockBlocksFlow(par1World, l1, par3 - 1, i2)) { return par5; } if (par5 < 4) { int j2 = this.calculateFlowCost(par1World, l1, par3, i2, par5 + 1, k1); if (j2 < j1) { j1 = j2; } } } } } return j1; } /** * Returns a boolean array indicating which flow directions are optimal based on each direction's calculated flow * cost. Each array index corresponds to one of the four cardinal directions. A value of true indicates the * direction is optimal. */ private boolean[] getOptimalFlowDirections(World par1World, int par2, int par3, int par4) { int l; int i1; for (l = 0; l < 4; ++l) { this.flowCost[l] = 1000; i1 = par2; int j1 = par4; if (l == 0) { i1 = par2 - 1; } if (l == 1) { ++i1; } if (l == 2) { j1 = par4 - 1; } if (l == 3) { ++j1; } if (!this.blockBlocksFlow(par1World, i1, par3, j1) && (par1World.getBlockMaterial(i1, par3, j1) != this.blockMaterial || par1World.getBlockMetadata(i1, par3, j1) != 0)) { if (this.blockBlocksFlow(par1World, i1, par3 - 1, j1)) { this.flowCost[l] = this.calculateFlowCost(par1World, i1, par3, j1, 1, l); } else { this.flowCost[l] = 0; } } } l = this.flowCost[0]; for (i1 = 1; i1 < 4; ++i1) { if (this.flowCost[i1] < l) { l = this.flowCost[i1]; } } for (i1 = 0; i1 < 4; ++i1) { this.isOptimalFlowDirection[i1] = this.flowCost[i1] == l; } return this.isOptimalFlowDirection; } /** * Returns true if block at coords blocks fluids */ private boolean blockBlocksFlow(World par1World, int par2, int par3, int par4) { int l = par1World.getBlockId(par2, par3, par4); if (l != Block.doorWood.blockID && l != Block.doorIron.blockID && l != Block.signPost.blockID && l != Block.ladder.blockID && l != Block.reed.blockID) { if (l == 0) { return false; } else { Material material = Block.blocksList[l].blockMaterial; return material == Material.portal ? true : material.blocksMovement(); } } else { return true; } } /** * getSmallestFlowDecay(World world, intx, int y, int z, int currentSmallestFlowDecay) - Looks up the flow decay at * the coordinates given and returns the smaller of this value or the provided currentSmallestFlowDecay. If one * value is valid and the other isn't, the valid value will be returned. Valid values are >= 0. Flow decay is the * amount that a liquid has dissipated. 0 indicates a source block. */ protected int getSmallestFlowDecay(World par1World, int par2, int par3, int par4, int par5) { int i1 = this.getFlowDecay(par1World, par2, par3, par4); if (i1 < 0) { return par5; } else { if (i1 == 0) { ++this.numAdjacentSources; } if (i1 >= { i1 = 0; } return par5 >= 0 && i1 >= par5 ? par5 : i1; } } /** * Returns true if the block at the coordinates can be displaced by the liquid. */ private boolean liquidCanDisplaceBlock(World par1World, int par2, int par3, int par4) { Material material = par1World.getBlockMaterial(par2, par3, par4); return material == this.blockMaterial ? false : (material == Material.lava ? false : !this.blockBlocksFlow(par1World, par2, par3, par4)); } /** * Called whenever the block is added into the world. Args: world, x, y, z */ public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); if (par1World.getBlockId(par2, par3, par4) == this.blockID) { par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); } } public boolean func_82506_l() { return false; } } This is the error i get when i try to place either of them, it somehow sends me into BlockFluid while i have no clue why it even goes into that class. Am i missing something?? : So if theres any one that can help me, please do i would love to get these 2 things fixed especialy the biomes one... that keeps me stuck for so long now. Btw i have been active on this thread for that issue : http://www.minecraftforge.net/forum/index.php/topic,8334.msg43286.html#msg43286 Thanks for your time and your effort!
-
[Custom Biomes][Custom Dimension] Multiple Biomes how?
OwnAgePau replied to OwnAgePau's topic in Modder Support
So if i get this right you use overworld biomes in your custom dimension and you use BiomeGenBase aswell? -
No thats not true, as the addBiome and removeBiome add the biome to the overworld and not to your custom dimension, so if you would want to make your custom biomelists etc etc you would have to do a hell lot. I have also been working on this issue a lot and havent gotten this to work yet.
-
Why would you do that? Just go to your chunkProvider class and put this in there (in the public void populate) Example: WorldGenMinable worldgenminable; int j2; for (int i = 0; i < 7; i++) { int randPosX = k + soulRNG.nextInt(16); int randPosY = soulRNG.nextInt(128); //Rarerity 6 (1-15) 1 is very common 15 is extremely rare int randPosZ = l + soulRNG.nextInt(16); (new WorldGenMinable(mod_Ores.Amazoniteore.blockID, 7, mod_Ores.Slate.blockID)).generate(worldObj, soulRNG, randPosX, randPosY, randPosZ); } for (int i = 0; i < 9; i++) { int randPosX = k + soulRNG.nextInt(16); int randPosY = soulRNG.nextInt(128); //Rarerity 4 (1-15) 1 is very common 15 is extremely rare int randPosZ = l + soulRNG.nextInt(16); (new WorldGenMinable(mod_Ores.Amethystore.blockID, 9, mod_Ores.Porphyry.blockID)).generate(worldObj, soulRNG, randPosX, randPosY, randPosZ); } for (int i = 0; i < 9; i++) { int randPosX = k + soulRNG.nextInt(16); int randPosY = soulRNG.nextInt(128); //Rarerity 4 (1-15) 1 is very common 15 is extremely rare int randPosZ = l + soulRNG.nextInt(16); (new WorldGenMinable(mod_Ores.Aquamarineore.blockID, 9, mod_Ores.Slate.blockID)).generate(worldObj, soulRNG, randPosX, randPosY, randPosZ); } Thats how i did it and that works, just note that i have mod_Ores.Slate.blockID set as the block it needs to replace, for the overworld this is stone.
-
[Custom Biomes][Custom Dimension] Multiple Biomes how?
OwnAgePau replied to OwnAgePau's topic in Modder Support
Unfortunately i haven't gotten this to work still. I don't have to make a custom WorldChunkManager, GenLayer (+ all subGenLayer), WorldType, WorldTypeEvent, IntCache, BiomeCacheBlock, BiomeCache etc would i? I also found out that i could use the list of the normal worldchunkmanager and delete biomes using Forge's .removeBiome(""); But that also deletes it from the overworld. I have tried several things to fix this but i haven't gotten it to work properly with loads of "NullPointerExceptions" and "Exception Ticking World". -
Sorry for another double post but i would really appreciate some help with this...
-
I added mine to the chunkProvider class for my dimension and my ore generation works well, good luck!! Hope it helped.
-
Hi there i am OwnAgePau and i am working on my mod called the Soul Forest mod. I have been making some nice custom blocks even managed to easily make a custom fire properly working, after that i wanted to make a custom liquid although this seemed as easy as fire but yet i can't get it to work. I have made 3 new classes one is SoulFluid which is basically BlockFluid but then for my custom fluid, i thought to have to add this if i wanted to pick it up with my custom bucket. Also i made a custom stationary and custom still water class. But somehow it manages to get into BlockFluid into the getFlowDirection which SoulFluid also uses, but it throws a nullPointer Exception. I just hoped you guys know what to do with the custom liquids. So here are my files : SoulFluid SoulWaterFlowing SoulWaterStationary I also made a custom bucket and a filled bucket but i haven't gotten to test those yet because i can not yet place my water. Thanks for your time and effort!
-
Hey there i would like to get a modder status stating that i am the modder of the Soul Forest Mod. Also can i do a separate request of a subform later? Here's the link to my mod : http://www.planetminecraft.com/member/ownagepau/
-
There are quite some threads and tuts about containers and gui's, a good look at the furnace container and furnace gui classes is always nice aswell.
-
Anyone gotten any further on solving the problem around multiple biomes in your custom dimension???
-
Well i am pretty sure that in my case the lists that are defined in my ChunkProvider are read but not used in the generation. Also i somehow do not get a message when entering the world and such while its perfectly the same as in the overworld and such. So uhm jeah here are my classes: ChunkProviderMarona WorldProviderMarona mod_Ores, its about 2500 lines of code so i snipped out about 99% @Mod(modid="myOresMod", name="Soul Forest Mod", version="1.4") @NetworkMod(clientSideRequired = true, serverSideRequired = false, clientPacketHandlerSpec = @SidedPacketHandler(channels = {"mod_Ores" }, packetHandler = ClientPacketHandler.class), serverPacketHandlerSpec = @SidedPacketHandler(channels = {"mod_Ores" }, packetHandler = ServerPacketHandler.class)) public class mod_Ores { @Instance("myOresMod") // instance public static mod_Ores instance; public static BiomeGenBase SoulForest; public static BiomeGenBase FrostCaves; // i will just skip the @PreInit @Init public void load(FMLInitializationEvent ev) { SoulForest = (new BiomeGenSoulForest(23).setBiomeName("SoulForest").setTemperatureRainfall(0.3F, 0.8F).setMinMaxHeight(0.0F, 0.9F)); //Custom Biome FrostCaves = (new BiomeGenFrostCaves(24).setBiomeName("FrostCaves").setEnableSnow().setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.0F, 0.9F)); //Custom Biome GameRegistry.addBiome(SoulForest); GameRegistry.addBiome(FrostCaves); GameRegistry.removeBiome(SoulForest); GameRegistry.removeBiome(FrostCaves); // i know i add them and remove em again, as you sayd i should add removeBiome(), i think i could just leave the 4 rows out completel but i'm not sure if that works or something. Do i need to GameRegistry.addBiome somewhere else though?? } And for you i also have my biomeGenBase and biomeDecorator TheBiomeDeco BiomeGenBaseMarona // i am not sure what and how to use it yet because if i start changing everything to BiomeGenBaseMarona it makes me have to change a hell lot more... i haven't figured out how to do anything that way, like you end up making a custom WorldChunkManager, BiomeCacheBlock, GenLayer etc etc. Thats also why i have everything outcomented in my editor.