Clean it up please!

This commit is contained in:
Vasco Lavos committed 2014-05-02 21:29:38 +01:00
1 parent 5c7a94cd99
commit dae80b6208
23 files changed
+79 -80

No files matched your search

+1 -1
View File
@@ -146,7 +146,7 @@ public final class BotaniaAPI {
manaInfusionRecipes.add(recipe);
return recipe;
}
/**
* Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an
* Alchemy Catalyst below the pool).
@@ -42,11 +42,11 @@ public class RecipeManaInfusion {
return false;
}
public void setAlchemy(boolean alchemy) {
isAlchemy = alchemy;
}
public boolean isAlchemy() {
return isAlchemy;
}
+1 -1
View File
@@ -45,7 +45,7 @@ public class Botania {
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit(event);
// Corruption.init();
// Corruption.init();
}
@EventHandler
@@ -11,11 +11,6 @@
*/
package vazkii.botania.common.block;
import vazkii.botania.api.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -23,11 +18,16 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.api.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockAlchemyCatalyst extends BlockMod implements ILexiconable {
IIcon[] icons;
public BlockAlchemyCatalyst() {
super(Material.rock);
setHardness(2.0F);
@@ -42,7 +42,7 @@ public class BlockAlchemyCatalyst extends BlockMod implements ILexiconable {
for(int i = 0; i < icons.length; i++)
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
}
@Override
public IIcon getIcon(int par1, int par2) {
return icons[Math.min(2, par1)];
@@ -52,5 +52,5 @@ public class BlockAlchemyCatalyst extends BlockMod implements ILexiconable {
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.alchemy;
}
}
@@ -64,7 +64,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public int damageDropped(int par1) {
return par1;
@@ -11,16 +11,16 @@
*/
package vazkii.botania.common.block;
import vazkii.botania.api.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.block.tile.TileTinyPlanet;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import vazkii.botania.api.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.block.tile.TileTinyPlanet;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockTinyPlanet extends BlockModContainer implements ILexiconable {
@@ -53,5 +53,5 @@ public class BlockTinyPlanet extends BlockModContainer implements ILexiconable {
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.tinyPlanet;
}
}
@@ -94,7 +94,7 @@ public final class ModBlocks {
turntable = new BlockTurntable();
tinyPlanet = new BlockTinyPlanet();
alchemyCatalyst = new BlockAlchemyCatalyst();
for(int i = 0; i < 16; i++)
OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower, 1, i));
@@ -49,7 +49,7 @@ public class SubTileAgricarnation extends SubTileFunctional {
boolean isPlant(int x, int y, int z) {
Block block = supertile.getWorldObj().getBlock(x, y, z);
if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || (block instanceof BlockBush && !(block instanceof BlockCrops)))
if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush && !(block instanceof BlockCrops))
return false;
Material mat = block.getMaterial();
@@ -38,7 +38,7 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
public class SubTileRannuncarpus extends SubTileFunctional {
int cooldown = 0;
@Override
public void onUpdate() {
super.onUpdate();
@@ -48,14 +48,14 @@ public class SubTileRannuncarpus extends SubTileFunctional {
}
BlockData filter = getUnderlyingBlock();
boolean scanned = false;
List<ChunkCoordinates> validPositions = new ArrayList();
int range = 2;
int rangePlace = mana > 0 ? 8 : 6;
int rangePlaceY = 6;
int x = supertile.xCoord;
int y = supertile.yCoord;
int z = supertile.zCoord;
@@ -64,7 +64,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
for(EntityItem item : items) {
if(item.age < 60)
continue;
ItemStack stack = item.getEntityItem();
Item stackItem = stack.getItem();
if(stackItem instanceof ItemBlock || stackItem instanceof ItemReed) {
@@ -76,35 +76,35 @@ public class SubTileRannuncarpus extends SubTileFunctional {
int yp = y + j;
int zp = z + l;
Block blockAbove = supertile.getWorldObj().getBlock(xp, yp + 1, zp);
if(filter.equals(supertile.getWorldObj(), xp, yp, zp) && (blockAbove.isAir(supertile.getWorldObj(), xp, yp + 1, zp) || blockAbove.isReplaceable(supertile.getWorldObj(), xp, yp + 1, zp)))
validPositions.add(new ChunkCoordinates(xp, yp + 1, zp));
}
scanned = true;
}
if(!validPositions.isEmpty() && !supertile.getWorldObj().isRemote) {
Block blockToPlace = null;
if(stackItem instanceof ItemBlock)
blockToPlace = ((ItemBlock) stackItem).field_150939_a;
else if(stackItem instanceof ItemReed)
blockToPlace = ReflectionHelper.getPrivateValue(ItemReed.class, (ItemReed) stackItem, LibObfuscation.REED_ITEM);
if(blockToPlace != null) {
ChunkCoordinates coords = validPositions.get(supertile.getWorldObj().rand.nextInt(validPositions.size()));
if(blockToPlace.canPlaceBlockAt(supertile.getWorldObj(), coords.posX, coords.posY, coords.posZ)) {
supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, blockToPlace, stack.getItemDamage(), 1 | 2);
supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(blockToPlace) + (stack.getItemDamage() << 12));
validPositions.remove(coords);
if(!supertile.getWorldObj().isRemote) {
stack.stackSize--;
if(stack.stackSize == 0)
item.setDead();
}
cooldown = 10;
if(mana > 1)
mana--;
@@ -115,17 +115,17 @@ public class SubTileRannuncarpus extends SubTileFunctional {
}
}
}
public BlockData getUnderlyingBlock() {
return new BlockData(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 2, supertile.zCoord);
}
@Override
public void renderHUD(Minecraft mc, ScaledResolution res) {
super.renderHUD(mc, res);
BlockData filter = getUnderlyingBlock();
ItemStack recieverStack = new ItemStack(Item.getItemFromBlock(filter.block), 1, filter.meta);
ItemStack recieverStack = new ItemStack(Item.getItemFromBlock(filter.block), 1, filter.meta);
int color = 0x66000000 | getColor();
GL11.glEnable(GL11.GL_BLEND);
@@ -143,40 +143,40 @@ public class SubTileRannuncarpus extends SubTileFunctional {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
}
@Override
public int getMaxMana() {
return 20;
}
@Override
public int getColor() {
return 0xFFB27F;
}
@Override
public LexiconEntry getEntry() {
return LexiconData.rannuncarpus;
}
static class BlockData {
Block block;
int meta;
public BlockData(World world, int x, int y, int z) {
block = world.getBlock(x, y, z);
meta = world.getBlockMetadata(x, y, z);
}
public boolean equals(BlockData data) {
return block == data.block && meta == data.meta;
}
public boolean equals(World world, int x, int y, int z) {
return equals(new BlockData(world, x, y, z));
}
}
}
@@ -43,7 +43,7 @@ public class SubtileOrechid extends SubTileFunctional {
int meta = stack.getItemDamage();
supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, block, meta, 1 | 2);
supertile.getWorldObj().playAuxSFX(2001, coords.posX, coords.posY, coords.posZ, Block.getIdFromBlock(block) + (meta << 12));
mana -= COST;
sync();
}
@@ -83,7 +83,7 @@ public class TilePool extends TileMod implements IManaPool {
public boolean collideEntityItem(EntityItem item) {
if(craftCooldown > 0)
return false;
boolean didChange = false;
ItemStack stack = item.getEntityItem();
if(stack == null)
@@ -104,7 +104,7 @@ public class TilePool extends TileMod implements IManaPool {
EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output);
worldObj.spawnEntityInWorld(outputItem);
}
craftCooldown = 20;
craftingFanciness();
didChange = true;
@@ -139,9 +139,9 @@ public class TilePool extends TileMod implements IManaPool {
if(Math.random() > particleChance)
Botania.proxy.wispFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord + 0.6 + Math.random() * 0.25, zCoord + Math.random(), color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 3F, (float) -Math.random() / 25F);
}
alchemy = worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.alchemyCatalyst;
if(craftCooldown > 0)
craftCooldown--;
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
@@ -25,5 +25,5 @@ public class TileTinyPlanet extends TileMod implements IManaCollisionGhost {
public boolean isGhost() {
return true;
}
}
@@ -62,7 +62,7 @@ public final class ConfigHandler {
desc = "The frequency in which particles spawn from normal (worldgen) mystical flowers";
flowerParticleFrequency = loadPropDouble("flowerParticles.frequency", desc, flowerParticleFrequency);
desc = "Do not ever touch this value if not asked to. Possible symptoms of doing so include your head turning backwards, the appearance of Titans near the walls or you being trapped in a game of Sword Art Online.";
spreaderPositionShift = loadPropInt("spreader.posShift", desc, spreaderPositionShift);
@@ -115,7 +115,7 @@ public final class ManaNetworkHandler implements IManaNetwork {
private List<TileEntity> getAllInWorld(Map<World, List<TileEntity>> map, World world) {
if(!map.containsKey(world))
return new ArrayList();
return map.get(world);
}
}
@@ -40,7 +40,7 @@ public final class TerrasteelCraftingHandler {
doParticles(item, time);
if(time == TIME)
item.worldObj.playSoundAtEntity(item, "random.levelup", 1F, 1F);
getManaFromPools : {
int x = (int) item.posX;
int y = (int) item.posY;
@@ -68,14 +68,14 @@ public final class TerrasteelCraftingHandler {
}
static int validateCraftingItem(EntityItem item, boolean recursive) {
if(recursive) {
if(recursive) {
item.posX--;
int firstVal = validateCraftingItem(item, false);
item.posX++;
if(firstVal > -1)
return firstVal;
}
int x = (int) item.posX;
int y = (int) item.posY;
int z = (int) item.posZ;
@@ -180,7 +180,7 @@ public final class TerrasteelCraftingHandler {
finalizeCraftingRecipe(item, false);
item.posX++;
}
int x = (int) item.posX;
int y = (int) item.posY;
int z = (int) item.posZ;
@@ -552,16 +552,16 @@ public final class ModCrafingRecipes {
'L', "treeLeaves",
'E', LibOreDict.LIFE_ESSENCE);
recipeGoldenLaurel = BotaniaAPI.getLatestAddedRecipe();
// Tiny Planet Block Recipe
addOreDictRecipe(new ItemStack(ModBlocks.tinyPlanet),
addOreDictRecipe(new ItemStack(ModBlocks.tinyPlanet),
"SSS", "SPS", "SSS",
'S', "stone",
'P', ModItems.tinyPlanet);
recipeTinyPlanetBlock = BotaniaAPI.getLatestAddedRecipe();
// Alchemy Catalyst Recipe
addOreDictRecipe(new ItemStack(ModBlocks.alchemyCatalyst),
addOreDictRecipe(new ItemStack(ModBlocks.alchemyCatalyst),
"SGS", "BPB", "SGS",
'S', LibOreDict.LIVING_ROCK,
'G', "ingotGold",
@@ -34,14 +34,14 @@ public final class ModManaAlchemyRecipes {
public static List<RecipeManaInfusion> cropRecipes;
public static RecipeManaInfusion potatoRecipe;
public static RecipeManaInfusion netherWartRecipe;
public static List<RecipeManaInfusion> gunpowderAndFlintRecipes;
public static List<RecipeManaInfusion> gunpowderAndFlintRecipes;
public static RecipeManaInfusion nameTagRecipe;
public static RecipeManaInfusion enderPearlRecipe;
public static RecipeManaInfusion sandRecipe;
public static void init() {
leatherRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.leather), new ItemStack(Items.rotten_flesh), 600);
woodRecipes = new ArrayList();
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 0), new ItemStack(Blocks.log2, 1, 1), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 1), new ItemStack(Blocks.log, 1, 0), 40));
@@ -49,16 +49,16 @@ public final class ModManaAlchemyRecipes {
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log, 1, 3), new ItemStack(Blocks.log, 1, 2), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log2, 1, 0), new ItemStack(Blocks.log, 1, 3), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.log2, 1, 1), new ItemStack(Blocks.log2, 1, 0), 40));
saplingRecipes = new ArrayList();
for(int i = 0; i < 6; i++)
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.sapling, 1, i == 5 ? 0 : i + 1), new ItemStack(Blocks.sapling, 1, i), 120));
glowstoneDustRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.glowstone_dust, 4), new ItemStack(Blocks.glowstone), 25);
netherQuartzRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.quartz, 4), new ItemStack(Blocks.quartz_block), 25);
chiseledBrickRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.stonebrick, 1, 3), new ItemStack(Blocks.stonebrick), 150);
iceRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ice), new ItemStack(Blocks.snow), 2250);
swampFolliageRecipes = new ArrayList();
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.waterlily), new ItemStack(Blocks.vine), 320));
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.vine), new ItemStack(Blocks.waterlily), 320));
@@ -66,7 +66,7 @@ public final class ModManaAlchemyRecipes {
fishRecipes = new ArrayList();
for(int i = 0; i < 4; i++)
fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.fish, 1, i == 3 ? 0 : i + 1), new ItemStack(Items.fish, 1, i), 200));
cropRecipes = new ArrayList();
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.wheat_seeds), new ItemStack(Items.pumpkin_seeds), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.potato), new ItemStack(Items.wheat), 6000));
@@ -76,11 +76,11 @@ public final class ModManaAlchemyRecipes {
potatoRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.potato), new ItemStack(Items.poisonous_potato), 1200);
netherWartRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.nether_wart), new ItemStack(Items.blaze_rod), 4000);
gunpowderAndFlintRecipes = new ArrayList();
gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.flint), new ItemStack(Items.gunpowder), 200));
gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.gunpowder), new ItemStack(Items.flint), 4000));
nameTagRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.name_tag), new ItemStack(Items.writable_book), 16000);
enderPearlRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.ender_pearl, 2), new ItemStack(Items.ghast_tear), 28000);
sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.sand), new ItemStack(Blocks.cobblestone), 50);
@@ -11,7 +11,6 @@
*/
package vazkii.botania.common.crafting;
import net.minecraft.item.ItemSpade;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -31,7 +31,7 @@ public class Item16Colors extends ItemMod {
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
if(par1ItemStack.getItemDamage() >= EntitySheep.fleeceColorTable.length)
return 0xFFFFFF;
float[] color = EntitySheep.fleeceColorTable[par1ItemStack.getItemDamage()];
return new Color(color[0], color[1], color[2]).getRGB();
}
@@ -46,10 +46,10 @@ public class ItemTinyPlanet extends ItemBauble {
double z = player.posZ;
if(player.worldObj.isRemote)
y -= 1.62F;
applyEffect(player.worldObj, x, y, z);
}
public static void applyEffect(World world, double x, double y, double z) {
int range = 8;
List<Entity> entities = world.getEntitiesWithinAABB(IManaBurst.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range));
@@ -260,7 +260,7 @@ public final class LexiconData {
rannuncarpus = new BLexiconEntry(LibLexicon.FFLOWER_RANNUNCARPUS, categoryFunctionalFlowers);
rannuncarpus.setLexiconPages(new PageText("0"), new PageText("1"), new PagePetalRecipe("2", ModPetalRecipes.rannuncarpusRecipe));
// GENERATING FLOWERS ENTRIES
generatingIntro = new BLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers);
generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"));
@@ -304,7 +304,7 @@ public final class LexiconData {
new PageManaInfusionRecipe("6", ModManaAlchemyRecipes.netherQuartzRecipe), new PageManaInfusionRecipe("7", ModManaAlchemyRecipes.chiseledBrickRecipe), new PageManaInfusionRecipe("8", ModManaAlchemyRecipes.iceRecipe), new PageManaInfusionRecipe("9", ModManaAlchemyRecipes.swampFolliageRecipes),
new PageManaInfusionRecipe("10", ModManaAlchemyRecipes.fishRecipes), new PageManaInfusionRecipe("11", ModManaAlchemyRecipes.cropRecipes), new PageManaInfusionRecipe("12", ModManaAlchemyRecipes.potatoRecipe), new PageManaInfusionRecipe("13", ModManaAlchemyRecipes.netherWartRecipe),
new PageManaInfusionRecipe("14", ModManaAlchemyRecipes.gunpowderAndFlintRecipes), new PageManaInfusionRecipe("15", ModManaAlchemyRecipes.nameTagRecipe), new PageManaInfusionRecipe("16", ModManaAlchemyRecipes.enderPearlRecipe), new PageManaInfusionRecipe("17", ModManaAlchemyRecipes.sandRecipe));
// 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));
@@ -105,7 +105,7 @@ public class PageRecipe extends LexiconPage {
public void renderItemAtAngle(IGuiLexiconEntry gui, int angle, ItemStack stack) {
if(stack == null || stack.getItem() == null)
return;
ItemStack workStack = stack.copy();
if(workStack.getItemDamage() == Short.MAX_VALUE || workStack.getItemDamage() == -1)
@@ -34,7 +34,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" };
}