if ( ChunkInhabitedTime > 150 hours )
ChunkFactor = 1
else
ChunkFactor = ChunkInhabitedTimeInTicks / 108,000,000
if (difficulty is not Hard)
multiply ChunkFactor by 3/4
if ( MoonPhase / 4 > TotalTimeFactor )
add TotalTimeFactor to ChunkFactor
else
add MoonPhase / 4 to ChunkFactor
It appears that you just copied the "code" given in the Wiki into your own class, which would not work even if it were valid Java code since nothing would call it; you have to actually modify the method that calculates regional difficulty and I doubt that MCreator is able to do that, or even Forge unless you employ reflection/ASM/etc which are beyond even my capabilities and is part of the reason why I have never made any Forge mods; I have modified the regional difficulty calculation but by directly editing the World class where it is calculated (at least prior to 1.8, which uses the formula given by the Wiki; 1.7.10 uses the same formula as 1.6.4); of course, this probably breaks compatibility with Forge itself even if no other mods depend on the class since Forge modifies many base classes in order to add mod support:
Modified; note that I added a new method and redirect the old ones to it; the passed-in coordinates are ignored since they are no longer needed and my custom method can be called directly:
public float getLocationTensionFactor(double par1, double par3, double par5)
{
return this.getTensionFactor();
}
public float getTensionFactorForBlock(int par1, int par2, int par3)
{
return this.getTensionFactor();
}
public float getTensionFactor()
{
// Uses total world time instead of inhabited time, reaching a maximum after 100 hours on
// Easy-Normal, 75 on Hard (during a full moon 75 on Easy-Normal, 50 on Hard)
float factor = (float)this.worldInfo.getWorldTotalTime() / 7200000.0F + this.getCurrentMoonPhaseFactor() * 0.25F;
if (this.difficultySetting == 1)
{
factor /= 2.0F;
}
else if (this.difficultySetting == 3)
{
factor *= 2.0F;
}
return MathHelper.clamp_float(factor, 0.0F, (float)this.difficultySetting * 0.5F);
}
Another variation is what I did for my first world, which was make the inhabited time factor start at 50% of its maximum by modifying this line to add 1800000 to the inhabited time (prior to 1.8 there was no total time factor so you had to wait for 50 hours to get the maximum regional difficulty and I load chunks for less than half that even within the largest cave systems, so even with this change I likely never see maximum regional difficulty while caving):
Also, you appear to be trying to mod 1.7.10 (which uses MCreator v 1.7.3), in which case the methods have different names (they are near the end of the World.java class so are easy to find. Note that you cannot just copy and paste the code for 1.6.4 given above since some other things were renamed):
public float func_147462_b(double p_147462_1_, double p_147462_3_, double p_147462_5_)
public float func_147473_B(int p_147473_1_, int p_147473_2_, int p_147473_3_)
It appears that you just copied the "code" given in the Wiki into your own class, which would not work even if it were valid Java code since nothing would call it; you have to actually modify the method that calculates regional difficulty and I doubt that MCreator is able to do that, or even Forge unless you employ reflection/ASM/etc which are beyond even my capabilities and is part of the reason why I have never made any Forge mods; I have modified the regional difficulty calculation but by directly editing the World class where it is calculated (at least prior to 1.8, which uses the formula given by the Wiki; 1.7.10 uses the same formula as 1.6.4); of course, this probably breaks compatibility with Forge itself even if no other mods depend on the class since Forge modifies many base classes in order to add mod support:
Modified; note that I added a new method and redirect the old ones to it; the passed-in coordinates are ignored since they are no longer needed and my custom method can be called directly:
public float getLocationTensionFactor(double par1, double par3, double par5)
{
return this.getTensionFactor();
}
public float getTensionFactorForBlock(int par1, int par2, int par3)
{
return this.getTensionFactor();
}
public float getTensionFactor()
{
// Uses total world time instead of inhabited time, reaching a maximum after 100 hours on
// Easy-Normal, 75 on Hard (during a full moon 75 on Easy-Normal, 50 on Hard)
float factor = (float)this.worldInfo.getWorldTotalTime() / 7200000.0F + this.getCurrentMoonPhaseFactor() * 0.25F;
if (this.difficultySetting == 1)
{
factor /= 2.0F;
}
else if (this.difficultySetting == 3)
{
factor *= 2.0F;
}
return MathHelper.clamp_float(factor, 0.0F, (float)this.difficultySetting * 0.5F);
}
Another variation is what I did for my first world, which was make the inhabited time factor start at 50% of its maximum by modifying this line to add 1800000 to the inhabited time (prior to 1.8 there was no total time factor so you had to wait for 50 hours to get the maximum regional difficulty and I load chunks for less than half that even within the largest cave systems, so even with this change I likely never see maximum regional difficulty while caving):
Also, you appear to be trying to mod 1.7.10 (which uses MCreator v 1.7.3), in which case the methods have different names (they are near the end of the World.java class so are easy to find. Note that you cannot just copy and paste the code for 1.6.4 given above since some other things were renamed):
public float func_147462_b(double p_147462_1_, double p_147462_3_, double p_147462_5_)
public float func_147473_B(int p_147473_1_, int p_147473_2_, int p_147473_3_)
What is the code for increasing chances of Diamond armor on Zombies? I also want to figure that out.
What is the code for increasing chances of Diamond armor on Zombies? I also want to figure that out.
That is located in EntityLiving base, method addRandomArmor:
protected void addRandomArmor()
{
if (this.rand.nextFloat() < 0.15F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ))
{
int var1 = this.rand.nextInt(2);
float var2 = this.worldObj.difficultySetting == 3 ? 0.1F : 0.25F;
if (this.rand.nextFloat() < 0.095F)
{
++var1;
}
if (this.rand.nextFloat() < 0.095F)
{
++var1;
}
if (this.rand.nextFloat() < 0.095F)
{
++var1;
}
The chance of diamond armor is calculated as 0.5 * 0.095 * 0.095 * 0.095 = 0.000428688, or one in 2332.7 mobs with armor, which is itself determined by 0.15 * regionalDifficulty, or 15% for a regional difficulty of 1 (the first line), at which point one in 15551 mobs will have diamond armor. Note that if you change the 0.095 factors (all staying the same) the chance of diamond armor increases by the cube of the difference; for example, in TMCW I changed them to 0.2, which gives 0.5 * 0.2 * 0.2 * 0.2 = 0.004 or one in 250 armored mobs, which is (0.2 / 0.095) cubed, or 9.33 times more common.
Note that this affects skeletons as well, and zombies have their own method (same name in EntityZombie) which extends this to add weapons (the chances of which are themselves determined by difficulty, 1% on Easy-Normal and 5% on Hard). Mobs from other mods would presumably also be affected unless they completely override the method (for example, zombie pigmen use it to add a gold sword but do not call their super() method so they do not spawn with armor).
Of course, that's a moot point (again) if you just edit the class with MCP since it is unlikely it would work with Forge (unless you could directly edit the Forge-patched source but that has not been possible since Forge started using Gradle in 1.6.4; I did successfully make my own Forge-compatible mods back in 1.6.2 by doing this. Otherwise, you'd have to add every single method/field/constructor that mods might access in the patched class (for example, I had to do this to get TMCWv4 Underground compatible with Forge's version of WorldGenMinable), and that's if Forge doesn't add its own stuff; MCP won't recompile if you just try to add references to nonexistent Forge code, at least not without making dummy classes).
I'm trying to edit Regional Difficulty, I got an error when I was running Gradle on MCreator.
C:\Pylo\MCreator173\forge\build\sources\java\mod\Regionaldifficulty.java:1: error: class, interface, or enum expected
TotalTimeFactor, ChunkFactor, and RegionalDifficulty are floating-point variables
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Here's my code:
if ( TotalPlayTime > 42 hours )
TotalTimeFactor = 0.50
else if ( TotalPlayTime < 1 hour )
TotalTimeFactor = 0
else
TotalTimeFactor = ( TotalPlayTimeInTicks - 144,000 ) / 5,760,000
if ( ChunkInhabitedTime > 150 hours )
ChunkFactor = 1
else
ChunkFactor = ChunkInhabitedTimeInTicks / 108,000,000
if (difficulty is not Hard)
multiply ChunkFactor by 3/4
if ( MoonPhase / 4 > TotalTimeFactor )
add TotalTimeFactor to ChunkFactor
else
add MoonPhase / 4 to ChunkFactor
if ( difficulty is Easy )
divide ChunkFactor by 2
RegionalDifficulty = 3.75 + TotalTimeFactor + ChunkFactor
if (difficulty is Normal)
multiply RegionalDifficulty by 2
if (difficulty is Hard)
multiply RegionalDifficulty by 3
return RegionalDifficulty
I need help.
If you aren't going to learn Java then you should not be trying to make mods.
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้
It appears that you just copied the "code" given in the Wiki into your own class, which would not work even if it were valid Java code since nothing would call it; you have to actually modify the method that calculates regional difficulty and I doubt that MCreator is able to do that, or even Forge unless you employ reflection/ASM/etc which are beyond even my capabilities and is part of the reason why I have never made any Forge mods; I have modified the regional difficulty calculation but by directly editing the World class where it is calculated (at least prior to 1.8, which uses the formula given by the Wiki; 1.7.10 uses the same formula as 1.6.4); of course, this probably breaks compatibility with Forge itself even if no other mods depend on the class since Forge modifies many base classes in order to add mod support:
Modified; note that I added a new method and redirect the old ones to it; the passed-in coordinates are ignored since they are no longer needed and my custom method can be called directly:
Another variation is what I did for my first world, which was make the inhabited time factor start at 50% of its maximum by modifying this line to add 1800000 to the inhabited time (prior to 1.8 there was no total time factor so you had to wait for 50 hours to get the maximum regional difficulty and I load chunks for less than half that even within the largest cave systems, so even with this change I likely never see maximum regional difficulty while caving):
Also, you appear to be trying to mod 1.7.10 (which uses MCreator v 1.7.3), in which case the methods have different names (they are near the end of the World.java class so are easy to find. Note that you cannot just copy and paste the code for 1.6.4 given above since some other things were renamed):
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
What is the code for increasing chances of Diamond armor on Zombies? I also want to figure that out.
That is located in EntityLiving base, method addRandomArmor:
The chance of diamond armor is calculated as 0.5 * 0.095 * 0.095 * 0.095 = 0.000428688, or one in 2332.7 mobs with armor, which is itself determined by 0.15 * regionalDifficulty, or 15% for a regional difficulty of 1 (the first line), at which point one in 15551 mobs will have diamond armor. Note that if you change the 0.095 factors (all staying the same) the chance of diamond armor increases by the cube of the difference; for example, in TMCW I changed them to 0.2, which gives 0.5 * 0.2 * 0.2 * 0.2 = 0.004 or one in 250 armored mobs, which is (0.2 / 0.095) cubed, or 9.33 times more common.
Note that this affects skeletons as well, and zombies have their own method (same name in EntityZombie) which extends this to add weapons (the chances of which are themselves determined by difficulty, 1% on Easy-Normal and 5% on Hard). Mobs from other mods would presumably also be affected unless they completely override the method (for example, zombie pigmen use it to add a gold sword but do not call their super() method so they do not spawn with armor).
Of course, that's a moot point (again) if you just edit the class with MCP since it is unlikely it would work with Forge (unless you could directly edit the Forge-patched source but that has not been possible since Forge started using Gradle in 1.6.4; I did successfully make my own Forge-compatible mods back in 1.6.2 by doing this. Otherwise, you'd have to add every single method/field/constructor that mods might access in the patched class (for example, I had to do this to get TMCWv4 Underground compatible with Forge's version of WorldGenMinable), and that's if Forge doesn't add its own stuff; MCP won't recompile if you just try to add references to nonexistent Forge code, at least not without making dummy classes).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?