Server side crash fix.

This commit is contained in:
Dragon2488 2016-10-24 00:31:45 +07:00
parent 484a9e7640
commit 87b033b319
5 changed files with 13 additions and 6 deletions

View file

@ -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

View file

@ -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<IIconData> 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<BakedQuad> getIcon(EnumFacing aSide, int aDamage) {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public ImmutableList<BakedQuad> 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<BakedQuad> 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++) {

View file

@ -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<BakedQuad> getQuads(EnumFacing side);
}

View file

@ -22,6 +22,7 @@ public interface IIconRegister {
}
@Deprecated //TODO split to item register and block register
@SideOnly(Side.CLIENT)
default void registerIcons(TextureMap textureMap) {}
}

View file

@ -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);*/
}
}