mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-24 22:14:45 +00:00
Cleanup...
This commit is contained in:
1 parent
294617dad3
commit
fd1a411bfe
16 files changed
+39
-107
No files matched your search
@@ -1,63 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 11, 2014, 2:18:35 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.core.helper;
|
||||
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
// Copy of ScaledResolution with 1.7.2 and 1.7.10 support. Will drop once 1.7.10 is in full use
|
||||
public class TransientScaledResolution {
|
||||
|
||||
private int scaledWidth;
|
||||
private int scaledHeight;
|
||||
private double scaledWidthD;
|
||||
private double scaledHeightD;
|
||||
private int scaleFactor;
|
||||
|
||||
public TransientScaledResolution(GameSettings par1GameSettings, int par2, int par3) {
|
||||
scaledWidth = par2;
|
||||
scaledHeight = par3;
|
||||
scaleFactor = 1;
|
||||
int k = par1GameSettings.guiScale;
|
||||
|
||||
if (k == 0)
|
||||
k = 1000;
|
||||
|
||||
while (scaleFactor < k && scaledWidth / (scaleFactor + 1) >= 320 && scaledHeight / (scaleFactor + 1) >= 240)
|
||||
++scaleFactor;
|
||||
|
||||
scaledWidthD = (double)scaledWidth / (double)scaleFactor;
|
||||
scaledHeightD = (double)scaledHeight / (double)scaleFactor;
|
||||
scaledWidth = MathHelper.ceiling_double_int(scaledWidthD);
|
||||
scaledHeight = MathHelper.ceiling_double_int(scaledHeightD);
|
||||
}
|
||||
|
||||
public int getScaledWidth() {
|
||||
return scaledWidth;
|
||||
}
|
||||
|
||||
public int getScaledHeight() {
|
||||
return scaledHeight;
|
||||
}
|
||||
|
||||
public double getScaledWidth_double() {
|
||||
return scaledWidthD;
|
||||
}
|
||||
|
||||
public double getScaledHeight_double() {
|
||||
return scaledHeightD;
|
||||
}
|
||||
|
||||
public int getScaleFactor() {
|
||||
return scaleFactor;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
public class BlockEnderEye extends BlockModContainer implements ILexiconable {
|
||||
|
||||
IIcon iconOff, iconOn;
|
||||
|
||||
|
||||
protected BlockEnderEye() {
|
||||
super(Material.iron);
|
||||
setHardness(3F);
|
||||
@@ -43,17 +43,17 @@ public class BlockEnderEye extends BlockModContainer implements ILexiconable {
|
||||
iconOff = IconHelper.forBlock(par1IconRegister, this, 0);
|
||||
iconOn = IconHelper.forBlock(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return meta == 0 ? iconOff : iconOn;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return world.getBlockMetadata(x, y, z);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable
|
||||
list.add(new ItemStack(item));
|
||||
list.add(new ItemStack(Blocks.mob_spawner));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
//NO-OP
|
||||
|
||||
@@ -284,7 +284,7 @@ public final class ModBlocks {
|
||||
thatch = new BlockThatch();
|
||||
customBrick = new BlockCustomBrick();
|
||||
enderEye = new BlockEnderEye();
|
||||
|
||||
|
||||
livingwoodStairs = new BlockLivingwoodStairs();
|
||||
livingwoodSlab = new BlockLivingwoodSlab(false);
|
||||
livingwoodSlabFull = new BlockLivingwoodSlab(true);
|
||||
|
||||
@@ -27,27 +27,27 @@ public class TileEnderEye extends TileMod {
|
||||
public void updateEntity() {
|
||||
if(worldObj.isRemote)
|
||||
return;
|
||||
|
||||
|
||||
int meta = getBlockMetadata();
|
||||
int range = 80;
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - range, yCoord - range, zCoord - range, xCoord + range, yCoord + range, zCoord + range));
|
||||
|
||||
|
||||
boolean looking = false;
|
||||
for(EntityPlayer player : players) {
|
||||
ItemStack helm = player.getCurrentArmor(3);
|
||||
if(helm != null && helm.getItem() == Item.getItemFromBlock(Blocks.pumpkin))
|
||||
continue;
|
||||
|
||||
|
||||
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(worldObj, player, true, 64);
|
||||
if(pos != null && pos.blockX == xCoord && pos.blockY == yCoord && pos.blockZ == zCoord) {
|
||||
looking = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int newMeta = looking ? 15 : 0;
|
||||
if(newMeta != meta)
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -135,7 +135,7 @@ public final class ConfigHandler {
|
||||
|
||||
desc = "Set to false to disable the Mana Enchanter. Since some people find it OP or something. This only disables the entry and creation. Old ones that are already in the world will stay.";
|
||||
enchanterEnabled = loadPropBool("manaEnchanter.enabled", desc, enchanterEnabled);
|
||||
|
||||
|
||||
desc = "The average amount of ticks between a chicken randomly dropping a feather. Set to -1 to disable this feature";
|
||||
shedRateChicken = loadPropInt("shedRate.chicken", desc, shedRateChicken);
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@
|
||||
*/
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemMonsterPlacer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
@@ -39,5 +37,5 @@ public final class SpawnerChangingHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1119,33 +1119,33 @@ public final class ModCrafingRecipes {
|
||||
'E', new ItemStack(Items.ender_eye),
|
||||
'O', new ItemStack(Blocks.obsidian));
|
||||
recipeEnderEyeBlock = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// The Spectator Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.itemFinder),
|
||||
addOreDictRecipe(new ItemStack(ModItems.itemFinder),
|
||||
" I ", "IYI", "IEI",
|
||||
'I', "ingotIron",
|
||||
'Y', new ItemStack(Items.ender_eye),
|
||||
'E', new ItemStack(Items.emerald));
|
||||
recipeItemFinder = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Crimson Pendant Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.superLavaPendant),
|
||||
addOreDictRecipe(new ItemStack(ModItems.superLavaPendant),
|
||||
"BBB", "BPB", "NGN",
|
||||
'B', new ItemStack(Items.blaze_rod),
|
||||
'P', new ItemStack(ModItems.lavaPendant),
|
||||
'N', new ItemStack(Blocks.nether_brick),
|
||||
'G', LibOreDict.LIFE_ESSENCE);
|
||||
recipeSuperLavaPendant = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Hand of Ender Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.enderHand),
|
||||
addOreDictRecipe(new ItemStack(ModItems.enderHand),
|
||||
"PLO", "LEL", "OL ",
|
||||
'P', LibOreDict.PIXIE_DUST,
|
||||
'L', new ItemStack(Items.leather),
|
||||
'E', new ItemStack(Blocks.ender_chest),
|
||||
'O', new ItemStack(Blocks.obsidian));
|
||||
recipeEnderHand = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Mana and Terrasteel Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -89,7 +89,7 @@ public class EntityPixie extends EntityFlyingCreature {
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
|
||||
if((getType() == 0 && par1DamageSource.getEntity() != summoner) || (getType() == 1 && par1DamageSource.getDamageType().equals("player")))
|
||||
if(getType() == 0 && par1DamageSource.getEntity() != summoner || getType() == 1 && par1DamageSource.getDamageType().equals("player"))
|
||||
return super.attackEntityFrom(par1DamageSource, par2);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem {
|
||||
iplayer.worldObj.playSoundAtEntity(iplayer, "mob.endermen.portal", 1F, 1F);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,27 +98,27 @@ public class ItemItemFinder extends ItemBauble {
|
||||
if(e instanceof EntityItem) {
|
||||
EntityItem item = (EntityItem) e;
|
||||
ItemStack istack = item.getEntityItem();
|
||||
if(player.isSneaking() || (istack.isItemEqual(pstack) && ItemStack.areItemStackTagsEqual(istack, pstack)))
|
||||
if(player.isSneaking() || istack.isItemEqual(pstack) && ItemStack.areItemStackTagsEqual(istack, pstack))
|
||||
positionsBuilder.append(item.getEntityId()).append(";");
|
||||
|
||||
|
||||
} else if(e instanceof IInventory) {
|
||||
IInventory inv = (IInventory) e;
|
||||
if(scanInventory(inv, pstack))
|
||||
positionsBuilder.append(e.getEntityId()).append(";");
|
||||
|
||||
|
||||
} else if(e instanceof EntityHorse) {
|
||||
EntityHorse horse = (EntityHorse) e;
|
||||
AnimalChest chest = ReflectionHelper.getPrivateValue(EntityHorse.class, horse, LibObfuscation.HORSE_CHEST);
|
||||
if(scanInventory(chest, pstack))
|
||||
positionsBuilder.append(horse.getEntityId()).append(";");
|
||||
|
||||
|
||||
} else if(e instanceof EntityPlayer) {
|
||||
EntityPlayer player_ = (EntityPlayer) e;
|
||||
InventoryPlayer inv = player_.inventory;
|
||||
InventoryBaubles binv = PlayerHandler.getPlayerBaubles(player_);
|
||||
if(scanInventory(inv, pstack) || scanInventory(binv, pstack))
|
||||
positionsBuilder.append(player_.getEntityId()).append(";");
|
||||
|
||||
|
||||
} else if(e instanceof EntityVillager) {
|
||||
EntityVillager villager = (EntityVillager) e;
|
||||
ArrayList<MerchantRecipe> recipes = villager.getRecipes(player);
|
||||
@@ -126,7 +126,7 @@ public class ItemItemFinder extends ItemBauble {
|
||||
for(MerchantRecipe recipe : recipes)
|
||||
if(!recipe.isRecipeDisabled() && (equalStacks(pstack, recipe.getItemToBuy()) || equalStacks(pstack, recipe.getItemToSell())))
|
||||
positionsBuilder.append(villager.getEntityId()).append(";");
|
||||
|
||||
|
||||
} else if(e instanceof EntityLivingBase) {
|
||||
EntityLivingBase living = (EntityLivingBase) e;
|
||||
ItemStack estack = living.getEquipmentInSlot(0);
|
||||
@@ -137,9 +137,9 @@ public class ItemItemFinder extends ItemBauble {
|
||||
|
||||
if(pstack != null) {
|
||||
range = 12;
|
||||
int x = (int) MathHelper.floor_double(player.posX);
|
||||
int y = (int) MathHelper.floor_double(player.posY);
|
||||
int z = (int) MathHelper.floor_double(player.posZ);
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int y = MathHelper.floor_double(player.posY);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -range; j < range + 1; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
@@ -163,7 +163,7 @@ public class ItemItemFinder extends ItemBauble {
|
||||
PacketHandler.INSTANCE.sendToAll(new PacketSyncBauble(player, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean equalStacks(ItemStack stack1, ItemStack stack2) {
|
||||
return stack1.isItemEqual(stack2) && ItemStack.areItemStackTagsEqual(stack1, stack2);
|
||||
}
|
||||
|
||||
@@ -11,13 +11,10 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import baubles.api.BaubleType;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class ItemLavaPendant extends ItemBauble {
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
@@ -47,6 +47,7 @@ public class ItemElementiumShears extends ItemManasteelShears {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
|
||||
@@ -378,7 +378,7 @@ public final class LexiconData {
|
||||
new PageImage("2", LibResources.ENTRY_ENCHANTER0), new PageImage("3", LibResources.ENTRY_ENCHANTER1), new PageImage("4", LibResources.ENTRY_ENCHANTER2), new PageImage("5", LibResources.ENTRY_ENCHANTER3),
|
||||
new PageText("6"), new PageText("7"), new PageText("8"), new PageText("9"), new PageText("10"));
|
||||
}
|
||||
|
||||
|
||||
turntable = new BLexiconEntry(LibLexicon.DEVICE_TURNTABLE, categoryDevices);
|
||||
turntable.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTurntable));
|
||||
|
||||
@@ -420,7 +420,7 @@ public final class LexiconData {
|
||||
|
||||
enderEyeBlock = new BLexiconEntry(LibLexicon.DEVICE_ENDER_EYE_BLOCK, categoryDevices);
|
||||
enderEyeBlock.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeEnderEyeBlock));
|
||||
|
||||
|
||||
// TOOLS ENTRIES
|
||||
manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools);
|
||||
manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManaBlaster));
|
||||
@@ -491,7 +491,7 @@ public final class LexiconData {
|
||||
|
||||
enderHand = new ALexiconEntry(LibLexicon.TOOL_ENDER_HAND, categoryTools);
|
||||
enderHand.setLexiconPages(new PageText(ConfigHandler.enderPickpocketEnabled ? "0" : "0a"), new PageCraftingRecipe(ConfigHandler.enderPickpocketEnabled ? "1" : "1a", ModCrafingRecipes.recipeEnderHand));
|
||||
|
||||
|
||||
// BAUBLES ENTRIES
|
||||
baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles);
|
||||
baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2"));
|
||||
@@ -546,10 +546,10 @@ public final class LexiconData {
|
||||
|
||||
itemFinder = new BLexiconEntry(LibLexicon.BAUBLE_ITEM_FINDER, categoryBaubles);
|
||||
itemFinder.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeItemFinder));
|
||||
|
||||
|
||||
superLavaPendant = new ALexiconEntry(LibLexicon.BAUBLE_SUPER_LAVA_PENDANT, categoryBaubles);
|
||||
superLavaPendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeSuperLavaPendant));
|
||||
|
||||
|
||||
// ALFHOMANCY ENTRIES
|
||||
alfhomancyIntro = new BLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy);
|
||||
alfhomancyIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeAlfPortal), new PageCraftingRecipe("3", ModCrafingRecipes.recipeNaturaPylon),
|
||||
|
||||
@@ -35,7 +35,7 @@ public final class LibObfuscation {
|
||||
|
||||
// Entity
|
||||
public static final String[] IS_IMMUNE_TO_FIRE = new String[] { "isImmuneToFire", "field_70178_ae", "ag" };
|
||||
|
||||
|
||||
// ItemReed
|
||||
public static final String[] REED_ITEM = new String[] { "field_150935_a", "a" };
|
||||
|
||||
|
||||
Reference in new issue
Block a user