Posted October 11, 201411 yr I am interested in making my own orespawner algorithm and I am curious how to delete or inhibit the inherent orespawning algorithm that minecrafts has how would I go about doing that? I know I can just afterward replace all ore with cobblestone and start from scratch but that seems like an aweful lot of work for the computer. Best regards
October 11, 201411 yr Author Fantastic start indeed....I am clueless how do I STOP it from generating anything?
October 11, 201411 yr Author I made some progress, I have looked about and figured I should be denying it the ore then, let's see how it goes
October 11, 201411 yr Author Okey, I am trying this, I don't even get the message ive implemented so it doesn't reach the event, what am I doing wrong on it? @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(OreGenEvent.GenerateMinable event) { System.out.println("deny the ore damn it"); event.setResult(Result.DENY); }
October 11, 201411 yr Author Yes, I put this event in my event handler that has been registered already and I know this because this is how it looks package aerosteam.events; import java.util.Random; import aerosteam.AeroSteam; import aerosteam.RandomFunctions; import aerosteam.blocks.BlocksGases; import aerosteam.gases.Gases; import aerosteam.gases.gasDirection; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraftforge.client.event.EntityViewRenderEvent.FogColors; import net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.world.BlockEvent; import cpw.mods.fml.common.eventhandler.Event.HasResult; import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class EventASHandler { @SideOnly(Side.CLIENT) @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(FogColors event) { if (event.entity instanceof EntityPlayer){ Block block = event.block; //System.out.println("Is Player-" + x + "," + y + "," + z); if (block instanceof Gases){ Gases gas = (Gases) block; //System.out.println("red: " + gas.red); event.red = gas.red; event.blue = gas.blue; event.green = gas.green; } } } @SideOnly(Side.CLIENT) @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(FogDensity event) { //System.out.println("Fogged"); if (event.entity instanceof EntityPlayer){ Block block = event.block; //System.out.println("Is Player-" + x + "," + y + "," + z); if (block instanceof Gases){ Gases gas = (Gases) block; event.density = gas.fogdensity; }else event.density = (float) 0.0F; }else event.density = (float) 0.0F; event.setCanceled(true); // must be canceled to affect the fog density } @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(LivingJumpEvent event) { // DEBUG if (event.entity instanceof EntityPlayer) { EntityPlayer player=(EntityPlayer) event.entity; player.motionY += 0; } } @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(BlockEvent.BreakEvent event) { if (event.block == Blocks.coal_ore || event.block == Blocks.coal_block){ for (gasDirection check: gasDirection.VALID_DIRECTIONS){ if (event.world.getBlock(event.x+check.offsetX, event.y+check.offsetY, event.z+check.offsetZ) == Blocks.air){ //System.out.println("found free"); if (RandomFunctions.BoolRndInt(3,1,7)){ //System.out.println("random is good"); event.world.setBlock(event.x+check.offsetX, event.y+check.offsetY, event.z+check.offsetZ,BlocksGases.coalDust); } } } } } @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(OreGenEvent.Pre event) { System.out.println("Pre working"); event.setResult(Result.DENY); } @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(OreGenEvent.GenerateMinable event) { System.out.println("deny the ore damn it"); event.setResult(Result.DENY); } @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(TickEvent.WorldTickEvent event) { //Include random meteors and natural disasters here } } and BlockEvent.BreakEvent fires off without a problem generating the coaldust like I want it to
October 11, 201411 yr Author this is where it is registered too @EventHandler public void preInit(FMLInitializationEvent event) { BlocksAS.Init(); BlocksPipes.Init(); BlocksGases.Init(); ItemsAS.Init(); FMLCommonHandler.instance().bus().register(new AnvilSmithingHandler()); MinecraftForge.EVENT_BUS.register(new EventASHandler()); FMLCommonHandler.instance().bus().register(new EventASHandler()); //ItemsAS.Init(); //stuff NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); BiomesAS.init(); RecipeRemover.removeRecipe(); CraftingRecipes.addRecipes(); //Steam stuff //Entity EntityHandler.registerDayMob(MobThief.class, "Thief"); //RenderingRegistry.registerBlockHandler(RenderBlockGases.instance); //achievementStoneAge=new Achievement() //GameRegistry.registerFuelHandler(new FuelHandler()); //Generate world GameRegistry.registerWorldGenerator(eventWorldGen, 0); //Renders neoProxy.registerRenderThings(); }
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.