mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 05:02:30 +00:00
1.7 update: All compile errors fixed, now to fix the mod itself.
This commit is contained in:
1 parent
6685fa0260
commit
048e59e825
117 files changed
+925
-1225
No files matched your search
@@ -13,11 +13,11 @@ package vazkii.botania.api.internal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
@@ -82,12 +82,12 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
|
||||
@Override
|
||||
public ItemStack getSubTileAsStack(String subTile) {
|
||||
return new ItemStack(1, 0, 0);
|
||||
return new ItemStack(Blocks.stone, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getSubTileIconForName(String name) {
|
||||
return Block.plantRed.getIcon(0, 0);
|
||||
public IIcon getSubTileIconForName(String name) {
|
||||
return Blocks.red_flower.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
@@ -58,7 +58,7 @@ public interface IInternalMethodHandler {
|
||||
|
||||
public ItemStack getSubTileAsStack(String subTile);
|
||||
|
||||
public Icon getSubTileIconForName(String name);
|
||||
public IIcon getSubTileIconForName(String name);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res);
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class LexiconRecipeMappings {
|
||||
if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider)
|
||||
return ((IRecipeKeyProvider) stack.getItem()).getKey(stack);
|
||||
|
||||
return stack.itemID + ":" + stack.getItemDamage();
|
||||
return stack.getUnlocalizedName() + "~" + stack.getItemDamage();
|
||||
}
|
||||
|
||||
public static class EntryData {
|
||||
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.api.mana;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.Event;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
|
||||
public class ManaNetworkEvent extends Event {
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RecipePetals {
|
||||
}
|
||||
|
||||
boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) {
|
||||
return stack.itemID == stack2.itemID && stack.getItemDamage() == stack2.getItemDamage();
|
||||
return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage();
|
||||
}
|
||||
|
||||
public List<Object> getInputs() {
|
||||
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -60,6 +60,10 @@ public class SubTileEntity {
|
||||
*/
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) { }
|
||||
|
||||
public void sync() {
|
||||
supertile.getWorldObj().markBlockForUpdate(supertile.xCoord, supertile.yCoord, supertile.zCoord);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return BotaniaAPI.getSubTileStringMapping(getClass());
|
||||
}
|
||||
@@ -68,9 +72,8 @@ public class SubTileEntity {
|
||||
* Gets the icon for this SubTileEntity, this is a block icon.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon() {
|
||||
Icon icon = BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName());
|
||||
return icon;
|
||||
public IIcon getIcon() {
|
||||
return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,11 +64,11 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
addMana(manaToRemove);
|
||||
}
|
||||
|
||||
if(supertile.worldObj.isRemote) {
|
||||
if(supertile.getWorldObj().isRemote) {
|
||||
double particleChance = 1F - (double) mana / (double) getMaxMana() / 2F;
|
||||
Color color = new Color(getColor());
|
||||
if(Math.random() > particleChance)
|
||||
BotaniaAPI.internalHandler.sparkleFX(supertile.worldObj, supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
needsNew = true;
|
||||
|
||||
if(cachedPoolCoordinates != null) {
|
||||
TileEntity tileAt = supertile.worldObj.getBlockTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ);
|
||||
TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ);
|
||||
if(tileAt != null && tileAt instanceof IManaPool) {
|
||||
linkedPool = tileAt;
|
||||
needsNew = false;
|
||||
@@ -90,7 +90,7 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
}
|
||||
|
||||
if(!needsNew) {
|
||||
TileEntity tileAt = supertile.worldObj.getBlockTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord);
|
||||
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord);
|
||||
if(!(tileAt instanceof IManaPool)) {
|
||||
linkedPool = null;
|
||||
needsNew = true;
|
||||
@@ -99,10 +99,10 @@ public class SubTileFunctional extends SubTileEntity {
|
||||
|
||||
if(needsNew) {
|
||||
IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance();
|
||||
int size = network.getAllPoolsInWorld(supertile.worldObj.provider.dimensionId).size();
|
||||
int size = network.getAllPoolsInWorld(supertile.getWorldObj().provider.dimensionId).size();
|
||||
if(size != sizeLastCheck) {
|
||||
ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord);
|
||||
linkedPool = network.getClosestPool(coords, supertile.worldObj.provider.dimensionId, range);
|
||||
linkedPool = network.getClosestPool(coords, supertile.getWorldObj().provider.dimensionId, range);
|
||||
sizeLastCheck = size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
import vazkii.botania.api.mana.IManaCollector;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
/**
|
||||
* The basic class for a Generating Flower.
|
||||
@@ -58,19 +57,19 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
|
||||
if(canGeneratePassively()) {
|
||||
int delay = getDelayBetweenPassiveGeneration();
|
||||
if(delay > 0 && supertile.worldObj.getWorldTime() % delay == 0) {
|
||||
if(delay > 0 && supertile.getWorldObj().getWorldTime() % delay == 0) {
|
||||
if(shouldSyncPassiveGeneration())
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
addMana(getValueForPassiveGeneration());
|
||||
}
|
||||
emptyManaIntoCollector();
|
||||
}
|
||||
|
||||
if(supertile.worldObj.isRemote) {
|
||||
if(supertile.getWorldObj().isRemote) {
|
||||
double particleChance = 1F - (double) mana / (double) getMaxMana() / 2F;
|
||||
Color color = new Color(getColor());
|
||||
if(Math.random() > particleChance)
|
||||
BotaniaAPI.internalHandler.sparkleFX(supertile.worldObj, supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
needsNew = true;
|
||||
|
||||
if(cachedCollectorCoordinates != null) {
|
||||
TileEntity tileAt = supertile.worldObj.getBlockTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ);
|
||||
TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ);
|
||||
if(tileAt != null && tileAt instanceof IManaCollector) {
|
||||
linkedCollector = tileAt;
|
||||
needsNew = false;
|
||||
@@ -92,7 +91,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
}
|
||||
|
||||
if(!needsNew) {
|
||||
TileEntity tileAt = supertile.worldObj.getBlockTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
|
||||
TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord);
|
||||
if(!(tileAt instanceof IManaCollector)) {
|
||||
linkedCollector = null;
|
||||
needsNew = true;
|
||||
@@ -101,10 +100,10 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
|
||||
if(needsNew) {
|
||||
IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance();
|
||||
int size = network.getAllCollectorsInWorld(supertile.worldObj.provider.dimensionId).size();
|
||||
int size = network.getAllCollectorsInWorld(supertile.getWorldObj().provider.dimensionId).size();
|
||||
if(size != sizeLastCheck) {
|
||||
ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord);
|
||||
linkedCollector = network.getClosestCollector(coords, supertile.worldObj.provider.dimensionId, range);
|
||||
linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj().provider.dimensionId, range);
|
||||
sizeLastCheck = size;
|
||||
}
|
||||
}
|
||||
@@ -129,8 +128,8 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
}
|
||||
|
||||
public boolean canGeneratePassively() {
|
||||
boolean rain = supertile.worldObj.getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.worldObj.isRaining() || supertile.worldObj.isThundering());
|
||||
return !supertile.worldObj.isRemote && supertile.worldObj.isDaytime() && !rain && supertile.worldObj.canBlockSeeTheSky(supertile.xCoord, supertile.yCoord + 1, supertile.zCoord);
|
||||
boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering());
|
||||
return !supertile.getWorldObj().isRemote && supertile.getWorldObj().isDaytime() && !rain && supertile.getWorldObj().canBlockSeeTheSky(supertile.xCoord, supertile.yCoord + 1, supertile.zCoord);
|
||||
}
|
||||
|
||||
public int getDelayBetweenPassiveGeneration() {
|
||||
@@ -144,7 +143,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
@Override
|
||||
public boolean onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(!player.worldObj.isRemote)
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
|
||||
knownMana = mana;
|
||||
player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1F);
|
||||
|
||||
@@ -25,16 +25,16 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.ITileBound;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public final class BoundTileRenderer {
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onWorldRenderLast(RenderWorldLastEvent event) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
@@ -49,7 +49,7 @@ public final class BoundTileRenderer {
|
||||
if(stack != null && stack.getItem() instanceof ItemTwigWand) {
|
||||
MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver;
|
||||
if(pos != null) {
|
||||
TileEntity tile = world.getBlockTileEntity(pos.blockX, pos.blockY, pos.blockZ);
|
||||
TileEntity tile = world.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(tile != null && tile instanceof ITileBound) {
|
||||
ChunkCoordinates coords = ((ITileBound) tile).getBinding();
|
||||
if(coords != null)
|
||||
@@ -71,7 +71,7 @@ public final class BoundTileRenderer {
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255);
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
Block block = Block.blocksList[world.getBlockId(pos.posX, pos.posY, pos.posZ)];
|
||||
Block block = world.getBlock(pos.posX, pos.posY, pos.posZ);
|
||||
if(block != null) {
|
||||
AxisAlignedBB axis = block.getSelectedBoundingBoxFromPool(world, pos.posX, pos.posY, pos.posZ);
|
||||
axis.minX -= pos.posX;
|
||||
|
||||
@@ -20,11 +20,11 @@ import javax.imageio.ImageIO;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.ThreadDownloadImageData;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class CapeHandler {
|
||||
@@ -37,12 +37,12 @@ public class CapeHandler {
|
||||
instance = this;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onPreRenderSpecials (RenderPlayerEvent.Specials.Pre event) {
|
||||
if(Loader.isModLoaded("shadersmod"))
|
||||
return;
|
||||
|
||||
if(event.entityPlayer instanceof AbstractClientPlayer && (event.entityPlayer.username.equals("Vazkii") || event.entityPlayer.username.equals("Lizbeth"))) {
|
||||
if(event.entityPlayer instanceof AbstractClientPlayer && (event.entityPlayer.getCommandSenderName().equals("Vazkii"))) {
|
||||
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer;
|
||||
|
||||
if (!capePlayers.contains(abstractClientPlayer)) {
|
||||
|
||||
@@ -26,55 +26,54 @@ import vazkii.botania.client.gui.GuiLexicon;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Type;
|
||||
|
||||
public class ClientTickHandler implements ITickHandler {
|
||||
public class ClientTickHandler {
|
||||
|
||||
public static int ticksWithLexicaOpen = 0;
|
||||
public static int pageFlipTicks = 0;
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData) {
|
||||
// NO-OP
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void tickEnd(ClientTickEvent event) {
|
||||
if(event.phase == Phase.END && event.type == Type.CLIENT) {
|
||||
LightningBolt.update();
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
|
||||
LightningBolt.update();
|
||||
if(Minecraft.getMinecraft().theWorld == null)
|
||||
ManaNetworkHandler.instance.clear();
|
||||
|
||||
if(Minecraft.getMinecraft().theWorld == null)
|
||||
ManaNetworkHandler.instance.clear();
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(gui == null || !gui.doesGuiPauseGame()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if(player != null) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() instanceof ItemTwigWand) {
|
||||
List<TileEntity> list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld.provider.dimensionId));
|
||||
for(TileEntity tile : list) {
|
||||
if(tile instanceof IManaCollector)
|
||||
((IManaCollector) tile).onClientDisplayTick();
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if(gui == null || !gui.doesGuiPauseGame()) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if(player != null) {
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack != null && stack.getItem() instanceof ItemTwigWand) {
|
||||
List<TileEntity> list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld.provider.dimensionId));
|
||||
for(TileEntity tile : list) {
|
||||
if(tile instanceof IManaCollector)
|
||||
((IManaCollector) tile).onClientDisplayTick();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ticksToOpen = 10;
|
||||
if(gui instanceof GuiLexicon) {
|
||||
if(ticksWithLexicaOpen < 0)
|
||||
ticksWithLexicaOpen = 0;
|
||||
if(ticksWithLexicaOpen < ticksToOpen)
|
||||
ticksWithLexicaOpen++;
|
||||
if(pageFlipTicks > 0)
|
||||
pageFlipTicks--;
|
||||
} else {
|
||||
pageFlipTicks = 0;
|
||||
if(ticksWithLexicaOpen > 0) {
|
||||
if(ticksWithLexicaOpen > ticksToOpen)
|
||||
ticksWithLexicaOpen = ticksToOpen;
|
||||
ticksWithLexicaOpen--;
|
||||
int ticksToOpen = 10;
|
||||
if(gui instanceof GuiLexicon) {
|
||||
if(ticksWithLexicaOpen < 0)
|
||||
ticksWithLexicaOpen = 0;
|
||||
if(ticksWithLexicaOpen < ticksToOpen)
|
||||
ticksWithLexicaOpen++;
|
||||
if(pageFlipTicks > 0)
|
||||
pageFlipTicks--;
|
||||
} else {
|
||||
pageFlipTicks = 0;
|
||||
if(ticksWithLexicaOpen > 0) {
|
||||
if(ticksWithLexicaOpen > ticksToOpen)
|
||||
ticksWithLexicaOpen = ticksToOpen;
|
||||
ticksWithLexicaOpen--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,14 +83,4 @@ public class ClientTickHandler implements ITickHandler {
|
||||
pageFlipTicks = 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks() {
|
||||
return EnumSet.of(TickType.CLIENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return LibMisc.MOD_ID;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -33,27 +32,28 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.RenderHelper;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public final class HUDHandler {
|
||||
|
||||
private static final ResourceLocation manaBar = new ResourceLocation(LibResources.GUI_MANA_HUD);
|
||||
private static final RenderItem itemRender = new RenderItem();
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onDrawScreen(RenderGameOverlayEvent.Post event) {
|
||||
if(event.type == ElementType.ALL) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
MovingObjectPosition pos = mc.objectMouseOver;
|
||||
if(pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().itemID == ModItems.twigWand.itemID) {
|
||||
int id = mc.theWorld.getBlockId(pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(Block.blocksList[id] != null && Block.blocksList[id] instanceof IWandHUD)
|
||||
((IWandHUD) Block.blocksList[id]).renderHUD(mc, event.resolution, mc.theWorld, pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() == ModItems.twigWand) {
|
||||
Block block = mc.theWorld.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(block instanceof IWandHUD)
|
||||
((IWandHUD) block).renderHUD(mc, event.resolution, mc.theWorld, pos.blockX, pos.blockY, pos.blockZ);
|
||||
}
|
||||
|
||||
else if(pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().itemID == ModItems.lexicon.itemID) {
|
||||
int id = mc.theWorld.getBlockId(pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(Block.blocksList[id] != null && Block.blocksList[id] instanceof ILexiconable) {
|
||||
LexiconEntry entry = ((ILexiconable) Block.blocksList[id]).getEntry(mc.theWorld, pos.blockX, pos.blockY, pos.blockZ, mc.thePlayer, mc.thePlayer.getCurrentEquippedItem());
|
||||
else if(pos != null && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() == ModItems.lexicon) {
|
||||
Block block = mc.theWorld.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(block instanceof ILexiconable) {
|
||||
LexiconEntry entry = ((ILexiconable) block).getEntry(mc.theWorld, pos.blockX, pos.blockY, pos.blockZ, mc.thePlayer, mc.thePlayer.getCurrentEquippedItem());
|
||||
if(entry != null)
|
||||
drawLexiconGUI(entry, event.resolution);
|
||||
}
|
||||
|
||||
@@ -28,15 +28,14 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.client.core.handler.LightningHandler.LightningBolt.Segment;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
@@ -55,7 +54,7 @@ public class LightningHandler {
|
||||
return new Vector3((float) renderEntity.posX - pos.x, (float) renderEntity.posY + renderEntity.getEyeHeight() - pos.y, (float) renderEntity.posZ - pos.z);
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onRenderWorldLast(RenderWorldLastEvent event) {
|
||||
float frame = event.partialTicks;
|
||||
Entity entity = Minecraft.getMinecraft().thePlayer;
|
||||
@@ -394,18 +393,18 @@ public class LightningHandler {
|
||||
}
|
||||
|
||||
private float rayTraceResistance(Vector3 start, Vector3 end, float prevresistance) {
|
||||
MovingObjectPosition mop = world.clip(start.toVec3D(), end.toVec3D());
|
||||
MovingObjectPosition mop = world.rayTraceBlocks(start.toVec3D(), end.toVec3D());
|
||||
|
||||
if(mop == null)
|
||||
return prevresistance;
|
||||
|
||||
if(mop.typeOfHit == EnumMovingObjectType.TILE) {
|
||||
int blockID = world.getBlockId(mop.blockX, mop.blockY, mop.blockZ);
|
||||
if(mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
||||
Block block = world.getBlock(mop.blockX, mop.blockY, mop.blockZ);
|
||||
|
||||
if(world.isAirBlock(mop.blockX, mop.blockY, mop.blockZ))
|
||||
return prevresistance;
|
||||
|
||||
return prevresistance + (Block.blocksList[blockID].getExplosionResistance(source) + 0.3F);
|
||||
return prevresistance + block.getExplosionResistance(source) + 0.3F;
|
||||
} else return prevresistance;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,48 +12,43 @@
|
||||
package vazkii.botania.client.core.helper;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public final class IconHelper {
|
||||
|
||||
private static Icon emptyTexture;
|
||||
|
||||
public static Icon forName(IconRegister ir, String name) {
|
||||
public static IIcon forName(IIconRegister ir, String name) {
|
||||
return ir.registerIcon(LibResources.PREFIX_MOD + name);
|
||||
}
|
||||
|
||||
public static Icon forNameRaw(IconRegister ir, String name) {
|
||||
public static IIcon forNameRaw(IIconRegister ir, String name) {
|
||||
return ir.registerIcon(name);
|
||||
}
|
||||
|
||||
public static Icon emptyTexture(IconRegister ir) {
|
||||
return emptyTexture == null ? (emptyTexture = forName(ir, LibResources.EMTPY_TEXTURE)) : emptyTexture;
|
||||
}
|
||||
|
||||
public static Icon forBlock(IconRegister ir, Block block) {
|
||||
public static IIcon forBlock(IIconRegister ir, Block block) {
|
||||
return forNameRaw(ir, block.getUnlocalizedName().replaceAll("tile.", ""));
|
||||
}
|
||||
|
||||
public static Icon forBlock(IconRegister ir, Block block, int i) {
|
||||
public static IIcon forBlock(IIconRegister ir, Block block, int i) {
|
||||
return forBlock(ir, block, Integer.toString(i));
|
||||
}
|
||||
|
||||
public static Icon forBlock(IconRegister ir, Block block, String s) {
|
||||
public static IIcon forBlock(IIconRegister ir, Block block, String s) {
|
||||
return forNameRaw(ir, block.getUnlocalizedName().replaceAll("tile.", "") + s);
|
||||
}
|
||||
|
||||
public static Icon forItem(IconRegister ir, Item item) {
|
||||
public static IIcon forItem(IIconRegister ir, Item item) {
|
||||
return forNameRaw(ir, item.getUnlocalizedName().replaceAll("item.", ""));
|
||||
}
|
||||
|
||||
public static Icon forItem(IconRegister ir, Item item, int i) {
|
||||
public static IIcon forItem(IIconRegister ir, Item item, int i) {
|
||||
return forItem(ir, item, Integer.toString(i));
|
||||
}
|
||||
|
||||
public static Icon forItem(IconRegister ir, Item item, String s) {
|
||||
public static IIcon forItem(IIconRegister ir, Item item, String s) {
|
||||
return forNameRaw(ir, item.getUnlocalizedName().replaceAll("item.", "") + s);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ import vazkii.botania.common.item.ModItems;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@@ -62,8 +61,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
|
||||
TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new ClientTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new HUDHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new LightningHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new CapeHandler());
|
||||
@@ -86,9 +84,9 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderPool());
|
||||
RenderingRegistry.registerBlockHandler(new RenderPylon());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.lens.itemID, new RenderLens());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens());
|
||||
if(ConfigHandler.lexicon3dModel)
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.lexicon.itemID, new RenderLexicon());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.lexicon, new RenderLexicon());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderTileAltar());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSpreader.class, new RenderTileSpreader());
|
||||
|
||||
@@ -126,7 +126,6 @@ public class FXSparkle extends EntityFX {
|
||||
particleGravity = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean pushOutOfBlocks(double par1, double par3, double par5) {
|
||||
int var7 = MathHelper.floor_double(par1);
|
||||
int var8 = MathHelper.floor_double(par3);
|
||||
@@ -136,12 +135,12 @@ public class FXSparkle extends EntityFX {
|
||||
double var14 = par5 - var9;
|
||||
|
||||
if (!worldObj.isAirBlock(var7, var8, var9)) {
|
||||
boolean var16 = !worldObj.isBlockNormalCube(var7 - 1, var8, var9);
|
||||
boolean var17 = !worldObj.isBlockNormalCube(var7 + 1, var8, var9);
|
||||
boolean var18 = !worldObj.isBlockNormalCube(var7, var8 - 1, var9);
|
||||
boolean var19 = !worldObj.isBlockNormalCube(var7, var8 + 1, var9);
|
||||
boolean var20 = !worldObj.isBlockNormalCube(var7, var8, var9 - 1);
|
||||
boolean var21 = !worldObj.isBlockNormalCube(var7, var8, var9 + 1);
|
||||
boolean var16 = !worldObj.isBlockNormalCubeDefault(var7 - 1, var8, var9, false);
|
||||
boolean var17 = !worldObj.isBlockNormalCubeDefault(var7 + 1, var8, var9, false);
|
||||
boolean var18 = !worldObj.isBlockNormalCubeDefault(var7, var8 - 1, var9, false);
|
||||
boolean var19 = !worldObj.isBlockNormalCubeDefault(var7, var8 + 1, var9, false);
|
||||
boolean var20 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 - 1, false);
|
||||
boolean var21 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 + 1, false);
|
||||
byte var22 = -1;
|
||||
double var23 = 9999.0D;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
drawTexturedModalRect(left, top, 0, 0, guiWidth, guiHeight);
|
||||
drawCenteredString(fontRenderer, getTitle(), left + guiWidth / 2, top - 12, 0x00FF00);
|
||||
drawCenteredString(fontRendererObj, getTitle(), left + guiWidth / 2, top - 12, 0x00FF00);
|
||||
|
||||
drawHeader();
|
||||
|
||||
@@ -69,10 +69,10 @@ public class GuiLexicon extends GuiScreen {
|
||||
}
|
||||
|
||||
void drawHeader() {
|
||||
boolean unicode = fontRenderer.getUnicodeFlag();
|
||||
fontRenderer.setUnicodeFlag(true);
|
||||
fontRenderer.drawSplitString(StatCollector.translateToLocal("botania.gui.lexicon.header"), left + 15, top + 20, 110, 0);
|
||||
fontRenderer.setUnicodeFlag(unicode);
|
||||
boolean unicode = fontRendererObj.getUnicodeFlag();
|
||||
fontRendererObj.setUnicodeFlag(true);
|
||||
fontRendererObj.drawSplitString(StatCollector.translateToLocal("botania.gui.lexicon.header"), left + 15, top + 20, 110, 0);
|
||||
fontRendererObj.setUnicodeFlag(unicode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,7 +96,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
}
|
||||
|
||||
String getTitle() {
|
||||
return ModItems.lexicon.getItemDisplayName(null);
|
||||
return ModItems.lexicon.getItemStackDisplayName(null);
|
||||
}
|
||||
|
||||
boolean isIndex() {
|
||||
|
||||
@@ -31,8 +31,8 @@ public class GuiButtonBack extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
field_82253_i = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_82253_i);
|
||||
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_146123_n);
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -22,8 +22,8 @@ public class GuiButtonInvisible extends GuiButton {
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
field_82253_i = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_82253_i);
|
||||
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_146123_n);
|
||||
|
||||
boolean unicode = par1Minecraft.fontRenderer.getUnicodeFlag();
|
||||
par1Minecraft.fontRenderer.setUnicodeFlag(true);
|
||||
|
||||
@@ -34,8 +34,8 @@ public class GuiButtonPage extends GuiButton {
|
||||
@Override
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
|
||||
if(enabled) {
|
||||
field_82253_i = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_82253_i);
|
||||
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
|
||||
int k = getHoverState(field_146123_n);
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.client.render.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -29,7 +29,7 @@ public class RenderAltar implements ISimpleBlockRenderingHandler {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, -0.6F, -0.5F);
|
||||
GL11.glScalef(0.9F, 0.9F, 0.9F);
|
||||
TileEntityRenderer.instance.renderTileEntityAt(new TileAltar(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileAltar(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -38,13 +38,13 @@ public class RenderAltar implements ISimpleBlockRenderingHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idAltar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.client.render.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -28,7 +28,7 @@ public class RenderPool implements ISimpleBlockRenderingHandler {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
TileEntityRenderer.instance.renderTileEntityAt(new TilePool(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePool(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -37,14 +37,14 @@ public class RenderPool implements ISimpleBlockRenderingHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idPool;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.client.render.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -28,7 +28,7 @@ public class RenderPylon implements ISimpleBlockRenderingHandler {
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, -0.7F, -0.5F);
|
||||
TileEntityRenderer.instance.renderTileEntityAt(new TilePylon(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePylon(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -37,14 +37,14 @@ public class RenderPylon implements ISimpleBlockRenderingHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idPylon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,11 +15,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import vazkii.botania.common.block.vanilla.BlockSnowOverride;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderSpecialFlower implements ISimpleBlockRenderingHandler {
|
||||
@@ -66,27 +63,6 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler {
|
||||
|
||||
drawCrossedSquares(blockAccess, par1Block, par2, par3, par4, d0, d1, d2, 1.0F, render);
|
||||
|
||||
if(ConfigHandler.overrideVanillaBlocks) {
|
||||
int snow = -1;
|
||||
boolean foundSnow = false;
|
||||
|
||||
ForgeDirection[] directions = new ForgeDirection[] {
|
||||
ForgeDirection.NORTH, ForgeDirection.SOUTH, ForgeDirection.EAST, ForgeDirection.WEST
|
||||
};
|
||||
|
||||
for(ForgeDirection dir : directions)
|
||||
if(blockAccess.getBlockId(par2 + dir.offsetX, par3 + dir.offsetY, par4 + dir.offsetZ) == Block.snow.blockID) {
|
||||
int meta = blockAccess.getBlockMetadata(par2 + dir.offsetX, par3 + dir.offsetY, par4 + dir.offsetZ);
|
||||
snow = foundSnow ? Math.min(snow, meta) : meta;
|
||||
foundSnow = true;
|
||||
}
|
||||
|
||||
if(snow >= 0) {
|
||||
BlockSnowOverride.forcedMeta = snow;
|
||||
render.renderBlockByRenderType(Block.blocksList[Block.snow.blockID], par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,7 +71,7 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
// Only change here, to use xyz rather than side/meta
|
||||
Icon icon = render.getBlockIcon(par1Block, blockAccess, x, y, z, 0);
|
||||
IIcon icon = render.getBlockIcon(par1Block, blockAccess, x, y, z, 0);
|
||||
|
||||
double d3 = icon.getMinU();
|
||||
double d4 = icon.getMinV();
|
||||
@@ -124,14 +100,14 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler {
|
||||
tessellator.addVertexWithUV(d8, par5 + par9, d11, d5, d4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.client.render.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -30,7 +30,7 @@ public class RenderSpreader implements ISimpleBlockRenderingHandler {
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
TileSpreader spreader = new TileSpreader();
|
||||
spreader.rotationX = -180F;
|
||||
TileEntityRenderer.instance.renderTileEntityAt(spreader, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(spreader, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -39,14 +39,14 @@ public class RenderSpreader implements ISimpleBlockRenderingHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idSpreader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -51,7 +51,7 @@ public class RenderLens implements IItemRenderer {
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Color color = new Color(((ILens) item.getItem()).getLensColor(item));
|
||||
GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
|
||||
Icon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 1);
|
||||
IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 1);
|
||||
render.renderIcon(0, 0, icon, 16, 16);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
@@ -86,7 +86,7 @@ public class RenderLens implements IItemRenderer {
|
||||
|
||||
public static void render(ItemStack item, int color_) {
|
||||
int dmg = item.getItemDamage();
|
||||
Icon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0);
|
||||
IIcon icon = item.getItem().getIconFromDamageForRenderPass(dmg, 0);
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
float f2 = icon.getMinV();
|
||||
@@ -115,7 +115,7 @@ public class RenderLens implements IItemRenderer {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
|
||||
public static void renderShinyLensIcon(Icon icon, boolean shiny) {
|
||||
public static void renderShinyLensIcon(IIcon icon, boolean shiny) {
|
||||
float par1 = 0;
|
||||
float par2 = 0;
|
||||
float par4 = 16;
|
||||
|
||||
@@ -20,9 +20,10 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -103,7 +104,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
|
||||
ItemStack stack = altar.getStackInSlot(i);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
Icon icon = stack.getItem().getIcon(stack, 0);
|
||||
IIcon icon = stack.getItem().getIcon(stack, 0);
|
||||
if(icon != null) {
|
||||
Color color = new Color(stack.getItem().getColorFromItemStack(stack, 0));
|
||||
GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
|
||||
@@ -129,7 +130,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
GL11.glTranslatef(w, -0.3F, w);
|
||||
GL11.glRotatef(90F, 1F, 0F, 0F);
|
||||
GL11.glScalef(s, s, s);
|
||||
renderItem.renderIcon(0, 0, Block.waterStill.getIcon(0, 0), 16, 16);
|
||||
renderItem.renderIcon(0, 0, Blocks.water.getIcon(0, 0), 16, 16);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -46,9 +46,9 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
|
||||
|
||||
if(enchanter.itemToEnchant != null) {
|
||||
if(item == null)
|
||||
item = new EntityItem(enchanter.worldObj, enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant);
|
||||
item = new EntityItem(enchanter.getWorldObj(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant);
|
||||
|
||||
item.age = (int) tileentity.worldObj.getTotalWorldTime();
|
||||
item.age = (int) tileentity.getWorldObj().getTotalWorldTime();
|
||||
item.setEntityItemStack(enchanter.itemToEnchant);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
@@ -67,7 +67,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glColor4f(0.6F + (float) ((Math.cos(enchanter.worldObj.getTotalWorldTime() / 6D) + 1D) / 5D), 0.1F, 0.9F, (float) ((Math.sin(enchanter.worldObj.getTotalWorldTime() / 8D) + 1D) / 5D + 0.4D) * alphaMod);
|
||||
GL11.glColor4f(0.6F + (float) ((Math.cos(enchanter.getWorldObj().getTotalWorldTime() / 6D) + 1D) / 5D), 0.1F, 0.9F, (float) ((Math.sin(enchanter.getWorldObj().getTotalWorldTime() / 8D) + 1D) / 5D + 0.4D) * alphaMod);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderIcon(int par1, int par2, Icon par3Icon, int par4, int par5, int brightness) {
|
||||
public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setBrightness(brightness);
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -67,7 +67,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
|
||||
GL11.glScalef(s, s, s);
|
||||
float par1 = 0;
|
||||
float par2 = 0;
|
||||
Icon par3Icon = Block.waterStill.getIcon(0, 0);
|
||||
IIcon par3Icon = Blocks.water.getIcon(0, 0);
|
||||
float par4 = 16;
|
||||
float par5 = 16;
|
||||
float zLevel = 0F;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class RenderTilePylon extends TileEntitySpecialRenderer {
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
int worldTime = (int) (tileentity.worldObj == null ? 0 : tileentity.worldObj.getTotalWorldTime());
|
||||
int worldTime = (int) (tileentity.getWorldObj() == null ? 0 : tileentity.getWorldObj().getTotalWorldTime());
|
||||
|
||||
if(tileentity != null)
|
||||
worldTime += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(360);
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -36,6 +36,7 @@ import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
public class RenderTileRuneAltar extends TileEntitySpecialRenderer {
|
||||
|
||||
ModelSpinningCubes cubes = new ModelSpinningCubes();
|
||||
RenderBlocks renderBlocks = new RenderBlocks();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partticks) {
|
||||
@@ -61,28 +62,28 @@ public class RenderTileRuneAltar extends TileEntitySpecialRenderer {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glTranslatef(1F, 2.5F, 1F);
|
||||
GL11.glRotatef(angles[i] + altar.worldObj.getTotalWorldTime(), 0F, 1F, 0F);
|
||||
GL11.glRotatef(angles[i] + altar.getWorldObj().getTotalWorldTime(), 0F, 1F, 0F);
|
||||
GL11.glTranslatef(2.25F, 0F, 0.5F);
|
||||
GL11.glRotatef(90F, 0F, 1F, 0F);
|
||||
GL11.glTranslated(0D, 0.15 * Math.sin((tileentity.worldObj.getTotalWorldTime() + i * 10) / 5D), 0F);
|
||||
GL11.glTranslated(0D, 0.15 * Math.sin((tileentity.getWorldObj().getTotalWorldTime() + i * 10) / 5D), 0F);
|
||||
ItemStack stack = altar.getStackInSlot(i);
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(stack != null) {
|
||||
mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
|
||||
|
||||
GL11.glScalef(2F, 2F, 2F);
|
||||
if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.worldObj, altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.worldObj.rand, mc.renderEngine, new RenderBlocks())) {
|
||||
if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) {
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[stack.itemID].getRenderType())) {
|
||||
if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) {
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glTranslatef(1F, 1.1F, 0F);
|
||||
new RenderBlocks().renderBlockAsItem(Block.blocksList[stack.itemID], stack.getItemDamage(), 1F);
|
||||
renderBlocks.renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F);
|
||||
GL11.glTranslatef(-1F, -1.1F, 0F);
|
||||
GL11.glScalef(2F, 2F, 2F);
|
||||
} else {
|
||||
int renderPass = 0;
|
||||
do {
|
||||
Icon icon = stack.getItem().getIcon(stack, renderPass);
|
||||
IIcon icon = stack.getItem().getIcon(stack, renderPass);
|
||||
if(icon != null) {
|
||||
Color color = new Color(stack.getItem().getColorFromItemStack(stack, renderPass));
|
||||
GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
|
||||
|
||||
@@ -22,10 +22,8 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkMod;
|
||||
|
||||
@Mod(modid = LibMisc.MOD_ID, name = LibMisc.MOD_NAME, version = LibMisc.VERSION)
|
||||
@NetworkMod(clientSideRequired = true, channels = { LibMisc.NETWORK_CHANNEL })
|
||||
public class Botania {
|
||||
|
||||
@Instance(LibMisc.MOD_ID)
|
||||
|
||||
@@ -18,11 +18,12 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -30,19 +31,17 @@ import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
Random random;
|
||||
|
||||
protected BlockAltar() {
|
||||
super(LibBlockIDs.idAltar, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(3.5F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.ALTAR);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.ALTAR);
|
||||
|
||||
float f = 1F / 16F * 2F;
|
||||
setBlockBounds(f, f, f, 1F - f, 1F / 16F * 20F, 1F - f);
|
||||
@@ -53,23 +52,23 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
TileAltar tile = (TileAltar) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4);
|
||||
if(tile.collideEntityItem((EntityItem) par5Entity))
|
||||
PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), par1World.provider.dimensionId);
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
TileAltar tile = (TileAltar) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
if(stack != null && stack.itemID == Item.bucketWater.itemID) {
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(par2, par3, par4);
|
||||
if(stack != null && stack.getItem() == Items.water_bucket) {
|
||||
if(!tile.hasWater) {
|
||||
if(!par5EntityPlayer.capabilities.isCreativeMode)
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Items.bucket));
|
||||
tile.hasWater = true;
|
||||
par1World.func_96440_m(par2, par3, par4, blockID);
|
||||
PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), par1World.provider.dimensionId);
|
||||
par1World.func_147453_f(par2, par3, par4, this);
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -78,8 +77,8 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
return Block.cobblestone.getIcon(par1, par2);
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return Blocks.cobblestone.getIcon(par1, par2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,13 +97,13 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileAltar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (inv != null) {
|
||||
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {
|
||||
@@ -122,7 +121,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
@@ -134,7 +133,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
}
|
||||
|
||||
par1World.func_96440_m(par2, par3, par4, par5);
|
||||
par1World.func_147453_f(par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
@@ -147,7 +146,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
|
||||
TileAltar altar = (TileAltar) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TileAltar altar = (TileAltar) par1World.getTileEntity(par2, par3, par4);
|
||||
return altar.hasWater ? 15 : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,45 +12,44 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
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.block.tile.TileDistributor;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockDistributor extends BlockModContainer implements ILexiconable {
|
||||
|
||||
Icon iconSide, iconTop;
|
||||
IIcon iconSide, iconTop;
|
||||
|
||||
protected BlockDistributor() {
|
||||
super(LibBlockIDs.idDistributor, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.DISTRIBUTOR);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.DISTRIBUTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
iconTop = IconHelper.forBlock(par1IconRegister, this, 0);
|
||||
iconSide = IconHelper.forBlock(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return par1 == 0 ? ModBlocks.livingrock.getIcon(0, 0) : par1 == 1 ? iconTop : iconSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileDistributor();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,13 +15,16 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.IWandable;
|
||||
@@ -30,41 +33,40 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockEnchanter extends BlockModContainer implements IWandable, ILexiconable {
|
||||
|
||||
Random random;
|
||||
public static Icon overlay;
|
||||
public static IIcon overlay;
|
||||
|
||||
public BlockEnchanter() {
|
||||
super(LibBlockIDs.idEnchanter, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(3.0F);
|
||||
setResistance(5.0F);
|
||||
setLightValue(1.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.ENCHANTER);
|
||||
setLightLevel(1.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.ENCHANTER);
|
||||
|
||||
random = new Random();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
super.registerBlockIcons(par1IconRegister);
|
||||
overlay = IconHelper.forBlock(par1IconRegister, this, "Overlay");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEnchanter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return Block.blockLapis.blockID;
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(Blocks.lapis_block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
@@ -72,9 +74,9 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
TileEnchanter enchanter = (TileEnchanter) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(par2, par3, par4);
|
||||
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
if(stack != null && stack.itemID == ModItems.twigWand.itemID)
|
||||
if(stack != null && stack.getItem() == ModItems.twigWand)
|
||||
return false;
|
||||
|
||||
boolean stackEnchantable = stack != null && stack.isItemEnchantable() && stack.stackSize == 1 && stack.getItem().getItemEnchantability() > 0;
|
||||
@@ -89,15 +91,15 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
|
||||
if(par5EntityPlayer.inventory.addItemStackToInventory(enchanter.itemToEnchant.copy())) {
|
||||
enchanter.itemToEnchant = null;
|
||||
enchanter.sync();
|
||||
} else par5EntityPlayer.addChatMessage("botaniamisc.invFull");
|
||||
} else par5EntityPlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.invFull"));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
TileEnchanter enchanter = (TileEnchanter) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
TileEnchanter enchanter = (TileEnchanter) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
ItemStack itemstack = enchanter.itemToEnchant;
|
||||
|
||||
@@ -113,7 +115,7 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3 * 0.5;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
@@ -124,14 +126,14 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
|
||||
}
|
||||
}
|
||||
|
||||
par1World.func_96440_m(par2, par3, par4, par5);
|
||||
par1World.func_147453_f(par2, par3, par4, par5);
|
||||
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
((TileEnchanter) world.getBlockTileEntity(x, y, z)).onWanded(player, stack);
|
||||
((TileEnchanter) world.getTileEntity(x, y, z)).onWanded(player, stack);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,12 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
@@ -27,21 +28,20 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
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.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final int TYPES = 5;
|
||||
Icon[] icons;
|
||||
IIcon[] icons;
|
||||
|
||||
public BlockLivingrock() {
|
||||
super(LibBlockIDs.idLivingrock, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.LIVING_ROCK);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.LIVING_ROCK);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,33 +55,33 @@ public class BlockLivingrock extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[TYPES];
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[TYPES];
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[Math.min(TYPES - 1, par2)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return new ItemStack(blockID, 1, meta);
|
||||
return new ItemStack(this, 1, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,13 +13,16 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -28,20 +31,19 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
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.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
|
||||
private static final int TYPES = 6;
|
||||
Icon[] icons;
|
||||
IIcon[] icons;
|
||||
|
||||
public BlockLivingwood() {
|
||||
super(LibBlockIDs.idLivingwood, Material.wood);
|
||||
super( Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundWoodFootstep);
|
||||
setUnlocalizedName(LibBlockNames.LIVING_WOOD);
|
||||
setStepSound(soundTypeWood);
|
||||
setBlockName(LibBlockNames.LIVING_WOOD);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,33 +57,33 @@ public class BlockLivingwood extends BlockMod implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[TYPES];
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[TYPES];
|
||||
for(int i = 0; i < TYPES; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[Math.min(TYPES - 1, par2)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return new ItemStack(blockID, 1, meta);
|
||||
return new ItemStack(this, 1, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,13 +16,14 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
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.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
@@ -31,45 +32,45 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.tile.TileManaBeacon;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockManaBeacon extends BlockModContainer implements ILexiconable {
|
||||
|
||||
Icon[] icons = new Icon[2];
|
||||
IIcon[] icons;
|
||||
|
||||
public BlockManaBeacon() {
|
||||
super(LibBlockIDs.idManaBeacon, Material.iron);
|
||||
super(Material.iron);
|
||||
setHardness(5.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundMetalFootstep);
|
||||
setStepSound(soundTypeMetal);
|
||||
float size = 3F / 16F;
|
||||
setBlockBounds(size, size, size, 1F - size, 1F - size, 1F - size);
|
||||
setUnlocalizedName(LibBlockNames.MANA_BEACON);
|
||||
setBlockName(LibBlockNames.MANA_BEACON);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[2];
|
||||
for(int i = 0; i < 2; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[par1 == 1 ? 1 : 0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -109,7 +110,7 @@ public class BlockManaBeacon extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileManaBeacon();
|
||||
}
|
||||
}
|
||||
@@ -13,14 +13,15 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
@@ -29,30 +30,29 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.tile.TileManaDetector;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockManaDetector extends BlockModContainer implements ILexiconable {
|
||||
|
||||
Icon[] icons;
|
||||
IIcon[] icons;
|
||||
|
||||
protected BlockManaDetector() {
|
||||
super(LibBlockIDs.idManaDetector, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.MANA_DETECTOR);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setBlockName(LibBlockNames.MANA_DETECTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[2];
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[2];
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[Math.min(icons.length - 1, par2)];
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class BlockManaDetector extends BlockModContainer implements ILexiconable
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileManaDetector();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -20,21 +21,20 @@ import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.tile.TileManaVoid;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockManaVoid extends BlockModContainer implements ILexiconable {
|
||||
|
||||
protected BlockManaVoid() {
|
||||
super(LibBlockIDs.idManaVoid, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(2000F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.MANA_VOID);
|
||||
setStepSound(Block.soundTypeStone);
|
||||
setBlockName(LibBlockNames.MANA_VOID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int id) {
|
||||
return new TileManaVoid();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@@ -22,17 +22,17 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockMod extends Block {
|
||||
|
||||
public BlockMod(int par1, Material par2Material) {
|
||||
super(par1, par2Material);
|
||||
public BlockMod(Material par2Material) {
|
||||
super(par2Material);
|
||||
if(registerInCreative())
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
if(shouldRegisterInNameSet())
|
||||
GameRegistry.registerBlock(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
@@ -41,7 +41,7 @@ public class BlockMod extends Block {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
blockIcon = IconHelper.forBlock(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -25,27 +25,26 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockModContainer<T extends TileEntity> extends BlockContainer {
|
||||
|
||||
protected BlockModContainer(int par1, Material par2Material) {
|
||||
super(par1, par2Material);
|
||||
protected BlockModContainer(Material par2Material) {
|
||||
super(par2Material);
|
||||
if(registerInCreative())
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
if(shouldRegisterInNameSet())
|
||||
GameRegistry.registerBlock(this, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
blockIcon = IconHelper.forBlock(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@@ -54,6 +53,6 @@ public abstract class BlockModContainer<T extends TileEntity> extends BlockConta
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract T createNewTileEntity(World world);
|
||||
public abstract T createNewTileEntity(World world, int meta);
|
||||
|
||||
}
|
||||
@@ -14,16 +14,18 @@ package vazkii.botania.common.block;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -32,7 +34,6 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -40,43 +41,40 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockModFlower extends BlockFlower implements ILexiconable {
|
||||
|
||||
public static Icon[] icons;
|
||||
public static IIcon[] icons;
|
||||
|
||||
protected BlockModFlower() {
|
||||
super(LibBlockIDs.idFlower);
|
||||
setUnlocalizedName(LibBlockNames.FLOWER);
|
||||
super(0);
|
||||
setBlockName(LibBlockNames.FLOWER);
|
||||
setHardness(0F);
|
||||
setStepSound(soundGrassFootstep);
|
||||
setStepSound(soundTypeGrass);
|
||||
setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F);
|
||||
setTickRandomly(true);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
MinecraftForge.addGrassPlant(this, i, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[17];
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[17];
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[par2];
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -30,39 +31,37 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.IWandable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Type;
|
||||
|
||||
public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconable {
|
||||
|
||||
public static Map<String, String> playerPositions = new HashMap();
|
||||
public static Map<String, String> mappedPositions = new HashMap();
|
||||
|
||||
static List<String> removeThese = new ArrayList();
|
||||
static Map<String, Integer> coordsToCheck = new HashMap();
|
||||
|
||||
public BlockPistonRelay() {
|
||||
super(LibBlockIDs.idPistonRelay, Material.pumpkin);
|
||||
setUnlocalizedName(LibBlockNames.PISTON_RELAY);
|
||||
super(Material.gourd);
|
||||
setBlockName(LibBlockNames.PISTON_RELAY);
|
||||
setHardness(2F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundMetalFootstep);
|
||||
setStepSound(soundTypeMetal);
|
||||
|
||||
TickRegistry.registerTickHandler(new InternalTickHandler(), Side.SERVER);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random random) {
|
||||
return 0;
|
||||
@@ -74,7 +73,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
mapCoords(par1World.provider.dimensionId, par2, par3, par4, 2);
|
||||
}
|
||||
|
||||
@@ -83,30 +82,30 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
}
|
||||
|
||||
static void mapCoords(int world, int x, int y, int z, int time) {
|
||||
InternalTickHandler.coordsToCheck.put(getCoordsAsString(world, x, y, z), time);
|
||||
coordsToCheck.put(getCoordsAsString(world, x, y, z), time);
|
||||
}
|
||||
|
||||
static void decrCoords(String key) {
|
||||
int time = getTimeInCoords(key);
|
||||
|
||||
if(time <= 0)
|
||||
InternalTickHandler.removeThese.add(key);
|
||||
else InternalTickHandler.coordsToCheck.put(key, time - 1);
|
||||
removeThese.add(key);
|
||||
else coordsToCheck.put(key, time - 1);
|
||||
}
|
||||
|
||||
static int getTimeInCoords(String key) {
|
||||
return InternalTickHandler.coordsToCheck.get(key);
|
||||
return coordsToCheck.get(key);
|
||||
}
|
||||
|
||||
static int getBlockIDAt(String key) {
|
||||
static Block getBlockAt(String key) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
if(server == null)
|
||||
return 0;
|
||||
return Blocks.air;
|
||||
|
||||
String[] tokens = key.split(":");
|
||||
int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
|
||||
World world = server.worldServerForDimension(worldId);
|
||||
return world.getBlockId(x, y, z);
|
||||
return world.getBlock(x, y, z);
|
||||
}
|
||||
|
||||
static int getBlockMetaAt(String key) {
|
||||
@@ -123,19 +122,19 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
if(!player.isSneaking()) {
|
||||
InternalTickHandler.playerPositions.put(player.username, getCoordsAsString(world.provider.dimensionId, x, y, z));
|
||||
playerPositions.put(player.getCommandSenderName(), getCoordsAsString(world.provider.dimensionId, x, y, z));
|
||||
world.playSoundEffect(x, y, z, "random.orb", 0.5F, 1F);
|
||||
} else {
|
||||
dropBlockAsItem_do(world, x, y, z, new ItemStack(this));
|
||||
dropBlockAsItem(world, x, y, z, new ItemStack(this));
|
||||
world.setBlockToAir(x, y, z);
|
||||
if(!world.isRemote)
|
||||
world.playAuxSFX(2001, x, y , z, blockID);
|
||||
world.playAuxSFX(2001, x, y , z, Block.getIdFromBlock(this));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onWorldLoad(WorldEvent.Load event) {
|
||||
WorldData.get(event.world);
|
||||
}
|
||||
@@ -150,23 +149,23 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
InternalTickHandler.mappedPositions.clear();
|
||||
mappedPositions.clear();
|
||||
|
||||
Collection<NBTBase> tags = nbttagcompound.getTags();
|
||||
for(NBTBase tag : tags) {
|
||||
Collection<String> tags = nbttagcompound.func_150296_c();
|
||||
for(String key : tags) {
|
||||
NBTBase tag = nbttagcompound.getTag(key);
|
||||
if(tag instanceof NBTTagString) {
|
||||
String key = tag.getName();
|
||||
String value = ((NBTTagString) tag).data;
|
||||
String value = ((NBTTagString) tag).func_150285_a_();
|
||||
|
||||
InternalTickHandler.mappedPositions.put(key, value);
|
||||
mappedPositions.put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
for(String s : InternalTickHandler.mappedPositions.keySet())
|
||||
nbttagcompound.setString(s, InternalTickHandler.mappedPositions.get(s));
|
||||
for(String s : mappedPositions.keySet())
|
||||
nbttagcompound.setString(s, mappedPositions.get(s));
|
||||
}
|
||||
|
||||
public static WorldData get(World world) {
|
||||
@@ -181,26 +180,14 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
}
|
||||
}
|
||||
|
||||
public static class InternalTickHandler implements ITickHandler {
|
||||
|
||||
public static Map<String, String> playerPositions = new HashMap();
|
||||
public static Map<String, String> mappedPositions = new HashMap();
|
||||
|
||||
static List<String> removeThese = new ArrayList();
|
||||
static Map<String, Integer> coordsToCheck = new HashMap();
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
|
||||
@SubscribeEvent
|
||||
public void tickEnd(TickEvent event) {
|
||||
if(event.type == Type.SERVER && event.phase == Phase.END)
|
||||
for(String s : coordsToCheck.keySet()) {
|
||||
int id = getBlockIDAt(s);
|
||||
Block block = getBlockAt(s);
|
||||
decrCoords(s);
|
||||
|
||||
if(id == 36) {
|
||||
if(block == Blocks.piston_extension) {
|
||||
int meta = getBlockMetaAt(s);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(meta & ~8);
|
||||
|
||||
@@ -213,7 +200,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
String[] tokens = s.split(":");
|
||||
int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
|
||||
World world = server.worldServerForDimension(worldId);
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.pistonRelay.blockID);
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.pistonRelay);
|
||||
newPos = getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
}
|
||||
|
||||
@@ -223,16 +210,16 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
|
||||
World world = server.worldServerForDimension(worldId);
|
||||
|
||||
int srcId = world.getBlockId(x, y, z);
|
||||
Block srcBlock = world.getBlock(x, y, z);
|
||||
int srcMeta = world.getBlockMetadata(x, y, z);
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
Material mat = world.getBlockMaterial(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
Material mat = srcBlock.getMaterial();
|
||||
|
||||
if(tile == null && mat.getMaterialMobility() == 0 && Block.blocksList[srcId] != null && !Block.blocksList[srcId].isAirBlock(world, x, y, z)) {
|
||||
Material destMat = world.getBlockMaterial(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
if(tile == null && mat.getMaterialMobility() == 0 && !srcBlock.isAir(world, x, y, z)) {
|
||||
Material destMat = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).getMaterial();
|
||||
if(world.isAirBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) || destMat.isReplaceable()) {
|
||||
world.setBlock(x, y, z, 0);
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, srcId, srcMeta, 1 | 2);
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, srcBlock, srcMeta, 1 | 2);
|
||||
mappedPositions.put(s, getCoordsAsString(world.provider.dimensionId, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ));
|
||||
}
|
||||
}
|
||||
@@ -246,21 +233,9 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
}
|
||||
}
|
||||
|
||||
for(String s : removeThese)
|
||||
coordsToCheck.remove(s);
|
||||
removeThese.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks() {
|
||||
return EnumSet.of(TickType.SERVER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return LibBlockNames.PISTON_RELAY;
|
||||
}
|
||||
|
||||
for(String s : removeThese)
|
||||
coordsToCheck.remove(s);
|
||||
removeThese.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,7 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.IWandHUD;
|
||||
@@ -28,32 +28,30 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TilePool;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class BlockPool extends BlockModContainer implements IWandHUD, IWandable, ILexiconable {
|
||||
|
||||
protected BlockPool() {
|
||||
super(LibBlockIDs.idPool, Material.rock);
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.POOL);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.POOL);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TilePool();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {
|
||||
if(par5Entity instanceof EntityItem) {
|
||||
TilePool tile = (TilePool) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TilePool tile = (TilePool) par1World.getTileEntity(par2, par3, par4);
|
||||
if(tile.collideEntityItem((EntityItem) par5Entity))
|
||||
PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), par1World.provider.dimensionId);
|
||||
par1World.markBlockForUpdate(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +66,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return ModBlocks.livingrock.getIcon(par1, par2);
|
||||
}
|
||||
|
||||
@@ -84,7 +82,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) {
|
||||
TilePool pool = (TilePool) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4);
|
||||
int val = (int) ((double) pool.getCurrentMana() / (double) TilePool.MAX_MANA * 15.0);
|
||||
if(pool.getCurrentMana() > 0)
|
||||
val = Math.max(val, 1);
|
||||
@@ -94,12 +92,12 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
|
||||
((TilePool) world.getBlockTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
((TilePool) world.getTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
((TilePool) world.getBlockTileEntity(x, y, z)).onWanded(player, stack);
|
||||
((TilePool) world.getTileEntity(x, y, z)).onWanded(player, stack);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,36 +11,35 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
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.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TilePylon;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockPylon extends BlockModContainer implements ILexiconable {
|
||||
|
||||
public BlockPylon() {
|
||||
super(LibBlockIDs.idPylon, Material.iron);
|
||||
super(Material.iron);
|
||||
setHardness(5.5F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.PYLON);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockName(LibBlockNames.PYLON);
|
||||
|
||||
float f = 1F / 16F * 2F;
|
||||
setBlockBounds(f, 0F, f, 1F - f, 1F / 16F * 21F, 1F - f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
return Block.blockDiamond.getIcon(par1, par2);
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return Blocks.diamond_block.getIcon(par1, par2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,7 +63,7 @@ public class BlockPylon extends BlockModContainer implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TilePylon();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,15 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.IWandable;
|
||||
@@ -29,21 +30,20 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockRuneAltar extends BlockModContainer implements IWandable, ILexiconable {
|
||||
|
||||
Random random;
|
||||
Icon[] icons;
|
||||
IIcon[] icons;
|
||||
|
||||
public BlockRuneAltar() {
|
||||
super(LibBlockIDs.idRuneAltar, Material.rock);
|
||||
super(Material.rock);
|
||||
setBlockBounds(0F, 0F, 0F, 1F, 0.75F, 1F);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
setUnlocalizedName(LibBlockNames.RUNE_ALTAR);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.RUNE_ALTAR);
|
||||
|
||||
random = new Random();
|
||||
}
|
||||
@@ -59,8 +59,8 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[3];
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[3];
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
@@ -69,14 +69,14 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
if(stack != null)
|
||||
return ((TileRuneAltar) par1World.getBlockTileEntity(par2, par3, par4)).addItem(par5EntityPlayer, stack);
|
||||
return ((TileRuneAltar) par1World.getTileEntity(par2, par3, par4)).addItem(par5EntityPlayer, stack);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (inv != null) {
|
||||
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {
|
||||
@@ -94,7 +94,7 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
@@ -106,25 +106,25 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
|
||||
}
|
||||
}
|
||||
|
||||
par1World.func_96440_m(par2, par3, par4, par5);
|
||||
par1World.func_147453_f(par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return icons[Math.min(2, par1)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileRuneAltar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
((TileRuneAltar) world.getBlockTileEntity(x, y, z)).onWanded(player, stack);
|
||||
((TileRuneAltar) world.getTileEntity(x, y, z)).onWanded(player, stack);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,13 @@ import net.minecraft.block.BlockFlower;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
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.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -41,13 +42,13 @@ import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvider, ISpecialFlower, IWandable, ILexiconable, IWandHUD {
|
||||
|
||||
public static Map<String, Icon> icons = new HashMap();
|
||||
public static Map<String, IIcon> icons = new HashMap();
|
||||
|
||||
private static String[] subtypes = {
|
||||
// Misc
|
||||
LibBlockNames.SUBTILE_PUREDAISY,
|
||||
@@ -73,10 +74,10 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
};
|
||||
|
||||
protected BlockSpecialFlower() {
|
||||
super(LibBlockIDs.idSpecialFlower);
|
||||
setUnlocalizedName(LibBlockNames.SPECIAL_FLOWER);
|
||||
super(0);
|
||||
setBlockName(LibBlockNames.SPECIAL_FLOWER);
|
||||
setHardness(0F);
|
||||
setStepSound(soundGrassFootstep);
|
||||
setStepSound(soundTypeGrass);
|
||||
setTickRandomly(true);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setBlockBounds(0.3F, 0.0F, 0.3F, 0.8F, 1, 0.8F);
|
||||
@@ -88,9 +89,9 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockSpecialFlower.class, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,40 +100,30 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(String s : subtypes)
|
||||
par3List.add(ItemBlockSpecialFlower.ofType(s));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
for(String s : subtypes)
|
||||
icons.put(s, IconHelper.forName(par1IconRegister, s));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
return new TileSpecialFlower();
|
||||
public IIcon getIcon(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
return ((TileSpecialFlower) par1iBlockAccess.getTileEntity(par2, par3, par4)).getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getBlockTexture(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
return ((TileSpecialFlower) par1iBlockAccess.getBlockTileEntity(par2, par3, par4)).getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return BlockModFlower.icons[16];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
String name = ((TileSpecialFlower) world.getBlockTileEntity(x, y, z)).subTileName;
|
||||
String name = ((TileSpecialFlower) world.getTileEntity(x, y, z)).subTileName;
|
||||
return ItemBlockSpecialFlower.ofType(name);
|
||||
}
|
||||
|
||||
@@ -143,9 +134,9 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> list = new ArrayList();
|
||||
TileEntity tile = world.getBlockTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if(tile != null) {
|
||||
String name = ((TileSpecialFlower) tile).subTileName;
|
||||
@@ -158,28 +149,28 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
@Override
|
||||
public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
|
||||
TileEntity tileentity = par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
|
||||
return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return null;
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileSpecialFlower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return ((TileSpecialFlower) world.getBlockTileEntity(x, y, z)).getEntry();
|
||||
return ((TileSpecialFlower) world.getTileEntity(x, y, z)).getEntry();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
return ((TileSpecialFlower) world.getBlockTileEntity(x, y, z)).onWanded(stack, player);
|
||||
return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onWanded(stack, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
|
||||
((TileSpecialFlower) world.getBlockTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
((TileSpecialFlower) world.getTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -23,7 +24,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.IWandHUD;
|
||||
@@ -35,7 +36,6 @@ import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.block.tile.TileSpreader;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockSpreader extends BlockModContainer implements IWandable, IWandHUD, ILexiconable {
|
||||
@@ -43,10 +43,10 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
Random random;
|
||||
|
||||
protected BlockSpreader() {
|
||||
super(LibBlockIDs.idSpreader, Material.wood);
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundWoodFootstep);
|
||||
setUnlocalizedName(LibBlockNames.SPREADER);
|
||||
setStepSound(soundTypeWood);
|
||||
setBlockName(LibBlockNames.SPREADER);
|
||||
|
||||
random = new Random();
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
||||
TileSpreader spreader = (TileSpreader) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TileSpreader spreader = (TileSpreader) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
switch(orientation) {
|
||||
case 0:
|
||||
@@ -88,7 +88,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return ModBlocks.livingwood.getIcon(par1, par2);
|
||||
}
|
||||
|
||||
@@ -99,32 +99,32 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
|
||||
TileSpreader spreader = (TileSpreader) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
TileSpreader spreader = (TileSpreader) par1World.getTileEntity(par2, par3, par4);
|
||||
ItemStack lens = spreader.getStackInSlot(0);
|
||||
ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem();
|
||||
boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens;
|
||||
|
||||
if(heldItem != null && heldItem.itemID == ModItems.twigWand.itemID)
|
||||
if(heldItem != null && heldItem.getItem() == ModItems.twigWand)
|
||||
return false;
|
||||
|
||||
if(lens == null && isHeldItemLens) {
|
||||
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, null);
|
||||
spreader.setInventorySlotContents(0, heldItem.copy());
|
||||
spreader.onInventoryChanged();
|
||||
spreader.markDirty();
|
||||
} else if(lens != null) {
|
||||
ItemStack add = lens.copy();
|
||||
if(!par5EntityPlayer.inventory.addItemStackToInventory(add))
|
||||
par5EntityPlayer.dropPlayerItem(add);
|
||||
par5EntityPlayer.dropPlayerItemWithRandomChoice(add, false);
|
||||
spreader.setInventorySlotContents(0, null);
|
||||
spreader.onInventoryChanged();
|
||||
spreader.markDirty();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getBlockTileEntity(par2, par3, par4);
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (inv != null) {
|
||||
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {
|
||||
@@ -142,7 +142,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
k1 = itemstack.stackSize;
|
||||
|
||||
itemstack.stackSize -= k1;
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
|
||||
entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)random.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
|
||||
@@ -154,7 +154,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
}
|
||||
}
|
||||
|
||||
par1World.func_96440_m(par2, par3, par4, par5);
|
||||
par1World.func_147453_f(par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
@@ -163,18 +163,18 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
((TileSpreader) world.getBlockTileEntity(x, y, z)).onWanded(player, stack);
|
||||
((TileSpreader) world.getTileEntity(x, y, z)).onWanded(player, stack);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileSpreader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
|
||||
((TileSpreader) world.getBlockTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
((TileSpreader) world.getTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,11 +14,11 @@ package vazkii.botania.common.block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.IWandHUD;
|
||||
@@ -27,45 +27,44 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.tile.TileTurntable;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockTurntable extends BlockModContainer implements IWandable, IWandHUD, ILexiconable {
|
||||
|
||||
Icon[] icons;
|
||||
IIcon[] icons;
|
||||
|
||||
protected BlockTurntable() {
|
||||
super(LibBlockIDs.idTurntable, Material.wood);
|
||||
super(Material.wood);
|
||||
setHardness(2.0F);
|
||||
setStepSound(soundWoodFootstep);
|
||||
setUnlocalizedName(LibBlockNames.TURNTABLE);
|
||||
setStepSound(soundTypeWood);
|
||||
setBlockName(LibBlockNames.TURNTABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[2];
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[2];
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int par1, int par2) {
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return par1 == 1 ? icons[0] : icons[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileTurntable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
|
||||
((TileTurntable) world.getBlockTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
((TileTurntable) world.getTileEntity(x, y, z)).renderHUD(mc, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
|
||||
((TileTurntable) world.getBlockTileEntity(x, y, z)).onWanded(player, stack);
|
||||
((TileTurntable) world.getTileEntity(x, y, z)).onWanded(player, stack);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@@ -29,32 +30,31 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockUnstable extends BlockMod implements ILexiconable {
|
||||
|
||||
public BlockUnstable() {
|
||||
super(LibBlockIDs.idUnstableBlock, Material.iron);
|
||||
super(Material.iron);
|
||||
setHardness(5.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundMetalFootstep);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setUnlocalizedName(LibBlockNames.UNSTABLE_BLOCK);
|
||||
setBlockName(LibBlockNames.UNSTABLE_BLOCK);
|
||||
setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setUnlocalizedName(String par1Str) {
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setUnlocalizedName(par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -43,9 +44,6 @@ import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.block.tile.TileSpreader;
|
||||
import vazkii.botania.common.block.tile.TileTurntable;
|
||||
import vazkii.botania.common.block.vanilla.BlockFlowerOverride;
|
||||
import vazkii.botania.common.block.vanilla.BlockSnowOverride;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
@@ -91,7 +89,7 @@ public final class ModBlocks {
|
||||
turntable = new BlockTurntable();
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower.blockID, 1, i));
|
||||
OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower, 1, i));
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LIVING_ROCK, livingrock);
|
||||
OreDictionary.registerOre(LibOreDict.LIVING_WOOD, livingwood);
|
||||
@@ -100,17 +98,7 @@ public final class ModBlocks {
|
||||
registerMultiparts();
|
||||
|
||||
// Vanilla ores (because forge doesn't do this by default for some reason)
|
||||
OreDictionary.registerOre("oreCoal", Block.oreCoal);
|
||||
|
||||
if(ConfigHandler.overrideVanillaBlocks) {
|
||||
Block.blocksList[Block.snow.blockID] = null;
|
||||
Block.blocksList[Block.plantRed.blockID] = null;
|
||||
Block.blocksList[Block.plantYellow.blockID] = null;
|
||||
|
||||
new BlockSnowOverride(Block.snow.blockID).setHardness(0.1F).setStepSound(Block.soundSnowFootstep).setUnlocalizedName("snow").setLightOpacity(0).setTextureName("snow");
|
||||
new BlockFlowerOverride(Block.plantRed).setHardness(0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("rose").setTextureName("flower_rose");
|
||||
new BlockFlowerOverride(Block.plantYellow).setHardness(0F).setStepSound(Block.soundGrassFootstep).setUnlocalizedName("flower").setTextureName("flower_dandelion");
|
||||
}
|
||||
OreDictionary.registerOre("oreCoal", Blocks.coal_ore);
|
||||
}
|
||||
|
||||
private static void initTileEntities() {
|
||||
|
||||
@@ -13,8 +13,6 @@ package vazkii.botania.common.block.multipart;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import codechicken.microblock.BlockMicroMaterial;
|
||||
import codechicken.microblock.MicroMaterialRegistry;
|
||||
|
||||
public final class MultipartHandler {
|
||||
|
||||
@@ -29,8 +27,7 @@ public final class MultipartHandler {
|
||||
}
|
||||
|
||||
private static void registerMultipart(Block block, int meta) {
|
||||
MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta));
|
||||
|
||||
// MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), block.getUnlocalizedName() + (meta == 0 ? "" : "_" + meta));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
package vazkii.botania.common.block.subtile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
@@ -54,17 +55,17 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
|
||||
int[] acoords = POSITIONS[positionAt];
|
||||
ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord + acoords[0], supertile.yCoord + acoords[1], supertile.zCoord + acoords[2]);
|
||||
Block block = Block.blocksList[supertile.worldObj.getBlockId(coords.posX, coords.posY, coords.posZ)];
|
||||
if(block != null) {
|
||||
String oredict = OreDictionary.getOreName(OreDictionary.getOreID(new ItemStack(block, 1, supertile.worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ))));
|
||||
int output = oredict.equals("stone") ? ModBlocks.livingrock.blockID : oredict.endsWith("logWood") ? ModBlocks.livingwood.blockID : 0;
|
||||
if(output != 0) {
|
||||
Block block =supertile.getWorldObj().getBlock(coords.posX, coords.posY, coords.posZ);
|
||||
if(block != Blocks.air) {
|
||||
String oredict = OreDictionary.getOreName(OreDictionary.getOreID(new ItemStack(block, 1, supertile.getWorldObj().getBlockMetadata(coords.posX, coords.posY, coords.posZ))));
|
||||
Block output = oredict.equals("stone") ? ModBlocks.livingrock : oredict.endsWith("logWood") ? ModBlocks.livingwood : null;
|
||||
if(output != null) {
|
||||
ticksRemaining[positionAt] = ticksRemaining[positionAt] - 1;
|
||||
|
||||
Botania.proxy.sparkleFX(supertile.worldObj, coords.posX + Math.random(), coords.posY + Math.random(), coords.posZ + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5);
|
||||
Botania.proxy.sparkleFX(supertile.getWorldObj(), coords.posX + Math.random(), coords.posY + Math.random(), coords.posZ + Math.random(), 1F, 1F, 1F, (float) Math.random(), 5);
|
||||
|
||||
if(ticksRemaining[positionAt] <= 0) {
|
||||
supertile.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, output);
|
||||
supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, output);
|
||||
ticksRemaining[positionAt] = 200;
|
||||
|
||||
for(int i = 0; i < 25; i++) {
|
||||
@@ -72,7 +73,7 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
double y = coords.posY + Math.random() + 0.5;
|
||||
double z = coords.posZ + Math.random();
|
||||
|
||||
Botania.proxy.wispFX(supertile.worldObj, x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F);
|
||||
Botania.proxy.wispFX(supertile.getWorldObj(), x, y, z, 1F, 1F, 1F, (float) Math.random() / 2F);
|
||||
}
|
||||
}
|
||||
} else ticksRemaining[positionAt] = 200;
|
||||
@@ -83,7 +84,7 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
positionAt = cmp.getInteger(TAG_POSITION);
|
||||
|
||||
if(supertile.worldObj != null && !supertile.worldObj.isRemote)
|
||||
if(supertile.getWorldObj() != null && !supertile.getWorldObj().isRemote)
|
||||
for(int i = 0; i < ticksRemaining.length; i++)
|
||||
ticksRemaining[i] = cmp.getInteger(TAG_TICKS_REMAINING + i);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
|
||||
public class SubTileAgricarnation extends SubTileFunctional {
|
||||
@@ -21,33 +23,33 @@ public class SubTileAgricarnation extends SubTileFunctional {
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(supertile.worldObj.getTotalWorldTime() % 3 == 0) {
|
||||
if(supertile.getWorldObj().getTotalWorldTime() % 3 == 0) {
|
||||
int range = 5;
|
||||
int x = supertile.xCoord + supertile.worldObj.rand.nextInt(range * 2 + 1) - range;
|
||||
int z = supertile.zCoord + supertile.worldObj.rand.nextInt(range * 2 + 1) - range;
|
||||
int x = supertile.xCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range;
|
||||
int z = supertile.zCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range;
|
||||
|
||||
for(int i = 4; i > -2; i--) {
|
||||
int y = supertile.yCoord + i;
|
||||
|
||||
if(supertile.worldObj.isAirBlock(x, y, z))
|
||||
if(supertile.getWorldObj().isAirBlock(x, y, z))
|
||||
continue;
|
||||
|
||||
if(isPlant(x, y, z) && mana > 5) {
|
||||
int id = supertile.worldObj.getBlockId(x, y, z);
|
||||
Block block = supertile.getWorldObj().getBlock(x, y, z);
|
||||
mana -= 5;
|
||||
supertile.worldObj.scheduleBlockUpdate(x, y, z, id, 1);
|
||||
supertile.getWorldObj().scheduleBlockUpdate(x, y, z, block, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean isPlant(int x, int y, int z) {
|
||||
int id = supertile.worldObj.getBlockId(x, y, z);
|
||||
if(id == Block.grass.blockID || id == Block.leaves.blockID || id == Block.tallGrass.blockID)
|
||||
Block block = supertile.getWorldObj().getBlock(x, y, z);
|
||||
if(block == Blocks.grass || block == Blocks.leaves || block == Blocks.leaves2 || block instanceof BlockBush)
|
||||
return false;
|
||||
|
||||
Material mat = supertile.worldObj.getBlockMaterial(x, y, z);
|
||||
return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.vine || mat == Material.wood || mat == Material.pumpkin);
|
||||
Material mat = block.getMaterial();
|
||||
return mat != null && (mat == Material.plants || mat == Material.cactus || mat == Material.grass || mat == Material.leaves || mat == Material.vine || mat == Material.wood || mat == Material.gourd);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,8 +40,8 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
final int range = 6;
|
||||
final int manaToUse = 16;
|
||||
|
||||
if(supertile.worldObj.getTotalWorldTime() % 15 == 0) {
|
||||
List<EntityLivingBase> entities = supertile.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
if(supertile.getWorldObj().getTotalWorldTime() % 15 == 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));
|
||||
for(EntityLivingBase entity : entities) {
|
||||
if(entity instanceof EntityPlayer)
|
||||
continue;
|
||||
|
||||
@@ -35,17 +35,17 @@ public class SubTileExoflame extends SubTileFunctional {
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
|
||||
TileEntity tile = supertile.worldObj.getBlockTileEntity(x, y, z);
|
||||
TileEntity tile = supertile.getWorldObj().getTileEntity(x, y, z);
|
||||
if(tile != null && tile instanceof TileEntityFurnace) {
|
||||
TileEntityFurnace furnace = (TileEntityFurnace) tile;
|
||||
boolean canSmelt = canFurnaceSmelt(furnace);
|
||||
if(canSmelt && mana > 2) {
|
||||
if(furnace.furnaceBurnTime < 2) {
|
||||
if(furnace.furnaceBurnTime == 0)
|
||||
BlockFurnace.updateFurnaceBlockState(true, supertile.worldObj, x, y, z);
|
||||
BlockFurnace.updateFurnaceBlockState(true, supertile.getWorldObj(), x, y, z);
|
||||
furnace.furnaceBurnTime = 200;
|
||||
}
|
||||
if(supertile.worldObj.getTotalWorldTime() % 2 == 0)
|
||||
if(supertile.getWorldObj().getTotalWorldTime() % 2 == 0)
|
||||
furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 1);
|
||||
|
||||
mana -= 2;
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubTileFallenKanade extends SubTileFunctional {
|
||||
|
||||
@@ -31,12 +30,12 @@ public class SubTileFallenKanade extends SubTileFunctional {
|
||||
final int range = 5;
|
||||
final int cost = 20;
|
||||
|
||||
List<EntityPlayer> players = supertile.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
for(EntityPlayer player : players) {
|
||||
if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 100, 1));
|
||||
mana -= cost;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,14 +18,13 @@ import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITaskEntry;
|
||||
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
@@ -37,7 +36,7 @@ public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
final int range = 5;
|
||||
final int cost = 100;
|
||||
|
||||
List<IMob> mobs = supertile.worldObj.getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
List<IMob> mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
if(mobs.size() > 1 && mana >= cost)
|
||||
for(IMob mob : mobs) {
|
||||
if(mob instanceof EntityLiving) {
|
||||
@@ -45,7 +44,7 @@ public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
EntityLivingBase target = entity.getAttackTarget();
|
||||
if(target == null || !(target instanceof IMob)) {
|
||||
IMob newTarget;
|
||||
do newTarget = mobs.get(supertile.worldObj.rand.nextInt(mobs.size()));
|
||||
do newTarget = mobs.get(supertile.getWorldObj().rand.nextInt(mobs.size()));
|
||||
while(newTarget == mob);
|
||||
|
||||
if(newTarget instanceof EntityLivingBase) {
|
||||
@@ -61,7 +60,7 @@ public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
messWithAttackOnCollideAI((EntityAIAttackOnCollide) entry.action);
|
||||
|
||||
mana -= cost;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package vazkii.botania.common.block.subtile.functional;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -26,7 +27,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -34,7 +35,6 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubTileHopperhock extends SubTileFunctional {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
|
||||
List<EntityItem> items = supertile.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - 3, z - range, x + range + 1, y + 3, z + range + 1));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - 3, z - range, x + range + 1, y + 3, z + range + 1));
|
||||
for(EntityItem item : items) {
|
||||
if(item.age < 60)
|
||||
continue;
|
||||
@@ -73,7 +73,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
int y_ = y + dir.offsetY;
|
||||
int z_ = z + dir.offsetZ;
|
||||
|
||||
IInventory inv = InventoryHelper.getInventory(supertile.worldObj, x_, y_, z_);
|
||||
IInventory inv = InventoryHelper.getInventory(supertile.getWorldObj(), x_, y_, z_);
|
||||
if(inv != null) {
|
||||
List<ItemStack> filter = getFilterForInventory(inv, x_, y_, z_, true);
|
||||
boolean canAccept = canAcceptItem(stack, filter, filterType);
|
||||
@@ -97,7 +97,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
|
||||
if(invToPutItemIn != null) {
|
||||
InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1);
|
||||
if(!supertile.worldObj.isRemote)
|
||||
if(!supertile.getWorldObj().isRemote)
|
||||
item.setDead();
|
||||
pulledAny = true;
|
||||
break;
|
||||
@@ -136,13 +136,13 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
List<ItemStack> filter = new ArrayList();
|
||||
|
||||
if(recursiveForDoubleChests) {
|
||||
TileEntity tileEntity = supertile.worldObj.getBlockTileEntity(x, y, z);
|
||||
int chestId = supertile.worldObj.getBlockId(x, y, z);
|
||||
TileEntity tileEntity = supertile.getWorldObj().getTileEntity(x, y, z);
|
||||
Block chest = supertile.getWorldObj().getBlock(x, y, z);
|
||||
|
||||
if(tileEntity instanceof TileEntityChest)
|
||||
for(ForgeDirection dir : VALID_DIRS)
|
||||
if(supertile.worldObj.getBlockId(x + dir.offsetX, y, z + dir.offsetZ) == chestId) {
|
||||
filter.addAll(getFilterForInventory((IInventory) supertile.worldObj.getBlockTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false));
|
||||
if(supertile.getWorldObj().getBlock(x + dir.offsetX, y, z + dir.offsetZ) == chest) {
|
||||
filter.addAll(getFilterForInventory((IInventory) supertile.getWorldObj().getTileEntity(x + dir.offsetX, y, z + dir.offsetZ), x + dir.offsetX, y, z + dir.offsetZ, false));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
};
|
||||
|
||||
for(ForgeDirection dir : VALID_DIRS) {
|
||||
List<EntityItemFrame> frames = supertile.worldObj.getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(x+ dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1));
|
||||
List<EntityItemFrame> frames = supertile.getWorldObj().getEntitiesWithinAABB(EntityItemFrame.class, AxisAlignedBB.getBoundingBox(x+ dir.offsetX, y + dir.offsetY, z + dir.offsetZ, x + dir.offsetX + 1, y + dir.offsetY + 1, z + dir.offsetZ + 1));
|
||||
for(EntityItemFrame frame : frames) {
|
||||
int orientation = frame.hangingDirection;
|
||||
if(orientationToDir[orientation] == dir.ordinal())
|
||||
@@ -167,8 +167,8 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
public boolean onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player.isSneaking()) {
|
||||
filterType = filterType == 2 ? 0 : filterType + 1;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
|
||||
sync();
|
||||
|
||||
return true;
|
||||
}
|
||||
else return super.onWanded(player, wand);
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
|
||||
@@ -32,22 +32,22 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
return;
|
||||
}
|
||||
|
||||
if(mana >= COST && !supertile.worldObj.isRemote) {
|
||||
if(mana >= COST && !supertile.getWorldObj().isRemote) {
|
||||
int range = 4;
|
||||
int x = supertile.xCoord - range + supertile.worldObj.rand.nextInt(range * 2 + 1);
|
||||
int x = supertile.xCoord - range + supertile.getWorldObj().rand.nextInt(range * 2 + 1);
|
||||
int y = supertile.yCoord + range;
|
||||
int z = supertile.zCoord - range + supertile.worldObj.rand.nextInt(range * 2 + 1);
|
||||
int z = supertile.zCoord - range + supertile.getWorldObj().rand.nextInt(range * 2 + 1);
|
||||
|
||||
for(int i = 0; i < range * 2; i++) {
|
||||
int blockID = supertile.worldObj.getBlockId(x, y, z);
|
||||
if((blockID == Block.grass.blockID || blockID == Block.dirt.blockID || blockID == Block.tilledField.blockID) && supertile.worldObj.isAirBlock(x, y + 1, z)) {
|
||||
int color = supertile.worldObj.rand.nextInt(16);
|
||||
if(ModBlocks.flower.canBlockStay(supertile.worldObj, x, y + 1, z))
|
||||
supertile.worldObj.setBlock(x, y + 1, z, ModBlocks.flower.blockID, color, 1 | 2);
|
||||
Block block = supertile.getWorldObj().getBlock(x, y, z);
|
||||
if((block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland) && supertile.getWorldObj().isAirBlock(x, y + 1, z)) {
|
||||
int color = supertile.getWorldObj().rand.nextInt(16);
|
||||
if(ModBlocks.flower.canBlockStay(supertile.getWorldObj(), x, y + 1, z))
|
||||
supertile.getWorldObj().setBlock(x, y + 1, z, ModBlocks.flower, color, 1 | 2);
|
||||
|
||||
mana -= COST;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
|
||||
sync();
|
||||
|
||||
cooldown = 30;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.ai.EntityAIAvoidEntity;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITaskEntry;
|
||||
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
|
||||
import net.minecraft.entity.item.EntityEnderCrystal;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
@@ -27,7 +27,6 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class SubTileTigerseye extends SubTileFunctional {
|
||||
@@ -42,7 +41,7 @@ public class SubTileTigerseye extends SubTileFunctional {
|
||||
|
||||
boolean shouldAfffect = mana >= cost;
|
||||
|
||||
List<EntityLiving> entities = supertile.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - rangeY, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + rangeY, supertile.zCoord + range));
|
||||
List<EntityLiving> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - rangeY, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + rangeY, supertile.zCoord + range));
|
||||
|
||||
for(EntityLiving entity : entities) {
|
||||
List<EntityAITaskEntry> entries = new ArrayList(entity.tasks.taskEntries);
|
||||
@@ -65,7 +64,7 @@ public class SubTileTigerseye extends SubTileFunctional {
|
||||
|
||||
if(avoidsOcelots) {
|
||||
mana -= cost;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
shouldAfffect = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,16 +16,15 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.util.WeightedRandomItem;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubtileOrechid extends SubTileFunctional {
|
||||
|
||||
@@ -35,26 +34,26 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!supertile.worldObj.isRemote && mana >= COST && supertile.worldObj.getTotalWorldTime() % 100 == 0) {
|
||||
if(!supertile.getWorldObj().isRemote && mana >= COST && supertile.getWorldObj().getTotalWorldTime() % 100 == 0) {
|
||||
ChunkCoordinates coords = getCoordsToPut();
|
||||
if(coords != null) {
|
||||
ItemStack stack = getOreToPut();
|
||||
if(stack != null) {
|
||||
supertile.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, stack.itemID, stack.getItemDamage(), 1 | 2);
|
||||
supertile.getWorldObj().setBlock(coords.posX, coords.posY, coords.posZ, Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1 | 2);
|
||||
|
||||
mana -= COST;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getOreToPut() {
|
||||
Collection<WeightedRandomItem> values = new ArrayList();
|
||||
Collection<WeightedRandom.Item> values = new ArrayList();
|
||||
for(String s : BotaniaAPI.oreWeights.keySet())
|
||||
values.add(new StringRandomItem(BotaniaAPI.oreWeights.get(s), s));
|
||||
|
||||
String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.worldObj.rand, values)).s;
|
||||
String ore = ((StringRandomItem) WeightedRandom.getRandomItem(supertile.getWorldObj().rand, values)).s;
|
||||
|
||||
List<ItemStack> ores = OreDictionary.getOres(ore);
|
||||
if(ores.isEmpty())
|
||||
@@ -74,15 +73,14 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
int x = supertile.xCoord + i;
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
int id = supertile.worldObj.getBlockId(x, y, z);
|
||||
Block block = Block.blocksList[id];
|
||||
if(block != null && block.isGenMineableReplaceable(supertile.worldObj, x, y, z, Block.stone.blockID))
|
||||
Block block = supertile.getWorldObj().getBlock(x, y, z);
|
||||
if(block != null && block.isReplaceableOreGen(supertile.getWorldObj(), x, y, z, Blocks.stone))
|
||||
possibleCoords.add(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
|
||||
if(possibleCoords.isEmpty())
|
||||
return null;
|
||||
return possibleCoords.get(supertile.worldObj.rand.nextInt(possibleCoords.size()));
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,7 +98,7 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
return LexiconData.orechid;
|
||||
}
|
||||
|
||||
private static class StringRandomItem extends WeightedRandomItem {
|
||||
private static class StringRandomItem extends WeightedRandom.Item {
|
||||
|
||||
public String s;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.core.helper.ExperienceHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubTileArcaneRose extends SubTileGenerating {
|
||||
|
||||
@@ -30,12 +29,12 @@ public class SubTileArcaneRose extends SubTileGenerating {
|
||||
if(mana >= getMaxMana())
|
||||
return;
|
||||
|
||||
List<EntityPlayer> players = supertile.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - 1, supertile.yCoord, supertile.zCoord - 1, supertile.xCoord + 2, supertile.yCoord + 1, supertile.zCoord + 2));
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - 1, supertile.yCoord, supertile.zCoord - 1, supertile.xCoord + 2, supertile.yCoord + 1, supertile.zCoord + 2));
|
||||
for(EntityPlayer player : players)
|
||||
if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) {
|
||||
ExperienceHelper.drainPlayerXP(player, 1);
|
||||
mana += 10;
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ package vazkii.botania.common.block.subtile.generating;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
@@ -23,7 +24,6 @@ import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubTileEndoflame extends SubTileGenerating {
|
||||
|
||||
@@ -36,18 +36,18 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
|
||||
if(linkedCollector != null) {
|
||||
if(burnTime == 0) {
|
||||
if(mana < getMaxMana() && !supertile.worldObj.isRemote) {
|
||||
if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) {
|
||||
final int range = 3;
|
||||
boolean didSomething = false;
|
||||
|
||||
List<EntityItem> items = supertile.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
for(EntityItem item : items) {
|
||||
if(item.age >= 60 && !item.isDead) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack.getItem().hasContainerItem())
|
||||
if(stack.getItem().hasContainerItem(stack))
|
||||
continue;
|
||||
|
||||
int burnTime = stack == null || stack.itemID == ModBlocks.spreader.blockID ? 0 : TileEntityFurnace.getItemBurnTime(stack);
|
||||
int burnTime = stack == null || stack.getItem() == Item.getItemFromBlock(ModBlocks.spreader) ? 0 : TileEntityFurnace.getItemBurnTime(stack);
|
||||
if(burnTime > 0 && stack.stackSize > 0) {
|
||||
this.burnTime = burnTime / 2;
|
||||
|
||||
@@ -64,11 +64,11 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
}
|
||||
|
||||
if(didSomething)
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
sync();
|
||||
}
|
||||
} else {
|
||||
if(supertile.worldObj.rand.nextInt(8) == 0)
|
||||
Botania.proxy.wispFX(supertile.worldObj, supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
if(supertile.getWorldObj().rand.nextInt(8) == 0)
|
||||
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
|
||||
burnTime--;
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class SubTileHydroangeas extends SubTileGenerating {
|
||||
|
||||
@@ -33,13 +33,13 @@ public class SubTileHydroangeas extends SubTileGenerating {
|
||||
|
||||
boolean didSomething = false;
|
||||
|
||||
if (burnTime == 0) {
|
||||
if (supertile.worldObj.getWorldTime() % 40L == 0) {
|
||||
if (mana < getMaxMana() && !supertile.worldObj.isRemote)
|
||||
for (int i = -range; i <= range; i++)
|
||||
for (int j = -range; j <= range; j++) {
|
||||
if (supertile.worldObj.getBlockId(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == getIdToSearchFor() && supertile.worldObj.getBlockMetadata(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == 0) {
|
||||
supertile.worldObj.setBlockToAir(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j);
|
||||
if(burnTime == 0) {
|
||||
if(supertile.getWorldObj().getWorldTime() % 40L == 0) {
|
||||
if(mana < getMaxMana() && !supertile.getWorldObj().isRemote)
|
||||
for(int i = -range; i <= range; i++)
|
||||
for(int j = -range; j <= range; j++) {
|
||||
if(supertile.getWorldObj().getBlock(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == getBlockToSearchFor() && supertile.getWorldObj().getBlockMetadata(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j) == 0) {
|
||||
supertile.getWorldObj().setBlockToAir(supertile.xCoord + i, supertile.yCoord, supertile.zCoord + j);
|
||||
didSomething = true;
|
||||
burnTime += getBurnTime();
|
||||
|
||||
@@ -48,22 +48,22 @@ public class SubTileHydroangeas extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
|
||||
if (didSomething)
|
||||
PacketDispatcher.sendPacketToAllInDimension(supertile.getDescriptionPacket(), supertile.worldObj.provider.dimensionId);
|
||||
if(didSomething)
|
||||
sync();
|
||||
}
|
||||
} else {
|
||||
if(supertile.worldObj.rand.nextInt(8) == 0)
|
||||
if(supertile.getWorldObj().rand.nextInt(8) == 0)
|
||||
doBurnParticles();
|
||||
burnTime--;
|
||||
}
|
||||
}
|
||||
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(supertile.worldObj, supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.05F, 0.05F, 0.7F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
|
||||
public int getIdToSearchFor() {
|
||||
return Block.waterStill.blockID;
|
||||
public Block getBlockToSearchFor() {
|
||||
return Blocks.water;
|
||||
}
|
||||
|
||||
public int getBurnTime() {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -30,12 +31,12 @@ public class SubTileThermalily extends SubTileHydroangeas {
|
||||
|
||||
@Override
|
||||
public void doBurnParticles() {
|
||||
Botania.proxy.wispFX(supertile.worldObj, supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.55 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.9 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5, 0.7F, 0.05F, 0.05F, (float) Math.random() / 6, (float) -Math.random() / 60);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIdToSearchFor() {
|
||||
return Block.lavaStill.blockID;
|
||||
public Block getBlockToSearchFor() {
|
||||
return Blocks.lava;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -25,7 +26,6 @@ import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
|
||||
@@ -39,11 +39,11 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
return false;
|
||||
|
||||
if(!hasWater) {
|
||||
if(stack.itemID == Item.bucketWater.itemID) {
|
||||
if(stack.getItem() == Items.water_bucket) {
|
||||
hasWater = true;
|
||||
worldObj.func_96440_m(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
|
||||
stack.itemID = Item.bucketEmpty.itemID;
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
stack.func_150996_a(Items.bucket); // Set item
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
} else return false;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
didChange = true;
|
||||
break;
|
||||
}
|
||||
} else if(stack.itemID == Item.seeds.itemID) {
|
||||
} else if(stack.getItem() == Items.wheat_seeds) {
|
||||
for(RecipePetals recipe : BotaniaAPI.petalRecipes) {
|
||||
if(recipe.matches(this)) {
|
||||
for(int i = 0; i < getSizeInventory(); i++)
|
||||
@@ -85,7 +85,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
|
||||
craftingFanciness();
|
||||
hasWater = false;
|
||||
worldObj.func_96440_m(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
didChange = true;
|
||||
break;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
didChange = collideEntityItem(item) || didChange;
|
||||
|
||||
if(didChange)
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
for(int i = 0; i < getSizeInventory(); i++) {
|
||||
ItemStack stackAt = getStackInSlot(i);
|
||||
@@ -147,7 +147,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
public String getInventoryName() {
|
||||
return LibBlockNames.ALTAR;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,10 +15,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class TileDistributor extends TileMod implements IManaReceiver {
|
||||
|
||||
@@ -32,7 +31,7 @@ public class TileDistributor extends TileMod implements IManaReceiver {
|
||||
public void updateEntity() {
|
||||
validPools.clear();
|
||||
for(ForgeDirection dir : DIRECTIONS) {
|
||||
TileEntity tileAt = worldObj.getBlockTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
if(tileAt != null && tileAt instanceof IManaPool) {
|
||||
IManaReceiver receiver = (IManaReceiver) tileAt;
|
||||
if(!receiver.isFull())
|
||||
@@ -58,7 +57,8 @@ public class TileDistributor extends TileMod implements IManaReceiver {
|
||||
int manaForEach = mana / tiles;
|
||||
for(IManaReceiver pool : validPools) {
|
||||
pool.recieveMana(manaForEach);
|
||||
PacketDispatcher.sendPacketToAllInDimension(((TileEntity) pool).getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
TileEntity tile = (TileEntity) pool;
|
||||
worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ package vazkii.botania.common.block.tile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -29,7 +29,6 @@ import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
|
||||
@@ -80,10 +79,10 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
if(count > 0 && !worldObj.isRemote) {
|
||||
for(EntityItem entity : items) {
|
||||
ItemStack item = entity.getEntityItem();
|
||||
if(item.itemID == Item.enchantedBook.itemID) {
|
||||
NBTTagList enchants = Item.enchantedBook.func_92110_g(item);
|
||||
if(item.getItem() == Items.enchanted_book) {
|
||||
NBTTagList enchants = Items.enchanted_book.func_92110_g(item);
|
||||
if(enchants != null && enchants.tagCount() > 0) {
|
||||
NBTTagCompound enchant = (NBTTagCompound) enchants.tagAt(0);
|
||||
NBTTagCompound enchant = (NBTTagCompound) enchants.getCompoundTagAt(0);
|
||||
short id = enchant.getShort("id");
|
||||
if(isEnchantmentValid(id)) {
|
||||
advanceStage();
|
||||
@@ -99,11 +98,11 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
public void updateEntity() {
|
||||
if(!canEnchanterExist(worldObj, xCoord, yCoord, zCoord, getBlockMetadata())) {
|
||||
for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) {
|
||||
TilePylon pylonTile = (TilePylon) worldObj.getBlockTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]);
|
||||
TilePylon pylonTile = (TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]);
|
||||
if(pylonTile != null)
|
||||
pylonTile.activated = false;
|
||||
}
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, Block.blockLapis.blockID, 0, 1 | 2);
|
||||
worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.lapis_block, 0, 1 | 2);
|
||||
for(int i = 0; i < 50; i++) {
|
||||
float red = (float) Math.random();
|
||||
float green = (float) Math.random();
|
||||
@@ -123,11 +122,11 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
if(count > 0 && !worldObj.isRemote) {
|
||||
for(EntityItem entity : items) {
|
||||
ItemStack item = entity.getEntityItem();
|
||||
if(item.itemID == Item.enchantedBook.itemID) {
|
||||
if(item.getItem() == Items.enchanted_book) {
|
||||
// XXX - This needs to be rewritten for the new book enchanting in 1.7
|
||||
NBTTagList enchants = Item.enchantedBook.func_92110_g(item);
|
||||
NBTTagList enchants = Items.enchanted_book.func_92110_g(item);
|
||||
if(enchants != null && enchants.tagCount() > 0) {
|
||||
NBTTagCompound enchant = (NBTTagCompound) enchants.tagAt(0);
|
||||
NBTTagCompound enchant = (NBTTagCompound) enchants.getCompoundTagAt(0);
|
||||
short enchantId = enchant.getShort("id");
|
||||
short enchantLvl = enchant.getShort("lvl");
|
||||
if(!hasEnchantAlready(enchantId)) {
|
||||
@@ -151,7 +150,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
}
|
||||
case 2 : { // Get Mana
|
||||
for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()]) {
|
||||
TilePylon pylonTile = (TilePylon) worldObj.getBlockTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]);
|
||||
TilePylon pylonTile = (TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2]);
|
||||
if(pylonTile != null) {
|
||||
pylonTile.activated = true;
|
||||
pylonTile.centerX = xCoord;
|
||||
@@ -169,21 +168,20 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
} else if(mana >= manaRequired) {
|
||||
manaRequired = 0;
|
||||
for(int[] pylon : PYLON_LOCATIONS[getBlockMetadata()])
|
||||
((TilePylon) worldObj.getBlockTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2])).activated = false;
|
||||
((TilePylon) worldObj.getTileEntity(xCoord + pylon[0], yCoord + pylon[1], zCoord + pylon[2])).activated = false;
|
||||
|
||||
advanceStage();
|
||||
} else {
|
||||
getManaFromPools : {
|
||||
for(int i = -4; i < 5; i++)
|
||||
for(int j = -4; j < 5; j++) {
|
||||
TileEntity tile = worldObj.getBlockTileEntity(xCoord + i, yCoord, zCoord + j);
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord + i, yCoord, zCoord + j);
|
||||
if(tile instanceof IManaPool) {
|
||||
IManaPool pool = (IManaPool) tile;
|
||||
int manaToRemove = Math.min(pool.getCurrentMana(), Math.min(1000, manaRequired - mana + 1));
|
||||
if(!worldObj.isRemote) {
|
||||
pool.recieveMana(-manaToRemove);
|
||||
recieveMana((int) (manaToRemove * 0.9));
|
||||
PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
sync();
|
||||
}
|
||||
|
||||
@@ -267,7 +265,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
}
|
||||
|
||||
public void sync() {
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -281,7 +279,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
NBTTagCompound itemCmp = new NBTTagCompound();
|
||||
if(itemToEnchant != null)
|
||||
itemToEnchant.writeToNBT(itemCmp);
|
||||
cmp.setCompoundTag(TAG_ITEM, itemCmp);
|
||||
cmp.setTag(TAG_ITEM, itemCmp);
|
||||
|
||||
String enchStr = "";
|
||||
for(EnchantmentData data : enchants)
|
||||
@@ -337,16 +335,16 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
|
||||
|
||||
public static boolean canEnchanterExist(World world, int x, int y, int z, int meta) {
|
||||
for(int[] obsidian : OBSIDIAN_LOCATIONS)
|
||||
if(world.getBlockId(obsidian[0] + x, obsidian[1] + y, obsidian[2] + z) != Block.obsidian.blockID)
|
||||
if(world.getBlock(obsidian[0] + x, obsidian[1] + y, obsidian[2] + z) != Blocks.obsidian)
|
||||
return false;
|
||||
|
||||
for(int[] pylon : PYLON_LOCATIONS[meta])
|
||||
if(world.getBlockId(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon.blockID ||
|
||||
world.getBlockId(pylon[0] + x, pylon[1] + y - 1, pylon[2] + z) != ModBlocks.flower.blockID)
|
||||
if(world.getBlock(pylon[0] + x, pylon[1] + y, pylon[2] + z) != ModBlocks.pylon ||
|
||||
world.getBlock(pylon[0] + x, pylon[1] + y - 1, pylon[2] + z) != ModBlocks.flower)
|
||||
return false;
|
||||
|
||||
for(int[] flower : FLOWER_LOCATIONS)
|
||||
if(world.getBlockId(flower[0] + x, flower[1] + y, flower[2] + z) != ModBlocks.flower.blockID)
|
||||
if(world.getBlock(flower[0] + x, flower[1] + y, flower[2] + z) != ModBlocks.flower)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.common.Botania;
|
||||
|
||||
public class TileManaBeacon extends TileMod {
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileMod extends TileEntity {
|
||||
@@ -45,14 +45,14 @@ public class TileMod extends TileEntity {
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeCustomNBT(nbttagcompound);
|
||||
return new Packet132TileEntityData(xCoord, yCoord, zCoord, -999, nbttagcompound);
|
||||
return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(INetworkManager manager, Packet132TileEntityData packet) {
|
||||
super.onDataPacket(manager, packet);
|
||||
readCustomNBT(packet.data);
|
||||
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
||||
super.onDataPacket(net, packet);
|
||||
readCustomNBT(packet.func_148857_g());
|
||||
worldObj.func_147479_m(xCoord, yCoord, zCoord); // Mark block for render update
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,16 +11,20 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import ibxm.Player;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
@@ -34,8 +38,6 @@ import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class TilePool extends TileMod implements IManaPool {
|
||||
|
||||
@@ -53,8 +55,8 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
|
||||
@Override
|
||||
public boolean isFull() {
|
||||
int idBelow = worldObj.getBlockId(xCoord, yCoord - 1, zCoord);
|
||||
return idBelow != ModBlocks.manaVoid.blockID && mana >= MAX_MANA;
|
||||
Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
|
||||
return blockBelow != ModBlocks.manaVoid && mana >= MAX_MANA;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +65,7 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
|
||||
this.mana = Math.min(this.mana + mana, MAX_MANA);
|
||||
if(!full)
|
||||
worldObj.func_96440_m(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,7 +160,7 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
}
|
||||
|
||||
if(didSomething) {
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
if(worldObj.isRemote) {
|
||||
Color color = new Color(0x00C6FF);
|
||||
Botania.proxy.wispFX(worldObj, item.posX + Math.random() * 0.5 - 0.25, item.posY + Math.random() * 0.5 - (outputting ? 0.65 : 0.25), item.posZ + Math.random() * 0.5 - 0.25, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random() / 15F, (outputting ? -1F : 1) * (float) Math.random() / 25F);
|
||||
@@ -187,14 +189,15 @@ public class TilePool extends TileMod implements IManaPool {
|
||||
public void onWanded(EntityPlayer player, ItemStack wand) {
|
||||
if(player.isSneaking()) {
|
||||
outputting = !outputting;
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeCustomNBT(nbttagcompound);
|
||||
nbttagcompound.setInteger(TAG_KNOWN_MANA, getCurrentMana());
|
||||
PacketDispatcher.sendPacketToPlayer(new Packet132TileEntityData(xCoord, yCoord, zCoord, -999, nbttagcompound), (Player) player);
|
||||
if(player instanceof EntityPlayerMP)
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound));
|
||||
}
|
||||
|
||||
worldObj.playSoundAtEntity(player, "random.orb", 0.11F, 1F);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import vazkii.botania.common.Botania;
|
||||
@@ -25,15 +26,15 @@ public class TilePylon extends TileEntity {
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(activated && worldObj.isRemote) {
|
||||
if(worldObj.getBlockId(centerX, centerY, centerZ) != ModBlocks.enchanter.blockID) {
|
||||
if(worldObj.getBlock(centerX, centerY, centerZ) != ModBlocks.enchanter) {
|
||||
activated = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3 centerBlock = new Vector3(centerX + 0.5, centerY + 0.75 + (Math.random() - 0.5 * 0.25), centerZ + 0.5);
|
||||
|
||||
int id = worldObj.getBlockId(xCoord, yCoord - 1, zCoord);
|
||||
if(id == ModBlocks.flower.blockID) {
|
||||
Block block = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
|
||||
if(block == ModBlocks.flower) {
|
||||
int meta = worldObj.getBlockMetadata(xCoord, yCoord - 1, zCoord);
|
||||
float[] color = EntitySheep.fleeceColorTable[meta];
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
@@ -27,7 +28,6 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class TileRuneAltar extends TileSimpleInventory implements ISidedInventory, IManaReceiver {
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
int mana = 0;
|
||||
|
||||
public boolean addItem(EntityPlayer player, ItemStack stack) {
|
||||
if(stack.itemID == ModItems.twigWand.itemID || stack.itemID == ModItems.lexicon.itemID || manaToGet != 0)
|
||||
if(stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0)
|
||||
return false;
|
||||
|
||||
boolean did = false;
|
||||
@@ -59,7 +59,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
}
|
||||
|
||||
if(did)
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
|
||||
if(manaToGet != this.manaToGet) {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.orb", 1F, 1F);
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
|
||||
EntityItem livingrock = null;
|
||||
for(EntityItem item : items)
|
||||
if(item.getEntityItem() != null && item.getEntityItem().itemID == ModBlocks.livingrock.blockID) {
|
||||
if(item.getEntityItem() != null && item.getEntityItem().getItem() == Item.getItemFromBlock(ModBlocks.livingrock)) {
|
||||
livingrock = item;
|
||||
break;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
public String getInventoryName() {
|
||||
return LibBlockNames.RUNE_ALTAR;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,10 +23,10 @@ public abstract class TileSimpleInventory extends TileMod implements IInventory
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
|
||||
NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
|
||||
inventorySlots = new ItemStack[getSizeInventory()];
|
||||
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||
NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
|
||||
NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3);
|
||||
byte var5 = var4.getByte("Slot");
|
||||
if (var5 >= 0 && var5 < inventorySlots.length)
|
||||
inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
@@ -84,11 +84,6 @@ public abstract class TileSimpleInventory extends TileMod implements IInventory
|
||||
inventorySlots[i] = itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
@@ -96,21 +91,26 @@ public abstract class TileSimpleInventory extends TileMod implements IInventory
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this ? false : entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChest() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeChest() {
|
||||
// NO-OP
|
||||
return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : entityplayer.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,11 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.ITileBound;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -71,7 +72,7 @@ public class TileSpecialFlower extends TileMod implements ITileBound {
|
||||
|
||||
cmp.setString(TAG_SUBTILE_NAME, subTileName);
|
||||
NBTTagCompound subCmp = new NBTTagCompound();
|
||||
cmp.setCompoundTag(TAG_SUBTILE_CMP, subCmp);
|
||||
cmp.setTag(TAG_SUBTILE_CMP, subCmp);
|
||||
subTile.writeToPacketNBT(subCmp);
|
||||
}
|
||||
|
||||
@@ -88,8 +89,8 @@ public class TileSpecialFlower extends TileMod implements ITileBound {
|
||||
subTile.readFromPacketNBT(subCmp);
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return subTile == null ? Block.plantRed.getIcon(0, 0) : subTile.getIcon();
|
||||
public IIcon getIcon() {
|
||||
return subTile == null ? Blocks.red_flower.getIcon(0, 0) : subTile.getIcon();
|
||||
}
|
||||
|
||||
public LexiconEntry getEntry() {
|
||||
|
||||
@@ -21,14 +21,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -46,8 +46,6 @@ import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.entity.EntityManaBurst;
|
||||
import vazkii.botania.common.entity.EntityManaBurst.PositionProperties;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public class TileSpreader extends TileSimpleInventory implements IManaCollector, ITileBound {
|
||||
|
||||
@@ -102,7 +100,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
boolean redstone = false;
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
TileEntity tileAt = worldObj.getBlockTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
TileEntity tileAt = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
if(tileAt instanceof IManaPool) {
|
||||
IManaPool pool = (IManaPool) tileAt;
|
||||
int manaInPool = pool.getCurrentMana();
|
||||
@@ -161,7 +159,8 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
writeCustomNBT(nbttagcompound);
|
||||
nbttagcompound.setInteger(TAG_KNOWN_MANA, mana);
|
||||
PacketDispatcher.sendPacketToPlayer(new Packet132TileEntityData(xCoord, yCoord, zCoord, -999, nbttagcompound), (Player) player);
|
||||
if(player instanceof EntityPlayerMP)
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound));
|
||||
}
|
||||
worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1F);
|
||||
} else {
|
||||
@@ -191,7 +190,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
else this.receiver = null;
|
||||
|
||||
checkForReceiver();
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,7 +217,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
|
||||
canShootBurst = false;
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,7 +284,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
if (player instanceof EntityPlayerMP)
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3);
|
||||
return world.rayTraceBlocks_do_do(vec3, vec31, par3, !par3);
|
||||
return world.func_147447_a(vec3, vec31, par3, !par3, par3);
|
||||
}
|
||||
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
@@ -312,7 +311,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
|
||||
if(receiver != null) {
|
||||
TileEntity receiverTile = (TileEntity) receiver;
|
||||
ItemStack recieverStack = new ItemStack(worldObj.getBlockId(receiverTile.xCoord, receiverTile.yCoord, receiverTile.zCoord), 1, receiverTile.getBlockMetadata());
|
||||
ItemStack recieverStack = new ItemStack(worldObj.getBlock(receiverTile.xCoord, receiverTile.yCoord, receiverTile.zCoord), 1, receiverTile.getBlockMetadata());
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
if(recieverStack != null && recieverStack.getItem() != null) {
|
||||
@@ -351,7 +350,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
public String getInventoryName() {
|
||||
return LibBlockNames.SPREADER;
|
||||
}
|
||||
|
||||
@@ -366,11 +365,11 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoryChanged() {
|
||||
public void markDirty() {
|
||||
checkForReceiver();
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getBinding() {
|
||||
if(receiver == null)
|
||||
|
||||
@@ -18,12 +18,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class TileTurntable extends TileMod {
|
||||
|
||||
private static final String TAG_SPEED = "speed";
|
||||
@@ -43,7 +41,7 @@ public class TileTurntable extends TileMod {
|
||||
}
|
||||
|
||||
if(!redstone) {
|
||||
TileEntity tile = worldObj.getBlockTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
|
||||
if(tile instanceof TileSpreader) {
|
||||
TileSpreader spreader = (TileSpreader) tile;
|
||||
spreader.rotationX += speed * (backwards ? -1 : 1);
|
||||
@@ -69,7 +67,7 @@ public class TileTurntable extends TileMod {
|
||||
if(player.isSneaking())
|
||||
backwards = !backwards;
|
||||
else speed = speed == 6 ? 1 : speed + 1;
|
||||
PacketDispatcher.sendPacketToAllInDimension(getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Mar 12, 2014, 4:25:35 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.vanilla;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFlower;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
|
||||
public class BlockFlowerOverride extends BlockFlower {
|
||||
|
||||
Block original;
|
||||
|
||||
public BlockFlowerOverride(Block original) {
|
||||
super(original.blockID);
|
||||
this.original = original;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(net.minecraft.client.renderer.texture.IconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
original.registerIcons(par1IconRegister);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idSpecialFlower;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Mar 12, 2014, 4:08:35 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.vanilla;
|
||||
|
||||
import net.minecraft.block.BlockSnow;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockSnowOverride extends BlockSnow {
|
||||
|
||||
public static int forcedMeta = -1;
|
||||
|
||||
public BlockSnowOverride(int par1) {
|
||||
super(par1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
snow.registerIcons(par1IconRegister);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
|
||||
if(forcedMeta != -1) {
|
||||
setBlockBoundsForSnowDepth(forcedMeta);
|
||||
forcedMeta = -1;
|
||||
} else super.setBlockBoundsBasedOnState(par1IBlockAccess, par2, par3, par4);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,6 +34,12 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
public ItemStack getIconItemStack() {
|
||||
return new ItemStack(ModBlocks.flower);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
return getIconItemStack().getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayAllReleventItems(List list) {
|
||||
@@ -74,11 +80,12 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
}
|
||||
|
||||
private void addItem(Item item) {
|
||||
item.getSubItems(item.itemID, this, list);
|
||||
item.getSubItems(item, this, list);
|
||||
}
|
||||
|
||||
private void addBlock(Block block) {
|
||||
block.getSubBlocks(block.blockID, this, list);
|
||||
ItemStack stack = new ItemStack(block);
|
||||
block.getSubBlocks(stack.getItem(), this, list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,16 +12,16 @@
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.event.Event.Result;
|
||||
import net.minecraftforge.event.EventPriority;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
|
||||
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class BiomeDecorationHandler {
|
||||
|
||||
@ForgeSubscribe(priority = EventPriority.LOWEST)
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onWorldDecoration(DecorateBiomeEvent.Decorate event) {
|
||||
if((event.getResult() == Result.ALLOW || event.getResult() == Result.DEFAULT) && event.type == EventType.FLOWERS)
|
||||
for(int i = 0; i < ConfigHandler.flowerQuantity; i++) {
|
||||
@@ -34,8 +34,8 @@ public class BiomeDecorationHandler {
|
||||
int y1 = y + event.rand.nextInt(4) - event.rand.nextInt(4);
|
||||
int z1 = z + event.rand.nextInt(8) - event.rand.nextInt(8);
|
||||
|
||||
if (event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && Block.blocksList[ModBlocks.flower.blockID].canBlockStay(event.world, x1, y1, z1))
|
||||
event.world.setBlock(x1, y1, z1, ModBlocks.flower.blockID, event.rand.nextInt(16), 2);
|
||||
if (event.world.isAirBlock(x1, y1, z1) && (!event.world.provider.hasNoSky || y1 < 127) && ModBlocks.flower.canBlockStay(event.world, x1, y1, z1))
|
||||
event.world.setBlock(x1, y1, z1, ModBlocks.flower, event.rand.nextInt(16), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,8 @@ package vazkii.botania.common.core.handler;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.Property;
|
||||
import vazkii.botania.common.lib.LibBlockIDs;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibItemIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
public final class ConfigHandler {
|
||||
|
||||
@@ -27,7 +23,6 @@ public final class ConfigHandler {
|
||||
public static boolean lexiconRotatingItems = true;
|
||||
public static boolean subtlePowerSystem = false;
|
||||
public static boolean staticWandBeam = false;
|
||||
public static boolean overrideVanillaBlocks = true;
|
||||
public static boolean boundBlockWireframe = true;
|
||||
public static boolean lexicon3dModel = true;
|
||||
|
||||
@@ -51,10 +46,6 @@ public final class ConfigHandler {
|
||||
staticWandBeamProp.comment = "Set to true to use a static wand beam that shows every single position of the burst, similar to the way it used to work on old botania versions. Warning: Disabled by default because it may be laggy.";
|
||||
staticWandBeam = staticWandBeamProp.getBoolean(false);
|
||||
|
||||
Property overrideVanillaBlocksProp = config.get(Configuration.CATEGORY_GENERAL, "override.vanillaBlocks", true);
|
||||
overrideVanillaBlocksProp.comment = "Set to false to remove the overriding of vanilla blocks (snow, red and yellow flowers). Setting this to false will remove the snow on flowers tweak.";
|
||||
overrideVanillaBlocks = overrideVanillaBlocksProp.getBoolean(true);
|
||||
|
||||
Property boundBlockWireframeProp = config.get(Configuration.CATEGORY_GENERAL, "boundBlock.wireframe.enabled", true);
|
||||
boundBlockWireframeProp.comment = "Set to false to disable the wireframe when looking a block bound to something (spreaders, flowers, etc).";
|
||||
boundBlockWireframe = boundBlockWireframeProp.getBoolean(true);
|
||||
@@ -68,48 +59,8 @@ public final class ConfigHandler {
|
||||
Property propFlowerDensity = config.get(Configuration.CATEGORY_GENERAL, "worldgen.flower.density", 32);
|
||||
flowerDensity = propFlowerDensity.getInt(32);
|
||||
|
||||
// Block IDs
|
||||
LibBlockIDs.idFlower = loadBlock(LibBlockNames.FLOWER, LibBlockIDs.idFlower);
|
||||
LibBlockIDs.idAltar = loadBlock(LibBlockNames.ALTAR, LibBlockIDs.idAltar);
|
||||
LibBlockIDs.idSpecialFlower = loadBlock(LibBlockNames.SPECIAL_FLOWER, LibBlockIDs.idSpecialFlower);
|
||||
LibBlockIDs.idLivingrock = loadBlock(LibBlockNames.LIVING_ROCK, LibBlockIDs.idLivingrock);
|
||||
LibBlockIDs.idLivingwood = loadBlock(LibBlockNames.LIVING_WOOD, LibBlockIDs.idLivingwood);
|
||||
LibBlockIDs.idSpreader = loadBlock(LibBlockNames.SPREADER, LibBlockIDs.idSpreader);
|
||||
LibBlockIDs.idPool = loadBlock(LibBlockNames.POOL, LibBlockIDs.idPool);
|
||||
LibBlockIDs.idRuneAltar = loadBlock(LibBlockNames.RUNE_ALTAR, LibBlockIDs.idRuneAltar);
|
||||
LibBlockIDs.idUnstableBlock = loadBlock(LibBlockNames.UNSTABLE_BLOCK, LibBlockIDs.idUnstableBlock);
|
||||
LibBlockIDs.idPylon = loadBlock(LibBlockNames.PYLON, LibBlockIDs.idPylon);
|
||||
LibBlockIDs.idPistonRelay = loadBlock(LibBlockNames.PISTON_RELAY, LibBlockIDs.idPistonRelay);
|
||||
LibBlockIDs.idDistributor = loadBlock(LibBlockNames.DISTRIBUTOR, LibBlockIDs.idDistributor);
|
||||
LibBlockIDs.idManaBeacon = loadBlock(LibBlockNames.MANA_BEACON, LibBlockIDs.idManaBeacon);
|
||||
LibBlockIDs.idManaVoid = loadBlock(LibBlockNames.MANA_VOID, LibBlockIDs.idManaVoid);
|
||||
LibBlockIDs.idManaDetector = loadBlock(LibBlockNames.MANA_DETECTOR, LibBlockIDs.idManaDetector);
|
||||
LibBlockIDs.idEnchanter = loadBlock(LibBlockNames.ENCHANTER, LibBlockIDs.idEnchanter);
|
||||
LibBlockIDs.idTurntable = loadBlock(LibBlockNames.TURNTABLE, LibBlockIDs.idTurntable);
|
||||
|
||||
// Item IDs
|
||||
LibItemIDs.idLexicon = loadItem(LibItemNames.LEXICON, LibItemIDs.idLexicon);
|
||||
LibItemIDs.idPetal = loadItem(LibItemNames.PETAL, LibItemIDs.idPetal);
|
||||
LibItemIDs.idDye = loadItem(LibItemNames.DYE, LibItemIDs.idDye);
|
||||
LibItemIDs.idPestleAndMortar = loadItem(LibItemNames.PESTLE_AND_MORTAR, LibItemIDs.idPestleAndMortar);
|
||||
LibItemIDs.idTwigWand = loadItem(LibItemNames.TWIG_WAND, LibItemIDs.idTwigWand);
|
||||
LibItemIDs.idManaResource = loadItem(LibItemNames.MANA_RESOURCE, LibItemIDs.idManaResource);
|
||||
LibItemIDs.idLens = loadItem(LibItemNames.LENS, LibItemIDs.idLens);
|
||||
LibItemIDs.idManaPetal = loadItem(LibItemNames.MANA_PETAL, LibItemIDs.idManaPetal);
|
||||
LibItemIDs.idRune = loadItem(LibItemNames.RUNE, LibItemIDs.idRune);
|
||||
LibItemIDs.idSignalFlare = loadItem(LibItemNames.SIGNAL_FLARE, LibItemIDs.idSignalFlare);
|
||||
LibItemIDs.idManaTablet = loadItem(LibItemNames.MANA_TABLET, LibItemIDs.idManaTablet);
|
||||
LibItemIDs.idManaGun = loadItem(LibItemNames.MANA_GUN, LibItemIDs.idManaGun);
|
||||
LibItemIDs.idManaCookie = loadItem(LibItemNames.MANA_COOKIE, LibItemIDs.idManaCookie);
|
||||
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
private static int loadItem(String label, int defaultID) {
|
||||
return config.getItem(label, defaultID).getInt(defaultID);
|
||||
}
|
||||
|
||||
private static int loadBlock(String label, int defaultID) {
|
||||
return config.getBlock(label, defaultID).getInt(defaultID);
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,11 @@ package vazkii.botania.common.core.handler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.internal.IInternalMethodHandler;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
@@ -59,9 +59,9 @@ public class InternalMethodHandler implements IInternalMethodHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getSubTileIconForName(String name) {
|
||||
Icon icon = BlockSpecialFlower.icons.get(name);
|
||||
return icon == null ? Block.plantRed.getIcon(0, 0) : icon;
|
||||
public IIcon getSubTileIconForName(String name) {
|
||||
IIcon icon = BlockSpecialFlower.icons.get(name);
|
||||
return icon == null ? Blocks.red_flower.getIcon(0, 0) : icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,12 +18,12 @@ import java.util.Map;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import vazkii.botania.api.internal.IManaNetwork;
|
||||
import vazkii.botania.api.mana.ManaNetworkEvent;
|
||||
import vazkii.botania.api.mana.ManaNetworkEvent.Action;
|
||||
import vazkii.botania.api.mana.ManaNetworkEvent.ManaBlockType;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public final class ManaNetworkHandler implements IManaNetwork {
|
||||
|
||||
@@ -32,7 +32,7 @@ public final class ManaNetworkHandler implements IManaNetwork {
|
||||
public Map<Integer, List<TileEntity>> manaPools = new HashMap();
|
||||
public Map<Integer, List<TileEntity>> manaCollectors = new HashMap();
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onNetworkEvent(ManaNetworkEvent event) {
|
||||
Map<Integer, List<TileEntity>> map = event.type == ManaBlockType.COLLECTOR ? manaCollectors : manaPools;
|
||||
if(event.action == Action.ADD)
|
||||
@@ -79,7 +79,7 @@ public final class ManaNetworkHandler implements IManaNetwork {
|
||||
}
|
||||
|
||||
private synchronized void remove(Map<Integer, List<TileEntity>> map, TileEntity tile) {
|
||||
int dim = tile.worldObj.provider.dimensionId;
|
||||
int dim = tile.getWorldObj().provider.dimensionId;
|
||||
|
||||
if(!map.containsKey(dim))
|
||||
return;
|
||||
@@ -89,7 +89,7 @@ public final class ManaNetworkHandler implements IManaNetwork {
|
||||
}
|
||||
|
||||
private synchronized void add(Map<Integer, List<TileEntity>> map, TileEntity tile) {
|
||||
int dim = tile.worldObj.provider.dimensionId;
|
||||
int dim = tile.getWorldObj().provider.dimensionId;
|
||||
|
||||
List<TileEntity> tiles;
|
||||
if(!map.containsKey(dim))
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
@@ -38,7 +39,7 @@ public class WorldTreeGenerator {
|
||||
}
|
||||
|
||||
public void generateRing(int yoff, int radius) {
|
||||
int id = ModBlocks.livingwood.blockID;
|
||||
Block block = ModBlocks.livingwood;
|
||||
y = yoff;
|
||||
|
||||
for(int i = 0; i < 360; i++) {
|
||||
@@ -46,7 +47,7 @@ public class WorldTreeGenerator {
|
||||
continue;
|
||||
|
||||
int meta = world.rand.nextInt(200) == 0 ? 5 : 0;
|
||||
generateRingVal(radius, i, id, meta);
|
||||
generateRingVal(radius, i, block, meta);
|
||||
}
|
||||
|
||||
int mul = 4;
|
||||
@@ -55,8 +56,8 @@ public class WorldTreeGenerator {
|
||||
int meta = world.rand.nextInt(4) == 0 ? 5 : 0;
|
||||
int angle = (y - j) * mul % 360;
|
||||
|
||||
generateRingVal(radius - i - 3, angle, id, meta);
|
||||
generateRingVal(radius - i - 3, angle + 180, id, meta);
|
||||
generateRingVal(radius - i - 3, angle, block, meta);
|
||||
generateRingVal(radius - i - 3, angle + 180, block, meta);
|
||||
}
|
||||
|
||||
mul = 3;
|
||||
@@ -65,25 +66,25 @@ public class WorldTreeGenerator {
|
||||
for(int j = 0; j < mul; j++) {
|
||||
int meta = world.rand.nextInt(20) == 0 ? 5 : 0;
|
||||
int angle = (y - j) * mul % 360;
|
||||
generateRingVal(radius + i - 1, angle + 90, id, meta);
|
||||
generateRingVal(radius + i - 1, angle + 270, id, meta);
|
||||
generateRingVal(radius + i - 1, angle + 90, block, meta);
|
||||
generateRingVal(radius + i - 1, angle + 270, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
public void generateRingVal(int radius, int angle, int blockid, int meta) {
|
||||
public void generateRingVal(int radius, int angle, Block block, int meta) {
|
||||
int nx = (int) (Math.cos(angle * Math.PI / 180D) * radius);
|
||||
int nz = (int) (Math.sin(angle * Math.PI / 180D) * radius);
|
||||
|
||||
if(x != nx || z != nz) {
|
||||
x = nx;
|
||||
z = nz;
|
||||
place(srcx + x, srcy + y, srcz + z, blockid, meta);
|
||||
place(srcx + x, srcy + y, srcz + z, block, meta);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void place(int x, int y, int z, int id, int meta) {
|
||||
world.setBlock(x, y, z, id, meta, 2);
|
||||
public void place(int x, int y, int z, Block block, int meta) {
|
||||
world.setBlock(x, y, z, block, meta, 2);
|
||||
blocksPlaced++;
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@@ -27,7 +28,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
//From OpenBlocksLib: https://github.com/OpenMods/OpenModsLib
|
||||
public class InventoryHelper {
|
||||
@@ -146,17 +147,17 @@ public class InventoryHelper {
|
||||
}
|
||||
|
||||
public static IInventory getInventory(World world, int x, int y, int z) {
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if(tileEntity instanceof TileEntityChest) {
|
||||
int chestId = world.getBlockId(x, y, z);
|
||||
if(world.getBlockId(x - 1, y, z) == chestId)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)world.getBlockTileEntity(x - 1, y, z), (IInventory)tileEntity);
|
||||
if(world.getBlockId(x + 1, y, z) == chestId)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getBlockTileEntity(x + 1, y, z));
|
||||
if(world.getBlockId(x, y, z - 1) == chestId)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)world.getBlockTileEntity(x, y, z - 1), (IInventory)tileEntity);
|
||||
if(world.getBlockId(x, y, z + 1) == chestId)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getBlockTileEntity(x, y, z + 1));
|
||||
Block chestBlock = world.getBlock(x, y, z);
|
||||
if(world.getBlock(x - 1, y, z) == chestBlock)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)world.getTileEntity(x - 1, y, z), (IInventory)tileEntity);
|
||||
if(world.getBlock(x + 1, y, z) == chestBlock)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getTileEntity(x + 1, y, z));
|
||||
if(world.getBlock(x, y, z - 1) == chestBlock)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)world.getTileEntity(x, y, z - 1), (IInventory)tileEntity);
|
||||
if(world.getBlock(x, y, z + 1) == chestBlock)
|
||||
return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getTileEntity(x, y, z + 1));
|
||||
}
|
||||
return tileEntity instanceof IInventory ? (IInventory)tileEntity : null;
|
||||
}
|
||||
@@ -174,7 +175,7 @@ public class InventoryHelper {
|
||||
public static IInventory getInventory(IInventory inventory) {
|
||||
if(inventory instanceof TileEntityChest) {
|
||||
TileEntity te = (TileEntity)inventory;
|
||||
return getInventory(te.worldObj, te.xCoord, te.yCoord, te.zCoord);
|
||||
return getInventory(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord);
|
||||
}
|
||||
return inventory;
|
||||
}
|
||||
@@ -193,9 +194,6 @@ public class InventoryHelper {
|
||||
inventoryContents = new ItemStack[size];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeChest() { }
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if(inventoryContents[par1] != null) {
|
||||
@@ -221,11 +219,6 @@ public class InventoryHelper {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInvName() {
|
||||
return inventoryTitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slotsCount;
|
||||
@@ -254,11 +247,6 @@ public class InventoryHelper {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
return isInvNameLocalized;
|
||||
}
|
||||
|
||||
public boolean isItem(int slot, Item item) {
|
||||
return inventoryContents[slot] != null && inventoryContents[slot].getItem() == item;
|
||||
}
|
||||
@@ -273,9 +261,6 @@ public class InventoryHelper {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openChest() { }
|
||||
|
||||
public void clearAndSetSlotCount(int amount) {
|
||||
slotsCount = amount;
|
||||
inventoryContents = new ItemStack[amount];
|
||||
@@ -285,10 +270,10 @@ public class InventoryHelper {
|
||||
if(tag.hasKey("size"))
|
||||
slotsCount = tag.getInteger("size");
|
||||
|
||||
NBTTagList nbttaglist = tag.getTagList("Items");
|
||||
NBTTagList nbttaglist = tag.getTagList("Items", 10);
|
||||
inventoryContents = new ItemStack[slotsCount];
|
||||
for(int i = 0; i < nbttaglist.tagCount(); i++) {
|
||||
NBTTagCompound stacktag = (NBTTagCompound)nbttaglist.tagAt(i);
|
||||
NBTTagCompound stacktag = (NBTTagCompound)nbttaglist.getCompoundTagAt(i);
|
||||
int j = stacktag.getByte("Slot");
|
||||
if(j >= 0 && j < inventoryContents.length)
|
||||
inventoryContents[j] = ItemStack.loadItemStackFromNBT(stacktag);
|
||||
@@ -317,9 +302,6 @@ public class InventoryHelper {
|
||||
tag.setTag("Items", nbttaglist);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInventoryChanged() { }
|
||||
|
||||
public void copyFrom(IInventory inventory) {
|
||||
for(int i = 0; i < inventory.getSizeInventory(); i++)
|
||||
if(i < getSizeInventory()) {
|
||||
@@ -333,5 +315,24 @@ public class InventoryHelper {
|
||||
public List<ItemStack> contents() {
|
||||
return Arrays.asList(inventoryContents);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() { }
|
||||
|
||||
@Override
|
||||
public void openInventory() { }
|
||||
|
||||
@Override
|
||||
public void closeInventory() { }
|
||||
}
|
||||
}
|
||||
@@ -77,11 +77,7 @@ public final class ItemNBTHelper {
|
||||
|
||||
public static void setCompound(ItemStack stack, String tag, NBTTagCompound cmp) {
|
||||
if(!tag.equalsIgnoreCase("ench")) // not override the enchantments
|
||||
getNBT(stack).setCompoundTag(tag, cmp);
|
||||
}
|
||||
|
||||
public static void setCompound(ItemStack stack, NBTTagCompound cmp) {
|
||||
setCompound(stack, cmp.getName(), cmp);
|
||||
getNBT(stack).setTag(tag, cmp);
|
||||
}
|
||||
|
||||
public static void setString(ItemStack stack, String tag, String s) {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void init(FMLInitializationEvent event) {
|
||||
NetworkRegistry.instance().registerGuiHandler(Botania.instance, new GuiHandler());
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(Botania.instance, new GuiHandler());
|
||||
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeDecorationHandler());
|
||||
MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
|
||||
|
||||
@@ -14,6 +14,8 @@ package vazkii.botania.common.crafting;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
@@ -75,7 +77,7 @@ public final class ModCrafingRecipes {
|
||||
|
||||
public static void init() {
|
||||
// Lexicon Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.lexicon), "treeSapling", Item.book);
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.lexicon), "treeSapling", Items.book);
|
||||
recipeLexicon = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Petal/Dye Recipes
|
||||
@@ -92,7 +94,7 @@ public final class ModCrafingRecipes {
|
||||
" S", "W ", "B ",
|
||||
'S', "stickWood",
|
||||
'W', "plankWood",
|
||||
'B', Item.bowlEmpty);
|
||||
'B', Items.bowl);
|
||||
recipePestleAndMortar = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Wand of the Forest Recipes
|
||||
@@ -110,7 +112,7 @@ public final class ModCrafingRecipes {
|
||||
for(int i = 0; i < 16; i++)
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.altar),
|
||||
"SPS", " C ", "CCC",
|
||||
'S', new ItemStack(Block.stoneSingleSlab, 1, 3),
|
||||
'S', new ItemStack(Blocks.stone_slab, 1, 3),
|
||||
'P', LibOreDict.PETAL[i],
|
||||
'C', "cobblestone");
|
||||
recipesApothecary = BotaniaAPI.getLatestAddedRecipes(16);
|
||||
@@ -128,7 +130,7 @@ public final class ModCrafingRecipes {
|
||||
addOreDictRecipe(new ItemStack(ModItems.lens),
|
||||
" S ", "SGS", " S ",
|
||||
'S', LibOreDict.MANA_STEEL,
|
||||
'G', new ItemStack(Block.thinGlass));
|
||||
'G', new ItemStack(Blocks.glass_pane));
|
||||
recipeManaLens = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Mana Lens Dying Recipes
|
||||
@@ -201,9 +203,9 @@ public final class ModCrafingRecipes {
|
||||
for(int i = 0; i < 16; i++)
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.unstableBlock, 2, i),
|
||||
"OPO", "PMP", "OPO",
|
||||
'O', new ItemStack(Block.obsidian),
|
||||
'O', new ItemStack(Blocks.obsidian),
|
||||
'P', LibOreDict.PETAL[i],
|
||||
'M', new ItemStack(Item.enderPearl));
|
||||
'M', new ItemStack(Items.ender_pearl));
|
||||
recipesUnstableBlocks = BotaniaAPI.getLatestAddedRecipes(16);
|
||||
|
||||
// Mana Pylon Recipe
|
||||
@@ -226,7 +228,7 @@ public final class ModCrafingRecipes {
|
||||
"RR", "RR",
|
||||
'R', LibOreDict.LIVING_ROCK);
|
||||
livingrockDecorRecipe1 = BotaniaAPI.getLatestAddedRecipe();
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 1, 2), new ItemStack(ModBlocks.livingrock, 1, 1), new ItemStack(Item.seeds));
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 1, 2), new ItemStack(ModBlocks.livingrock, 1, 1), new ItemStack(Items.wheat_seeds));
|
||||
livingrockDecorRecipe2 = BotaniaAPI.getLatestAddedRecipe();
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingrock, 2, 3), new ItemStack(ModBlocks.livingrock, 1, 1), "cobblestone");
|
||||
livingrockDecorRecipe3 = BotaniaAPI.getLatestAddedRecipe();
|
||||
@@ -238,7 +240,7 @@ public final class ModCrafingRecipes {
|
||||
// Livingwood Decorative Blocks
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 1), LibOreDict.LIVING_WOOD);
|
||||
livingwoodDecorRecipe1 = BotaniaAPI.getLatestAddedRecipe();
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 2), new ItemStack(ModBlocks.livingwood, 1, 1), new ItemStack(Item.seeds));
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 2), new ItemStack(ModBlocks.livingwood, 1, 1), new ItemStack(Items.wheat_seeds));
|
||||
livingwoodDecorRecipe2 = BotaniaAPI.getLatestAddedRecipe();
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.livingwood, 4, 3),
|
||||
"WW", "WW",
|
||||
@@ -249,7 +251,7 @@ public final class ModCrafingRecipes {
|
||||
'W', new ItemStack(ModBlocks.livingwood, 1, 1));
|
||||
livingwoodDecorRecipe4 = BotaniaAPI.getLatestAddedRecipe();
|
||||
addShapelessOreDictRecipe(new ItemStack(ModBlocks.livingwood, 1, 5),
|
||||
LibOreDict.LIVING_WOOD, new ItemStack(Item.glowstone));
|
||||
LibOreDict.LIVING_WOOD, new ItemStack(Items.glowstone_dust));
|
||||
livingwoodDecorRecipe5 = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Mana Beacon Recipe
|
||||
@@ -273,7 +275,7 @@ public final class ModCrafingRecipes {
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.manaVoid),
|
||||
"SSS", "O O", "SSS",
|
||||
'S', LibOreDict.LIVING_ROCK,
|
||||
'O', new ItemStack(Block.obsidian));
|
||||
'O', new ItemStack(Blocks.obsidian));
|
||||
recipeManaVoid = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Mana Tablet Recipe
|
||||
@@ -290,8 +292,8 @@ public final class ModCrafingRecipes {
|
||||
// Mana Detector Recipe
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.manaDetector),
|
||||
"RSR", "SCS", "RSR",
|
||||
'R', new ItemStack(Item.redstone),
|
||||
'C', new ItemStack(Item.comparator),
|
||||
'R', new ItemStack(Items.redstone),
|
||||
'C', new ItemStack(Items.comparator),
|
||||
'S', LibOreDict.LIVING_ROCK);
|
||||
recipeManaDetector = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
@@ -301,7 +303,7 @@ public final class ModCrafingRecipes {
|
||||
'S', new ItemStack(ModBlocks.spreader),
|
||||
'M', LibOreDict.RUNE[8],
|
||||
'D', LibOreDict.MANA_DIAMOND,
|
||||
'T', new ItemStack(Block.tnt),
|
||||
'T', new ItemStack(Blocks.tnt),
|
||||
'W', LibOreDict.LIVING_WOOD);
|
||||
recipeManaBlaster = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
@@ -309,7 +311,7 @@ public final class ModCrafingRecipes {
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.turntable),
|
||||
"WWW", "WPW", "WWW",
|
||||
'W', LibOreDict.LIVING_WOOD,
|
||||
'P', Block.pistonStickyBase);
|
||||
'P', Blocks.sticky_piston);
|
||||
recipeTurntable = BotaniaAPI.getLatestAddedRecipe();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ package vazkii.botania.common.crafting;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -38,10 +39,10 @@ public final class ModManaInfusionRecipes {
|
||||
manaPetalRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaPetal, 1, i), LibOreDict.PETAL[i], 1000));
|
||||
|
||||
manasteelRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 0), "ingotIron", 3000);
|
||||
manaPearlRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 1), new ItemStack(Item.enderPearl), 6000);
|
||||
manaPearlRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 1), new ItemStack(Items.ender_pearl), 6000);
|
||||
manaDiamondRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 2), "gemDiamond", 10000);
|
||||
pistonRelayRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pistonRelay), new ItemStack(Block.pistonBase), 15000);
|
||||
manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Item.cookie), 20000);
|
||||
pistonRelayRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pistonRelay), new ItemStack(Blocks.piston), 15000);
|
||||
manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Items.cookie), 20000);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -46,19 +48,19 @@ public final class ModRuneRecipes {
|
||||
final int costTier2 = 4000;
|
||||
final int costTier3 = 6000;
|
||||
|
||||
recipeWaterRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 0), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.reed), new ItemStack(Item.fishingRod));
|
||||
recipeFireRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 1), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Item.blazeRod), new ItemStack(Item.gunpowder), new ItemStack(Item.netherStalkSeeds));
|
||||
recipeWaterRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 0), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Items.dye, 1, 15), new ItemStack(Items.reeds), new ItemStack(Items.fishing_rod));
|
||||
recipeFireRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 1), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Items.blaze_rod), new ItemStack(Items.gunpowder), new ItemStack(Items.nether_wart));
|
||||
|
||||
recipesEarthRune = new ArrayList();
|
||||
recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 2), costTier1, LibOreDict.MANA_STEEL, "stone", new ItemStack(Block.dirt), new ItemStack(Block.mushroomBrown)));
|
||||
recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 2), costTier1, LibOreDict.MANA_STEEL, "stone", new ItemStack(Block.dirt), new ItemStack(Block.mushroomRed)));
|
||||
recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 2), costTier1, LibOreDict.MANA_STEEL, "stone", new ItemStack(Blocks.dirt), new ItemStack(Blocks.brown_mushroom)));
|
||||
recipesEarthRune.add(BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 2), costTier1, LibOreDict.MANA_STEEL, "stone", new ItemStack(Blocks.dirt), new ItemStack(Blocks.red_mushroom)));
|
||||
|
||||
recipeAirRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 3), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Block.carpet), new ItemStack(Item.feather), new ItemStack(Item.carrot));
|
||||
recipeAirRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 3), costTier1, LibOreDict.MANA_STEEL, new ItemStack(Blocks.carpet), 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(Item.wheat));
|
||||
recipeSummerRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 5), costTier2, LibOreDict.RUNE[2], LibOreDict.RUNE[3], new ItemStack(Block.sand), new ItemStack(Block.sand), new ItemStack(Item.slimeBall), new ItemStack(Item.melon));
|
||||
recipeAutumnRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 6), costTier2, LibOreDict.RUNE[1], LibOreDict.RUNE[3], "treeLeaves", "treeLeaves", "treeLeaves", new ItemStack(Item.spiderEye));
|
||||
recipeWinterRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 1, 7), costTier2, LibOreDict.RUNE[0], LibOreDict.RUNE[2], new ItemStack(Block.blockSnow), new ItemStack(Block.blockSnow), new ItemStack(Block.cloth), new ItemStack(Item.cake));
|
||||
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));
|
||||
recipeWinterRune = 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), 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);
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
@@ -35,7 +35,7 @@ public class CompositeLensRecipe implements IRecipe {
|
||||
if(foundLens)
|
||||
foundSecondLens = true;
|
||||
else foundLens = true;
|
||||
} else if(stack.itemID == Item.slimeBall.itemID)
|
||||
} else if(stack.getItem() == Items.slime_ball)
|
||||
foundSlimeball = true;
|
||||
else return false; // Found an invalid item, breaking the recipe
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -38,7 +39,6 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.tile.TileSpreader;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
|
||||
public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
if(i == 4 || i == 5 || i == 10 || i == 11 || i == 12)
|
||||
dataWatcher.addObject(j, 0F);
|
||||
else if(i == 9)
|
||||
dataWatcher.addObject(j, new ItemStack(1, 0, 0));
|
||||
dataWatcher.addObject(j, new ItemStack(Blocks.stone, 0, 0));
|
||||
else dataWatcher.addObject(j, 0);
|
||||
|
||||
dataWatcher.setObjectWatched(j);
|
||||
@@ -83,7 +83,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
}
|
||||
|
||||
public EntityManaBurst(TileSpreader spreader, boolean fake) {
|
||||
this(spreader.worldObj);
|
||||
this(spreader.getWorldObj());
|
||||
this.fake = fake;
|
||||
|
||||
setBurstSourceCoords(spreader.xCoord, spreader.yCoord, spreader.zCoord);
|
||||
@@ -206,18 +206,17 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
int l = MathHelper.floor_double(par1Vec3.xCoord);
|
||||
int i1 = MathHelper.floor_double(par1Vec3.yCoord);
|
||||
int j1 = MathHelper.floor_double(par1Vec3.zCoord);
|
||||
int k1 = worldObj.getBlockId(l, i1, j1);
|
||||
Block block = worldObj.getBlock(l, i1, j1);
|
||||
int l1 = worldObj.getBlockMetadata(l, i1, j1);
|
||||
Block block = Block.blocksList[k1];
|
||||
|
||||
if (block != null && (!par4 || block == null || block.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && k1 > 0 && block.canCollideCheck(l1, par3)) {
|
||||
if (block != null && (!par4 || block == null || block.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block != Blocks.air && block.canCollideCheck(l1, par3)) {
|
||||
MovingObjectPosition movingobjectposition = block.collisionRayTrace(worldObj, l, i1, j1, par1Vec3, par2Vec3);
|
||||
|
||||
if (movingobjectposition != null)
|
||||
return movingobjectposition;
|
||||
}
|
||||
|
||||
k1 = 200;
|
||||
int k1 = 200;
|
||||
|
||||
while (k1-- >= 0) {
|
||||
if (Double.isNaN(par1Vec3.xCoord) || Double.isNaN(par1Vec3.yCoord) || Double.isNaN(par1Vec3.zCoord))
|
||||
@@ -317,11 +316,10 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
++vec32.zCoord;
|
||||
}
|
||||
|
||||
int i2 = worldObj.getBlockId(l, i1, j1);
|
||||
Block block1 = worldObj.getBlock(l, i1, j1);
|
||||
int j2 = worldObj.getBlockMetadata(l, i1, j1);
|
||||
Block block1 = Block.blocksList[i2];
|
||||
|
||||
if ((!par4 || block1 == null || block1.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && i2 > 0 && block1.canCollideCheck(j2, par3)) {
|
||||
if ((!par4 || block1 == null || block1.getCollisionBoundingBoxFromPool(worldObj, l, i1, j1) != null) && block1 != Blocks.air && block1.canCollideCheck(j2, par3)) {
|
||||
MovingObjectPosition movingobjectposition1 = block1.collisionRayTrace(worldObj, l, i1, j1, par1Vec3, par2Vec3);
|
||||
|
||||
if (movingobjectposition1 != null)
|
||||
@@ -493,7 +491,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
boolean dead = false;
|
||||
|
||||
if(movingobjectposition.entityHit == null) {
|
||||
TileEntity tile = worldObj.getBlockTileEntity(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
|
||||
TileEntity tile = worldObj.getTileEntity(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
|
||||
|
||||
if(tile instanceof IManaCollisionGhost && ((IManaCollisionGhost) tile).isGhost())
|
||||
return;
|
||||
@@ -509,7 +507,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
mana *= ((IManaCollector) tile).getManaYieldMultiplier(this);
|
||||
|
||||
((IManaReceiver) tile).recieveMana(mana);
|
||||
PacketDispatcher.sendPacketToAllInDimension(tile.getDescriptionPacket(), worldObj.provider.dimensionId);
|
||||
worldObj.markBlockForUpdate(tile.xCoord, tile.yCoord, tile.zCoord);
|
||||
}
|
||||
|
||||
dead = true;
|
||||
@@ -552,7 +550,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
if(!fake) {
|
||||
ChunkCoordinates coords = getBurstSourceChunkCoordinates();
|
||||
TileEntity tile = worldObj.getBlockTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
if(tile != null && tile instanceof TileSpreader)
|
||||
((TileSpreader) tile).canShootBurst = true;
|
||||
} else setDeathTicksForFakeParticle();
|
||||
@@ -657,7 +655,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
@Override
|
||||
public void setSourceLens(ItemStack lens) {
|
||||
dataWatcher.updateObject(dataWatcherStart + 9, lens == null ? new ItemStack(1, 0, 0) : lens);
|
||||
dataWatcher.updateObject(dataWatcherStart + 9, lens == null ? new ItemStack(Blocks.stone, 0, 0) : lens);
|
||||
}
|
||||
|
||||
public ILens getLensInstance() {
|
||||
@@ -691,7 +689,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
return true;
|
||||
|
||||
ChunkCoordinates coords = getBurstSourceChunkCoordinates();
|
||||
TileEntity tile = worldObj.getBlockTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
if(tile != null && tile instanceof TileSpreader)
|
||||
return getMana() != getStartingMana() && fullManaLastTick || Math.abs(((TileSpreader) tile).burstParticleTick - ticksExisted) < 4;
|
||||
return false;
|
||||
@@ -699,7 +697,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
private void incrementFakeParticleTick() {
|
||||
ChunkCoordinates coords = getBurstSourceChunkCoordinates();
|
||||
TileEntity tile = worldObj.getBlockTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
if(tile != null && tile instanceof TileSpreader) {
|
||||
TileSpreader spreader = (TileSpreader) tile;
|
||||
spreader.burstParticleTick += 2;
|
||||
@@ -710,7 +708,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
|
||||
private void setDeathTicksForFakeParticle() {
|
||||
ChunkCoordinates coords = getBurstSourceChunkCoordinates();
|
||||
TileEntity tile = worldObj.getBlockTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
TileEntity tile = worldObj.getTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
if(tile != null && tile instanceof TileSpreader)
|
||||
((TileSpreader) tile).lastBurstDeathTick = ticksExisted;
|
||||
}
|
||||
@@ -718,14 +716,15 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
public static class PositionProperties {
|
||||
|
||||
public final ChunkCoordinates coords;
|
||||
public final int id; int meta;
|
||||
public final Block block;
|
||||
public final int meta;
|
||||
|
||||
public PositionProperties(Entity entity) {
|
||||
int x = (int) entity.posX;
|
||||
int y = (int) entity.posY;
|
||||
int z = (int) entity.posZ;
|
||||
coords = new ChunkCoordinates(x, y, z);
|
||||
id = entity.worldObj.getBlockId(x, y, z);
|
||||
block = entity.worldObj.getBlock(x, y, z);
|
||||
meta = entity.worldObj.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
@@ -734,9 +733,9 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
}
|
||||
|
||||
public boolean contentsEqual(World world) {
|
||||
int id = world.getBlockId(coords.posX, coords.posY, coords.posZ);
|
||||
Block block = world.getBlock(coords.posX, coords.posY, coords.posZ);
|
||||
int meta = world.getBlockMetadata(coords.posX, coords.posY, coords.posZ);
|
||||
return id == this.id && meta == this.meta;
|
||||
return block == this.block && meta == this.meta;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,13 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class Item16Colors extends ItemMod {
|
||||
|
||||
public Item16Colors(int par1, String name) {
|
||||
super(par1);
|
||||
public Item16Colors(String name) {
|
||||
super();
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
@@ -33,9 +34,9 @@ public class Item16Colors extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
par3List.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,13 +11,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import vazkii.botania.common.lib.LibItemIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemDye extends Item16Colors {
|
||||
|
||||
public ItemDye() {
|
||||
super(LibItemIDs.idDye, LibItemNames.DYE);
|
||||
super(LibItemNames.DYE);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,23 +18,24 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
@@ -45,7 +46,6 @@ import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.crafting.recipe.CompositeLensRecipe;
|
||||
import vazkii.botania.common.lib.LibItemIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@@ -68,13 +68,13 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
private static final String TAG_COLOR = "color";
|
||||
private static final String TAG_COMPOSITE_LENS = "compositeLens";
|
||||
|
||||
public static Icon iconGlass;
|
||||
public static IIcon iconGlass;
|
||||
|
||||
public static final int SUBTYPES = 12;
|
||||
Icon[] ringIcons;
|
||||
IIcon[] ringIcons;
|
||||
|
||||
public ItemLens() {
|
||||
super(LibItemIDs.idLens);
|
||||
super();
|
||||
setUnlocalizedName(LibItemNames.LENS);
|
||||
setMaxStackSize(1);
|
||||
setHasSubtypes(true);
|
||||
@@ -83,16 +83,16 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
iconGlass = IconHelper.forName(par1IconRegister, "lensInside");
|
||||
|
||||
ringIcons = new Icon[SUBTYPES];
|
||||
ringIcons = new IIcon[SUBTYPES];
|
||||
for(int i = 0; i < ringIcons.length; i++)
|
||||
ringIcons[i] = IconHelper.forNameRaw(par1IconRegister, LibItemNames.LENS_NAMES[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
@@ -103,12 +103,12 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
public IIcon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
return par2 == 0 ? ringIcons[Math.min(SUBTYPES - 1, par1)] : iconGlass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return getIconFromDamageForRenderPass(par1, 0);
|
||||
}
|
||||
|
||||
@@ -135,10 +135,10 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemDisplayName(ItemStack stack) {
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
ItemStack compositeLens = getCompositeLens(stack);
|
||||
if(compositeLens == null)
|
||||
return super.getItemDisplayName(stack);
|
||||
return super.getItemStackDisplayName(stack);
|
||||
return String.format(StatCollector.translateToLocal("item.botania:compositeLens.name"), getItemShortTermName(stack), getItemShortTermName(compositeLens));
|
||||
}
|
||||
|
||||
@@ -209,10 +209,9 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
int x = pos.blockX;
|
||||
int y = pos.blockY;
|
||||
int z = pos.blockZ;
|
||||
int id = world.getBlockId(x, y, z);
|
||||
Block block = world.getBlock(x, y, z);
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block block = Block.blocksList[id];
|
||||
float hardness = block.getBlockHardness(world, x, y, z);
|
||||
int mana = burst.getMana();
|
||||
|
||||
@@ -220,12 +219,12 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
if((coords.posX != x || coords.posY != y || coords.posZ != z) && !isManaBlock && block != null && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) {
|
||||
List<ItemStack> items = new ArrayList();
|
||||
|
||||
items.addAll(block.getBlockDropped(world, x, y, z, meta, 0));
|
||||
items.addAll(block.getDrops(world, x, y, z, meta, 0));
|
||||
|
||||
if(!burst.hasAlreadyCollidedAt(x, y, z)) {
|
||||
if(!burst.isFake() && !entity.worldObj.isRemote) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
entity.worldObj.playAuxSFX(2001, x, y, z, id + (meta << 12));
|
||||
entity.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
|
||||
|
||||
for(ItemStack stack_ : items)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack_));
|
||||
@@ -294,8 +293,8 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
for(int i = -range; i < range; i++)
|
||||
for(int j = -range; j < range; j++)
|
||||
for(int k = -range; k < range; k++)
|
||||
if(entity.worldObj.getBlockTileEntity(i + x, j + y, k + z) instanceof IManaReceiver) {
|
||||
TileEntity tile = entity.worldObj.getBlockTileEntity(i + x, j + y, k + z);
|
||||
if(entity.worldObj.getTileEntity(i + x, j + y, k + z) instanceof IManaReceiver) {
|
||||
TileEntity tile = entity.worldObj.getTileEntity(i + x, j + y, k + z);
|
||||
|
||||
if(magnetized) {
|
||||
int magX = entity.getEntityData().getInteger("Botania:MagnetizedX");
|
||||
|
||||
@@ -20,13 +20,12 @@ import vazkii.botania.api.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemLexicon extends ItemMod {
|
||||
|
||||
public ItemLexicon() {
|
||||
super(LibItemIDs.idLexicon);
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(LibItemNames.LEXICON);
|
||||
}
|
||||
@@ -34,8 +33,7 @@ public class ItemLexicon extends ItemMod {
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
if(par2EntityPlayer.isSneaking()) {
|
||||
int id = par3World.getBlockId(par4, par5, par6);
|
||||
Block block = Block.blocksList[id];
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
|
||||
if(block != null && block instanceof ILexiconable) {
|
||||
LexiconEntry entry = ((ILexiconable) block).getEntry(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack);
|
||||
|
||||
@@ -11,13 +11,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.potion.Potion;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.lib.LibItemIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -26,7 +25,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemManaCookie extends ItemFood {
|
||||
|
||||
public ItemManaCookie() {
|
||||
super(LibItemIDs.idManaCookie, 0, 0.1F, false);
|
||||
super(0, 0.1F, false);
|
||||
setPotionEffect(Potion.field_76443_y.id, 1, 0, 1F);
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
setUnlocalizedName(LibItemNames.MANA_COOKIE);
|
||||
@@ -40,7 +39,7 @@ public class ItemManaCookie extends ItemFood {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user