Fix Biome Compass

Closes #42
This commit is contained in:
chylex committed 2014-09-05 19:25:11 +02:00
1 parent 34362da966
commit 47b8d8e575
3 files changed
+8 -11

No files matched your search

@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Random;
import java.util.Set;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@@ -14,7 +15,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import chylex.hee.render.texture.TextureBiomeCompass;
import chylex.hee.system.logging.Log;
import chylex.hee.system.savedata.WorldDataHandler;
import chylex.hee.system.savedata.types.DragonSavefile;
import chylex.hee.system.util.MathUtil;
@@ -72,16 +72,13 @@ public class ItemBiomeCompass extends Item{
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister){
if (iconRegister instanceof TextureMap){
((TextureMap)iconRegister).setTextureEntry("hardcoreenderexpansion:biome_compass",new TextureBiomeCompass("compass"));
((TextureMap)iconRegister).setTextureEntry("hardcoreenderexpansion:biome_compass",(TextureAtlasSprite)(itemIcon = new TextureBiomeCompass("hardcoreenderexpansion:biome_compass")));
if (locations == null){
locations = new ArrayList<>(IslandBiomeBase.biomeList.size());
for(int a = 0; a < IslandBiomeBase.biomeList.size(); a++)locations.add(a,new HashSet<ChunkCoordinates>());
lastSavedX = lastSavedZ = Integer.MAX_VALUE;
}
if (locations == null){
locations = new ArrayList<>(IslandBiomeBase.biomeList.size());
for(int a = 0; a < IslandBiomeBase.biomeList.size(); a++)locations.add(a,new HashSet<ChunkCoordinates>());
lastSavedX = lastSavedZ = Integer.MAX_VALUE;
}
else Log.error("Cannot cast iconRegister ($0) to Texture Map, Biome Compass will not be rendered correctly!",iconRegister.getClass().getSimpleName());
}
// BIOME DETECTION
+1 -1
View File
@@ -84,7 +84,7 @@ public final class ItemList{
register("enhanced_brewing_stand", enhanced_brewing_stand = new ItemReed(BlockList.enhanced_brewing_stand).setUnlocalizedName("enhancedBrewingStand").setTextureName("hardcoreenderexpansion:enhanced_brewing_stand"));
register("enhanced_ender_pearl", enhanced_ender_pearl = new ItemEnhancedEnderPearl().setCreativeTab(null).setUnlocalizedName("enderPearl").setTextureName("ender_pearl"));
register("potion_of_instability", potion_of_instability = new ItemPotionOfInstability().setMaxStackSize(1).setTextureName("hardcoreenderexpansion:potion_of_instability"));
register("biome_compass", biome_compass = new ItemBiomeCompass().setMaxStackSize(1).setUnlocalizedName("biomeCompass").setTextureName("hardcoreenderexpansion:biome_compass"));
register("biome_compass", biome_compass = new ItemBiomeCompass().setMaxStackSize(1).setUnlocalizedName("biomeCompass"));
register("spatial_dash_gem", spatial_dash_gem = new ItemSpatialDashGem().setMaxStackSize(1).setMaxDamage(300).setNoRepair().setUnlocalizedName("spatialDashGem").setTextureName("hardcoreenderexpansion:spatial_dash_gem"));
register("transference_gem", transference_gem = new ItemTransferenceGem().setMaxStackSize(1).setMaxDamage(108).setNoRepair().setUnlocalizedName("transferenceGem").setTextureName("hardcoreenderexpansion:transference_gem"));
register("temple_caller", temple_caller = new ItemTempleCaller().setMaxStackSize(1).setMaxDamage(50).setNoRepair().setUnlocalizedName("templeCaller").setTextureName("hardcoreenderexpansion:temple_caller"));
@@ -125,7 +125,7 @@ public final class CompendiumEvents{
}
}
if (distBlock < distEntity){
if (distBlock < distEntity && mopBlock != null){
BlockMetaWrapper wrapper = new BlockMetaWrapper(player.worldObj.getBlock(mopBlock.blockX,mopBlock.blockY,mopBlock.blockZ),player.worldObj.getBlockMetadata(mopBlock.blockX,mopBlock.blockY,mopBlock.blockZ));
KnowledgeObject<ObjectBlock> obj = KnowledgeObject.getObject(wrapper);
if (obj != null)getPlayerData(player).tryDiscoverBlock(obj,true);