Fix double-application of RR sorting upgrade deleting blocks.

This commit is contained in:
Justin Aquadro committed 2015-12-09 00:26:12 -05:00
1 parent 24f1f3beef
commit c741a6fd4b
3 files changed
+7 -9

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.7.10-1.7.3"
version = "1.7.10-1.7.4"
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StorageDrawers"
@@ -3,16 +3,11 @@ package com.jaquadro.minecraft.storagedrawers.integration.refinedrelocation;
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
import com.jaquadro.minecraft.storagedrawers.block.BlockCompDrawers;
import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawersComp;
import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawersStandard;
import com.jaquadro.minecraft.storagedrawers.core.ModBlocks;
import com.jaquadro.minecraft.storagedrawers.core.ModItems;
import com.jaquadro.minecraft.storagedrawers.integration.RefinedRelocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@@ -32,7 +27,7 @@ public class BlockSortingCompDrawers extends BlockCompDrawers
public static boolean upgradeToSorting (World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileEntityDrawersComp))
if (!(tile instanceof TileEntityDrawersComp) || tile instanceof TileSortingDrawersComp)
return false;
Block block = world.getBlock(x, y, z);
@@ -48,7 +43,10 @@ public class BlockSortingCompDrawers extends BlockCompDrawers
world.removeTileEntity(x, y, z);
world.setBlockToAir(x, y, z);
world.setBlock(x, y, z, RefinedRelocation.compDrawers, meta, 3);
Block sortingBlock = SortingBlockRegistry.resolveSortingBlock(block);
if (sortingBlock != null) {
world.setBlock(x, y, z, sortingBlock, meta, 3);
}
world.setTileEntity(x, y, z, newDrawer);
@@ -28,7 +28,7 @@ public class BlockSortingDrawers extends BlockDrawers
public static boolean upgradeToSorting (World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if (!(tile instanceof TileEntityDrawersStandard))
if (!(tile instanceof TileEntityDrawersStandard) || tile instanceof TileSortingDrawersStandard)
return false;
Block block = world.getBlock(x, y, z);