mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Some polish on the Petal Apothecary.
This commit is contained in:
1 parent
e41e49a3f3
commit
63a680595d
2 files changed
+40
-5
No files matched your search
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -18,6 +19,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
@@ -62,6 +64,11 @@ public class BlockAltar extends BlockModContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
return Block.cobblestone.getIcon(par1, par2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
|
||||
@@ -13,18 +13,19 @@ package vazkii.botania.common.block.tile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.RecipePetals;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
|
||||
@@ -61,9 +62,6 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
} else if(stack.itemID == Item.seeds.itemID) {
|
||||
for(RecipePetals recipe : BotaniaAPI.petalRecipes) {
|
||||
if(recipe.matches(this)) {
|
||||
ItemStack output = recipe.getOutput().copy();
|
||||
EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output);
|
||||
worldObj.spawnEntityInWorld(outputItem);
|
||||
for(int i = 0; i < getSizeInventory(); i++)
|
||||
setInventorySlotContents(i, null);
|
||||
|
||||
@@ -71,8 +69,14 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
item.setDead();
|
||||
|
||||
ItemStack output = recipe.getOutput().copy();
|
||||
EntityItem outputItem = new EntityItem(worldObj, xCoord + 0.5, yCoord + 1.5, zCoord + 0.5, output);
|
||||
worldObj.spawnEntityInWorld(outputItem);
|
||||
}
|
||||
|
||||
craftingFanciness();
|
||||
hasWater = false;
|
||||
didChange = true;
|
||||
break;
|
||||
}
|
||||
@@ -82,6 +86,16 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
return didChange;
|
||||
}
|
||||
|
||||
public void craftingFanciness() {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.levelup", 1F, 1F);
|
||||
for(int i = 0; i < 25; i++) {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
float blue = (float) Math.random();
|
||||
Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + (Math.random() * 0.4) - 0.2, yCoord + 1, zCoord + 0.5 + (Math.random() * 0.4) - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + (1D / 16D * 20D), zCoord, xCoord + 1, yCoord + (1D / 16D * 21D), zCoord + 1));
|
||||
@@ -93,6 +107,20 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
|
||||
if(didChange)
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
|
||||
for(int i = 0; i < getSizeInventory(); i++) {
|
||||
ItemStack stackAt = getStackInSlot(i);
|
||||
if(stackAt == null)
|
||||
break;
|
||||
|
||||
if(Math.random() >= 0.97) {
|
||||
float[] color = EntitySheep.fleeceColorTable[stackAt.getItemDamage()];
|
||||
float red = color[0];
|
||||
float green = color[1];
|
||||
float blue = color[2];
|
||||
Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + (Math.random() * 0.4) - 0.2, yCoord + 1, zCoord + 0.5 + (Math.random() * 0.4) - 0.2, red, green, blue, (float) Math.random(), 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user