diff --git a/changelog.txt b/changelog.txt index d864598..29fc7fd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,8 +1,21 @@ -## Version 1.3.5 ## +## Version 1.3.6 ## +/--Gameplay--/ +- Fixed an issue where sawing corners of wood types with metadata would create gears with metadata which wouldn't stack together or work in recipes. Additionally, recipes involving gears have been changed to ignore metadata so that existing bugged gears can be used. +- Fixed an issue where diamond shears made no sound when used in crafting. + +/--Creative Mode--/ +- Changed health/hunger status effects to not apply when the player is in creative mode. + +/--Addon API--/ +- Added hooks to FCAddOn to allow addons to define behavior for decorating the world (for things like trees, ores, etc) +- Added hooks to allow biomes to define whether it can snow at a certain location. +- Changed the checks for breaking the saw to check for if a block has a recipe, removing the need to also disable breaking the saw in the block's class. + Thanks to the following people who contributed to this release! - Dawnraider - yany +## Version 1.3.5 ## /--Gameplay--/ - Fixed an issue where moonlight was erroneously block mobs from spawning on slabs and other partial blocks. - Fixed an issue where scattered features (temples and witch huts) were not generating properly. diff --git a/patches/minecraft/net/minecraft/src/BiomeDecorator.java.patch b/patches/minecraft/net/minecraft/src/BiomeDecorator.java.patch new file mode 100644 index 0000000..cbf2d20 --- /dev/null +++ b/patches/minecraft/net/minecraft/src/BiomeDecorator.java.patch @@ -0,0 +1,11 @@ +--- a/minecraft/net/minecraft/src/BiomeDecorator.java ++++ b/minecraft/net/minecraft/src/BiomeDecorator.java +@@ -376,6 +376,8 @@ + (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); + } + } ++ ++ FCAddOnHandler.decorateWorld(this, this.currentWorld, this.randomGenerator, this.chunk_X, this.chunk_Z, this.biome); + } + + /** diff --git a/patches/minecraft/net/minecraft/src/BiomeGenBase.java.patch b/patches/minecraft/net/minecraft/src/BiomeGenBase.java.patch index 038bbcc..0418524 100644 --- a/patches/minecraft/net/minecraft/src/BiomeGenBase.java.patch +++ b/patches/minecraft/net/minecraft/src/BiomeGenBase.java.patch @@ -169,7 +169,7 @@ /** * Checks to see if the rainfall level of the biome is extremely high -@@ -352,4 +408,20 @@ +@@ -352,4 +408,24 @@ double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); return ColorizerFoliage.getFoliageColor(var1, var3); } @@ -188,5 +188,9 @@ + public boolean canSlimesSpawnOnSurface() { + return false; + } ++ ++ public boolean canSnowAt(int x, int y, int z) { ++ return this.temperature <= 0.15F; ++ } + // END FCMOD +} diff --git a/patches/minecraft/net/minecraft/src/Block.java.patch b/patches/minecraft/net/minecraft/src/Block.java.patch index 06bdd33..c0cf627 100644 --- a/patches/minecraft/net/minecraft/src/Block.java.patch +++ b/patches/minecraft/net/minecraft/src/Block.java.patch @@ -801,7 +801,7 @@ if (var0 > 0 && blocksList[var0].getRenderType() == 10) { var1 = true; -@@ -1364,10 +1429,2345 @@ +@@ -1364,10 +1429,2348 @@ } useNeighborBrightness[var0] = var1; @@ -1596,7 +1596,10 @@ + //------------- Saw related functionality ------------// + + public boolean DoesBlockBreakSaw(World world, int x, int y, int z) { -+ if (blockMaterial.isSolid() && blockMaterial.breaksSaw()) { ++ int metadata = world.getBlockMetadata(x, y, z); ++ FCCraftingManagerSawRecipe recipe = FCCraftingManagerSaw.instance.getRecipe(this, metadata); ++ ++ if (blockMaterial.isSolid() && blockMaterial.breaksSaw() && recipe == null) { + return true; + } + diff --git a/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch b/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch index 09620e2..90389c0 100644 --- a/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch +++ b/patches/minecraft/net/minecraft/src/EntityPlayer.java.patch @@ -465,7 +465,7 @@ return this.capabilities.allowEdit ? true : (par5ItemStack != null ? par5ItemStack.func_82835_x() : false); } -@@ -2183,4 +2374,1150 @@ +@@ -2183,4 +2374,1154 @@ { return ScorePlayerTeam.func_96667_a(this.getTeam(), this.username); } @@ -788,7 +788,7 @@ + { + float fModifier = GetHealthAndExhaustionModifier(); + -+ if ( GetGloomLevel() > 0 ) ++ if (GetGloomLevel() > 0 && !this.capabilities.isCreativeMode) + { + fModifier *= 0.5F; + } @@ -860,6 +860,10 @@ + + public int GetMaximumStatusPenaltyLevel() + { ++ if (this.capabilities.isCreativeMode) { ++ return 0; ++ } ++ + int iMaximumPenaltyLevel = GetHealthPenaltyLevel(); + int iHungerPenaltyLevel = GetHungerPenaltyLevel(); + diff --git a/patches/minecraft/net/minecraft/src/EntityPlayerMP.java.patch b/patches/minecraft/net/minecraft/src/EntityPlayerMP.java.patch index a65e7d8..f631b32 100644 --- a/patches/minecraft/net/minecraft/src/EntityPlayerMP.java.patch +++ b/patches/minecraft/net/minecraft/src/EntityPlayerMP.java.patch @@ -360,7 +360,7 @@ + + private void UpdateHealthAndHungerEffects() + { -+ if ( !isDead && ( worldObj.getTotalWorldTime() + (long)entityId ) % 80L == 0L ) ++ if ( !isDead && ( worldObj.getTotalWorldTime() + (long)entityId ) % 80L == 0L && !this.capabilities.isCreativeMode ) + { + if ( foodStats.getFoodLevel() <= 0 && foodStats.getSaturationLevel() <= 0F ) + { @@ -379,7 +379,7 @@ + { + if ( !isDead ) + { -+ if ( IsInGloom() ) ++ if ( IsInGloom() && !this.capabilities.isCreativeMode ) + { + m_iInGloomCounter++; + @@ -436,7 +436,7 @@ + int iFat = (int)foodStats.getSaturationLevel(); + int iFatLevel = 4; + -+ if ( iFat < 12 ) ++ if ( iFat < 12 || this.capabilities.isCreativeMode) + { + iFatLevel = 0; + } @@ -462,7 +462,7 @@ + int iHunger = foodStats.getFoodLevel(); + int iPenaltyLevel = 5; + -+ if ( iHunger > 24 ) ++ if ( iHunger > 24 || this.capabilities.isCreativeMode ) + { + iPenaltyLevel = 0; + } @@ -492,7 +492,7 @@ + int iHealth = getHealth(); + int iPenaltyLevel = 5; + -+ if ( iHealth > 10 ) ++ if ( iHealth > 10 || this.capabilities.isCreativeMode ) + { + iPenaltyLevel = 0; + } diff --git a/patches/minecraft/net/minecraft/src/FCAddOn.java.patch b/patches/minecraft/net/minecraft/src/FCAddOn.java.patch index 2b04096..34a046c 100644 --- a/patches/minecraft/net/minecraft/src/FCAddOn.java.patch +++ b/patches/minecraft/net/minecraft/src/FCAddOn.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/minecraft/net/minecraft/src/FCAddOn.java -@@ -0,0 +1,451 @@ +@@ -0,0 +1,464 @@ +// FCMOD + +package net.minecraft.src; @@ -27,6 +27,7 @@ +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; ++import java.util.Random; +import java.util.Set; + +import net.minecraft.client.Minecraft; @@ -120,6 +121,18 @@ + return null; + } + ++ /** ++ * Called when decorating a chunk (adding trees, ores, etc) to allow addons to add their own generators ++ * Look in BiomeDecorator for guidance in how to create and use a generator for those things ++ * @param decorator The decorator instance ++ * @param world The current world ++ * @param rand The random number generator. Always use this generator for deterministic generation. ++ * @param x ++ * @param y ++ * @param biome The biome being decorated. Biomes during decoration are lower resolution, only being caluclated per chunk not per block ++ */ ++ public void decorateWorld(BiomeDecorator decorator, World world, Random rand, int x, int y, BiomeGenBase biome) {} ++ + //------ API Methods ------// + /* + * These are methods which should be called from diff --git a/patches/minecraft/net/minecraft/src/FCAddOnHandler.java.patch b/patches/minecraft/net/minecraft/src/FCAddOnHandler.java.patch index 41e06fd..894d444 100644 --- a/patches/minecraft/net/minecraft/src/FCAddOnHandler.java.patch +++ b/patches/minecraft/net/minecraft/src/FCAddOnHandler.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/minecraft/net/minecraft/src/FCAddOnHandler.java -@@ -0,0 +1,402 @@ +@@ -0,0 +1,411 @@ +// FCMOD + +package net.minecraft.src; @@ -13,6 +13,7 @@ +import java.util.LinkedList; +import java.util.List; +import java.util.Map; ++import java.util.Random; +import java.util.Set; +import java.util.logging.FileHandler; +import java.util.logging.Level; @@ -323,6 +324,14 @@ + FCAddOnHandler.addonWorldDataMap.put(mod, data); + } + ++ public static void decorateWorld(BiomeDecorator decorator, World world, Random rand, int x, int y, BiomeGenBase biome) { ++ for (Object mod : FCAddOnHandler.m_ModList) { ++ FCAddOn addon = (FCAddOn) mod; ++ ++ addon.decorateWorld(decorator, world, rand, x, y, biome); ++ } ++ } ++ + public static boolean isModInstalled(String name) { + for (FCAddOn mod : m_ModList) { + if (mod.getName().equals(name)) { diff --git a/patches/minecraft/net/minecraft/src/FCBetterThanWolves.java.patch b/patches/minecraft/net/minecraft/src/FCBetterThanWolves.java.patch index df33d3c..71aec98 100644 --- a/patches/minecraft/net/minecraft/src/FCBetterThanWolves.java.patch +++ b/patches/minecraft/net/minecraft/src/FCBetterThanWolves.java.patch @@ -25,7 +25,7 @@ + +public class FCBetterThanWolves extends FCAddOn +{ -+ public static final String fcVersionString = "1.3.4"; ++ public static final String fcVersionString = "1.3.6"; + + public static FCBetterThanWolves m_instance = new FCBetterThanWolves(); + diff --git a/patches/minecraft/net/minecraft/src/FCItemShears.java.patch b/patches/minecraft/net/minecraft/src/FCItemShears.java.patch index e7c06a2..9b622ec7 100644 --- a/patches/minecraft/net/minecraft/src/FCItemShears.java.patch +++ b/patches/minecraft/net/minecraft/src/FCItemShears.java.patch @@ -98,7 +98,7 @@ + } + + @Override -+ public void OnDamagedInCrafting( EntityPlayer player ) ++ public void OnUsedInCrafting(EntityPlayer player, ItemStack outputStack) + { + // note: the playSound function for player both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same player + diff --git a/patches/minecraft/net/minecraft/src/FCRecipes.java.patch b/patches/minecraft/net/minecraft/src/FCRecipes.java.patch index 09e9563..c342dc0 100644 --- a/patches/minecraft/net/minecraft/src/FCRecipes.java.patch +++ b/patches/minecraft/net/minecraft/src/FCRecipes.java.patch @@ -1608,7 +1608,7 @@ + "XYX", + "#X#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcBlockAxle + } ); + @@ -1617,7 +1617,7 @@ + "XYX", + "#X#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcBlockAxle + } ); + @@ -1626,7 +1626,7 @@ + "XYX", + "#X#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcItemRedstoneLatch + } ); + @@ -1635,7 +1635,7 @@ + "XYX", + "#X#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcItemRedstoneLatch + } ); + @@ -1644,7 +1644,7 @@ + " Y ", + "#X#", + '#', FCBetterThanWolves.fcItemStoneBrick, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.stick + } ); + @@ -1652,7 +1652,7 @@ + "YYY", + "YYY", + "YXY", -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcItemStoneBrick + } ); + @@ -1662,7 +1662,7 @@ + "ZYZ", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), + 'X', Item.pocketSundial, -+ 'Y', FCBetterThanWolves.fcItemGear, ++ 'Y', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Z', FCBetterThanWolves.fcItemStoneBrick + } ); + @@ -1672,7 +1672,7 @@ + "YZY", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), + 'X', FCBetterThanWolves.fcItemTannedLeather, -+ 'Y', FCBetterThanWolves.fcItemGear, ++ 'Y', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Z', FCBetterThanWolves.fcItemBelt + } ); + @@ -1682,7 +1682,7 @@ + "YZY", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), + 'X', FCBetterThanWolves.fcItemTannedLeatherCut, -+ 'Y', FCBetterThanWolves.fcItemGear, ++ 'Y', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Z', FCBetterThanWolves.fcItemBelt + } ); + } @@ -1874,7 +1874,7 @@ + "XYX", + " Z ", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Block.pressurePlatePlanks, + 'Z', new ItemStack( FCBetterThanWolves.fcBlockWoodCornerItemStubID, 1, ignoreMetadata ) + } ); @@ -1884,7 +1884,7 @@ + "XZX", + "#X#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemBelt + } ); @@ -1894,7 +1894,7 @@ + "XZX", + "#X#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemBelt + } ); @@ -1920,7 +1920,7 @@ + "XZX", + "#Y#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemRedstoneLatch + } ); @@ -1931,7 +1931,7 @@ + "XZX", + "#Y#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemRedstoneLatch + } ); @@ -2012,7 +2012,7 @@ + "WSW", + "WgW", + 'W', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'g', FCBetterThanWolves.fcItemGear, ++ 'g', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'S', FCBetterThanWolves.fcItemScrew, + 'G', FCBetterThanWolves.fcBlockGrate, + 'X', FCBetterThanWolves.fcItemGlue @@ -5895,7 +5895,7 @@ + moulding, mouldingMetas); + + //Corners -+ addSawRecipe(new ItemStack(FCBetterThanWolves.fcItemGear, 2, itemMetadata), ++ addSawRecipe(new ItemStack(FCBetterThanWolves.fcItemGear, 2), + sidingAndCorner, cornerMetas); + + //Fence diff --git a/patches/minecraft/net/minecraft/src/World.java.patch b/patches/minecraft/net/minecraft/src/World.java.patch index ff1c610..bfb4987 100644 --- a/patches/minecraft/net/minecraft/src/World.java.patch +++ b/patches/minecraft/net/minecraft/src/World.java.patch @@ -450,24 +450,47 @@ if (this.ambientTickCountdown > 0) { -@@ -3149,10 +3328,16 @@ - { - if (par2 >= 0 && par2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10) - { -+ // FCMOD: Code change -+ /* - int var6 = this.getBlockId(par1, par2 - 1, par3); - int var7 = this.getBlockId(par1, par2, par3); +@@ -3136,31 +3315,22 @@ + /** + * Tests whether or not snow can be placed at a given location + */ +- public boolean canSnowAt(int par1, int par2, int par3) +- { +- BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); +- float var5 = var4.getFloatTemperature(); ++ public boolean canSnowAt(int x, int y, int z) { ++ BiomeGenBase biome = this.getBiomeGenForCoords(x, z); - if (var7 == 0 && Block.snow.canPlaceBlockAt(this, par1, par2, par3) && var6 != 0 && var6 != Block.ice.blockID && Block.blocksList[var6].blockMaterial.blocksMovement()) -+ */ -+ if ( FCBlockSnowCover.CanSnowCoverReplaceBlock( this, par1, par2, par3 ) && -+ Block.snow.canPlaceBlockAt( this, par1, par2, par3 ) ) -+ // END FCMOD - { +- if (var5 > 0.15F) +- { +- return false; +- } +- else +- { +- if (par2 >= 0 && par2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10) +- { +- int var6 = this.getBlockId(par1, par2 - 1, par3); +- int var7 = this.getBlockId(par1, par2, par3); +- +- if (var7 == 0 && Block.snow.canPlaceBlockAt(this, par1, par2, par3) && var6 != 0 && var6 != Block.ice.blockID && Block.blocksList[var6].blockMaterial.blocksMovement()) +- { ++ if (biome.canSnowAt(x, y, z)) { ++ if (y >= 0 && y < 256 && this.getSavedLightValue(EnumSkyBlock.Block, x, y, z) < 10) { ++ if (FCBlockSnowCover.CanSnowCoverReplaceBlock(this, x, y, z) && Block.snow.canPlaceBlockAt(this, x, y, z)) { return true; } -@@ -3181,10 +3366,10 @@ + } + + return false; + } ++ else { ++ return false; + } ++ } + + public void updateAllLightTypes(int par1, int par2, int par3) + { +@@ -3181,10 +3351,10 @@ else { int var5 = this.getBlockId(par1, par2, par3); @@ -480,7 +503,7 @@ { var7 = 1; } -@@ -3243,8 +3428,8 @@ +@@ -3243,8 +3413,8 @@ int var13; int var14; int var15; @@ -490,7 +513,7 @@ if (var8 > var7) { -@@ -3383,10 +3568,18 @@ +@@ -3383,10 +3553,18 @@ public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { ArrayList var4 = new ArrayList(); @@ -509,7 +532,7 @@ for (int var9 = var5; var9 <= var6; ++var9) { -@@ -3412,10 +3605,18 @@ +@@ -3412,10 +3590,18 @@ public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { @@ -528,7 +551,7 @@ ArrayList var8 = new ArrayList(); for (int var9 = var4; var9 <= var5; ++var9) -@@ -3484,6 +3685,8 @@ +@@ -3484,6 +3670,8 @@ /** * Counts how many entities of an entity class exist in the world. Args: entityClass */ @@ -537,7 +560,7 @@ public int countEntities(Class par1Class) { int var2 = 0; -@@ -3500,6 +3703,8 @@ +@@ -3500,6 +3688,8 @@ return var2; } @@ -546,7 +569,7 @@ /** * adds entities to the loaded entities list, and loads thier skins. -@@ -3543,7 +3748,14 @@ +@@ -3543,7 +3733,14 @@ } else { @@ -561,7 +584,7 @@ { var10 = null; } -@@ -3670,6 +3882,22 @@ +@@ -3670,6 +3867,22 @@ { if (this.isBlockNormalCube(par1, par2, par3)) { @@ -584,7 +607,7 @@ return this.getBlockPowerInput(par1, par2, par3); } else -@@ -3989,8 +4217,15 @@ +@@ -3989,8 +4202,15 @@ return (double)this.getRainStrength(1.0F) > 0.2D; } @@ -600,7 +623,7 @@ if (!this.isRaining()) { return false; -@@ -4008,8 +4243,20 @@ +@@ -4008,8 +4228,20 @@ BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); return var4.getEnableSnow() ? false : var4.canSpawnLightningBolt(); } @@ -621,7 +644,7 @@ /** * Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely high */ -@@ -4046,6 +4293,10 @@ +@@ -4046,6 +4278,10 @@ return this.mapStorage.getUniqueDataId(par1Str); } @@ -632,7 +655,7 @@ public void func_82739_e(int par1, int par2, int par3, int par4, int par5) { for (int var6 = 0; var6 < this.worldAccesses.size(); ++var6) -@@ -4240,4 +4491,1205 @@ +@@ -4240,4 +4476,1205 @@ { return this.worldLogAgent; } diff --git a/patches/minecraft_server/net/minecraft/src/BiomeDecorator.java.patch b/patches/minecraft_server/net/minecraft/src/BiomeDecorator.java.patch new file mode 100644 index 0000000..a253019 --- /dev/null +++ b/patches/minecraft_server/net/minecraft/src/BiomeDecorator.java.patch @@ -0,0 +1,11 @@ +--- a/minecraft_server/net/minecraft/src/BiomeDecorator.java ++++ b/minecraft_server/net/minecraft/src/BiomeDecorator.java +@@ -376,6 +376,8 @@ + (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); + } + } ++ ++ FCAddOnHandler.decorateWorld(this, this.currentWorld, this.randomGenerator, this.chunk_X, this.chunk_Z, this.biome); + } + + /** diff --git a/patches/minecraft_server/net/minecraft/src/BiomeGenBase.java.patch b/patches/minecraft_server/net/minecraft/src/BiomeGenBase.java.patch index fb4a964..a3c021c 100644 --- a/patches/minecraft_server/net/minecraft/src/BiomeGenBase.java.patch +++ b/patches/minecraft_server/net/minecraft/src/BiomeGenBase.java.patch @@ -169,7 +169,7 @@ /** * Checks to see if the rainfall level of the biome is extremely high -@@ -303,4 +359,20 @@ +@@ -303,4 +359,24 @@ { this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4); } @@ -188,5 +188,9 @@ + public boolean canSlimesSpawnOnSurface() { + return false; + } ++ ++ public boolean canSnowAt(int x, int y, int z) { ++ return this.temperature <= 0.15F; ++ } + // END FCMOD +} diff --git a/patches/minecraft_server/net/minecraft/src/Block.java.patch b/patches/minecraft_server/net/minecraft/src/Block.java.patch index 5e5bb66..039aa39 100644 --- a/patches/minecraft_server/net/minecraft/src/Block.java.patch +++ b/patches/minecraft_server/net/minecraft/src/Block.java.patch @@ -720,7 +720,7 @@ if (var0 > 0 && blocksList[var0].getRenderType() == 10) { var1 = true; -@@ -1204,10 +1266,2108 @@ +@@ -1204,10 +1266,2111 @@ } useNeighborBrightness[var0] = var1; @@ -1515,7 +1515,10 @@ + //------------- Saw related functionality ------------// + + public boolean DoesBlockBreakSaw(World world, int x, int y, int z) { -+ if (blockMaterial.isSolid() && blockMaterial.breaksSaw()) { ++ int metadata = world.getBlockMetadata(x, y, z); ++ FCCraftingManagerSawRecipe recipe = FCCraftingManagerSaw.instance.getRecipe(this, metadata); ++ ++ if (blockMaterial.isSolid() && blockMaterial.breaksSaw() && recipe == null) { + return true; + } + diff --git a/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch b/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch index e33ad65..ed020be 100644 --- a/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch +++ b/patches/minecraft_server/net/minecraft/src/EntityPlayer.java.patch @@ -444,7 +444,7 @@ return this.capabilities.allowEdit ? true : (par5ItemStack != null ? par5ItemStack.func_82835_x() : false); } -@@ -2026,4 +2205,1108 @@ +@@ -2026,4 +2205,1112 @@ { return ScorePlayerTeam.func_96667_a(this.getTeam(), this.username); } @@ -767,7 +767,7 @@ + { + float fModifier = GetHealthAndExhaustionModifier(); + -+ if ( GetGloomLevel() > 0 ) ++ if (GetGloomLevel() > 0 && !this.capabilities.isCreativeMode) + { + fModifier *= 0.5F; + } @@ -839,6 +839,10 @@ + + public int GetMaximumStatusPenaltyLevel() + { ++ if (this.capabilities.isCreativeMode) { ++ return 0; ++ } ++ + int iMaximumPenaltyLevel = GetHealthPenaltyLevel(); + int iHungerPenaltyLevel = GetHungerPenaltyLevel(); + diff --git a/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch b/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch index 52aa9f4..585981e 100644 --- a/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch +++ b/patches/minecraft_server/net/minecraft/src/EntityPlayerMP.java.patch @@ -361,7 +361,7 @@ + + private void UpdateHealthAndHungerEffects() + { -+ if ( !isDead && ( worldObj.getTotalWorldTime() + (long)entityId ) % 80L == 0L ) ++ if ( !isDead && ( worldObj.getTotalWorldTime() + (long)entityId ) % 80L == 0L && !this.capabilities.isCreativeMode) + { + if ( foodStats.getFoodLevel() <= 0 && foodStats.getSaturationLevel() <= 0F ) + { @@ -378,7 +378,7 @@ + @Override + protected void UpdateGloomState() + { -+ if ( !isDead ) ++ if ( !isDead && !this.capabilities.isCreativeMode) + { + if ( IsInGloom() ) + { @@ -437,7 +437,7 @@ + int iFat = (int)foodStats.getSaturationLevel(); + int iFatLevel = 4; + -+ if ( iFat < 12 ) ++ if ( iFat < 12 || this.capabilities.isCreativeMode) + { + iFatLevel = 0; + } @@ -463,7 +463,7 @@ + int iHunger = foodStats.getFoodLevel(); + int iPenaltyLevel = 5; + -+ if ( iHunger > 24 ) ++ if ( iHunger > 24 || this.capabilities.isCreativeMode) + { + iPenaltyLevel = 0; + } @@ -493,7 +493,7 @@ + int iHealth = getHealth(); + int iPenaltyLevel = 5; + -+ if ( iHealth > 10 ) ++ if ( iHealth > 10 || this.capabilities.isCreativeMode) + { + iPenaltyLevel = 0; + } diff --git a/patches/minecraft_server/net/minecraft/src/FCAddOn.java.patch b/patches/minecraft_server/net/minecraft/src/FCAddOn.java.patch index f079fb5..4a60ffd 100644 --- a/patches/minecraft_server/net/minecraft/src/FCAddOn.java.patch +++ b/patches/minecraft_server/net/minecraft/src/FCAddOn.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/minecraft_server/net/minecraft/src/FCAddOn.java -@@ -0,0 +1,366 @@ +@@ -0,0 +1,379 @@ +// FCMOD + +package net.minecraft.src; @@ -27,6 +27,7 @@ +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; ++import java.util.Random; +import java.util.Set; + +import net.minecraft.server.MinecraftServer; @@ -119,6 +120,18 @@ + return null; + } + ++ /** ++ * Called when decorating a chunk (adding trees, ores, etc) to allow addons to add their own generators ++ * Look in BiomeDecorator for guidance in how to create and use a generator for those things ++ * @param decorator The decorator instance ++ * @param world The current world ++ * @param rand The random number generator. Always use this generator for deterministic generation. ++ * @param x ++ * @param y ++ * @param biome The biome being decorated. Biomes during decoration are lower resolution, only being caluclated per chunk not per block ++ */ ++ public void decorateWorld(BiomeDecorator decorator, World world, Random rand, int x, int y, BiomeGenBase biome) {} ++ + //------ API Methods ------// + /* + * These are methods which should be called from diff --git a/patches/minecraft_server/net/minecraft/src/FCAddOnHandler.java.patch b/patches/minecraft_server/net/minecraft/src/FCAddOnHandler.java.patch index 6e9bc48..38de5c4 100644 --- a/patches/minecraft_server/net/minecraft/src/FCAddOnHandler.java.patch +++ b/patches/minecraft_server/net/minecraft/src/FCAddOnHandler.java.patch @@ -1,6 +1,6 @@ --- /dev/null +++ b/minecraft_server/net/minecraft/src/FCAddOnHandler.java -@@ -0,0 +1,347 @@ +@@ -0,0 +1,356 @@ +// FCMOD + +package net.minecraft.src; @@ -13,6 +13,7 @@ +import java.util.LinkedList; +import java.util.List; +import java.util.Map; ++import java.util.Random; +import java.util.Set; +import java.util.logging.FileHandler; +import java.util.logging.Level; @@ -321,6 +322,14 @@ + FCAddOnHandler.addonWorldDataMap.put(mod, data); + } + ++ public static void decorateWorld(BiomeDecorator decorator, World world, Random rand, int x, int y, BiomeGenBase biome) { ++ for (Object mod : FCAddOnHandler.m_ModList) { ++ FCAddOn addon = (FCAddOn) mod; ++ ++ addon.decorateWorld(decorator, world, rand, x, y, biome); ++ } ++ } ++ + public static boolean isModInstalled(String name) { + for (FCAddOn mod : m_ModList) { + if (mod.getName().equals(name)) { diff --git a/patches/minecraft_server/net/minecraft/src/FCBetterThanWolves.java.patch b/patches/minecraft_server/net/minecraft/src/FCBetterThanWolves.java.patch index 321e0e2..5379d3a 100644 --- a/patches/minecraft_server/net/minecraft/src/FCBetterThanWolves.java.patch +++ b/patches/minecraft_server/net/minecraft/src/FCBetterThanWolves.java.patch @@ -22,7 +22,7 @@ + +public class FCBetterThanWolves extends FCAddOn +{ -+ public static final String fcVersionString = "1.3.4"; ++ public static final String fcVersionString = "1.3.6"; + + public static FCBetterThanWolves m_instance = new FCBetterThanWolves(); + diff --git a/patches/minecraft_server/net/minecraft/src/FCItemShears.java.patch b/patches/minecraft_server/net/minecraft/src/FCItemShears.java.patch index 2afcd80..a2eb0c3 100644 --- a/patches/minecraft_server/net/minecraft/src/FCItemShears.java.patch +++ b/patches/minecraft_server/net/minecraft/src/FCItemShears.java.patch @@ -98,7 +98,7 @@ + } + + @Override -+ public void OnDamagedInCrafting( EntityPlayer player ) ++ public void OnUsedInCrafting(EntityPlayer player, ItemStack outputStack) + { + // note: the playSound function for player both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same player + diff --git a/patches/minecraft_server/net/minecraft/src/FCRecipes.java.patch b/patches/minecraft_server/net/minecraft/src/FCRecipes.java.patch index 7048beb..35d2b23 100644 --- a/patches/minecraft_server/net/minecraft/src/FCRecipes.java.patch +++ b/patches/minecraft_server/net/minecraft/src/FCRecipes.java.patch @@ -1608,7 +1608,7 @@ + "XYX", + "#X#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcBlockAxle + } ); + @@ -1617,7 +1617,7 @@ + "XYX", + "#X#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcBlockAxle + } ); + @@ -1626,7 +1626,7 @@ + "XYX", + "#X#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcItemRedstoneLatch + } ); + @@ -1635,7 +1635,7 @@ + "XYX", + "#X#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcItemRedstoneLatch + } ); + @@ -1644,7 +1644,7 @@ + " Y ", + "#X#", + '#', FCBetterThanWolves.fcItemStoneBrick, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.stick + } ); + @@ -1652,7 +1652,7 @@ + "YYY", + "YYY", + "YXY", -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', FCBetterThanWolves.fcItemStoneBrick + } ); + @@ -1662,7 +1662,7 @@ + "ZYZ", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), + 'X', Item.pocketSundial, -+ 'Y', FCBetterThanWolves.fcItemGear, ++ 'Y', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Z', FCBetterThanWolves.fcItemStoneBrick + } ); + @@ -1672,7 +1672,7 @@ + "YZY", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), + 'X', FCBetterThanWolves.fcItemTannedLeather, -+ 'Y', FCBetterThanWolves.fcItemGear, ++ 'Y', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Z', FCBetterThanWolves.fcItemBelt + } ); + @@ -1682,7 +1682,7 @@ + "YZY", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), + 'X', FCBetterThanWolves.fcItemTannedLeatherCut, -+ 'Y', FCBetterThanWolves.fcItemGear, ++ 'Y', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Z', FCBetterThanWolves.fcItemBelt + } ); + } @@ -1874,7 +1874,7 @@ + "XYX", + " Z ", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Block.pressurePlatePlanks, + 'Z', new ItemStack( FCBetterThanWolves.fcBlockWoodCornerItemStubID, 1, ignoreMetadata ) + } ); @@ -1884,7 +1884,7 @@ + "XZX", + "#X#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemBelt + } ); @@ -1894,7 +1894,7 @@ + "XZX", + "#X#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemBelt + } ); @@ -1920,7 +1920,7 @@ + "XZX", + "#Y#", + '#', Block.planks, -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemRedstoneLatch + } ); @@ -1931,7 +1931,7 @@ + "XZX", + "#Y#", + '#', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'X', FCBetterThanWolves.fcItemGear, ++ 'X', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'Y', Item.ingotIron, + 'Z', FCBetterThanWolves.fcItemRedstoneLatch + } ); @@ -2012,7 +2012,7 @@ + "WSW", + "WgW", + 'W', new ItemStack( FCBetterThanWolves.fcBlockWoodSidingItemStubID, 1, ignoreMetadata ), -+ 'g', FCBetterThanWolves.fcItemGear, ++ 'g', new ItemStack(FCBetterThanWolves.fcItemGear, 1, ignoreMetadata), + 'S', FCBetterThanWolves.fcItemScrew, + 'G', FCBetterThanWolves.fcBlockGrate, + 'X', FCBetterThanWolves.fcItemGlue @@ -5895,7 +5895,7 @@ + moulding, mouldingMetas); + + //Corners -+ addSawRecipe(new ItemStack(FCBetterThanWolves.fcItemGear, 2, itemMetadata), ++ addSawRecipe(new ItemStack(FCBetterThanWolves.fcItemGear, 2), + sidingAndCorner, cornerMetas); + + //Fence diff --git a/patches/minecraft_server/net/minecraft/src/World.java.patch b/patches/minecraft_server/net/minecraft/src/World.java.patch index f7df21a..c8c5aaa 100644 --- a/patches/minecraft_server/net/minecraft/src/World.java.patch +++ b/patches/minecraft_server/net/minecraft/src/World.java.patch @@ -448,24 +448,47 @@ if (this.ambientTickCountdown > 0) { -@@ -2819,10 +2973,16 @@ - { - if (par2 >= 0 && par2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10) - { -+ // FCMOD: Code change -+ /* - int var6 = this.getBlockId(par1, par2 - 1, par3); - int var7 = this.getBlockId(par1, par2, par3); +@@ -2806,31 +2960,22 @@ + /** + * Tests whether or not snow can be placed at a given location + */ +- public boolean canSnowAt(int par1, int par2, int par3) +- { +- BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); +- float var5 = var4.getFloatTemperature(); ++ public boolean canSnowAt(int x, int y, int z) { ++ BiomeGenBase biome = this.getBiomeGenForCoords(x, z); - if (var7 == 0 && Block.snow.canPlaceBlockAt(this, par1, par2, par3) && var6 != 0 && var6 != Block.ice.blockID && Block.blocksList[var6].blockMaterial.blocksMovement()) -+ */ -+ if ( FCBlockSnowCover.CanSnowCoverReplaceBlock( this, par1, par2, par3 ) && -+ Block.snow.canPlaceBlockAt( this, par1, par2, par3 ) ) -+ // END FCMOD - { +- if (var5 > 0.15F) +- { +- return false; +- } +- else +- { +- if (par2 >= 0 && par2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10) +- { +- int var6 = this.getBlockId(par1, par2 - 1, par3); +- int var7 = this.getBlockId(par1, par2, par3); +- +- if (var7 == 0 && Block.snow.canPlaceBlockAt(this, par1, par2, par3) && var6 != 0 && var6 != Block.ice.blockID && Block.blocksList[var6].blockMaterial.blocksMovement()) +- { ++ if (biome.canSnowAt(x, y, z)) { ++ if (y >= 0 && y < 256 && this.getSavedLightValue(EnumSkyBlock.Block, x, y, z) < 10) { ++ if (FCBlockSnowCover.CanSnowCoverReplaceBlock(this, x, y, z) && Block.snow.canPlaceBlockAt(this, x, y, z)) { return true; } -@@ -2851,10 +3011,10 @@ + } + + return false; + } ++ else { ++ return false; + } ++ } + + public void updateAllLightTypes(int par1, int par2, int par3) + { +@@ -2851,10 +2996,10 @@ else { int var5 = this.getBlockId(par1, par2, par3); @@ -478,7 +501,7 @@ { var7 = 1; } -@@ -2913,8 +3073,8 @@ +@@ -2913,8 +3058,8 @@ int var13; int var14; int var15; @@ -488,7 +511,7 @@ if (var8 > var7) { -@@ -3053,10 +3213,18 @@ +@@ -3053,10 +3198,18 @@ public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { ArrayList var4 = new ArrayList(); @@ -507,7 +530,7 @@ for (int var9 = var5; var9 <= var6; ++var9) { -@@ -3082,10 +3250,18 @@ +@@ -3082,10 +3235,18 @@ public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { @@ -526,7 +549,7 @@ ArrayList var8 = new ArrayList(); for (int var9 = var4; var9 <= var5; ++var9) -@@ -3146,6 +3322,8 @@ +@@ -3146,6 +3307,8 @@ /** * Counts how many entities of an entity class exist in the world. Args: entityClass */ @@ -535,7 +558,7 @@ public int countEntities(Class par1Class) { int var2 = 0; -@@ -3162,6 +3340,8 @@ +@@ -3162,6 +3325,8 @@ return var2; } @@ -544,7 +567,7 @@ /** * adds entities to the loaded entities list, and loads thier skins. -@@ -3205,7 +3385,14 @@ +@@ -3205,7 +3370,14 @@ } else { @@ -559,7 +582,7 @@ { var10 = null; } -@@ -3332,6 +3519,22 @@ +@@ -3332,6 +3504,22 @@ { if (this.isBlockNormalCube(par1, par2, par3)) { @@ -582,7 +605,7 @@ return this.getBlockPowerInput(par1, par2, par3); } else -@@ -3607,8 +3810,15 @@ +@@ -3607,8 +3795,15 @@ return (double)this.getRainStrength(1.0F) > 0.2D; } @@ -598,7 +621,7 @@ if (!this.isRaining()) { return false; -@@ -3626,8 +3836,20 @@ +@@ -3626,8 +3821,20 @@ BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); return var4.getEnableSnow() ? false : var4.canSpawnLightningBolt(); } @@ -619,7 +642,7 @@ /** * Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely high */ -@@ -3664,6 +3886,10 @@ +@@ -3664,6 +3871,10 @@ return this.mapStorage.getUniqueDataId(par1Str); } @@ -630,7 +653,7 @@ public void func_82739_e(int par1, int par2, int par3, int par4, int par5) { for (int var6 = 0; var6 < this.worldAccesses.size(); ++var6) -@@ -3841,4 +4067,1200 @@ +@@ -3841,4 +4052,1200 @@ { return this.worldLogAgent; }