From 87b033b31982d4ad84d08cc54e7695dac32998b4 Mon Sep 17 00:00:00 2001 From: Dragon2488 Date: Mon, 24 Oct 2016 00:31:45 +0700 Subject: [PATCH] Server side crash fix. --- build.properties | 2 +- .../gregtech/common/blocks/GT_Block_Ores_Abstract.java | 5 ++++- src/main/java/gregtech/common/render/data/IIconData.java | 3 +++ .../java/gregtech/common/render/data/IIconRegister.java | 1 + .../java/gregtech/loaders/postload/GT_Worldgenloader.java | 8 ++++---- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build.properties b/build.properties index faeffe34..2d518fde 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.10.2 forge.version=12.18.1.2079 -gt.version=5.10.05 +gt.version=5.10.06 forestry.version=5.2.7.220 ic2.version=2.6.9-ex110 diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index bd4b4816..3450a121 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -45,7 +45,6 @@ import java.util.List; public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider, IBlockIconProvider, IIconRegister { - @SideOnly(Side.CLIENT) protected TIntObjectMap mGeneratedIconData = new TIntObjectHashMap<>(); protected GT_Block_Ores_Abstract(String aUnlocalizedName, Material aMaterial) { @@ -159,11 +158,13 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements @Override + @SideOnly(Side.CLIENT) public ImmutableList getIcon(EnumFacing aSide, int aDamage) { return null; } @Override + @SideOnly(Side.CLIENT) public ImmutableList getIcon(IBlockAccess world, BlockPos pos, EnumFacing aSide, int metadata) { try { GT_TileEntity_Ores tileEntity_ores = (GT_TileEntity_Ores) world.getTileEntity(pos); @@ -180,6 +181,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override + @SideOnly(Side.CLIENT) public ImmutableList getIcon(EntityPlayer player, ItemStack itemStack, EnumFacing aSide) { IIconData iconData = mGeneratedIconData.get(itemStack.getItemDamage()); if(iconData == null) { @@ -189,6 +191,7 @@ public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements } @Override + @SideOnly(Side.CLIENT) public void registerIcons(IconDataGetter quadGetter) { System.out.println("Starting ore texture generation"); for(int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) { diff --git a/src/main/java/gregtech/common/render/data/IIconData.java b/src/main/java/gregtech/common/render/data/IIconData.java index a8f5e44f..1e1a52dc 100644 --- a/src/main/java/gregtech/common/render/data/IIconData.java +++ b/src/main/java/gregtech/common/render/data/IIconData.java @@ -4,9 +4,12 @@ import com.google.common.collect.ImmutableList; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.EnumFacing; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; public interface IIconData { + @SideOnly(Side.CLIENT) ImmutableList getQuads(EnumFacing side); } diff --git a/src/main/java/gregtech/common/render/data/IIconRegister.java b/src/main/java/gregtech/common/render/data/IIconRegister.java index 068c567a..86eaf9f6 100644 --- a/src/main/java/gregtech/common/render/data/IIconRegister.java +++ b/src/main/java/gregtech/common/render/data/IIconRegister.java @@ -22,6 +22,7 @@ public interface IIconRegister { } @Deprecated //TODO split to item register and block register + @SideOnly(Side.CLIENT) default void registerIcons(TextureMap textureMap) {} } diff --git a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java index 0dea878d..126d9bad 100644 --- a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java +++ b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java @@ -95,10 +95,10 @@ public class GT_Worldgenloader new GT_Worldgen_GT_Ore_SmallPieces("ore.small.sulfur_n", true, 10, 60, 32, false, true, false, Materials.Sulfur); new GT_Worldgen_GT_Ore_SmallPieces("ore.small.sulfur_o", true, 5, 15, 8, !tPFAA, false, false, Materials.Sulfur); - int i = 0; + /*int i = 0; for (int j = GregTech_API.sWorldgenFile.get("worldgen", "AmountOfCustomSmallOreSlots", 16); i < j; i++) { new GT_Worldgen_GT_Ore_SmallPieces("ore.small.custom." + (i < 10 ? "0" : "") + i, false, 0, 0, 0, false, false, false, Materials._NULL); - } + }*/ new GT_Worldgen_GT_Ore_Layer("ore.mix.naquadah", true, 10, 60, 10, 5, 32, false, false, true, Materials.Naquadah, Materials.Naquadah, Materials.Naquadah, Materials.NaquadahEnriched); new GT_Worldgen_GT_Ore_Layer("ore.mix.lignite", true, 50, 130, 160, 8, 32, !tPFAA, false, false, Materials.Lignite, Materials.Lignite, Materials.Lignite, Materials.Coal); new GT_Worldgen_GT_Ore_Layer("ore.mix.coal", true, 50, 80, 80, 6, 32, !tPFAA, false, false, Materials.Coal, Materials.Coal, Materials.Coal, Materials.Lignite); @@ -132,7 +132,7 @@ public class GT_Worldgenloader new GT_Worldgen_GT_Ore_Layer("ore.mix.beryllium", true, 5, 30, 30, 3, 16, !tPFAA, false, true, Materials.Beryllium, Materials.Beryllium, Materials.Emerald, Materials.Thorium); new GT_Worldgen_GT_Ore_Layer("ore.mix.oilsand", true, 50, 80, 80, 6, 32, !tPFAA, false, false, Materials.Oilsands, Materials.Oilsands, Materials.Oilsands, Materials.Oilsands); - i = 0; + /*i = 0; for (int j = GregTech_API.sWorldgenFile.get("worldgen", "AmountOfCustomLargeVeinSlots", 16); i < j; i++) { new GT_Worldgen_GT_Ore_Layer("ore.mix.custom." + (i < 10 ? "0" : "") + i, false, 0, 0, 0, 0, 0, false, false, false, Materials._NULL, Materials._NULL, Materials._NULL, Materials._NULL); } @@ -151,6 +151,6 @@ public class GT_Worldgenloader new GT_Worldgen_GT_Ore_Layer("ore.mix.custom.12", false, 0, 0, 0, 0, 0, false, false, false, Materials._NULL, Materials._NULL, Materials._NULL, Materials._NULL); new GT_Worldgen_GT_Ore_Layer("ore.mix.custom.13", false, 0, 0, 0, 0, 0, false, false, false, Materials._NULL, Materials._NULL, Materials._NULL, Materials._NULL); new GT_Worldgen_GT_Ore_Layer("ore.mix.custom.14", false, 0, 0, 0, 0, 0, false, false, false, Materials._NULL, Materials._NULL, Materials._NULL, Materials._NULL); - new GT_Worldgen_GT_Ore_Layer("ore.mix.custom.15", false, 0, 0, 0, 0, 0, false, false, false, Materials._NULL, Materials._NULL, Materials._NULL, Materials._NULL); + new GT_Worldgen_GT_Ore_Layer("ore.mix.custom.15", false, 0, 0, 0, 0, 0, false, false, false, Materials._NULL, Materials._NULL, Materials._NULL, Materials._NULL);*/ } }