diff --git a/build.gradle b/build.gradle index dc20ffa..c021f21 100644 --- a/build.gradle +++ b/build.gradle @@ -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" diff --git a/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingCompDrawers.java b/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingCompDrawers.java index 53aa84d..49fc5b1 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingCompDrawers.java +++ b/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingCompDrawers.java @@ -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); diff --git a/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingDrawers.java b/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingDrawers.java index 35eb42d..abcd94d 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingDrawers.java +++ b/src/com/jaquadro/minecraft/storagedrawers/integration/refinedrelocation/BlockSortingDrawers.java @@ -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);