mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-03-13 11:29:43 +00:00
Use IBlockState instead of Block methods
There was a crash in RedstoneUtil when redstone state was changing next to a full block due to the incorrect state being passed. By using IBlockState methods we ensure that this cannot happen again. The old IBlockState methods were also deprecated, so this reduces the warning count a little. I've also moved string translation into StringUtils, to reduce the number of deprecation warnings from there.
This commit is contained in:
@@ -48,10 +48,7 @@ import dan200.computercraft.shared.pocket.items.PocketComputerItemFactory;
|
||||
import dan200.computercraft.shared.pocket.recipes.PocketComputerUpgradeRecipe;
|
||||
import dan200.computercraft.shared.turtle.blocks.TileTurtle;
|
||||
import dan200.computercraft.shared.turtle.inventory.ContainerTurtle;
|
||||
import dan200.computercraft.shared.util.Colour;
|
||||
import dan200.computercraft.shared.util.CreativeTabMain;
|
||||
import dan200.computercraft.shared.util.ImpostorRecipe;
|
||||
import dan200.computercraft.shared.util.ImpostorShapelessRecipe;
|
||||
import dan200.computercraft.shared.util.*;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -68,7 +65,6 @@ import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.IThreadListener;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
@@ -130,7 +126,7 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
||||
{
|
||||
ItemRecord record = (ItemRecord) item;
|
||||
String key = ObfuscationReflectionHelper.getPrivateValue( ItemRecord.class, record, "field_185077_c" );
|
||||
return I18n.translateToLocal( key );
|
||||
return StringUtil.translateToLocal( key );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user