From 9bed6f7ea59e8aa23fa3ba540d92cd61a04dfb2f Mon Sep 17 00:00:00 2001 From: Shadows_of_Fire Date: Wed, 15 Nov 2017 18:11:17 -0500 Subject: [PATCH] no more lamp sneak --- build.gradle | 4 ++-- .../actuallyadditions/mod/blocks/BlockColoredLamp.java | 2 +- .../actuallyadditions/mod/blocks/BlockCrystalCluster.java | 2 +- .../ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java | 6 +++--- .../de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java | 4 ++-- .../actuallyadditions/mod/items/ItemCrystalShard.java | 2 +- .../de/ellpeck/actuallyadditions/mod/items/ItemDrill.java | 4 ++-- .../de/ellpeck/actuallyadditions/mod/items/ItemDust.java | 2 +- .../de/ellpeck/actuallyadditions/mod/items/ItemJams.java | 2 +- .../ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java | 4 ++-- .../ellpeck/actuallyadditions/mod/items/ItemPotionRing.java | 2 +- .../de/ellpeck/actuallyadditions/mod/util/WorldUtil.java | 2 +- src/main/resources/assets/actuallyadditions/lang/en_US.lang | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.gradle b/build.gradle index 40aa2bd39..4789374ed 100644 --- a/build.gradle +++ b/build.gradle @@ -23,9 +23,9 @@ if(hasProperty('buildnumber')){ } minecraft { - version = "1.12.1-14.22.1.2481" + version = "1.12.2-14.23.0.2536" runDir = "run" - mappings = "snapshot_20170821" + mappings = "snapshot_20171108" replaceIn "ModUtil.java" replace "@VERSION@", project.version.toString() } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java index a57fbbc14..94c31d255 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockColoredLamp.java @@ -69,7 +69,7 @@ public class BlockColoredLamp extends BlockBase{ public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ){ ItemStack stack = player.getHeldItem(hand); //Turning On - if(stack.isEmpty() && player.isSneaking()){ + if(hand == EnumHand.MAIN_HAND && stack.isEmpty()){ world.setBlockState(pos, (this.isOn ? InitBlocks.blockColoredLamp : InitBlocks.blockColoredLampOn).getDefaultState().withProperty(TYPE, state.getValue(TYPE)), 2); world.notifyLightSet(pos); return true; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java index d98eac230..a264917e6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCrystalCluster.java @@ -124,7 +124,7 @@ public class BlockCrystalCluster extends BlockBase implements IColorProvidingBlo public IItemColor getItemColor(){ return new IItemColor(){ @Override - public int getColorFromItemstack(ItemStack stack, int tintIndex){ + public int colorMultiplier(ItemStack stack, int tintIndex){ return BlockCrystalCluster.this.crystal.clusterColor; } }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java index eb83e5bf7..7a27f543b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAllToolAA.java @@ -108,12 +108,12 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{ } @Override - public float getStrVsBlock(ItemStack stack, IBlockState state){ + public float getDestroySpeed(ItemStack stack, IBlockState state){ if(state.getBlock() == Blocks.WEB){ return 15.0F; } else{ - return this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.efficiencyOnProperMaterial : 1.0F; + return this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.efficiency : 1.0F; } } @@ -122,7 +122,7 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{ public IItemColor getItemColor(){ return new IItemColor(){ @Override - public int getColorFromItemstack(ItemStack stack, int pass){ + public int colorMultiplier(ItemStack stack, int pass){ return pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF; } }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java index ad692a32d..b592bd857 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemAxeAA.java @@ -38,9 +38,9 @@ public class ItemAxeAA extends ItemToolAA{ } @Override - public float getStrVsBlock(ItemStack stack, IBlockState state){ + public float getDestroySpeed(ItemStack stack, IBlockState state){ Material material = state.getMaterial(); - return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + return material != Material.WOOD && material != Material.PLANTS && material != Material.VINE ? super.getDestroySpeed(stack, state) : this.efficiency; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystalShard.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystalShard.java index 2084a749c..69ca50230 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystalShard.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemCrystalShard.java @@ -69,7 +69,7 @@ public class ItemCrystalShard extends ItemBase implements IColorProvidingItem{ public IItemColor getItemColor(){ return new IItemColor(){ @Override - public int getColorFromItemstack(ItemStack stack, int tintIndex){ + public int colorMultiplier(ItemStack stack, int tintIndex){ int damage = stack.getItemDamage(); if(damage >= 0 && damage < BlockCrystal.ALL_CRYSTALS.length){ return BlockCrystal.ALL_CRYSTALS[damage].clusterColor; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java index 279f30df6..b792cc7b0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDrill.java @@ -199,7 +199,7 @@ public class ItemDrill extends ItemEnergy{ } @Override - public float getStrVsBlock(ItemStack stack, IBlockState state){ + public float getDestroySpeed(ItemStack stack, IBlockState state){ return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) ? (this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.getEfficiencyFromUpgrade(stack) : 1.0F) : 0.1F; } @@ -455,7 +455,7 @@ public class ItemDrill extends ItemEnergy{ IBlockState state = world.getBlockState(pos); Block block = state.getBlock(); float hardness = state.getBlockHardness(world, pos); - boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getStrVsBlock(stack, world.getBlockState(pos)) > 1.0F); + boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getDestroySpeed(stack, world.getBlockState(pos)) > 1.0F); if(hardness >= 0.0F && (!isExtra || (canHarvest && !block.hasTileEntity(world.getBlockState(pos))))){ if(!player.capabilities.isCreativeMode){ this.extractEnergyInternal(stack, use, false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java index dbad445fb..b0973f317 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemDust.java @@ -71,7 +71,7 @@ public class ItemDust extends ItemBase implements IColorProvidingItem{ public IItemColor getItemColor(){ return new IItemColor(){ @Override - public int getColorFromItemstack(ItemStack stack, int pass){ + public int colorMultiplier(ItemStack stack, int pass){ return stack.getItemDamage() >= ALL_DUSTS.length ? 0xFFFFFF : ALL_DUSTS[stack.getItemDamage()].color; } }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java index 456f868fc..12cc9ebec 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemJams.java @@ -111,7 +111,7 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{ public IItemColor getItemColor(){ return new IItemColor(){ @Override - public int getColorFromItemstack(ItemStack stack, int pass){ + public int colorMultiplier(ItemStack stack, int pass){ return pass > 0 ? (stack.getItemDamage() >= ALL_JAMS.length ? 0xFFFFFF : ALL_JAMS[stack.getItemDamage()].color) : 0xFFFFFF; } }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java index bc94783c6..c8c180077 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPickaxeAA.java @@ -79,9 +79,9 @@ public class ItemPickaxeAA extends ItemToolAA{ } @Override - public float getStrVsBlock(ItemStack stack, IBlockState state){ + public float getDestroySpeed(ItemStack stack, IBlockState state){ Material material = state.getMaterial(); - return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; + return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getDestroySpeed(stack, state) : this.efficiency; } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java index 93c35ab72..e38b3e37b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemPotionRing.java @@ -178,7 +178,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi public IItemColor getItemColor(){ return new IItemColor(){ @Override - public int getColorFromItemstack(ItemStack stack, int tintIndex){ + public int colorMultiplier(ItemStack stack, int tintIndex){ return stack.getItemDamage() >= ALL_RINGS.length ? 0xFFFFFF : ALL_RINGS[stack.getItemDamage()].color; } }; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java index bd4b2ff44..1e47a0b8f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/WorldUtil.java @@ -378,7 +378,7 @@ public final class WorldUtil{ } public static RayTraceResult getNearestBlockWithDefaultReachDistance(World world, EntityPlayer player, boolean stopOnLiquids, boolean ignoreBlockWithoutBoundingBox, boolean returnLastUncollidableBlock){ - return getMovingObjectPosWithReachDistance(world, player, player instanceof EntityPlayerMP ? ((EntityPlayerMP)player).interactionManager.getBlockReachDistance() : 5.0D, stopOnLiquids, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); + return getMovingObjectPosWithReachDistance(world, player, player.getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue(), stopOnLiquids, ignoreBlockWithoutBoundingBox, returnLastUncollidableBlock); } //Cobbled together from Tinkers' Construct (with permission, thanks!) and PlayerInteractionManager code. diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 979274eff..f5ea423f9 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -909,7 +909,7 @@ booklet.actuallyadditions.chapter.coalStuff.name=Coal Stuff booklet.actuallyadditions.chapter.coalStuff.text.1=Sometimes your Coal just burns for too long or too short. For that, you can craft Tiny Coal, Tiny Charcoal and Blocks of Charcoal for using them in a furnace. While the Block of Charcoal burns for as long as a Block of Coal, the Tiny Coal and Tiny Charcoal will burn for one eighth of a piece of coal, meaning it will smelt one item in a normal furnace. booklet.actuallyadditions.chapter.lamps.name=Lamps -booklet.actuallyadditions.chapter.lamps.text.1=Lamps are a block providing lots of light, similar to the mystic Glowstone or Torches, but they can be dyed with all of the 16 different colors either by crafting them or by placing them on the ground and right-clicking them with a piece of dye. When shift-right-clicking them with an empty hand, they will turn on and off. +booklet.actuallyadditions.chapter.lamps.text.1=Lamps are a block providing lots of light, similar to the mystic Glowstone or Torches, but they can be dyed with all of the 16 different colors either by crafting them or by placing them on the ground and right-clicking them with a piece of dye. When right-clicking them with an empty hand, they will turn on and off. booklet.actuallyadditions.chapter.lamps.text.2=There is a way to toggle them with Redstone, however. If you place a Lamp Controller facing into one and give it a redstone signal, it will turn the lamp in front of it on and off. The thing that makes this very expandable, though, is that it also toggles every lamp adjacent to that lamp and every other lamp that gets touched. That means you can have a huge field of lamps and toggle them all with just one Lamp Controller. booklet.actuallyadditions.chapter.treasureChest.name=Treasure Chests