mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-26 00:46:54 +00:00
Fix advanced computer's item model
This commit is contained in:
parent
77d225d1fe
commit
d050ca9849
@ -13,6 +13,7 @@ import net.minecraft.item.ItemRecord;
|
||||
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 class RecordMedia implements IMedia
|
||||
public SoundEvent getAudio( ItemStack stack )
|
||||
{
|
||||
ItemRecord itemRecord = (ItemRecord)stack.getItem();
|
||||
return itemRecord.getSound();
|
||||
return ObfuscationReflectionHelper.getPrivateValue(ItemRecord.class, itemRecord, "field_185076_b");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,7 +89,7 @@ public class ItemCable extends ItemPeripheralBase
|
||||
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 class ItemCable extends ItemPeripheralBase
|
||||
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 class ItemCable extends ItemPeripheralBase
|
||||
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 );
|
||||
|
@ -15,7 +15,6 @@ import dan200.computercraft.shared.computer.blocks.BlockCommandComputer;
|
||||
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.ItemRecord;
|
||||
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 abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
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;
|
||||
}
|
||||
|
@ -281,8 +281,7 @@ public class TurtleTool implements ITurtleUpgrade
|
||||
|
||||
// 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
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"parent": "computercraft:block/advanced_computer_blinking",
|
||||
"parent": "computercraft:block/advanced_computer_blinking"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user