mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-28 15:56:14 +00:00
Cleanup...
This commit is contained in:
1 parent
b8e0e0b0b9
commit
50a0323892
56 files changed
+191
-213
No files matched your search
@@ -53,7 +53,7 @@ public final class BotaniaAPI {
|
||||
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
|
||||
|
||||
public static Map<Item, Block> seeds = new HashMap();
|
||||
|
||||
|
||||
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18);
|
||||
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
|
||||
|
||||
@@ -105,7 +105,7 @@ public final class BotaniaAPI {
|
||||
addOreWeight("oreUranium", 1337); // IC2
|
||||
addOreWeight("oreVinteum", 5925); // Ars Magica
|
||||
addOreWeight("oreYellorite", 3520); // Big Reactors
|
||||
|
||||
|
||||
addSeed(Items.wheat_seeds, Blocks.wheat);
|
||||
addSeed(Items.potato, Blocks.potatoes);
|
||||
addSeed(Items.carrot, Blocks.carrots);
|
||||
@@ -211,10 +211,10 @@ public final class BotaniaAPI {
|
||||
public static int getOreWeight(String ore) {
|
||||
return oreWeights.get(ore);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allows an item to be counted as a seed. Any item in this list can be
|
||||
* dispensed by a dispenser, the block is the block to be placed.
|
||||
* dispensed by a dispenser, the block is the block to be placed.
|
||||
*/
|
||||
public static void addSeed(Item item, Block block) {
|
||||
seeds.put(item, block);
|
||||
|
||||
@@ -18,7 +18,7 @@ import vazkii.botania.api.internal.IManaBurst;
|
||||
* Have a block implement this class to make it do something when a mana burst collides with it.
|
||||
*/
|
||||
public interface IManaTrigger {
|
||||
|
||||
|
||||
public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z);
|
||||
|
||||
}
|
||||
@@ -22,7 +22,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.server.ForgeTimeTracker;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
@@ -39,9 +38,9 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
private static final String TAG_POOL_Z = "poolZ";
|
||||
|
||||
public int mana;
|
||||
|
||||
|
||||
public int redstoneSignal = 0;
|
||||
|
||||
|
||||
int sizeLastCheck = -1;
|
||||
TileEntity linkedPool = null;
|
||||
public int knownMana = -1;
|
||||
@@ -52,7 +51,7 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* If set to true, redstoneSignal will be updated every tick.
|
||||
*/
|
||||
@@ -74,7 +73,7 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
pool.recieveMana(-manaToRemove);
|
||||
addMana(manaToRemove);
|
||||
}
|
||||
|
||||
|
||||
if(acceptsRedstone()) {
|
||||
redstoneSignal = 0;
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
@@ -135,7 +134,7 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
public boolean onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player == null)
|
||||
return false;
|
||||
|
||||
|
||||
knownMana = mana;
|
||||
player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1F);
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
public boolean onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player == null)
|
||||
return false;
|
||||
|
||||
|
||||
if(!player.worldObj.isRemote)
|
||||
sync();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Botania {
|
||||
public void serverStopping(FMLServerStoppingEvent event) {
|
||||
ManaNetworkHandler.instance.clear();
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void missingMappings(FMLMissingMappingsEvent event) {
|
||||
AliasHandler.onMissingMappings(event);
|
||||
|
||||
@@ -29,17 +29,17 @@ import vazkii.botania.common.lib.LibBlockNames;
|
||||
public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexiconable {
|
||||
|
||||
IIcon iconBases, iconFaces;
|
||||
|
||||
|
||||
public BlockForestDrum() {
|
||||
super(Material.wood);
|
||||
float f = 1F / 16F;
|
||||
setBlockBounds(f * 3, 0F, f * 3, 1F - f * 3, 1F - f * 2, 1F - f * 3);
|
||||
|
||||
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
setBlockName(LibBlockNames.FOREST_DRUM);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
@@ -49,13 +49,13 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
iconBases = IconHelper.forBlock(par1IconRegister, this, 0);
|
||||
iconFaces = IconHelper.forBlock(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side < 2 ? iconBases : iconFaces;
|
||||
@@ -75,5 +75,5 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.forestDrum;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class BlockMod extends Block {
|
||||
GameRegistry.registerBlock(this, ItemBlockMod.class, par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
if(player == null)
|
||||
return false;
|
||||
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
playerPositions.put(player.getCommandSenderName(), getCoordsAsString(world.provider.dimensionId, x, y, z));
|
||||
world.playSoundEffect(x, y, z, "random.orb", 0.5F, 1F);
|
||||
|
||||
@@ -13,9 +13,6 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -32,13 +29,16 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
|
||||
|
||||
IIcon[] icons;
|
||||
|
||||
|
||||
public BlockStorage() {
|
||||
super(Material.iron);
|
||||
setHardness(3F);
|
||||
@@ -46,13 +46,13 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockName(LibBlockNames.STORAGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2, List par3) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
par3.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
@@ -63,7 +63,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
@@ -76,7 +76,7 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[Math.min(icons.length - 1, par2)];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
@@ -87,5 +87,5 @@ public class BlockStorage extends BlockMod implements ILexiconable {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return meta == 0 ? LexiconData.pool : LexiconData.terrasteel;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -122,13 +122,13 @@ public final class ModBlocks {
|
||||
|
||||
initTileEntities();
|
||||
}
|
||||
|
||||
|
||||
public static void addDispenserBehaviours() {
|
||||
for(Item seed : BotaniaAPI.seeds.keySet())
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(seed, new BehaviourSeeds(BotaniaAPI.seeds.get(seed)));
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.twigWand, new BehaviourWand());
|
||||
}
|
||||
|
||||
|
||||
private static void initTileEntities() {
|
||||
GameRegistry.registerTileEntity(TileAltar.class, LibBlockNames.ALTAR);
|
||||
GameRegistry.registerTileEntity(TileSpecialFlower.class, LibBlockNames.SPECIAL_FLOWER);
|
||||
|
||||
@@ -22,26 +22,26 @@ import net.minecraft.world.World;
|
||||
public class BehaviourSeeds extends BehaviorDefaultDispenseItem {
|
||||
|
||||
Block block;
|
||||
|
||||
|
||||
public BehaviourSeeds(Block block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
|
||||
EnumFacing facing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
|
||||
int x = par1IBlockSource.getXInt() + facing.getFrontOffsetX();
|
||||
int y = par1IBlockSource.getYInt() + facing.getFrontOffsetY();
|
||||
int z = par1IBlockSource.getZInt() + facing.getFrontOffsetZ();
|
||||
World world = par1IBlockSource.getWorld();
|
||||
|
||||
if(world.getBlock(x, y, z).isAir(world, x, y, z) && block.canBlockStay(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, block);
|
||||
par2ItemStack.stackSize--;
|
||||
return par2ItemStack;
|
||||
}
|
||||
|
||||
return super.dispenseStack(par1IBlockSource, par2ItemStack);
|
||||
EnumFacing facing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
|
||||
int x = par1IBlockSource.getXInt() + facing.getFrontOffsetX();
|
||||
int y = par1IBlockSource.getYInt() + facing.getFrontOffsetY();
|
||||
int z = par1IBlockSource.getZInt() + facing.getFrontOffsetZ();
|
||||
World world = par1IBlockSource.getWorld();
|
||||
|
||||
if(world.getBlock(x, y, z).isAir(world, x, y, z) && block.canBlockStay(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, block);
|
||||
par2ItemStack.stackSize--;
|
||||
return par2ItemStack;
|
||||
}
|
||||
|
||||
return super.dispenseStack(par1IBlockSource, par2ItemStack);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,26 +16,25 @@ import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
import net.minecraft.dispenser.IBlockSource;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
|
||||
public class BehaviourWand extends BehaviorDefaultDispenseItem {
|
||||
|
||||
|
||||
@Override
|
||||
protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) {
|
||||
ForgeDirection facing = ForgeDirection.getOrientation(BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata()).ordinal());
|
||||
int x = par1IBlockSource.getXInt() + facing.offsetX;
|
||||
int y = par1IBlockSource.getYInt() + facing.offsetY;
|
||||
int z = par1IBlockSource.getZInt() + facing.offsetZ;
|
||||
World world = par1IBlockSource.getWorld();
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if(block instanceof IWandable) {
|
||||
((IWandable) block).onUsedByWand(null, par2ItemStack, world, x, y, z, facing.getOpposite().ordinal());
|
||||
return par2ItemStack;
|
||||
}
|
||||
|
||||
ForgeDirection facing = ForgeDirection.getOrientation(BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata()).ordinal());
|
||||
int x = par1IBlockSource.getXInt() + facing.offsetX;
|
||||
int y = par1IBlockSource.getYInt() + facing.offsetY;
|
||||
int z = par1IBlockSource.getZInt() + facing.offsetZ;
|
||||
World world = par1IBlockSource.getWorld();
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if(block instanceof IWandable) {
|
||||
((IWandable) block).onUsedByWand(null, par2ItemStack, world, x, y, z, facing.getOpposite().ordinal());
|
||||
return par2ItemStack;
|
||||
}
|
||||
|
||||
return super.dispenseStack(par1IBlockSource, par2ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
@@ -48,11 +48,11 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
if(supertile.getWorldObj().getTotalWorldTime() % 5 == 0) {
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
IEntitySelector selector = getSelector();
|
||||
|
||||
|
||||
for(EntityLivingBase entity : entities) {
|
||||
if(!selector.isEntityApplicable(entity))
|
||||
continue;
|
||||
|
||||
|
||||
if(entity.hurtTime == 0 && mana >= manaToUse) {
|
||||
entity.attackEntityFrom(DamageSource.magic, 4);
|
||||
mana -= manaToUse;
|
||||
@@ -61,24 +61,24 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public int getManaCost() {
|
||||
return 24;
|
||||
}
|
||||
|
||||
|
||||
public IEntitySelector getSelector() {
|
||||
return new IEntitySelector() {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isEntityApplicable(Entity entity) {
|
||||
return !(entity instanceof EntityPlayer);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(!supertile.getWorldObj().isRemote && supertile.getWorldObj().getTotalWorldTime() % 5 == 0) {
|
||||
int manaCost = 80;
|
||||
if(mana >= manaCost) {
|
||||
@@ -44,7 +44,7 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ChunkCoordinates getCoordsToPut() {
|
||||
List<ChunkCoordinates> possibleCoords = new ArrayList();
|
||||
int range = 5;
|
||||
@@ -65,20 +65,20 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
return null;
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x7B8792;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 640;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.clayconia;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -11,11 +11,11 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import net.minecraft.command.IEntitySelector;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileDreadthorn extends SubTileBellethorn {
|
||||
|
||||
@@ -23,7 +23,7 @@ public class SubTileDreadthorn extends SubTileBellethorn {
|
||||
public int getColor() {
|
||||
return 0x260B45;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IEntitySelector getSelector() {
|
||||
return new IEntitySelector() {
|
||||
@@ -32,18 +32,18 @@ public class SubTileDreadthorn extends SubTileBellethorn {
|
||||
public boolean isEntityApplicable(Entity var1) {
|
||||
return var1 instanceof EntityAnimal && ((EntityAnimal) var1).getGrowingAge() == 0;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getManaCost() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.dreadthorne;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
|
||||
boolean pulledAny = false;
|
||||
int range = mana > 0 ? 6 : 3;
|
||||
|
||||
@@ -170,12 +170,12 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player == null)
|
||||
return false;
|
||||
|
||||
|
||||
if(player.isSneaking()) {
|
||||
filterType = filterType == 2 ? 0 : filterType + 1;
|
||||
sync();
|
||||
|
||||
@@ -27,7 +27,7 @@ public class SubTileHyacidus extends SubTileFunctional {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SubTileHyacidus extends SubTileFunctional {
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x8B438F;
|
||||
@@ -57,10 +57,10 @@ public class SubTileHyacidus extends SubTileFunctional {
|
||||
public int getMaxMana() {
|
||||
return 180;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.hyacidus;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
|
||||
@@ -28,31 +28,31 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 6;
|
||||
int manaCost = 12;
|
||||
|
||||
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
for(EntityAnimal animal : animals) {
|
||||
if(mana < manaCost)
|
||||
break;
|
||||
|
||||
|
||||
int love = ReflectionHelper.getPrivateValue(EntityAnimal.class, animal, LibObfuscation.IN_LOVE);
|
||||
if(animal.getGrowingAge() == 0 && love <= 0) {
|
||||
for(EntityItem item : items) {
|
||||
if(item.age < 60 || item.isDead)
|
||||
continue;
|
||||
|
||||
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(animal.isBreedingItem(stack)) {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
item.setDead();
|
||||
|
||||
|
||||
mana -= manaCost;
|
||||
|
||||
|
||||
ReflectionHelper.setPrivateValue(EntityAnimal.class, animal, 1200, LibObfuscation.IN_LOVE);
|
||||
animal.setTarget(null);
|
||||
supertile.getWorldObj().setEntityState(animal, (byte)18);
|
||||
@@ -62,17 +62,17 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 120;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xCF4919;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.pollidisiac;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
super.renderHUD(mc, res);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
return null;
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class SubTileDaybloom extends SubTileGenerating {
|
||||
public int getColor() {
|
||||
return 0xFFFF00;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canGeneratePassively() {
|
||||
boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering());
|
||||
|
||||
@@ -28,13 +28,13 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
int manaPerLeaf = 16;
|
||||
if(getMaxMana() - mana >= manaPerLeaf && !supertile.getWorldObj().isRemote && supertile.getWorldObj().getTotalWorldTime() % 4 == 0) {
|
||||
List<ChunkCoordinates> coords = new ArrayList();
|
||||
int range = 8;
|
||||
int rangeY = 16;
|
||||
|
||||
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
@@ -53,15 +53,15 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
exposed = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(exposed)
|
||||
coords.add(new ChunkCoordinates(xp, yp, zp));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(coords.isEmpty())
|
||||
return;
|
||||
|
||||
|
||||
Collections.shuffle(coords);
|
||||
ChunkCoordinates breakCoords = coords.get(0);
|
||||
Block block = supertile.getWorldObj().getBlock(breakCoords.posX, breakCoords.posY, breakCoords.posZ);
|
||||
@@ -71,17 +71,17 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
mana += manaPerLeaf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x79C42F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 200;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.munchdew;
|
||||
|
||||
@@ -14,9 +14,7 @@ package vazkii.botania.common.block.tile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class TileOpenCrate extends TileSimpleInventory {
|
||||
@@ -39,7 +37,7 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
if(redstoneSide > 0)
|
||||
redstone = true;
|
||||
}
|
||||
|
||||
|
||||
Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
|
||||
if(blockBelow.isAir(worldObj, xCoord, yCoord - 1, zCoord)) {
|
||||
ItemStack stack = getStackInSlot(0);
|
||||
@@ -48,10 +46,10 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
item.motionX = 0;
|
||||
item.motionY = 0;
|
||||
item.motionZ = 0;
|
||||
|
||||
|
||||
if(redstone)
|
||||
item.age = -200;
|
||||
|
||||
|
||||
setInventorySlotContents(0, null);
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
|
||||
@@ -200,7 +200,7 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
public void onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
|
||||
if(player.isSneaking()) {
|
||||
outputting = !outputting;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
@@ -80,8 +80,8 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(worldObj.isRemote && manaToGet > 0 && mana >= manaToGet) {
|
||||
if(worldObj.rand.nextInt(20) == 0) {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "mob.creeper.live", 1F, 1F);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class TileSpecialFlower extends TileMod implements ITileBound {
|
||||
cmp.setString(TAG_SUBTILE_NAME, subTileName);
|
||||
NBTTagCompound subCmp = new NBTTagCompound();
|
||||
cmp.setTag(TAG_SUBTILE_CMP, subCmp);
|
||||
|
||||
|
||||
if(subTile != null)
|
||||
subTile.writeToPacketNBT(subCmp);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
public void onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
|
||||
if(!player.isSneaking()) {
|
||||
if(!worldObj.isRemote) {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TileTurntable extends TileMod {
|
||||
public void onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
|
||||
if(player.isSneaking())
|
||||
backwards = !backwards;
|
||||
else speed = speed == 6 ? 1 : speed + 1;
|
||||
|
||||
@@ -11,21 +11,13 @@
|
||||
*/
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
|
||||
public final class AliasHandler {
|
||||
@@ -57,7 +49,7 @@ public final class AliasHandler {
|
||||
if(i.getUnlocalizedName().substring("item.".length()).equals(name))
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -67,7 +59,7 @@ public final class AliasHandler {
|
||||
if(b.getUnlocalizedName().substring("tile.".length()).equals(name))
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,6 @@ package vazkii.botania.common.core.proxy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import baubles.common.Baubles;
|
||||
import baubles.common.Config;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
@@ -39,6 +37,7 @@ import vazkii.botania.common.entity.ModEntities;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.network.GuiHandler;
|
||||
import baubles.common.Config;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
@@ -76,7 +75,7 @@ public class CommonProxy {
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ModBlocks.addDispenserBehaviours();
|
||||
|
||||
|
||||
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
|
||||
for(IRecipe recipe : recipes)
|
||||
if(recipe.getRecipeOutput() != null && recipe.getRecipeOutput().getItem() == Config.itemRing) {
|
||||
|
||||
@@ -589,48 +589,48 @@ public final class ModCrafingRecipes {
|
||||
'S', LibOreDict.LIVING_ROCK,
|
||||
'E', new ItemStack(Items.ender_eye));
|
||||
recipeForestEye = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Redstone Root Recipe
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.manaResource, 1, 6), new ItemStack(Items.redstone), new ItemStack(Blocks.tallgrass, 1, 1));
|
||||
recipeRedstoneRoot = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Drum of the Wild Recipe
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.forestDrum),
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.forestDrum),
|
||||
"WLW", "WHW", "WLW",
|
||||
'W', LibOreDict.LIVING_WOOD,
|
||||
'L', new ItemStack(Items.leather),
|
||||
'H', new ItemStack(ModItems.grassHorn));
|
||||
recipeForestDrum = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Ring of Chordata Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.waterRing),
|
||||
addOreDictRecipe(new ItemStack(ModItems.waterRing),
|
||||
"WMP", "M M", "SM ",
|
||||
'W', LibOreDict.RUNE[0],
|
||||
'M', LibOreDict.MANA_STEEL,
|
||||
'P', new ItemStack(Items.fish, 1, 3),
|
||||
'S', new ItemStack(Items.fish, 1, 1));
|
||||
recipeWaterRing = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Ring of the Mantle Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.miningRing),
|
||||
addOreDictRecipe(new ItemStack(ModItems.miningRing),
|
||||
"EMP", "M M", " M ",
|
||||
'E', LibOreDict.RUNE[2],
|
||||
'M', LibOreDict.MANA_STEEL,
|
||||
'P', new ItemStack(Items.golden_pickaxe));
|
||||
recipeMiningRing = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Ring of Magnetization Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.magnetRing),
|
||||
addOreDictRecipe(new ItemStack(ModItems.magnetRing),
|
||||
"LM ", "M M", " M ",
|
||||
'L', new ItemStack(ModItems.lens, 1, 10),
|
||||
'M', LibOreDict.MANA_STEEL);
|
||||
recipeMagnetRing = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Mana and Terrasteel Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
'I', LibOreDict.MANA_STEEL);
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 1),
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 1),
|
||||
"III", "III", "III",
|
||||
'I', LibOreDict.TERRA_STEEL);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.manaResource, 9, 0), new ItemStack(ModBlocks.storage, 1, 0));
|
||||
|
||||
@@ -23,7 +23,7 @@ public final class ModPetalRecipes {
|
||||
public static final String whiteMana = LibOreDict.MANA_PETAL[0], orangeMana = LibOreDict.MANA_PETAL[1], magentaMana = LibOreDict.MANA_PETAL[2], lightBlueMana = LibOreDict.MANA_PETAL[3], yellowMana = LibOreDict.MANA_PETAL[4], limeMana = LibOreDict.MANA_PETAL[5], pinkMana = LibOreDict.MANA_PETAL[6], grayMana = LibOreDict.MANA_PETAL[7], lightGrayMana = LibOreDict.MANA_PETAL[8], cyanMana = LibOreDict.MANA_PETAL[9], purpleMana = LibOreDict.MANA_PETAL[10], blueMana = LibOreDict.MANA_PETAL[11], brownMana = LibOreDict.MANA_PETAL[12], greenMana = LibOreDict.MANA_PETAL[13], redMana = LibOreDict.MANA_PETAL[14], blackMana = LibOreDict.MANA_PETAL[15];
|
||||
public static final String runeWater = LibOreDict.RUNE[0], runeFire = LibOreDict.RUNE[1], runeEarth = LibOreDict.RUNE[2], runeAir = LibOreDict.RUNE[3], runeSpring = LibOreDict.RUNE[4], runeSummer = LibOreDict.RUNE[5], runeAutumn = LibOreDict.RUNE[6], runeWinter = LibOreDict.RUNE[7], runeMana = LibOreDict.RUNE[8], runeLust = LibOreDict.RUNE[9], runeGluttony = LibOreDict.RUNE[10], runeGreed = LibOreDict.RUNE[11], runeSloth = LibOreDict.RUNE[12], runeWrath = LibOreDict.RUNE[13], runeEnvy = LibOreDict.RUNE[14], runePride = LibOreDict.RUNE[15];
|
||||
public static final String redstoneRoot = LibOreDict.REDSTONE_ROOT;
|
||||
|
||||
|
||||
public static RecipePetals pureDaisyRecipe;
|
||||
|
||||
public static RecipePetals daybloomRecipe;
|
||||
@@ -61,7 +61,7 @@ public final class ModPetalRecipes {
|
||||
thermalilyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_THERMALILY), red, orangeMana, orange, runeEarth, runeFire);
|
||||
arcaneRoseRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ARCANE_ROSE), pink, pinkMana, pinkMana, lime, purple, purpleMana, runeMana);
|
||||
munchdewRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MUNCHDEW), lime, limeMana, green, red, redMana, white, whiteMana, runeGluttony);
|
||||
|
||||
|
||||
jadedAmaranthusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_JADED_AMARANTHUS), purpleMana, purpleMana, lime, purple, green, runeSpring, redstoneRoot);
|
||||
bellethorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN), redMana, redMana, cyan, cyan, red, redstoneRoot);
|
||||
dreadthorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DREADTHORN), blackMana, purpleMana, cyan, cyan, black, purple, redstoneRoot);
|
||||
|
||||
@@ -56,15 +56,15 @@ public final class ModRuneRecipes {
|
||||
recipesAirRune = new ArrayList();
|
||||
for(int i = 0; i < 16; i++)
|
||||
recipesAirRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 3), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Blocks.carpet, 1, i), new ItemStack(Items.feather), new ItemStack(Items.carrot)));
|
||||
|
||||
|
||||
recipeSpringRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 4), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[1], "treeSapling", "treeSapling", "treeSapling", new ItemStack(Items.wheat));
|
||||
recipeSummerRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 5), costTier2, LibOreDict.RUNE[2], LibOreDict.RUNE[3], new ItemStack(Blocks.sand), new ItemStack(Blocks.sand), new ItemStack(Items.slime_ball), new ItemStack(Items.melon));
|
||||
recipeAutumnRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 6), costTier2, LibOreDict.RUNE[1], LibOreDict.RUNE[3], "treeLeaves", "treeLeaves", "treeLeaves", new ItemStack(Items.spider_eye));
|
||||
|
||||
|
||||
recipesWinterRune = new ArrayList();
|
||||
for(int i = 0; i < 16; i++)
|
||||
recipesWinterRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 7), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[2], new ItemStack(Blocks.snow), new ItemStack(Blocks.snow), new ItemStack(Blocks.wool, 1, i), new ItemStack(Items.cake)));
|
||||
|
||||
|
||||
recipeManaRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 8), costTier2, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_STEEL, LibOreDict.MANA_PEARL);
|
||||
|
||||
recipeLustRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 9), costTier3, LibOreDict.MANA_DIAMOND, LibOreDict.MANA_DIAMOND, LibOreDict.RUNE[5], LibOreDict.RUNE[3]);
|
||||
|
||||
@@ -516,7 +516,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
if(!isFake() && block instanceof IManaTrigger)
|
||||
((IManaTrigger) block).onBurstCollision(this, worldObj, movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
|
||||
|
||||
|
||||
dead = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ public class ItemGrassHorn extends ItemMod {
|
||||
if(!player.worldObj.isRemote)
|
||||
player.worldObj.playSoundAtEntity(player, "note.bassattack", 1F, 0.001F);
|
||||
}
|
||||
|
||||
|
||||
public static void breakGrass(World world, int srcx, int srcy, int srcz) {
|
||||
Random rand = new Random((int) srcx ^ (int) srcy ^ (int) srcz);
|
||||
Random rand = new Random(srcx ^ srcy ^ srcz);
|
||||
int range = 12;
|
||||
List<ChunkCoordinates> coords = new ArrayList();
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ItemManaCookie extends ItemFood {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemMod extends Item {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.block;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public class ItemBlockMod extends ItemBlock {
|
||||
|
||||
public ItemBlockMod(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("tile.", "tile." + LibResources.PREFIX_MOD);
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.item.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -24,7 +23,7 @@ public class ItemBlockPool extends ItemBlockWithMetadataAndName {
|
||||
public ItemBlockPool(Block par2Block) {
|
||||
super(par2Block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.block;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public class ItemBlockWithMetadataAndName extends ItemBlockWithMetadata {
|
||||
|
||||
public ItemBlockWithMetadataAndName(Block par2Block) {
|
||||
super(par2Block, par2Block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("tile.", "tile." + LibResources.PREFIX_MOD);
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
if(!player.isSneaking()) {
|
||||
int range = 6;
|
||||
double x = player.posX + 0.5;
|
||||
double y = player.posY -(player.worldObj.isRemote ? 1.62 : 0) + 0.75;
|
||||
double y = player.posY -(player.worldObj.isRemote ? 1.62 : 0) + 0.75;
|
||||
double z = player.posZ + 0.5;
|
||||
|
||||
List<EntityItem> items = player.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range, y + range, z + range));
|
||||
|
||||
@@ -11,13 +11,11 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
@@ -27,28 +25,28 @@ public class ItemMiningRing extends ItemBauble {
|
||||
public ItemMiningRing() {
|
||||
super(LibItemNames.MINING_RING);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||
super.onWornTick(stack, player);
|
||||
|
||||
|
||||
if(player instanceof EntityPlayer && !player.worldObj.isRemote) {
|
||||
int manaCost = 5;
|
||||
boolean hasMana = ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, false);
|
||||
if(!hasMana)
|
||||
if(!hasMana)
|
||||
onUnequipped(stack, player);
|
||||
else {
|
||||
if(player.getActivePotionEffect(Potion.digSpeed) != null)
|
||||
player.removePotionEffect(Potion.digSpeed.id);
|
||||
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, Integer.MAX_VALUE, 1, true));
|
||||
}
|
||||
|
||||
|
||||
if(player.swingProgress == 0.25F)
|
||||
ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, manaCost, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
PotionEffect effect = player.getActivePotionEffect(Potion.digSpeed);
|
||||
|
||||
@@ -26,11 +26,11 @@ public class ItemWaterRing extends ItemBauble {
|
||||
public ItemWaterRing() {
|
||||
super(LibItemNames.WATER_RING);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||
super.onWornTick(stack, player);
|
||||
|
||||
|
||||
if(player.isInsideOfMaterial(Material.water)) {
|
||||
double motionX = player.motionX * 1.2;
|
||||
double motionY = player.motionY * 1.2;
|
||||
@@ -46,28 +46,28 @@ public class ItemWaterRing extends ItemBauble {
|
||||
player.motionY = motionY;
|
||||
if(changeZ)
|
||||
player.motionZ = motionZ;
|
||||
|
||||
|
||||
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
|
||||
if(effect == null) {
|
||||
PotionEffect neweffect = new PotionEffect(Potion.nightVision.id, Integer.MAX_VALUE, -42, true);
|
||||
neweffect.setPotionDurationMax(true);
|
||||
player.addPotionEffect(neweffect);
|
||||
}
|
||||
|
||||
|
||||
if(player.getAir() == 1 && player instanceof EntityPlayer) {
|
||||
int mana = ManaItemHandler.requestMana(stack, (EntityPlayer) player, 300, true);
|
||||
player.setAir(mana);
|
||||
}
|
||||
} else onUnequipped(stack, player);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
|
||||
if(effect != null && effect.getAmplifier() == -42)
|
||||
player.removePotionEffect(Potion.nightVision.id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.RING;
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ItemManasteelAxe extends ItemAxe {
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ItemManasteelPick extends ItemPickaxe {
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ItemManasteelShears extends ItemShears {
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ItemManasteelShovel extends ItemSpade {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ItemManasteelSword extends ItemSword {
|
||||
public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedNameInefficiently(par1ItemStack).replaceAll("item.", "item." + LibResources.PREFIX_MOD);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
PotionEffect haste = player.getActivePotionEffect(Potion.digSpeed);
|
||||
float check = haste == null ? 0.16666667F : haste.getAmplifier() == 1 ? 0.5F : 0.4F;
|
||||
|
||||
|
||||
if(player.getCurrentEquippedItem() == par1ItemStack && player.swingProgress == check && !par2World.isRemote && par2World.rand.nextInt(2) == 0) {
|
||||
EntityManaBurst burst = getBurst(player, par1ItemStack);
|
||||
par2World.spawnEntityInWorld(burst);
|
||||
|
||||
@@ -245,7 +245,7 @@ public final class LexiconData {
|
||||
|
||||
dreadthorne = new BLexiconEntry(LibLexicon.FFLOWER_DREADTHORNE, categoryFunctionalFlowers);
|
||||
dreadthorne.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.dreadthorneRecipe));
|
||||
|
||||
|
||||
heiseiDream = new BLexiconEntry(LibLexicon.FFLOWER_HEISEI_DREAM, categoryFunctionalFlowers);
|
||||
heiseiDream.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.heiseiDreamRecipe));
|
||||
|
||||
@@ -278,13 +278,13 @@ public final class LexiconData {
|
||||
|
||||
hyacidus = new BLexiconEntry(LibLexicon.FFLOWER_HYACIDUS, categoryFunctionalFlowers);
|
||||
hyacidus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.hyacidusRecipe));
|
||||
|
||||
|
||||
pollidisiac = new BLexiconEntry(LibLexicon.FFLOWER_POLLIDISIAC, categoryFunctionalFlowers);
|
||||
pollidisiac.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.pollidisiacRecipe));
|
||||
|
||||
|
||||
clayconia = new BLexiconEntry(LibLexicon.FFLOWER_CLAYCONIA, categoryFunctionalFlowers);
|
||||
clayconia.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.clayconiaRecipe));
|
||||
|
||||
|
||||
// GENERATING FLOWERS ENTRIES
|
||||
generatingIntro = new BLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers);
|
||||
generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"));
|
||||
@@ -309,7 +309,7 @@ public final class LexiconData {
|
||||
|
||||
munchdew = new BLexiconEntry(LibLexicon.GFLOWER_MUNCHDEW, categoryGenerationFlowers);
|
||||
munchdew.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.munchdewRecipe));
|
||||
|
||||
|
||||
// DEVICES ENTRIES
|
||||
pistonRelay = new BLexiconEntry(LibLexicon.DEVICE_PISTON_RELAY, categoryDevices);
|
||||
pistonRelay.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe));
|
||||
@@ -340,7 +340,7 @@ public final class LexiconData {
|
||||
|
||||
forestDrum = new BLexiconEntry(LibLexicon.DEVICE_FOREST_DRUM, categoryDevices);
|
||||
forestDrum.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeForestDrum));
|
||||
|
||||
|
||||
// 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));
|
||||
@@ -398,13 +398,13 @@ public final class LexiconData {
|
||||
|
||||
waterRing = new BLexiconEntry(LibLexicon.BAUBLE_WATER_RING, categoryBaubles);
|
||||
waterRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeWaterRing));
|
||||
|
||||
|
||||
miningRing = new BLexiconEntry(LibLexicon.BAUBLE_MINING_RING, categoryBaubles);
|
||||
miningRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeMiningRing));
|
||||
|
||||
|
||||
magnetRing = new BLexiconEntry(LibLexicon.BAUBLE_MAGNET_RING, categoryBaubles);
|
||||
magnetRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeMagnetRing));
|
||||
|
||||
|
||||
// MISCLENAEOUS ENTRIES
|
||||
unstableBlocks = new BLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc);
|
||||
unstableBlocks.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_UNSTABLE_BLOCK), new PageCraftingRecipe("2", ModCrafingRecipes.recipesUnstableBlocks), new PageText("3"), new PageImage("4", LibResources.ENTRY_UNSTABLE_BEACON), new PageCraftingRecipe("5", ModCrafingRecipes.recipesManaBeacons), new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipesSignalFlares));
|
||||
@@ -412,7 +412,7 @@ public final class LexiconData {
|
||||
decorativeBlocks = new BLexiconEntry(LibLexicon.MISC_DECORATIVE_BLOCKS, categoryMisc);
|
||||
decorativeBlocks.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLivingrockDecor1), new PageCraftingRecipe("2", ModCrafingRecipes.recipeLivingrockDecor2), new PageCraftingRecipe("3", ModCrafingRecipes.recipeLivingrockDecor3), new PageCraftingRecipe("4", ModCrafingRecipes.recipeLivingrockDecor4),
|
||||
new PageCraftingRecipe("5", ModCrafingRecipes.recipeLivingwoodDecor1), new PageCraftingRecipe("6", ModCrafingRecipes.recipeLivingwoodDecor2), new PageCraftingRecipe("7", ModCrafingRecipes.recipeLivingwoodDecor3), new PageCraftingRecipe("8", ModCrafingRecipes.recipeLivingwoodDecor4), new PageCraftingRecipe("9", ModCrafingRecipes.recipeLivingwoodDecor5));
|
||||
|
||||
|
||||
dispenserTweaks = new BLexiconEntry(LibLexicon.MISC_DISPENSER_TWEAKS, categoryMisc);
|
||||
dispenserTweaks.setLexiconPages(new PageText("0"));
|
||||
}
|
||||
|
||||
@@ -16,11 +16,9 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -139,20 +137,18 @@ public class PageRecipe extends LexiconPage {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack, boolean accountForContainer) {
|
||||
RenderItem render = new RenderItem();
|
||||
TextureManager renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
boolean mouseDown = Mouse.isButtonDown(0);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
render.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, xPos, yPos);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
render.renderItemAndEffectIntoGUI(Minecraft.getMinecraft().fontRenderer, Minecraft.getMinecraft().getTextureManager(), stack, xPos, yPos);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) {
|
||||
tooltipStack = stack;
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.lib;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public final class LibBlockNames {
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.lib;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public final class LibItemNames {
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public final class LibObfuscation {
|
||||
|
||||
// ItemReed
|
||||
public static final String[] REED_ITEM = new String[] { "field_150935_a", "a" };
|
||||
|
||||
|
||||
// EntityAnimal
|
||||
public static final String[] IN_LOVE = new String[] { "inLove", "field_70881_d", "bp" };
|
||||
}
|
||||
Reference in new issue
Block a user