mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 00:37:57 +00:00
Le cleanup.
This commit is contained in:
1 parent
6d34e2a12f
commit
7dfe13e1e6
18 files changed
+61
-64
No files matched your search
@@ -12,7 +12,6 @@
|
||||
package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
|
||||
/**
|
||||
* A block that implements this has a flag for whether it can be moved by the Shard of Laputa.
|
||||
@@ -20,5 +19,5 @@ import vazkii.botania.api.internal.IManaBurst;
|
||||
public interface ILaputaImmobile {
|
||||
|
||||
public boolean canMove(World world, int x, int y, int z);
|
||||
|
||||
|
||||
}
|
||||
@@ -27,5 +27,5 @@ public final class TooltipHandler {
|
||||
event.toolTip.add(StatCollector.translateToLocal("botaniamisc.coarseDirt1"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class ClientProxy extends CommonProxy {
|
||||
if(ConfigHandler.boundBlockWireframe)
|
||||
MinecraftForge.EVENT_BUS.register(new BoundTileRenderer());
|
||||
MinecraftForge.EVENT_BUS.register(new TooltipHandler());
|
||||
|
||||
|
||||
if(ConfigHandler.versionCheckEnabled)
|
||||
new VersionChecker().init();
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
IIcon iconBottom;
|
||||
IIcon iconSideCraft;
|
||||
IIcon iconBottomCraft;
|
||||
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
|
||||
|
||||
public BlockOpenCrate() {
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
@@ -54,7 +54,7 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
@@ -66,12 +66,12 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
iconSide = IconHelper.forBlock(par1IconRegister, this, 0);
|
||||
|
||||
@@ -25,15 +25,13 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_COOLDOWN = "cooldown";
|
||||
private static final String TAG_STORED_MANA = "storedMana";
|
||||
|
||||
int cooldown = 0;
|
||||
int storedMana = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(cooldown > 0)
|
||||
cooldown--;
|
||||
if(cooldown == 0 && !supertile.getWorldObj().isRemote) {
|
||||
@@ -50,43 +48,43 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
if(stack != null && stack.getItem() instanceof ItemFood) {
|
||||
if(cooldown == 0) {
|
||||
int val = ((ItemFood) stack.getItem()).func_150905_g(stack);
|
||||
storedMana = (val * val) * 18;
|
||||
storedMana = val * val * 18;
|
||||
cooldown = val * 10;
|
||||
sync();
|
||||
}
|
||||
|
||||
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
cmp.setInteger(TAG_COOLDOWN, cooldown);
|
||||
cmp.setInteger(TAG_COOLDOWN, cooldown);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
cooldown = cmp.getInteger(TAG_COOLDOWN);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 2400;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xD3D604;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.gourmaryllis;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,13 +13,13 @@ package vazkii.botania.common.block.tile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class TileCraftCrate extends TileOpenCrate {
|
||||
|
||||
@@ -27,27 +27,27 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
public int getSizeInventory() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return i != 9;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote && craft(true) && canEject())
|
||||
ejectAll();
|
||||
}
|
||||
|
||||
|
||||
boolean craft(boolean fullCheck) {
|
||||
if(fullCheck && !isFull())
|
||||
return false;
|
||||
|
||||
|
||||
InventoryCrafting craft = new InventoryCrafting(new Container() {
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer p_75145_1_) {
|
||||
@@ -56,32 +56,32 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
}, 3, 3);
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack stack = getStackInSlot(i);
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == ModItems.manaResource && stack.getItemDamage() == 11)
|
||||
continue;
|
||||
|
||||
|
||||
craft.setInventorySlotContents(i, stack.copy());
|
||||
}
|
||||
|
||||
|
||||
List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
|
||||
for(IRecipe recipe : recipes)
|
||||
if(recipe.matches(craft, worldObj)) {
|
||||
setInventorySlotContents(9, recipe.getCraftingResult(craft));
|
||||
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack stack = getStackInSlot(i);
|
||||
if(stack == null)
|
||||
continue;
|
||||
|
||||
|
||||
ItemStack container = stack.getItem().getContainerItem(stack);
|
||||
setInventorySlotContents(i, container);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
boolean isFull() {
|
||||
for(int i = 0; i < 9; i++)
|
||||
if(getStackInSlot(i) == null)
|
||||
@@ -89,7 +89,7 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void ejectAll() {
|
||||
for(int i = 0; i < getSizeInventory(); i++) {
|
||||
ItemStack stack = getStackInSlot(i);
|
||||
@@ -98,7 +98,7 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
setInventorySlotContents(i, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onWanded(EntityPlayer player, ItemStack stack) {
|
||||
craft(false);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
eject(stack, redstone);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean canEject() {
|
||||
Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
|
||||
return blockBelow.isAir(worldObj, xCoord, yCoord - 1, zCoord);
|
||||
@@ -64,8 +64,8 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
if(!worldObj.isRemote)
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean onWanded(EntityPlayer player, ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked {
|
||||
}
|
||||
|
||||
public boolean collideEntityItem(EntityItem item) {
|
||||
if(item.isDead || (item.age > 100 && item.age < 130))
|
||||
if(item.isDead || item.age > 100 && item.age < 130)
|
||||
return false;
|
||||
|
||||
boolean didChange = false;
|
||||
@@ -157,7 +157,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.levelup", 0.25F, 4F);
|
||||
soundTicks = 10;
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < 25; i++) {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
@@ -173,7 +173,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked {
|
||||
|
||||
if(soundTicks > 0)
|
||||
soundTicks--;
|
||||
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
double particleChance = 1F - (double) getCurrentMana() / (double) MAX_MANA * 0.1;
|
||||
Color color = new Color(0x00C6FF);
|
||||
@@ -208,7 +208,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked {
|
||||
}
|
||||
} else {
|
||||
if(canAccept) {
|
||||
if(mana.getMana(stack) > 0 && !this.isFull())
|
||||
if(mana.getMana(stack) > 0 && !isFull())
|
||||
didSomething = true;
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class InventoryHelper {
|
||||
if(targetStack == null) {
|
||||
int space = targetInventory.getInventoryStackLimit();
|
||||
int mergeAmount = Math.min(space, stack.stackSize);
|
||||
|
||||
|
||||
ItemStack copy = stack.copy();
|
||||
copy.stackSize = mergeAmount;
|
||||
targetInventory.setInventorySlotContents(slot, copy);
|
||||
@@ -48,7 +48,7 @@ public class InventoryHelper {
|
||||
if(targetInventory.isItemValidForSlot(slot, stack) && areMergeCandidates(stack, targetStack)) {
|
||||
int space = Math.min(targetInventory.getInventoryStackLimit(), targetStack.getMaxStackSize()) - targetStack.stackSize;
|
||||
int mergeAmount = Math.min(space, stack.stackSize);
|
||||
|
||||
|
||||
ItemStack copy = targetStack.copy();
|
||||
copy.stackSize += mergeAmount;
|
||||
targetInventory.setInventorySlotContents(slot, copy);
|
||||
|
||||
@@ -171,7 +171,7 @@ public final class ModCrafingRecipes {
|
||||
public static IRecipe recipeSpawnerClaw;
|
||||
public static IRecipe recipeCraftCrate;
|
||||
public static IRecipe recipePlaceholder;
|
||||
|
||||
|
||||
public static void init() {
|
||||
// Lexicon Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.lexicon), "treeSapling", Items.book);
|
||||
@@ -1046,11 +1046,11 @@ public final class ModCrafingRecipes {
|
||||
'C', new ItemStack(Blocks.crafting_table),
|
||||
'W', new ItemStack(ModBlocks.dreamwood, 1, 1));
|
||||
recipeCraftCrate = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Crafting Placeholder Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 32, 11), new ItemStack(Blocks.crafting_table), LibOreDict.LIVING_ROCK);
|
||||
recipePlaceholder = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Mana and Terrasteel Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -116,7 +116,7 @@ public final class ModManaAlchemyRecipes {
|
||||
|
||||
sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Blocks.cobblestone), 50);
|
||||
coarseDirtRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.dirt, 1, 1), new ItemStack(Blocks.dirt), 120);
|
||||
|
||||
|
||||
prismarineRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.manaResource, 1, 10), new ItemStack(Items.quartz), 200);
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public final class ModPetalRecipes {
|
||||
entropinnyumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENTROPINNYUM), red, redMana, gray, grayMana, white, whiteMana, runeWrath, runeFire);
|
||||
kekimurusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_KEKIMURUS), white, whiteMana, orangeMana, brownMana, brownMana, orange, runeGluttony);
|
||||
gourmaryllisRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_GOURMARYLLIS), lightGray, lightGrayMana, yellowMana, yellow, yellowMana, red, runeFire, runeSummer);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
@@ -387,14 +387,14 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
ChunkCoordinates coords = burst.getBurstSourceChunkCoordinates();
|
||||
if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit);
|
||||
|
||||
|
||||
int x = pos.blockX + dir.offsetX;
|
||||
int y = pos.blockY + dir.offsetY;
|
||||
int z = pos.blockZ + dir.offsetZ;
|
||||
|
||||
|
||||
Block blockAt = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
Block blockAt_ = entity.worldObj.getBlock(x, y, z);
|
||||
|
||||
|
||||
if(blockAt == Blocks.portal)
|
||||
entity.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.air);
|
||||
else if(blockAt_.isAir(entity.worldObj, x, y, z) || blockAt_.isReplaceable(entity.worldObj, x, y, z))
|
||||
|
||||
@@ -95,8 +95,8 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
int meta = stack.getItemDamage();
|
||||
return meta == 7 || meta == 8 || meta == 9;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack) {
|
||||
return itemStack.getItemDamage() == 11 ? itemStack.copy() : null;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
AxisAlignedBB axis = par3World.getBlock(par4, par5, par6).getCollisionBoundingBoxFromPool(par3World, par4, par5, par6);
|
||||
if(axis == null)
|
||||
axis = AxisAlignedBB.getBoundingBox(par4, par5, par6, par4 + 1, par5 + 1, par6 + 1);
|
||||
|
||||
|
||||
if(!blockVec.isInside(axis))
|
||||
blockVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2);
|
||||
|
||||
|
||||
@@ -60,12 +60,12 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
|
||||
double x = event.entityLiving.posX - 0.5;
|
||||
double y = event.entityLiving.posY - 1.7;
|
||||
double z = event.entityLiving.posZ - 0.5;
|
||||
|
||||
String name = player.getGameProfile().getName();
|
||||
|
||||
String name = player.getGameProfile().getName();
|
||||
float r = 1F;
|
||||
float g = 1F;
|
||||
float b = 1F;
|
||||
|
||||
|
||||
if(name.equals("Vazkii"))
|
||||
g = 1F - ((float) Math.random() * 0.75F + 0.25F);
|
||||
else if(name.equals("Nemsun")) {
|
||||
@@ -73,7 +73,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem {
|
||||
g = (float) Math.random();
|
||||
b = (float) Math.random();
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
Botania.proxy.sparkleFX(event.entityLiving.worldObj, x + Math.random() * event.entityLiving.width, y + Math.random() * 0.4, z + Math.random() * event.entityLiving.width, r, g, b, 2F * (float) Math.random(), 20);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry loonium;
|
||||
public static LexiconEntry daffomill;
|
||||
public static LexiconEntry vinculotus;
|
||||
|
||||
|
||||
public static LexiconEntry generatingIntro;
|
||||
public static LexiconEntry daybloom;
|
||||
public static LexiconEntry nightshade;
|
||||
@@ -359,7 +359,7 @@ public final class LexiconData {
|
||||
|
||||
gourmaryllis = new BLexiconEntry(LibLexicon.GFLOWER_GOURMARYLLIS, categoryGenerationFlowers);
|
||||
gourmaryllis.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PagePetalRecipe("3", ModPetalRecipes.gourmaryllisRecipe));
|
||||
|
||||
|
||||
// DEVICES ENTRIES
|
||||
pistonRelay = new BLexiconEntry(LibLexicon.DEVICE_PISTON_RELAY, categoryDevices);
|
||||
pistonRelay.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe));
|
||||
@@ -410,7 +410,7 @@ public final class LexiconData {
|
||||
|
||||
craftCrate = new ALexiconEntry(LibLexicon.DEVICE_CRAFT_CRATE, categoryDevices);
|
||||
craftCrate.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipePlaceholder), new PageText("3"), new PageText("4"), new PageImage("5", LibResources.ENTRY_CRAFT_CRATE), new PageCraftingRecipe("6", ModCrafingRecipes.recipeCraftCrate));
|
||||
|
||||
|
||||
// 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));
|
||||
|
||||
@@ -79,7 +79,7 @@ public final class LibLexicon {
|
||||
public static final String GFLOWER_ENTROPINNYUM = "entropinnyum";
|
||||
public static final String GFLOWER_KEKIMURUS = "kekimurus";
|
||||
public static final String GFLOWER_GOURMARYLLIS = "gourmaryllis";
|
||||
|
||||
|
||||
public static final String DEVICE_PISTON_RELAY = "pistonRelay";
|
||||
public static final String DEVICE_PYLON = "pylon";
|
||||
public static final String DEVICE_MANA_ENCHANTING = "manaEnchanting";
|
||||
|
||||
Reference in new issue
Block a user