mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Most of ItemInWorldManager reject, various small error fixes.
This commit is contained in:
1 parent
4b4146bbed
commit
befbb45522
11 files changed
+233
-225
No files matched your search
@@ -137,24 +137,24 @@ public class ForgeHooks
|
||||
|
||||
public static boolean canHarvestBlock(Block block, EntityPlayer player, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
if (block.getMaterial().isToolNotRequired())
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
state = state.getBlock().getActualState(state, world, pos);
|
||||
if (state.func_185904_a().isToolNotRequired())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
ItemStack stack = player.inventory.getCurrentItem();
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
state = state.getBlock().getActualState(state, world, pos);
|
||||
String tool = block.getHarvestTool(state);
|
||||
if (stack == null || tool == null)
|
||||
{
|
||||
return player.canHarvestBlock(block);
|
||||
return player.func_184823_b(state);
|
||||
}
|
||||
|
||||
int toolLevel = stack.getItem().getHarvestLevel(stack, tool);
|
||||
if (toolLevel < 0)
|
||||
{
|
||||
return player.canHarvestBlock(block);
|
||||
return player.func_184823_b(state);
|
||||
}
|
||||
|
||||
return toolLevel >= block.getHarvestLevel(state);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
|
||||
dataDir.mkdirs();
|
||||
}
|
||||
File file = new File(dataDir, name + ".dat");
|
||||
if (!file.exists() && name.equalsIgnoreCase("FORTRESS") && world.provider.getDimensionId() == -1) //Only copy over the fortress.dat for the vanilla nether.
|
||||
if (!file.exists() && name.equalsIgnoreCase("FORTRESS") && world.provider.getDimension() == -1) //Only copy over the fortress.dat for the vanilla nether.
|
||||
{
|
||||
File parentFile = parent.getMapFileFromName(name);
|
||||
if (parentFile.exists())
|
||||
|
||||
@@ -43,7 +43,7 @@ class QueuedChunk {
|
||||
result.append(" z: " + z + NEW_LINE);
|
||||
result.append(" loader: " + loader + NEW_LINE );
|
||||
result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE);
|
||||
result.append(" dimension: " + world.provider.getDimensionId() + NEW_LINE);
|
||||
result.append(" dimension: " + world.provider.getDimension() + NEW_LINE);
|
||||
result.append(" provider: " + world.provider.getClass().getName() + NEW_LINE);
|
||||
result.append("}");
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class BlockSnapshot implements Serializable
|
||||
public BlockSnapshot(World world, BlockPos pos, IBlockState state)
|
||||
{
|
||||
this.world = world;
|
||||
this.dimId = world.provider.getDimensionId();
|
||||
this.dimId = world.provider.getDimension();
|
||||
this.pos = pos;
|
||||
this.replacedBlock = state;
|
||||
this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(state.getBlock());
|
||||
@@ -57,7 +57,7 @@ public class BlockSnapshot implements Serializable
|
||||
public BlockSnapshot(World world, BlockPos pos, IBlockState state, NBTTagCompound nbt)
|
||||
{
|
||||
this.world = world;
|
||||
this.dimId = world.provider.getDimensionId();
|
||||
this.dimId = world.provider.getDimension();
|
||||
this.pos = pos.getImmutable();
|
||||
this.replacedBlock = state;
|
||||
this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(state.getBlock());
|
||||
|
||||
Reference in new issue
Block a user