Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by acid1103

  1. One solution I've found is to use the "generator-settings" in server.properties, as they're get loaded properly, even if they don't strictly match valid settings in the vanilla game. Here's an example: server.properties: allow-flight = false ... generator-settings = {"mod-id": true} ... white-list = false mod.java: @SubscribeEvent public void dedicatedServerStarting(FMLDedicatedServerSetupEvent event) { ServerProperties serverProperties = event.getServerSupplier().get().getServerProperties(); boolean loadMod = false; // get the generator-settings and parse them as json JsonElement json = new Gson().fromJson(serverProperties.generatorSettings, JsonElement.class); // check for the existance of the "mod-id" entry in the json object. if it's present, we can load the mod. if (json.isJsonObject()) loadMod = JSONUtils.getBoolean(json.getAsJsonObject(), "mod-id", false); if (loadMod) { // do mod loading stuff } else { LOGGER.info("Using normal world generator"); } } While not as elegant as having the ability to type a custom level-type, this works and is, in my mind, less hacky than many other options I tried. One thing to note is that the Client is never sent generator-settings. Thus, if the Client needs to know whether or not the mod was loaded, you'll have to find another way to inform it.
  2. In net.minecraftforge.common.util.EnumHelper , there's at lease one bug in Class[][] CommonTypes . {EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class} needs to be {EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class} because the constructor in EnumCreatureType.class is as follows: private EnumCreatureType(Class par3Class, int par4, Material par5Material, boolean par6, boolean par7) { this.creatureClass = par3Class; this.maxNumberOfCreature = par4; this.creatureMaterial = par5Material; this.isPeacefulCreature = par6; this.isAnimal = par7; } As for now, modders have to use the public static <T extends Enum<? >> T addEnum(Class<T> enumType, String enumName, Class<?>[] paramTypes, Object[] paramValues) method in EnumHelper , which is obviously not the intent of this class. Also, just as some evidence that this is an issue, I spent over two hours trying to figure out how to do this using Reflection because I didn't read the error very well last night when I first stumbled upon it. The error is one of those where it's like Exception blahblah stacktrace stacktrace stacktrace stacktrace ... caused by Exception blahblah stacktrace stacktrace ... caused by Exception blahblah stacktrace stacktrace ... and I only saw the first exception.. Anyway, I hope this gets fixed (though, of course, it's certainly of low priority, albeit a simple fix..)
  3. When I try to run forge in Eclipse, I get this... I've tried running gradlew cleanCache and recreating the forge environment, (or what ever you chose to call it) and having nothing other than what is normally setup in Eclipse.. Still, when I try to run (with ONLY the argument "--tweakClass=cpw.mods.fml.common.launcher.FMLTweaker") it doesn't work. Does it matter that I'm opting out of changing my entire workspace directory in Eclipse and instead just have a project with the same .classpath and everything as there would be if I used the Gradle-made workspace directory? (That's a confusingly worded question, but I'm 99% confident that it is not causing the problem.) Regardless, I do, in fact, have a clean forgeSrc-1.7.2-, and have even tried running it with the arguments the error messages suggest. But it's still not working... How do I fix this annoying problem?
  4. A wild bump appears! acid1103 uses Confusion. It's super effective!
  5. Why are you extending BlockBush rather than BlockSapling?
  6. I'm making a mod that completely redoes the Minecraft terrain generation. It places a bunch of lava on the overworld along with a whole bunch of other stuff. The issue is, none of the methods that check to see if a spot is a good place to spawn the player take lava into consideration. I've tried making my own WorldProvider (which actually creates the spawn points) and my own dimension, but I want this dimension to be the overworld, not some alternate dimension you teleport to. (See, ultimately, all of this is a custom WorldType.) Since there's no way to tell Forge that my custom dimension needs to be the overworld, this method failed. I've tried having an EntityJoinWorldEvent which narrows it down to only EntityPlayers and down even further to check if it's the first time this player has joined this world. Then it checks to see if the world's spawnpoint is going to kill the player or not. If it is going to kill the player, it searches frantically until it finds a nice peaceful spot NOT in lava. Then it sets THAT to the spawnpoint. (It even makes sure that all the spots around the spawnpoint that the game could possibly spawn the player are not in lava.) BUT, this isn't working either! And I don't know why! You might say, "Give the player a temporary fire resist effect." I can't I also give the player some items when s/he first spawn in. If I did the fire resist, the items would still burn in the lava. I'm at an absolute utter loss and don't know what else to do... HELP! It should not seriously be THAT hard to change the world's spawnpoint before the player spawns in it!! Here's my code that checks if it's okay to spawn:
  7. I know that other mobs (such as villagers) often look at the player. Anyway you could find the code for that and incorporate it into your own?
  8. Thanks for finding that!... But it still isn't working..
  9. Actually, all I want is for the first time. So, either way, it doesn't really matter that much. And I have tried deleting the world and making a new one, but it still does not work.
  10. I want my player to spawn on sand with a Y-value > 78. I have a WorldProvider (that is getting used. I mean, its methods are being called..) that has overridden the spawn checking methods. Regardless, Minecraft insists on spawning the player at a location that does not meet the previously mentioned requirements. @Override public boolean canCoordinateBeSpawn(int x, int z) { return worldObj.getTopBlock(x, z) == Blocks.sand && worldObj.getTopSolidOrLiquidBlock(x, z) > 78; } @Override public ChunkCoordinates getRandomizedSpawnPoint()//Notice how, even whenever it's getting the randomized spawn point, I still check to see that it meets the requirements. I do so right down... { ChunkCoordinates chunkcoordinates = new ChunkCoordinates(this.worldObj.getSpawnPoint()); boolean isAdventure = worldObj.getWorldInfo().getGameType() == GameType.ADVENTURE; int spawnFuzz = terrainType.getSpawnFuzz(); int spawnFuzzHalf = spawnFuzz / 2; if (!hasNoSky && !isAdventure) { do { chunkcoordinates.posX += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf; chunkcoordinates.posZ += this.worldObj.rand.nextInt(spawnFuzz) - spawnFuzzHalf; chunkcoordinates.posY = this.worldObj.getTopSolidOrLiquidBlock(chunkcoordinates.posX, chunkcoordinates.posZ); } while (!canCoordinateBeSpawn(chunkcoordinates.posX, chunkcoordinates.posY));//here.. But MC still seems to be ignoring them. } return chunkcoordinates; } Also, I know Minecraft isn't literally ignoring my code, so please don't correct me on that. I promise that I'm not that stupid.
  11. Yeah, after 3 hours of no replies, that's what I ended up doing. Which is a bit unfortunate because now my code iterates through one forth of every chunk during generation, making generation that much slower.. Ah well, it works the way I want it to, and I have more control over it this way.
  12. In the mod that I'm making, I don't want any above-ground water. So, I went through the painful process of making new subclasses of every class that generates water and replaced it all. (I didn't replace it all at once. It was only after I went through several times replacing what I thought was causing the water that I eventually replaced all of them finally the above-ground water is gone.) However, I still want those single underground water source blocks. I don't want underground lakes, just those singular source blocks you find in caves. (Also, I don't mind if they generate on the surface making waterfalls. I just don't want bodies of water on the surface.) I was wondering if anyone knew where in the source code these underground water blocks are? I've looked and looked, changing some of them back to water, but to no avail. If anyone knows where these are located, it would be greatly appreciated.
  13. This may not help a ton, but I've found this in EntityCreature (of which all entities that flee are subclasses): public static final AttributeModifier field_110181_i = (new AttributeModifier(field_110179_h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); So, maybe if you trace that around, you can find where it's being used. For instance, in EntityAnimal: public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { if (this.isEntityInvulnerable()) { return false; } else { this.fleeingTick = 60; if (!this.isAIEnabled()) { IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); if (iattributeinstance.getModifier(field_110179_h) == null) { iattributeinstance.applyModifier(field_110181_i); //It's being used right here! } } this.entityToAttack = null; this.inLove = 0; return super.attackEntityFrom(par1DamageSource, par2); } }
  14. So, I'm fairly new to Forge (I used it a little many months ago, but much of the little that I learned then has changed.) Due to the recent update, most of the tutorials aren't up to date. I'm fairly skilled in Java (I've been programming in Java for nearly 5 years now and got started with Java because of Minecraft.) I'm having some problems finding my way around Forge, because I'm unfamiliar with it, but I would like to create a new WorldType which will encompass an alternative of the a basic survival world. This alternative really only needs three (thus far, non-existent) biomes. I've created the new WorldType and have set it up to my liking, but the further I dig into the generation of the biomes, the more and more and more complex it gets. Is there not a simpler way to change which biomes are generated in my alternate dimension than to go and change every reference to them in all of the code?! For instance, in net.minecraft.world.gen.layer.GenLayer.java: protected static boolean isBiomeOceanic(int p_151618_0_) { return p_151618_0_ == BiomeGenBase.ocean.biomeID || p_151618_0_ == BiomeGenBase.deepOcean.biomeID || p_151618_0_ == BiomeGenBase.frozenOcean.biomeID; } This is intermingled with the code used to actually generate the world. However, some of the biomes are hardcoded right in there! One of the biomes I need to make is indeed oceanic. Does this mean I will have to make a subclass of GenLayer.java simply to override this method to include mt biome?? In my personal opinion, that's somewhat ridiculous. If things like this can't be avoided, then I understand and will (maybe) just put up with them, but I simply would like to know if there is a simpler way to do what I'm wanting to do.
  • Create New...

Important Information

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