Fix compile error and a few more warnings.

This commit is contained in:
Vincent Lee committed 2016-02-01 00:16:18 -06:00
1 parent 576362e400
commit 2fdcbdb668
9 files changed
+9 -46

No files matched your search

@@ -99,6 +99,7 @@ public final class BaubleRenderHandler implements LayerRenderer<EntityPlayer> {
}
}
@SuppressWarnings("deprecation")
private void renderManaTablet(EntityPlayer player) {
boolean renderedOne = false;
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
@@ -171,6 +171,7 @@ public final class ContributorFancinessHandler implements LayerRenderer<EntityPl
GlStateManager.popMatrix();
}
@SuppressWarnings("deprecation")
private static void renderFlower(EntityPlayer player, ItemStack flower) {
GlStateManager.pushMatrix();
Helper.translateToHeadLevel(player);
@@ -28,6 +28,7 @@ public class RenderTileIncensePlate extends TileEntitySpecialRenderer<TileIncens
private static final Map<EnumFacing, Integer> ROTATIONS = ImmutableMap.of(EnumFacing.NORTH, 180, EnumFacing.SOUTH, 0, EnumFacing.WEST, 270, EnumFacing.EAST, 90);
@SuppressWarnings("deprecation")
@Override
public void renderTileEntityAt(TileIncensePlate plate, double d0, double d1, double d2, float ticks, int digProgress) {
if (plate != null && plate.getWorld() != null && !plate.getWorld().isBlockLoaded(plate.getPos(), false)) {
@@ -17,11 +17,11 @@ import java.util.List;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import vazkii.botania.common.Botania;
@@ -36,7 +36,6 @@ public final class ConfigHandler {
public static Configuration config;
public static ConfigAdaptor adaptor;
private static final String CATEGORY_POTIONS = "potions";
public static final int hardcorePassiveGeneration = 72000;
@@ -99,23 +98,13 @@ public final class ConfigHandler {
public static double flowerTallChance = 0.05;
public static int mushroomQuantity = 40;
private static boolean verifiedPotionArray = false;
private static int potionArrayLimit = 0; // todo 1.8 potion things should be unneeded thanks to potion registry
public static int potionIDSoulCross = 91;
public static int potionIDFeatherfeet = 92;
public static int potionIDEmptiness = 93;
public static int potionIDBloodthirst = 94;
public static int potionIDAllure = 95;
public static int potionIDClear = 96;
public static void loadConfig(File configFile) {
config = new Configuration(configFile);
config.load();
load();
FMLCommonHandler.instance().bus().register(new ChangeListener());
MinecraftForge.EVENT_BUS.register(new ChangeListener());
}
public static void load() {
@@ -281,13 +270,6 @@ public final class ConfigHandler {
desc = "The quantity of Botania mushrooms to generate underground, in the world, defaults to 40, the lower the number the less patches generate.";
mushroomQuantity = loadPropInt("worldgen.mushroom.quantity", desc, mushroomQuantity);
// potionIDSoulCross = loadPropPotionId(LibPotionNames.SOUL_CROSS, potionIDSoulCross); todo 1.8 should be unneeded thanks to potion registry
// potionIDFeatherfeet = loadPropPotionId(LibPotionNames.FEATHER_FEET, potionIDFeatherfeet);
// potionIDEmptiness = loadPropPotionId(LibPotionNames.EMPTINESS, potionIDEmptiness);
// potionIDBloodthirst = loadPropPotionId(LibPotionNames.BLOODTHIRST, potionIDBloodthirst);
// potionIDAllure = loadPropPotionId(LibPotionNames.ALLURE, potionIDAllure);
// potionIDClear = loadPropPotionId(LibPotionNames.CLEAR, potionIDClear);
if(config.hasChanged())
config.save();
}
@@ -329,28 +311,6 @@ public final class ConfigHandler {
return prop.getBoolean(default_);
}
public static int loadPropPotionId(String propName, int default_) {
if(!verifiedPotionArray)
verifyPotionArray();
Property prop = config.get(CATEGORY_POTIONS, propName, default_);
int val = prop.getInt(default_);
if(val > potionArrayLimit) {
val = default_;
prop.set(default_);
}
return val;
}
private static void verifyPotionArray() {
if(Loader.isModLoaded("DragonAPI"))
potionArrayLimit = Potion.potionTypes.length;
else potionArrayLimit = 127;
verifiedPotionArray = true;
}
public static class ConfigAdaptor {
private boolean enabled;
@@ -42,7 +42,6 @@ public class ItemKeepIvy extends ItemMod {
GameRegistry.addRecipe(new KeepIvyRecipe());
RecipeSorter.register("botania:keepIvy", KeepIvyRecipe.class, Category.SHAPELESS, "");
MinecraftForge.EVENT_BUS.register(this);
FMLCommonHandler.instance().bus().register(this);
}
@SubscribeEvent
@@ -309,6 +309,7 @@ public class ItemBaubleCosmetic extends ItemBauble implements ICosmeticBauble {
GlStateManager.scale(f, f, f);
}
@SuppressWarnings("deprecation")
public void renderIcon(int i) {
GlStateManager.pushMatrix();
renderStack.setItemDamage(i);
@@ -130,7 +130,7 @@ public class ItemMagnetRing extends ItemBauble {
}
public static void addItemToBlackList(String item) {
BLACKLIST.add(item);
BLACKLIST.add(new ResourceLocation(item));
}
@Override
@@ -61,7 +61,7 @@ public class LensFirework extends Lens {
ItemNBTHelper.setCompound(stack, "Explosion", explosion);
NBTTagCompound fireworks = new NBTTagCompound();
fireworks.setInteger("Flight", (int) Math.random() * 3 + 2);
fireworks.setInteger("Flight", (int) (Math.random() * 3 + 2)); // todo 1.8 this bugged in 1.7 to always be 0 (cast before multiplication). is that intended now?
NBTTagList explosions = new NBTTagList();
explosions.appendTag(explosion);
@@ -104,7 +104,7 @@ public class PageEntity extends LexiconPage{
public void prepDummy() {
if(dummyEntity == null || dummyEntity.isDead) {
try {
dummyEntity = (Entity) entityConstructor.newInstance(new Object[] {Minecraft.getMinecraft().theWorld});
dummyEntity = (Entity) entityConstructor.newInstance(Minecraft.getMinecraft().theWorld);
} catch (Exception e) {
e.printStackTrace();
}