This commit is contained in:
Lizbeth Rika committed 2015-02-16 22:02:53 +00:00
1 parent d0efcc43db
commit 80f32e4778
52 files changed
+226 -269

No files matched your search

@@ -16,7 +16,6 @@ import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import scala.actors.threadpool.Arrays;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -38,16 +37,16 @@ public final class CorporeaHelper {
* How many items were extracted in the last request.
*/
public static int lastRequestExtractions = 0;
/**
* Gets a list of all the inventories on this spark network. This list is cached for use once every tick,
* Gets a list of all the inventories on this spark network. This list is cached for use once every tick,
* and if something changes during that tick it'll still have the first result.
*/
public static List<IInventory> getInventoriesOnNetwork(ICorporeaSpark spark) {
ICorporeaSpark master = spark.getMaster();
if(master == null)
return empty;
List<ICorporeaSpark> network = master.getConnections();
List<ICorporeaSpark> network = master.getConnections();
if(cachedNetworks.containsKey(network)) {
List<IInventory> cache = cachedNetworks.get(network);
@@ -71,7 +70,7 @@ public final class CorporeaHelper {
/**
* Gets the amount of available items in the network of the type passed in, checking NBT or not.
* The higher level functions that use a List< IInventory > or a Map< IInventory, Integer > should be
* called instead if the context for those exists to avoid having to get the values again.
* called instead if the context for those exists to avoid having to get the values again.
*/
public static int getCountInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) {
List<IInventory> inventories = getInventoriesOnNetwork(spark);
@@ -81,8 +80,8 @@ public final class CorporeaHelper {
/**
* Gets the amount of available items in the network of the type passed in, checking NBT or not.
* The higher level function that use a Map< IInventory, Integer > should be
* called instead if the context for this exists to avoid having to get the value again.
*/
* called instead if the context for this exists to avoid having to get the value again.
*/
public static int getCountInNetwork(ItemStack stack, List<IInventory> inventories, boolean checkNBT) {
Map<IInventory, Integer> map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT);
return getCountInNetwork(stack, map, checkNBT);
@@ -103,7 +102,7 @@ public final class CorporeaHelper {
/**
* Gets a Map mapping IInventories to the amount of items of the type passed in that exist
* The higher level function that use a List< IInventory > should be
* called instead if the context for this exists to avoid having to get the value again.
* called instead if the context for this exists to avoid having to get the value again.
*/
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) {
List<IInventory> inventories = getInventoriesOnNetwork(spark);
@@ -113,7 +112,7 @@ public final class CorporeaHelper {
/**
* Gets a Map mapping IInventories to the amount of items of the type passed in that exist
* The deeper level function that use a List< IInventory > should be
* called instead if the context for this exists to avoid having to get the value again.
* called instead if the context for this exists to avoid having to get the value again.
*/
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack, List<IInventory> inventories, boolean checkNBT) {
Map<IInventory, Integer> countMap = new HashMap();
@@ -165,7 +164,7 @@ public final class CorporeaHelper {
lastRequestMatches = 0;
lastRequestExtractions = 0;
int count = itemCount;
for(IInventory inv : inventories) {
ICorporeaSpark invSpark = getSparkForInventory(inv);
@@ -200,14 +199,14 @@ public final class CorporeaHelper {
return stacks;
}
/**
* Gets the spark attached to the inventory passed case it's a TileEntity.
*/
public static ICorporeaSpark getSparkForInventory(IInventory inv) {
if(!(inv instanceof TileEntity))
return null;
TileEntity tile = (TileEntity) inv;
return getSparkForBlock(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord);
}
@@ -249,21 +248,21 @@ public final class CorporeaHelper {
public static boolean stacksMatch(ItemStack stack, String s) {
if(stack == null)
return false;
boolean contains = false;
if(s.endsWith("...")) {
contains = true;
s = s.substring(0, s.length() - 3);
s = s.substring(0, s.length() - 3);
}
if(s.startsWith("...")) {
contains = true;
s = s.substring(3);
}
String name = stack.getDisplayName().toLowerCase().trim();
return equalOrContain(name, s, contains) || equalOrContain(name + "s", s, contains) || equalOrContain(name + "es", s, contains) || (name.endsWith("y") && equalOrContain(name.substring(0, name.length() - 1) + "ies", s, contains));
return equalOrContain(name, s, contains) || equalOrContain(name + "s", s, contains) || equalOrContain(name + "es", s, contains) || name.endsWith("y") && equalOrContain(name.substring(0, name.length() - 1) + "ies", s, contains);
}
/**
* Clears the cached networks, called once per tick, should not be called outside
* of the botania code.
@@ -276,16 +275,16 @@ public final class CorporeaHelper {
* Helper method to check if an int array contains an int.
*/
public static boolean arrayHas(int[] arr, int val) {
for(int i = 0; i < arr.length; i++)
if(arr[i] == val)
for (int element : arr)
if(element == val)
return true;
return false;
}
/**
* Helper method to make stacksMatch() less messy.
*/
*/
public static boolean equalOrContain(String s1, String s2, boolean contain) {
return contain ? s1.contains(s2) : s1.equals(s2);
}
@@ -34,12 +34,12 @@ public interface ICorporeaSpark {
* in this instance, as it should be a pointer.
*/
public void registerConnections(ICorporeaSpark master, ICorporeaSpark referrer, List<ICorporeaSpark> connections);
/**
* Gets the inventory this spark is bound to, generally the one right below it.
*/
public IInventory getInventory();
/**
* Gets the list of sparks this spark is connected to, see registerConnections(). This list
* should also include itself. This list must be checked against on a regular basis to verify
@@ -47,41 +47,41 @@ public interface ICorporeaSpark {
* eliminated.
*/
public List<ICorporeaSpark> getConnections();
/**
* Gets the list of sparks that this spark added to the list of connections during registerConnections(), this
* is mainly used to create a non messy chain of particles to display the network when a spark is right
* clicked with a wand.
*/
public List<ICorporeaSpark> getRelatives();
/**
* Gets the master spark in this network, see registerConnections(). The value this returns
* should be null and the pointer should be eliminated if the spark is no longer present
* in the network.
* in the network.
*/
public ICorporeaSpark getMaster();
/**
* Called when an item is extracted from the inventory this spark is attached to through this
* spark.
*/
public void onItemExtracted(ItemStack stack);
/**
* Called when this spark requests items, passes in the result of the request and not the actual requested stack(s).
*/
public void onItemsRequested(List<ItemStack> stacks);
/**
* Gets if this spark is considered a master spark.
*/
public boolean isMaster();
/**
* Gets the network that this spark is on, or the color it's displaying. Sparks may only connect to others
* of the same network, and on changing network should trigger a re-cache of the previous network.
*/
public int getNetwork();
}
@@ -57,7 +57,7 @@ public interface IManaBurst {
public boolean hasAlreadyCollidedAt(int x, int y, int z);
public void setCollidedAt(int x, int y, int z);
public int getTicksExisted();
}
@@ -94,7 +94,7 @@ public final class HUDHandler {
renderPoolRecipeHUD(event.resolution, (TilePool) tile, equippedStack);
}
}
if(!TileCorporeaIndex.input.getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
profiler.startSection("nearIndex");
renderNearIndexDisplay(event.resolution);
@@ -301,7 +301,7 @@ public final class HUDHandler {
GL11.glColor4f(1F, 1F, 1F, 1F);
profiler.endSection();
}
private void renderNearIndexDisplay(ScaledResolution res) {
Minecraft mc = Minecraft.getMinecraft();
String txt0 = StatCollector.translateToLocal("botaniamisc.nearIndex0");
@@ -104,7 +104,7 @@ public class LightningHandler {
GL11.glTranslated(interpPosX, interpPosY, interpPosZ);
GL11.glPopMatrix();
profiler.endSection();
profiler.endSection();
@@ -121,7 +121,6 @@ import baubles.common.lib.PlayerHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
@@ -231,7 +230,7 @@ public class ClientProxy extends CommonProxy {
public void setEntryToOpen(LexiconEntry entry) {
GuiLexicon.currentOpenLexicon = new GuiLexiconEntry(entry, new GuiLexiconIndex(entry.category));
}
@Override
public void setLexiconStack(ItemStack stack) {
GuiLexicon.stackUsed = stack;
@@ -349,7 +348,7 @@ public class ClientProxy extends CommonProxy {
private boolean doParticle(World world) {
if(!world.isRemote)
return false;
if(!ConfigHandler.useVanillaParticleLimiter)
return true;
@@ -77,10 +77,10 @@ public class GuiLexicon extends GuiScreen {
super.initGui();
onInitGui();
putTutorialArrow();
}
public void onInitGui() {
allCategories = new ArrayList(BotaniaAPI.getAllCategories());
Collections.sort(allCategories);
@@ -170,14 +170,14 @@ public class GuiLexicon extends GuiScreen {
RenderHelper.renderTooltip(par1, par2, Arrays.asList(EnumChatFormatting.GOLD + "#goldfishchris", EnumChatFormatting.RED + "INTENSIFY HIM"));
}
}
super.drawScreen(par1, par2, par3);
if(hasTutorialArrow) {
mc.renderEngine.bindTexture(texture);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 0.7F + (float) (Math.sin((float) (ClientTickHandler.ticksInGame + par3) * 0.3F) + 1) * 0.15F);
GL11.glColor4f(1F, 1F, 1F, 0.7F + (float) (Math.sin((ClientTickHandler.ticksInGame + par3) * 0.3F) + 1) * 0.15F);
drawTexturedModalRect(tutorialArrowX, tutorialArrowY, 20, 200, TUTORIAL_ARROW_WIDTH, TUTORIAL_ARROW_HEIGHT);
GL11.glDisable(GL11.GL_BLEND);
}
@@ -354,7 +354,7 @@ public class GuiLexicon extends GuiScreen {
public void positionTutorialArrow() {
LexiconEntry entry = tutorial.peek();
LexiconCategory category = entry.category;
List<GuiButton> buttons = buttonList;
for(GuiButton button : buttons)
if(button instanceof GuiButtonCategory) {
@@ -24,7 +24,6 @@ import org.lwjgl.input.Mouse;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.IAddonEntry;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconPage;
import vazkii.botania.client.core.handler.ClientTickHandler;
@@ -164,8 +163,8 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
public void updateScreen() {
LexiconPage page = entry.pages.get(this.page);
page.updateScreen(this);
if(this.page == entry.pages.size() - 1) {
LexiconEntry entry = tutorial.peek();
if(entry == this.entry) {
@@ -178,7 +177,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
}
}
}
@Override
public void positionTutorialArrow() {
LexiconEntry entry = tutorial.peek();
@@ -28,7 +28,6 @@ import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.gui.lexicon.button.GuiButtonBack;
import vazkii.botania.client.gui.lexicon.button.GuiButtonCategory;
import vazkii.botania.client.gui.lexicon.button.GuiButtonInvisible;
import vazkii.botania.client.gui.lexicon.button.GuiButtonPage;
@@ -131,7 +130,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
drawTexturedModalRect(left + 134, top + guiHeight - 26, 86, 180, 12, 12);
}
}
@Override
public void positionTutorialArrow() {
LexiconEntry entry = tutorial.peek();
@@ -140,13 +139,13 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
orientTutorialArrowWithButton(backButton);
return;
}
List<GuiButton> buttons = buttonList;
for(GuiButton button : buttons) {
int index = button.id + page * 12;
if(index >= entriesToDisplay.size())
continue;
if(entry == entriesToDisplay.get(index)) {
orientTutorialArrowWithButton(button);
break;
@@ -10,17 +10,16 @@
*/
package vazkii.botania.client.render.block;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.client.render.tile.RenderTileBrewery;
import vazkii.botania.client.render.tile.RenderTileCorporeaIndex;
import vazkii.botania.common.block.tile.TileBrewery;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.client.render.tile.RenderTileCorporeaIndex;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderCorporeaIndex implements ISimpleBlockRenderingHandler {
@@ -24,7 +24,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.common.entity.EntityCorporeaSpark;
import vazkii.botania.common.item.ItemCorporeaSpark;
@@ -40,20 +39,20 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
int network = Math.min(15, entity.getNetwork());
GL11.glColor3f(EntitySheep.fleeceColorTable[network][0], EntitySheep.fleeceColorTable[network][1], EntitySheep.fleeceColorTable[network][2]);
}
@Override
public IIcon getSpinningIcon(EntityCorporeaSpark entity) {
return ItemCorporeaSpark.iconColorStar;
}
@Override
public void renderCallback(EntityCorporeaSpark entity, float pticks) {
int time = entity.getItemDisplayTicks();
if(time == 0)
return;
float absTime = Math.abs(time) - pticks;
GL11.glPushMatrix();
GL11.glRotated(90F, 1F, 0F, 0F);
float scalef = 1F / 6F;
@@ -62,27 +61,27 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, absTime / 10);
GL11.glTranslatef(0F, 0F, -2F + (time < 0 ? -absTime : absTime) / 6);
ItemStack stack = entity.getDisplayedItem();
if(stack == null)
return;
Item item = stack.getItem();
boolean block = item instanceof ItemBlock;
Minecraft.getMinecraft().renderEngine.bindTexture(block ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);
IIcon icon = block ? Block.getBlockFromItem(item).getBlockTextureFromSide(ForgeDirection.UP.ordinal()) : item.getIcon(stack, 0);
float minU = icon.getMinU();
float maxU = icon.getMaxU();
float minV = icon.getMinV();
float maxV = icon.getMaxV();
int pieces = 8;
float stepU = (maxU - minU) / pieces;
float stepV = (maxV - minV) / pieces;
float gap = 1F + (time > 0 ? 10F - absTime : absTime) * 0.2F;
int shift = pieces / 2;
float scale = 1F / pieces * 3F;
GL11.glScalef(scale, scale, 1F);
for(int i = -shift; i < shift; i++) {
@@ -94,9 +93,9 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
}
GL11.glTranslated(-gap * i, 0F, 0F);
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
@@ -11,9 +11,6 @@
package vazkii.botania.client.render.entity;
import net.minecraft.util.IIcon;
import org.lwjgl.opengl.GL11;
import vazkii.botania.common.entity.EntitySpark;
import vazkii.botania.common.item.ItemSparkUpgrade;
@@ -24,5 +21,5 @@ public class RenderSpark extends RenderSparkBase<EntitySpark> {
int upgrade = entity.getUpgrade() - 1;
return upgrade >= 0 && upgrade < ItemSparkUpgrade.worldIcons.length ? ItemSparkUpgrade.worldIcons[upgrade] : null;
}
}
@@ -24,7 +24,6 @@ import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.common.item.ItemSpark;
import vazkii.botania.common.item.ItemSparkUpgrade;
public class RenderSparkBase<T extends Entity> extends RenderEntity {
@@ -70,15 +69,15 @@ public class RenderSparkBase<T extends Entity> extends RenderEntity {
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
public IIcon getBaseIcon(T entity) {
return ItemSpark.worldIcon;
}
public void colorSpinningIcon(T entity) {
// NO-OP
}
public IIcon getSpinningIcon(T entity) {
return null;
}
@@ -86,7 +85,7 @@ public class RenderSparkBase<T extends Entity> extends RenderEntity {
public void renderCallback(T entity, float pticks) {
// NO-OP
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return TextureMap.locationItemsTexture;
@@ -31,33 +31,33 @@ public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partticks) {
TileCorporeaIndex index = (TileCorporeaIndex) tile;
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
float translation = move ? (float) ((Math.cos((float) (index.ticksWithCloseby + (index.hasCloseby ? partticks : 0)) / 10F) * 0.5 + 0.5) * 0.25) : 0F;
float rotation = move ? (index.ticks * 2 + partticks) : 0F;
float translation = move ? (float) ((Math.cos((index.ticksWithCloseby + (index.hasCloseby ? partticks : 0)) / 10F) * 0.5 + 0.5) * 0.25) : 0F;
float rotation = move ? index.ticks * 2 + partticks : 0F;
float scale = 0.6F;
GL11.glScalef(scale, scale, scale);
crystal.render(null, 0F, rotation, translation, 0F, 0F, 1F / 16F);
GL11.glScalef(1F / scale, 1F / scale, 1F / scale);
if(index.closeby > 0F) {
float starScale = 0.02F;
float starRadius = (float) TileCorporeaIndex.RADIUS * index.closeby + (index.closeby == 1F ? 0F : index.hasCloseby ? partticks : -partticks) * 0.2F;
double rads = ((index.ticksWithCloseby + partticks) * 2) * Math.PI / 180;
double rads = (index.ticksWithCloseby + partticks) * 2 * Math.PI / 180;
double starX = Math.cos(rads) * starRadius;
double starZ = Math.sin(rads) * starRadius;
int color = 0xFF00FF;
int seed = index.xCoord ^ index.yCoord ^ index.zCoord;
GL11.glTranslated(starX, 0.3, starZ);
RenderHelper.renderStar(color, starScale, starScale, starScale, seed);
GL11.glTranslated(-starX * 2, 0, -starZ * 2);
RenderHelper.renderStar(color, starScale, starScale, starScale, seed);
GL11.glTranslated(starX, 0, starZ);
rads = -rads;
starX = Math.cos(rads) * starRadius;
starZ = Math.sin(rads) * starRadius;
@@ -43,7 +43,7 @@ public class Botania {
thaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
bcTriggersLoaded = ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|statements");
bloodMagicLoaded = Loader.isModLoaded("AWWayofTime"); // Psh, noob
proxy.preInit(event);
}
@@ -195,7 +195,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
decrCoords(s);
if(checkedCoords.contains(s))
continue;
Block block = getBlockAt(s);
if(block == Blocks.piston_extension) {
int meta = getBlockMetaAt(s);
@@ -264,7 +264,7 @@ public final class ModBlocks {
corporeaIndex = new BlockCorporeaIndex();
corporeaFunnel = new BlockCorporeaFunnel();
endStoneBrick = new BlockEndStoneBrick();
ModFluffBlocks.init();
for(int i = 0; i < 16; i++)
@@ -140,7 +140,7 @@ public final class ModFluffBlocks {
public static Block[] biomeStoneStairs = new Block[24];
public static Block[] biomeStoneSlabs = new Block[24];
public static Block[] biomeStoneFullSlabs = new Block[24];
public static Block endStoneSlab;
public static Block endStoneSlabFull;
public static Block endStoneStairs;
@@ -240,7 +240,7 @@ public final class ModFluffBlocks {
endStoneSlab = new BlockEndStoneSlab(false);
endStoneSlabFull = new BlockEndStoneSlab(true);
endStoneStairs = new BlockEndStoneStairs();
if(ConfigHandler.darkQuartzEnabled) {
((BlockModSlab) darkQuartzSlab).register();
((BlockModSlab) darkQuartzSlabFull).register();
@@ -292,7 +292,7 @@ public final class ModFluffBlocks {
((BlockModSlab) dirtPathSlab).register();
((BlockModSlab) dirtPathSlabFull).register();
((BlockModSlab) endStoneSlab).register();
((BlockModSlab) endStoneSlabFull).register();
@@ -25,11 +25,11 @@ import vazkii.botania.common.block.tile.corporea.TileCorporeaBase;
public abstract class BlockCorporeaBase extends BlockModContainer<TileCorporeaBase> {
Random random;
public BlockCorporeaBase(Material material, String name) {
super(material);
setBlockName(name);
random = new Random();
}
@@ -70,5 +70,5 @@ public abstract class BlockCorporeaBase extends BlockModContainer<TileCorporeaBa
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
}
@@ -28,13 +28,13 @@ import vazkii.botania.common.lib.LibBlockNames;
public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconable {
IIcon[] icons;
public BlockCorporeaFunnel() {
super(Material.iron, LibBlockNames.CORPOREA_FUNNEL);
setHardness(5.5F);
setStepSound(soundTypeMetal);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
icons = new IIcon[3];
@@ -54,12 +54,12 @@ public class BlockCorporeaFunnel extends BlockCorporeaBase implements ILexiconab
} else if(!power && powered)
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
}
@Override
public IIcon getIcon(int par1, int par2) {
return icons[Math.min(2, par1)];
}
@Override
public TileCorporeaBase createNewTileEntity(World world, int meta) {
return new TileCorporeaFunnel();
@@ -10,6 +10,11 @@
*/
package vazkii.botania.common.block.corporea;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.lib.LibRenderIDs;
@@ -18,11 +23,6 @@ import vazkii.botania.common.block.tile.corporea.TileCorporeaBase;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconable {
@@ -31,7 +31,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
setHardness(5.5F);
setStepSound(soundTypeMetal);
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -41,7 +41,7 @@ public class BlockCorporeaIndex extends BlockCorporeaBase implements ILexiconabl
public boolean renderAsNormalBlock() {
return false;
}
@Override
public IIcon getIcon(int side, int meta) {
return ModBlocks.storage.getIcon(0, 2);
@@ -38,13 +38,13 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
setStepSound(soundTypeGrass);
setBlockName(LibBlockNames.PETAL_BLOCK);
}
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
for(int i = 0; i < 16; i++)
list.add(new ItemStack(item, 1, i));
}
@Override
protected boolean shouldRegisterInNameSet() {
return false;
@@ -55,17 +55,17 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
return super.setBlockName(par1Str);
}
@Override
public int getRenderColor(int meta) {
return new Color(EntitySheep.fleeceColorTable[meta][0], EntitySheep.fleeceColorTable[meta][1], EntitySheep.fleeceColorTable[meta][2]).getRGB();
return new Color(EntitySheep.fleeceColorTable[meta][0], EntitySheep.fleeceColorTable[meta][1], EntitySheep.fleeceColorTable[meta][2]).getRGB();
}
@Override
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
return getRenderColor(world.getBlockMetadata(x, y, z));
}
@Override
public int damageDropped(int meta) {
return meta;
@@ -75,5 +75,5 @@ public class BlockPetalBlock extends BlockMod implements ILexiconable {
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.flowers;
}
}
@@ -10,15 +10,14 @@
*/
package vazkii.botania.common.block.decor.slabs;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.ModFluffBlocks;
import vazkii.botania.common.lexicon.LexiconData;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.ModFluffBlocks;
import vazkii.botania.common.lexicon.LexiconData;
public class BlockEndStoneSlab extends BlockLivingSlab {
@@ -40,5 +39,5 @@ public class BlockEndStoneSlab extends BlockLivingSlab {
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.endStoneDecor;
}
}
@@ -10,13 +10,12 @@
*/
package vazkii.botania.common.block.decor.stairs;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lexicon.LexiconData;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lexicon.LexiconData;
public class BlockEndStoneStairs extends BlockLivingStairs {
@@ -28,5 +27,5 @@ public class BlockEndStoneStairs extends BlockLivingStairs {
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.endStoneDecor;
}
}
@@ -49,7 +49,7 @@ public class BlockTerraPlate extends BlockModContainer implements ILexiconable {
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) {
return false;
@@ -42,7 +42,7 @@ public class SubTileHydroangeas extends SubTileGenerating {
Botania.proxy.wispFX(supertile.getWorldObj(), supertile.xCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.yCoord + 0.5 + Math.random() * 0.2 - 0.1, supertile.zCoord + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30);
return;
}
boolean didSomething = false;
if(burnTime == 0) {
@@ -83,7 +83,7 @@ public class SubTileHydroangeas extends SubTileGenerating {
didSomething = true;
}
}
if(didSomething)
sync();
}
@@ -151,13 +151,13 @@ public class SubTileHydroangeas extends SubTileGenerating {
ItemNBTHelper.setInt(drops.get(0), TAG_COOLDOWN, getCooldown());
return drops;
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
super.onBlockPlacedBy(world, x, y, z, entity, stack);
cooldown = ItemNBTHelper.getInt(stack, TAG_COOLDOWN, 0);
}
@Override
public boolean canGeneratePassively() {
return burnTime > 0;
@@ -168,7 +168,7 @@ public class SubTileHydroangeas extends SubTileGenerating {
boolean rain = supertile.getWorldObj().getWorldChunkManager().getBiomeGenAt(supertile.xCoord, supertile.zCoord).getIntRainfall() > 0 && (supertile.getWorldObj().isRaining() || supertile.getWorldObj().isThundering());
return rain ? 3 : 4;
}
public int getCooldown() {
return 0;
}
@@ -14,7 +14,6 @@ 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.core.handler.ConfigHandler;
import vazkii.botania.common.lexicon.LexiconData;
public class SubTileThermalily extends SubTileHydroangeas {
@@ -68,7 +67,7 @@ public class SubTileThermalily extends SubTileHydroangeas {
public int getMaxMana() {
return 250;
}
@Override
public int getCooldown() {
return 9600;
@@ -20,7 +20,7 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo
public boolean isOnSpecialSoil() {
return false;
}
@Override
public ItemStack getDisplayStack() {
return ItemBlockSpecialFlower.ofType(subTileName);
@@ -98,7 +98,7 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
public boolean isOnSpecialSoil() {
return worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.enchantedSoil;
}
@Override
public boolean canUpdate() {
return subTile == null || subTile.canUpdate();
@@ -10,11 +10,6 @@
*/
package vazkii.botania.common.block.tile.corporea;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.ICorporeaSpark;
import vazkii.botania.common.block.tile.TileSimpleInventory;
@@ -24,5 +19,5 @@ public abstract class TileCorporeaBase extends TileSimpleInventory {
public ICorporeaSpark getSpark() {
return CorporeaHelper.getSparkForBlock(worldObj, xCoord, yCoord, zCoord);
}
}
@@ -13,13 +13,10 @@ package vazkii.botania.common.block.tile.corporea;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.item.EntityItemFrame;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.corporea.CorporeaHelper;
@@ -36,11 +33,11 @@ public class TileCorporeaFunnel extends TileCorporeaBase {
IInventory inv = InventoryHelper.getInventory(worldObj, xCoord, yCoord - 1, zCoord);
if(inv == null)
inv = InventoryHelper.getInventory(worldObj, xCoord, yCoord - 2, zCoord);
List<ItemStack> filter = getFilter();
if(!filter.isEmpty()) {
ItemStack stack = filter.get(worldObj.rand.nextInt(filter.size()));
List<ItemStack> stacks = CorporeaHelper.requestItem(stack, spark, true, true);
spark.onItemsRequested(stacks);
for(ItemStack reqStack : stacks)
@@ -55,7 +52,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase {
}
}
}
public List<ItemStack> getFilter() {
List<ItemStack> filter = new ArrayList();
@@ -74,7 +71,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase {
return filter;
}
@Override
public int getSizeInventory() {
return 1;
@@ -20,17 +20,17 @@ import java.util.WeakHashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.text.WordUtils;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.ServerChatEvent;
import org.apache.commons.lang3.text.WordUtils;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.ICorporeaSpark;
import vazkii.botania.common.core.helper.MathHelper;
@@ -64,73 +64,73 @@ public class TileCorporeaIndex extends TileCorporeaBase {
@Override public int getCount(Matcher m) { return 1; }
@Override public String getName(Matcher m) { return m.group(1); }
});
//(n)[x][ of] (name) = n
addPattern("(\\d+)x?(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return i(m, 1); }
@Override public String getName(Matcher m) { return m.group(2); }
});
// [a ]stack[ of] (name) = 64
addPattern("(?:a )?stack(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 64; }
@Override public String getName(Matcher m) { return m.group(1); }
});
// (n)[x] stack[s][ of] (name) = n * 64
addPattern("(\\d+)x?? stacks?(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 64 * i(m, 1); }
@Override public String getName(Matcher m) { return m.group(2); }
});
// [a ]stack <and/+> (n)[x][ of] (name) = 64 + n
addPattern("(?:a )?stack (?:(?:and)|(?:\\+)) (\\d+)(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 64 + i(m, 1); }
@Override public String getName(Matcher m) { return m.group(2); }
});
// (n1)[x] stack[s] <and/+> (n2)[x][ of] (name) = n1 * 64 + n2
addPattern("(\\d+)x?? stacks? (?:(?:and)|(?:\\+)) (\\d+)x?(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 64 * i(m, 1) + i(m, 2); }
@Override public String getName(Matcher m) { return m.group(3); }
});
// [a ]half [of ][a ]stack[ of] (name) = 32
addPattern("(?:a )?half (?:of )?(?:a )?stack(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 32; }
@Override public String getName(Matcher m) { return m.group(1); }
});
// [a ]quarter [of ][a ]stack[ of] (name) = 16
addPattern("(?:a )?quarter (?:of )?(?:a )?stack(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 16; }
@Override public String getName(Matcher m) { return m.group(1); }
});
// [a ]dozen[ of] (name) = 12
addPattern("(?:a )?dozen(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 12; }
@Override public String getName(Matcher m) { return m.group(1); }
});
// (n)[x] dozen[s][ of] (name) = n * 12
addPattern("(\\d+)x?? dozens?(?: of)? (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 12 * i(m, 1); }
@Override public String getName(Matcher m) { return m.group(2); }
});
// <all/every> [<of/the> ](name) = 2147483647
addPattern("(?:all|every) (?:(?:of|the) )?(.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return Integer.MAX_VALUE; }
@Override public String getName(Matcher m) { return m.group(1); }
});
// [the ]answer to life[,] the universe and everything [of ](name) = 42
addPattern("(?:the )?answer to life,? the universe and everything (?:of )?(.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 42; }
@Override public String getName(Matcher m) { return m.group(1); }
});
// <count/show/display/tell> (name) = 0 (display only)
addPattern("(?:count|show|display|tell) (.+)", new IRegexStacker() {
@Override public int getCount(Matcher m) { return 0; }
@@ -221,10 +221,9 @@ public class TileCorporeaIndex extends TileCorporeaBase {
for(TileCorporeaIndex index : nearbyIndexes) {
if(index.worldObj.isRemote)
continue;
ICorporeaSpark spark = index.getSpark();
if(spark != null) {
String matchedPattern = "";
String name = "";
int count = 0;
for(Pattern pattern : patterns.keySet()) {
@@ -233,16 +232,16 @@ public class TileCorporeaIndex extends TileCorporeaBase {
IRegexStacker stacker = patterns.get(pattern);
count = stacker.getCount(matcher);
name = stacker.getName(matcher).toLowerCase().trim();
matchedPattern = pattern.toString();
pattern.toString();
}
}
if(name.equals("this")) {
ItemStack stack = event.player.getCurrentEquippedItem();
if(stack != null)
name = stack.getDisplayName().toLowerCase().trim();
}
List<ItemStack> stacks = CorporeaHelper.requestItem(name, count, spark, true);
spark.onItemsRequested(stacks);
for(ItemStack stack : stacks)
@@ -250,7 +249,7 @@ public class TileCorporeaIndex extends TileCorporeaBase {
EntityItem item = new EntityItem(index.worldObj, index.xCoord + 0.5, index.yCoord + 1.5, index.zCoord + 0.5, stack);
index.worldObj.spawnEntityInWorld(item);
}
event.player.addChatMessage(new ChatComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE)));
}
}
@@ -212,12 +212,12 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.manaGun);
addItem(ModItems.clip);
addItem(ModItems.lens);
addItem(ModItems.corporeaSpark);
addBlock(ModBlocks.corporeaIndex);
// FLUFF
addBlock(ModBlocks.shinyFlower);
addBlock(ModBlocks.floatingFlower);
addBlock(ModBlocks.floatingSpecialFlower);
@@ -228,7 +228,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.dirtPath);
addBlock(ModFluffBlocks.dirtPathSlab);
addBlock(ModBlocks.prismarine);
addBlock(ModBlocks.seaLamp);
addBlock(ModFluffBlocks.prismarineStairs);
@@ -10,14 +10,7 @@
*/
package vazkii.botania.common.core.handler;
import java.util.ArrayList;
import java.util.List;
import vazkii.botania.api.corporea.CorporeaHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
@@ -34,7 +27,7 @@ public final class CommonTickHandler {
for(Entity entity : entities)
if(entity instanceof EntityItem)
TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity);*/
CorporeaHelper.clearCache();
}
}
@@ -50,7 +43,7 @@ public final class CommonTickHandler {
if(entity instanceof EntityItem)
TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity);
}*/
CorporeaHelper.clearCache();
}
}
@@ -23,7 +23,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public final class ConfigHandler {
public static Configuration config;
private static final String CATEGORY_POTIONS = "potions";
public static boolean useShaders = true;
@@ -58,7 +58,7 @@ public final class ConfigHandler {
public static int flowerQuantity = 2;
public static int flowerDensity = 16;
public static int potionIDSoulCross = 91;
public static int potionIDFeatherfeet = 92;
public static int potionIDEmptiness = 93;
@@ -195,7 +195,7 @@ public final class ConfigHandler {
prop.comment = desc;
return prop.getBoolean(default_);
}
public static int loadPropPotionId(String propName, int default_) {
Property prop = config.get(CATEGORY_POTIONS, propName, default_);
int val = prop.getInt(default_);
@@ -203,7 +203,7 @@ public final class ConfigHandler {
val = default_;
prop.set(default_);
}
return val;
}
@@ -102,9 +102,9 @@ public class CommonProxy {
MinecraftForge.EVENT_BUS.register(TileCorporeaIndex.input);
FMLCommonHandler.instance().bus().register(new CommonTickHandler());
FMLInterModComms.sendMessage("ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
if(Botania.bcTriggersLoaded)
new StatementAPIPlugin();
}
@@ -135,7 +135,7 @@ public class CommonProxy {
public void setEntryToOpen(LexiconEntry entry) {
// NO-OP
}
public void setLexiconStack(ItemStack stack) {
// NO-OP
}
@@ -251,11 +251,11 @@ public final class ModCraftingRecipes {
// Petal Block Recipes
for(int i = 0; i < 16; i++)
addOreDictRecipe(new ItemStack(ModBlocks.petalBlock, 1, i),
addOreDictRecipe(new ItemStack(ModBlocks.petalBlock, 1, i),
"PPP", "PPP", "PPP", // PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
'P', LibOreDict.PETAL[i]);
'P', LibOreDict.PETAL[i]);
recipesPetalBlocks = BotaniaAPI.getLatestAddedRecipes(16);
// Pestle and Mortar Recipe
addOreDictRecipe(new ItemStack(ModItems.pestleAndMortar),
" S", "W ", "B ",
@@ -1022,7 +1022,7 @@ public final class ModCraftingRecipes {
// Warp Lens Recipe
addShapelessOreDictRecipe(new ItemStack(ModItems.lens, 1, 18), new ItemStack(ModItems.lens), LibOreDict.PIXIE_DUST);
recipeLensWarp = BotaniaAPI.getLatestAddedRecipe();
// Mini Island Recipes
for(int i = 0; i < 16; i++)
GameRegistry.addRecipe(new ItemStack(ModBlocks.floatingFlower, 1, i),
@@ -1513,35 +1513,35 @@ public final class ModCraftingRecipes {
// Corporea Spark Recipe
addShapelessOreDictRecipe(new ItemStack(ModItems.corporeaSpark), new ItemStack(ModItems.spark), LibOreDict.PIXIE_DUST, LibOreDict.ENDER_AIR_BOTTLE);
recipeCorporeaSpark = BotaniaAPI.getLatestAddedRecipe();
// Master Corporea Spark Recipe
addShapelessOreDictRecipe(new ItemStack(ModItems.corporeaSpark, 1, 1), new ItemStack(ModItems.corporeaSpark), LibOreDict.DRAGONSTONE);
recipeMasterCorporeaSpark = BotaniaAPI.getLatestAddedRecipe();
// Corporea Index Recipe
addOreDictRecipe(new ItemStack(ModBlocks.corporeaIndex),
addOreDictRecipe(new ItemStack(ModBlocks.corporeaIndex),
"AOA", "OSO", "DOD",
'A', LibOreDict.ENDER_AIR_BOTTLE,
'O', new ItemStack(Blocks.obsidian),
'S', new ItemStack(ModItems.corporeaSpark),
'D', LibOreDict.DRAGONSTONE);
recipeCorporeaIndex = BotaniaAPI.getLatestAddedRecipe();
// Corporea Funnel Recipe
addShapelessOreDictRecipe(new ItemStack(ModBlocks.corporeaFunnel), new ItemStack(Blocks.dropper), new ItemStack(ModItems.corporeaSpark));
recipeCorporeaFunnel = BotaniaAPI.getLatestAddedRecipe();
// End Stone Brick Recipes
GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 4),
GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 4),
"SS", "SS",
'S', new ItemStack(Blocks.end_stone));
recipeEndStoneBricks = BotaniaAPI.getLatestAddedRecipe();
GameRegistry.addRecipe(new ItemStack(ModBlocks.endStoneBrick, 1, 1),
"S", "S",
'S', new ItemStack(ModFluffBlocks.endStoneSlab));
recipeEndStoneChiseledBricks = BotaniaAPI.getLatestAddedRecipe();
// Storage Block Recipes
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
"III", "III", "III",
@@ -11,21 +11,17 @@
package vazkii.botania.common.entity;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.ICorporeaSpark;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.item.ModItems;
@@ -163,7 +159,7 @@ public class EntityCorporeaSpark extends Entity implements ICorporeaSpark {
if(master != null) {
this.master = master;
restartNetwork();
break;
}
}
@@ -243,23 +243,23 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
@Override
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
if((par1DamageSource.damageType.equals("player") || par1DamageSource.getEntity() instanceof EntityPixie) && par1DamageSource.getEntity() != null && !(isTruePlayer(par1DamageSource.getEntity())) && getInvulTime() == 0)
if((par1DamageSource.damageType.equals("player") || par1DamageSource.getEntity() instanceof EntityPixie) && par1DamageSource.getEntity() != null && !isTruePlayer(par1DamageSource.getEntity()) && getInvulTime() == 0)
return super.attackEntityFrom(par1DamageSource, par2 * (isHardMode() ? 0.6F : 1F));
return false;
}
public boolean isTruePlayer(Entity e) {
if(e instanceof EntityPlayer)
return false;
return false;
if(worldObj.isRemote)
return true;
return true;
EntityPlayer player = (EntityPlayer) e;
String name = player.getCommandSenderName();
return !(player instanceof FakePlayer || name.contains("[CoFH]") || name.contains("[Thaumcraft"));
}
String name = player.getCommandSenderName();
return !(player instanceof FakePlayer || name.contains("[CoFH]") || name.contains("[Thaumcraft"));
}
@Override
protected void damageEntity(DamageSource par1DamageSource, float par2) {
@@ -26,7 +26,7 @@ public class EntityEnderAirBottle extends EntityThrowable {
public EntityEnderAirBottle(World world) {
super(world);
}
public EntityEnderAirBottle(World world, EntityLivingBase entity) {
super(world, entity);
}
@@ -35,7 +35,7 @@ public class EntityEnderAirBottle extends EntityThrowable {
protected void onImpact(MovingObjectPosition pos) {
if(pos.entityHit == null && !worldObj.isRemote) {
List<ChunkCoordinates> coordsList = getCoordsToPut(pos.blockX, pos.blockY, pos.blockZ);
this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 8);
worldObj.playAuxSFX(2002, (int)Math.round(posX), (int)Math.round(posY), (int)Math.round(posZ), 8);
for(ChunkCoordinates coords : coordsList) {
worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.end_stone);
@@ -65,12 +65,12 @@ public class EntityEnderAirBottle extends EntityThrowable {
int count = 64;
while(!possibleCoords.isEmpty() && count > 0) {
ChunkCoordinates coords = possibleCoords.get(worldObj.rand.nextInt(possibleCoords.size()));
ChunkCoordinates coords = possibleCoords.get(worldObj.rand.nextInt(possibleCoords.size()));
possibleCoords.remove(coords);
selectedCoords.add(coords);
count--;
}
return selectedCoords;
}
}
@@ -761,7 +761,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
if(!hasAlreadyCollidedAt(x, y, z))
alreadyCollidedAt.add(getCollisionLocString(x, y, z));
}
private String getCollisionLocString(int x, int y, int z) {
return x + ":" + y + ":" + z;
}
@@ -207,11 +207,11 @@ public class EntitySpark extends Entity implements ISparkEntity {
Botania.proxy.wispFX(worldObj, thisVec.x, thisVec.y, thisVec.z, r, g, b, size, (float) motion.x, (float) motion.y, (float) motion.z);
}
public static void particleBeam(Entity e1, Entity e2) {
if(e1 == null || e2 == null)
return;
Vector3 orig = new Vector3(e1.posX , e1.posY + 0.25, e1.posZ);
Vector3 end = new Vector3(e2.posX, e2.posY + 0.25, e2.posZ);
Vector3 diff = end.copy().sub(orig);
@@ -11,7 +11,6 @@ import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import vazkii.botania.api.BotaniaAPI;
@@ -17,7 +17,7 @@ import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.mana.BurstProperties;
public class Lens {
public void apply(ItemStack stack, BurstProperties props) {
// NO-OP
}
@@ -29,5 +29,5 @@ public class Lens {
public void updateBurst(IManaBurst burst, EntityThrowable entity, ItemStack stack) {
// NO-OP
}
}
@@ -37,13 +37,13 @@ public class LensMine extends Lens {
int y = pos.blockY;
int z = pos.blockZ;
Block block = world.getBlock(x, y, z);
ItemStack composite = ((ItemLens) ModItems.lens).getCompositeLens(stack);
boolean warp = composite != null && composite.getItem() == ModItems.lens && composite.getItemDamage() == ItemLens.WARP;
if(warp && (block == ModBlocks.pistonRelay || block == Blocks.piston || block == Blocks.piston_extension || block == Blocks.piston_head))
return false;
TileEntity tile = world.getTileEntity(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
@@ -65,10 +65,10 @@ public class LensMine extends Lens {
int dropX = warp ? coords.posX : x;
int dropY = warp ? coords.posY : y;
int dropZ = warp ? coords.posZ : z;
for(ItemStack stack_ : items)
world.spawnEntityInWorld(new EntityItem(world, dropX + 0.5, dropY + 0.5, dropZ + 0.5, stack_));
burst.setMana(mana - 24);
}
}
@@ -24,7 +24,7 @@ public class LensWarp extends Lens {
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
if(burst.isFake())
return dead;
Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
if(block == ModBlocks.pistonRelay) {
String key = BlockPistonRelay.mappedPositions.get(BlockPistonRelay.getCoordsAsString(entity.worldObj.provider.dimensionId, pos.blockX, pos.blockY, pos.blockZ));
@@ -40,5 +40,5 @@ public class LensWarp extends Lens {
}
return dead;
}
}
@@ -15,7 +15,6 @@ import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityExpBottle;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@@ -37,7 +36,6 @@ import vazkii.botania.common.achievement.ModAchievements;
import vazkii.botania.common.entity.EntityDoppleganger;
import vazkii.botania.common.entity.EntityEnderAirBottle;
import vazkii.botania.common.item.ItemMod;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
@@ -54,14 +52,14 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
setHasSubtypes(true);
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent event) {
boolean rightEvent = event.action == Action.RIGHT_CLICK_AIR;
ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
boolean correctStack = stack != null && stack.getItem() == Items.glass_bottle;
boolean ender = event.world.provider.dimensionId == 1;
boolean ender = event.world.provider.dimensionId == 1;
if(rightEvent && correctStack && ender) {
ItemStack stack1 = new ItemStack(this, 1, 15);
if(!event.entityPlayer.inventory.addItemStackToInventory(stack1))
@@ -70,7 +68,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
stack.stackSize--;
if(stack.stackSize == 0)
event.entityPlayer.inventory.setInventorySlotContents(event.entityPlayer.inventory.currentItem, null);
if(event.world.isRemote)
event.entityPlayer.swingItem();
else event.world.playSoundAtEntity(event.entityPlayer, "random.pop", 0.5F, 1F);
@@ -81,23 +79,23 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if(par1ItemStack.getItemDamage() == 4 || par1ItemStack.getItemDamage() == 14)
return EntityDoppleganger.spawn(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6, par1ItemStack.getItemDamage() == 14);
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par3World, EntityPlayer par2EntityPlayer) {
if(par1ItemStack.getItemDamage() == 15) {
if(!par2EntityPlayer.capabilities.isCreativeMode)
--par1ItemStack.stackSize;
if(!par2EntityPlayer.capabilities.isCreativeMode)
--par1ItemStack.stackSize;
par3World.playSoundAtEntity(par2EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
par3World.playSoundAtEntity(par2EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if(!par3World.isRemote)
par3World.spawnEntityInWorld(new EntityEnderAirBottle(par3World, par2EntityPlayer));
else par2EntityPlayer.swingItem();
if(!par3World.isRemote)
par3World.spawnEntityInWorld(new EntityEnderAirBottle(par3World, par2EntityPlayer));
else par2EntityPlayer.swingItem();
}
return par1ItemStack;
}
@@ -46,7 +46,7 @@ public final class LexiconData {
public static LexiconEntry tutorial;
public static LexiconEntry introVideo;
public static LexiconEntry flowers;
public static LexiconEntry apothecary;
public static LexiconEntry lexicon;
@@ -161,7 +161,7 @@ public final class LexiconData {
public static LexiconEntry spellCloth;
public static LexiconEntry thornChakram;
public static LexiconEntry overgrowthSeed;
public static LexiconEntry enderAir;
public static LexiconEntry enderEyeBlock;
public static LexiconEntry pistonRelay;
@@ -243,7 +243,7 @@ public final class LexiconData {
// BASICS ENTRIES
tutorial = new TLexiconEntry();
introVideo = new BLexiconEntry(LibLexicon.BASICS_INTRO_VIDEO, categoryBasics);
introVideo.setPriority().setLexiconPages(new PageGuide("0"));
@@ -344,7 +344,7 @@ public final class LexiconData {
warpLens = new ALexiconEntry(LibLexicon.MANA_WARP_LENS, categoryMana);
warpLens.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeLensWarp));
prism = new ALexiconEntry(LibLexicon.MANA_PRISM, categoryMana);
prism.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePrism));
@@ -638,13 +638,13 @@ public final class LexiconData {
enderEyeBlock = new BLexiconEntry(LibLexicon.ENDER_ENDER_EYE_BLOCK, categoryEnder);
enderEyeBlock.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeEnderEyeBlock));
pistonRelay = new BLexiconEntry(LibLexicon.ENDER_PISTON_RELAY, categoryEnder);
pistonRelay.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.pistonRelayRecipe));
enderHand = new BLexiconEntry(LibLexicon.ENDER_ENDER_HAND, categoryEnder);
enderHand.setLexiconPages(new PageText(ConfigHandler.enderPickpocketEnabled ? "0" : "0a"), new PageCraftingRecipe(ConfigHandler.enderPickpocketEnabled ? "1" : "1a", ModCraftingRecipes.recipeEnderHand));
enderDagger = new BLexiconEntry(LibLexicon.ENDER_ENDER_DAGGER, categoryEnder);
enderDagger.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeEnderDagger));
@@ -661,19 +661,19 @@ public final class LexiconData {
flightTiara = new ALexiconEntry(LibLexicon.ENDER_FLIGHT_TIARA, categoryEnder);
flightTiara.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFlightTiara), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipesWings));
corporea = new ALexiconEntry(LibLexicon.ENDER_CORPOREA, categoryEnder);
corporea.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeCorporeaSpark), new PageCraftingRecipe("8", ModCraftingRecipes.recipeMasterCorporeaSpark));
corporeaIndex = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_INDEX, categoryEnder);
corporeaIndex.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageCraftingRecipe("6", ModCraftingRecipes.recipeCorporeaIndex));
corporeaFunnel = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_FUNNEL, categoryEnder);
corporeaFunnel.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCorporeaFunnel));
endStoneDecor = new BLexiconEntry(LibLexicon.ENDER_END_STONE_DECOR, categoryEnder);
endStoneDecor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeEndStoneBricks), new PageCraftingRecipe("2", ModCraftingRecipes.recipeEndStoneChiseledBricks));
// BAUBLES ENTRIES
baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles);
baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2"));
@@ -11,9 +11,6 @@
package vazkii.botania.common.lexicon;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lexicon.page.PageTutorial;
import vazkii.botania.common.lib.LibLexicon;
@@ -10,9 +10,6 @@
*/
package vazkii.botania.common.lexicon.page;
import java.awt.Desktop;
import java.net.URI;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ChatComponentTranslation;
@@ -49,5 +46,5 @@ public class PageTutorial extends PageText {
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentTranslation("botaniamisc.tutorialStarted").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
}
}
}
@@ -27,7 +27,7 @@ public final class LibLexicon {
public static final String BASICS_TUTORIAL = "tutorial";
public static final String BASICS_INTRO_VIDEO = "introVideo";
public static final String BASICS_FLOWERS = "flowers";
public static final String BASICS_APOTHECARY = "apothecary";
public static final String BASICS_LEXICON = "lexicon";
@@ -12,7 +12,6 @@ package vazkii.botania.common.network;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexicon;
import vazkii.botania.client.gui.crafting.ContainerCraftingHalo;
import vazkii.botania.client.gui.crafting.GuiCraftingHalo;
import vazkii.botania.client.gui.lexicon.GuiLexicon;