diff --git a/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java b/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java index e770268dc..ffaf433ed 100644 --- a/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java +++ b/src/main/java/dan200/computercraft/shared/media/items/RecordMedia.java @@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.SoundEvent; import net.minecraft.world.World; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; // An implementation of IMedia for ItemRecord's public class RecordMedia implements IMedia @@ -43,7 +44,7 @@ public String getAudioTitle( ItemStack stack ) public SoundEvent getAudio( ItemStack stack ) { ItemRecord itemRecord = (ItemRecord)stack.getItem(); - return itemRecord.getSound(); + return ObfuscationReflectionHelper.getPrivateValue(ItemRecord.class, itemRecord, "field_185076_b"); } @Override diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java index a0b2ebbd6..c98e0d41c 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/ItemCable.java @@ -89,7 +89,7 @@ public EnumActionResult onItemUse( ItemStack stack, EntityPlayer player, World w if( stack.stackSize > 0 ) { world.setBlockState( pos, existingState.withProperty( BlockCable.Properties.CABLE, true ), 3 ); - world.playSound( null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); + world.playSound( null, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); stack.stackSize--; TileEntity tile = world.getTileEntity( pos ); @@ -119,7 +119,7 @@ public EnumActionResult onItemUse( ItemStack stack, EntityPlayer player, World w if( stack.stackSize > 0 ) { world.setBlockState( offset, offsetExistingState.withProperty( BlockCable.Properties.MODEM, BlockCableModemVariant.fromFacing( side.getOpposite() ) ), 3 ); - world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); + world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); stack.stackSize--; TileEntity tile = world.getTileEntity( offset ); @@ -139,7 +139,7 @@ public EnumActionResult onItemUse( ItemStack stack, EntityPlayer player, World w if( stack.stackSize > 0 ) { world.setBlockState( offset, offsetExistingState.withProperty( BlockCable.Properties.CABLE, true ), 3 ); - world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); + world.playSound( null, offset.getX() + 0.5, offset.getY() + 0.5, offset.getZ() + 0.5, ComputerCraft.Blocks.cable.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, (ComputerCraft.Blocks.cable.getSoundType().getVolume() + 1.0F ) / 2.0F, ComputerCraft.Blocks.cable.getSoundType().getPitch() * 0.8F); stack.stackSize--; TileEntity tile = world.getTileEntity( offset ); diff --git a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java index bf968244e..ab288aa7e 100644 --- a/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java +++ b/src/main/java/dan200/computercraft/shared/proxy/ComputerCraftProxyCommon.java @@ -15,7 +15,6 @@ import dan200.computercraft.shared.computer.blocks.BlockComputer; import dan200.computercraft.shared.computer.blocks.TileCommandComputer; import dan200.computercraft.shared.computer.blocks.TileComputer; -import dan200.computercraft.shared.computer.core.ClientComputer; import dan200.computercraft.shared.computer.core.ComputerFamily; import dan200.computercraft.shared.computer.core.ServerComputer; import dan200.computercraft.shared.computer.inventory.ContainerComputer; @@ -63,16 +62,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; -import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IThreadListener; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.IThreadListener; -import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.translation.I18n; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent; @@ -127,8 +125,9 @@ public String getRecordInfo( ItemStack recordStack ) Item item = recordStack.getItem(); if( item instanceof ItemRecord ) { - ItemRecord record = (ItemRecord)item; - return record.getRecordNameLocal(); + ItemRecord record = (ItemRecord) item; + String key = ObfuscationReflectionHelper.getPrivateValue( ItemRecord.class, record, "field_185077_c" ); + return I18n.translateToLocal( key ); } return null; } diff --git a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java index 90f8a835d..87bbefd1a 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java +++ b/src/main/java/dan200/computercraft/shared/turtle/upgrades/TurtleTool.java @@ -281,8 +281,7 @@ private TurtleCommandResult dig( ITurtleAccess turtle, EnumFacing direction ) // Destroy the block IBlockState previousState = world.getBlockState( newPosition ); - Block previousBlock = previousState.getBlock(); - world.playSound( null, newPosition, previousBlock.getSoundType().getBreakSound(), SoundCategory.BLOCKS, (previousBlock.getSoundType().getVolume() + 1.0F) / 2.0F, previousBlock.getSoundType().getPitch() * 0.8F ); + world.playEvent(2001, newPosition, Block.getStateId(previousState)); world.setBlockToAir( newPosition ); // Remember the previous block diff --git a/src/main/resources/assets/computercraft/models/item/advanced_computer.json b/src/main/resources/assets/computercraft/models/item/advanced_computer.json index 3a444bc0b..b2ff4dc35 100644 --- a/src/main/resources/assets/computercraft/models/item/advanced_computer.json +++ b/src/main/resources/assets/computercraft/models/item/advanced_computer.json @@ -1,3 +1,3 @@ { - "parent": "computercraft:block/advanced_computer_blinking", + "parent": "computercraft:block/advanced_computer_blinking" }