From 1778263c8ad3d02603be76db96b70f16bf913bee Mon Sep 17 00:00:00 2001 From: Amnet Date: Sun, 12 May 2013 15:06:54 +0200 Subject: [PATCH] Fixed picking up slabs with MMB. Fixed stairs textures. --- .../biomesoplenty/blocks/BlockBOPSlab.java | 25 +++++++------------ .../biomesoplenty/blocks/BlockBOPStairs.java | 2 +- .../configuration/BOPBlocks.java | 4 +++ .../configuration/BOPConfiguration.java | 2 +- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java b/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java index 439c183d3..cca907bd0 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPSlab.java @@ -139,23 +139,17 @@ public class BlockBOPSlab extends BlockHalfSlab switch (getTypeFromMeta(meta)) { case 0: + case 3: hardness = 1.6F; break; case 1: + case 4: hardness = 1.1F; break; case 2: hardness = 1.0F; - break; - - case 3: - hardness = 1.6F; - break; - - case 4: - hardness = 1.1F; break; } } @@ -174,23 +168,17 @@ public class BlockBOPSlab extends BlockHalfSlab switch (getTypeFromMeta(meta)) { case 0: + case 3: resistance = 7.0F; break; case 1: + case 4: resistance = 7.5F; break; case 2: resistance = 2.0F; - break; - - case 3: - resistance = 7.0F; - break; - - case 4: - resistance = 7.5F; break; } } @@ -198,6 +186,11 @@ public class BlockBOPSlab extends BlockHalfSlab return resistance / 5.0F; } + public int idPicked(World par1World, int par2, int par3, int par4) + { + return !isDoubleSlab ? this.blockID : (this.blockID == Blocks.woodenDoubleSlab1.get().blockID ? Blocks.woodenSingleSlab1.get().blockID : (this.blockID == Blocks.woodenDoubleSlab2.get().blockID ? Blocks.woodenSingleSlab2.get().blockID : Blocks.stoneSingleSlab.get().blockID)); + } + protected ItemStack createStackedBlock(int par1) { return new ItemStack(this.blockID, 2, par1); diff --git a/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java b/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java index 07d0b85cb..6cc3fc44b 100644 --- a/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java +++ b/src/minecraft/biomesoplenty/blocks/BlockBOPStairs.java @@ -35,7 +35,7 @@ public class BlockBOPStairs extends BlockStairs textures = new Icon[types.length]; for (int i = 0; i < types.length; ++i) - if (i < types.length - 3) + if (i < types.length - 5) textures[i] = iconRegister.registerIcon("BiomesOPlenty:plank_"+types[i]); else textures[i] = iconRegister.registerIcon("BiomesOPlenty:"+types[i]); diff --git a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java index 3858a382a..fa1dc95bd 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPBlocks.java +++ b/src/minecraft/biomesoplenty/configuration/BOPBlocks.java @@ -279,9 +279,13 @@ public class BOPBlocks { LanguageRegistry.addName(new ItemStack(Blocks.stoneDoubleSlab.get(),1,0), "Red Rock Cobblestone Slab"); LanguageRegistry.addName(new ItemStack(Blocks.stoneDoubleSlab.get(),1,1), "Red Rock Bricks Slab"); LanguageRegistry.addName(new ItemStack(Blocks.stoneDoubleSlab.get(),1,2), "Mud Bricks Slab"); + LanguageRegistry.addName(new ItemStack(Blocks.stoneDoubleSlab.get(),1,3), "Skystone Cobblestone Slab"); + LanguageRegistry.addName(new ItemStack(Blocks.stoneDoubleSlab.get(),1,4), "Skystone Bricks Slab"); LanguageRegistry.addName(new ItemStack(Blocks.stoneSingleSlab.get(),1,0), "Red Rock Cobblestone Slab"); LanguageRegistry.addName(new ItemStack(Blocks.stoneSingleSlab.get(),1,1), "Red Rock Bricks Slab"); LanguageRegistry.addName(new ItemStack(Blocks.stoneSingleSlab.get(),1,2), "Mud Bricks Slab"); + LanguageRegistry.addName(new ItemStack(Blocks.stoneSingleSlab.get(),1,3), "Skystone Cobblestone Slab"); + LanguageRegistry.addName(new ItemStack(Blocks.stoneSingleSlab.get(),1,4), "Skystone Bricks Slab"); LanguageRegistry.addName(Blocks.mudBricksStairs.get(), "Mud Bricks Stairs"); LanguageRegistry.addName(Blocks.originGrass.get(), "Origin Grass"); LanguageRegistry.addName(new ItemStack(Blocks.leaves2.get(),1,0), "Origin Leaves"); diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 1ad641dfd..7881618ca 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -813,7 +813,7 @@ public class BOPConfiguration { } finally { - config.save(); + if (config.hasChanged()) config.save(); } } }