mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 19:29:31 +00:00
Cleanup.
This commit is contained in:
1 parent
61c456215d
commit
4eeadecc98
93 files changed
+620
-674
No files matched your search
@@ -85,7 +85,7 @@ public final class BotaniaAPI {
|
||||
public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26);
|
||||
|
||||
public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic");
|
||||
|
||||
|
||||
public static KnowledgeType basicKnowledge, elvenKnowledge;
|
||||
|
||||
// All of these categories are initialized during botania's PreInit stage.
|
||||
|
||||
@@ -183,6 +183,6 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public interface IInternalMethodHandler {
|
||||
public IInventory getBaublesInventory(EntityPlayer player);
|
||||
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side);
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res);
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
@@ -24,20 +23,20 @@ public interface IRelic {
|
||||
* Binds to the player name passed in.
|
||||
*/
|
||||
public void bindToUsername(String playerName, ItemStack stack);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the username of the person this relic is bound to.
|
||||
*/
|
||||
public String getSoulbindUsername(ItemStack stack);
|
||||
|
||||
|
||||
/**
|
||||
* Sets the achievement that this relic binds to.
|
||||
*/
|
||||
public void setBindAchievement(Achievement achievement);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the achievement that this relic binds to.
|
||||
*/
|
||||
public Achievement getBindAchievement();
|
||||
|
||||
|
||||
}
|
||||
@@ -16,12 +16,12 @@ import net.minecraft.item.ItemStack;
|
||||
/**
|
||||
* An item that implements this can break multiple blocks at once
|
||||
* with a Ring of Loki. Usage of this interface requires an implementation
|
||||
* (see ItemTerraPick).
|
||||
* (see ItemTerraPick).
|
||||
*/
|
||||
public interface ISequentialBreaker {
|
||||
|
||||
public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side);
|
||||
|
||||
|
||||
public boolean disposeOfTrashBlocks(ItemStack stack);
|
||||
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
* armor slot or bauble slots.
|
||||
*/
|
||||
public interface IWireframeCoordinateListProvider {
|
||||
|
||||
|
||||
/**
|
||||
* Returns a list of ChunkCoordinates for the wireframes to draw.
|
||||
* Can be null.
|
||||
|
||||
@@ -15,75 +15,75 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
/**
|
||||
* This object describes the Radius of a SubTileEntity. It can either be
|
||||
* a circle or rectangle, it's to note that the
|
||||
* a circle or rectangle, it's to note that the
|
||||
*/
|
||||
public class RadiusDescriptor {
|
||||
|
||||
final ChunkCoordinates subtileCoords;
|
||||
|
||||
|
||||
public RadiusDescriptor(ChunkCoordinates subtileCoords) {
|
||||
this.subtileCoords = subtileCoords;
|
||||
}
|
||||
|
||||
|
||||
public ChunkCoordinates getSubtileCoords() {
|
||||
return subtileCoords;
|
||||
}
|
||||
|
||||
|
||||
public boolean isCircle() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public double getCircleRadius() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public AxisAlignedBB getAABB() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static class Circle extends RadiusDescriptor {
|
||||
|
||||
final double radius;
|
||||
|
||||
|
||||
final double radius;
|
||||
|
||||
public Circle(ChunkCoordinates subtileCoords, double radius) {
|
||||
super(subtileCoords);
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isCircle() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getCircleRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class Rectangle extends RadiusDescriptor {
|
||||
|
||||
|
||||
final AxisAlignedBB aabb;
|
||||
|
||||
|
||||
public Rectangle(ChunkCoordinates subtileCoords, AxisAlignedBB aabb) {
|
||||
super(subtileCoords);
|
||||
this.aabb = aabb;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getAABB() {
|
||||
return aabb;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class Square extends Rectangle {
|
||||
|
||||
|
||||
public Square(ChunkCoordinates subtileCoords, int expand) {
|
||||
super(subtileCoords, AxisAlignedBB.getBoundingBox(subtileCoords.posX - expand, subtileCoords.posY, subtileCoords.posZ - expand, subtileCoords.posX + 1 + expand, subtileCoords.posY, subtileCoords.posZ + 1 + expand));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class SubTileEntity {
|
||||
public ChunkCoordinates getBinding() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a descriptor for the radius of this sub tile. This is called while a player
|
||||
* is looking at the block with a Manaseer Monocle (IBurstViewerBauble).
|
||||
@@ -161,7 +161,7 @@ public class SubTileEntity {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets a ChunkCoordinates instance with the position of this sub tile.
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@ public final class BoundTileRenderer {
|
||||
if(coords != null)
|
||||
renderBlockOutlineAt(coords, color);
|
||||
}
|
||||
|
||||
|
||||
IInventory mainInv = player.inventory;
|
||||
IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player);
|
||||
|
||||
@@ -65,7 +65,7 @@ public final class BoundTileRenderer {
|
||||
boolean useBaubles = i >= invSize;
|
||||
IInventory inv = useBaubles ? baublesInv : mainInv;
|
||||
ItemStack stackInSlot = inv.getStackInSlot(i - (useBaubles ? invSize : 0));
|
||||
|
||||
|
||||
if(stackInSlot != null && stackInSlot.getItem() instanceof IWireframeCoordinateListProvider) {
|
||||
IWireframeCoordinateListProvider provider = (IWireframeCoordinateListProvider) stackInSlot.getItem();
|
||||
List<ChunkCoordinates> coordsList = provider.getWireframesToDraw(player, stackInSlot);
|
||||
|
||||
@@ -107,7 +107,7 @@ public final class HUDHandler {
|
||||
ItemCraftingHalo.renderHUD(event.resolution, mc.thePlayer, equippedStack);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
|
||||
if(equippedStack != null && equippedStack.getItem() == ModItems.flugelEye) {
|
||||
profiler.startSection("flugelEye");
|
||||
ItemFlugelEye.renderHUD(event.resolution, mc.thePlayer, equippedStack);
|
||||
|
||||
@@ -12,16 +12,13 @@ package vazkii.botania.client.core.handler;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -29,7 +26,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.subtile.ISubTileContainer;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.wand.IWireframeAABBProvider;
|
||||
import vazkii.botania.common.Botania;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
@@ -38,9 +34,8 @@ public final class SubTileRadiusRenderHandler {
|
||||
@SubscribeEvent
|
||||
public void onWorldRenderLast(RenderWorldLastEvent event) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
MovingObjectPosition pos = mc.objectMouseOver;
|
||||
|
||||
|
||||
if(!Botania.proxy.isClientPlayerWearingMonocle() || pos == null || pos.entityHit != null)
|
||||
return;
|
||||
TileEntity tile = mc.theWorld.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
|
||||
@@ -53,23 +48,23 @@ public final class SubTileRadiusRenderHandler {
|
||||
RadiusDescriptor descriptor = subtile.getRadius();
|
||||
if(descriptor == null)
|
||||
return;
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
Tessellator.renderingWorldRenderer = false;
|
||||
|
||||
if(descriptor.isCircle())
|
||||
renderCircle(descriptor.getSubtileCoords(), descriptor.getCircleRadius());
|
||||
else renderRectangle(descriptor.getAABB());
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
public void renderRectangle(AxisAlignedBB aabb) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(aabb.minX - RenderManager.renderPosX, aabb.minY - RenderManager.renderPosY, aabb.minZ - RenderManager.renderPosZ);
|
||||
@@ -80,9 +75,8 @@ public final class SubTileRadiusRenderHandler {
|
||||
|
||||
double f = 1F / 16F;
|
||||
double x = aabb.maxX - aabb.minX - f;
|
||||
double y = aabb.maxY - aabb.minY - f;
|
||||
double z = aabb.maxZ - aabb.minZ - f;
|
||||
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertex(x, f, f);
|
||||
@@ -90,9 +84,8 @@ public final class SubTileRadiusRenderHandler {
|
||||
tessellator.addVertex(f, f, z);
|
||||
tessellator.addVertex(x, f, z);
|
||||
tessellator.draw();
|
||||
|
||||
|
||||
x += f;
|
||||
y += f;
|
||||
z += f;
|
||||
double f1 = f + f / 4F;
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
|
||||
@@ -102,10 +95,10 @@ public final class SubTileRadiusRenderHandler {
|
||||
tessellator.addVertex(0, f1, z);
|
||||
tessellator.addVertex(x, f1, z);
|
||||
tessellator.draw();
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
public void renderCircle(ChunkCoordinates center, double radius) {
|
||||
GL11.glPushMatrix();
|
||||
double x = center.posX + 0.5;
|
||||
@@ -118,31 +111,31 @@ public final class SubTileRadiusRenderHandler {
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 32);
|
||||
|
||||
double f = 1F / 16F;
|
||||
|
||||
|
||||
int totalAngles = 360;
|
||||
int drawAngles = 360;
|
||||
int step = totalAngles / drawAngles;
|
||||
|
||||
|
||||
radius -= f;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawing(GL11.GL_TRIANGLE_FAN);
|
||||
tessellator.addVertex(0, f, 0);
|
||||
for(int i = 0; i < totalAngles + 1; i += step) {
|
||||
double rad = (double) (totalAngles - i) * Math.PI / 180.0;
|
||||
double rad = (totalAngles - i) * Math.PI / 180.0;
|
||||
double xp = Math.cos(rad) * radius;
|
||||
double zp = Math.sin(rad) * radius;
|
||||
tessellator.addVertex(xp, f, zp);
|
||||
}
|
||||
tessellator.addVertex(0, f, 0);
|
||||
tessellator.draw();
|
||||
|
||||
|
||||
radius += f;
|
||||
double f1 = f + f / 4F;
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 64);
|
||||
tessellator.startDrawing(GL11.GL_TRIANGLE_FAN);
|
||||
tessellator.addVertex(0, f1, 0);
|
||||
for(int i = 0; i < totalAngles + 1; i += step) {
|
||||
double rad = (double) (totalAngles - i) * Math.PI / 180.0;
|
||||
double rad = (totalAngles - i) * Math.PI / 180.0;
|
||||
double xp = Math.cos(rad) * radius;
|
||||
double zp = Math.sin(rad) * radius;
|
||||
tessellator.addVertex(xp, f1, zp);
|
||||
@@ -151,5 +144,5 @@ public final class SubTileRadiusRenderHandler {
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -33,7 +33,6 @@ import vazkii.botania.client.gui.lexicon.button.GuiButtonBackWithShift;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonPage;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonShare;
|
||||
import vazkii.botania.client.gui.lexicon.button.GuiButtonViewOnline;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IParented {
|
||||
|
||||
|
||||
@@ -10,15 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.block;
|
||||
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDoublePlant;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderDoubleFlower implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -29,38 +27,30 @@ public class RenderDoubleFlower implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int p_147774_2_, int p_147774_3_, int p_147774_4_, Block block, int modelId, RenderBlocks renderer) {
|
||||
BlockDoublePlant p_147774_1_ = (BlockDoublePlant) block;
|
||||
BlockDoublePlant p_147774_1_ = (BlockDoublePlant) block;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.setBrightness(p_147774_1_.getMixedBrightnessForBlock(world, p_147774_2_, p_147774_3_, p_147774_4_));
|
||||
tessellator.setColorOpaque_F(1F, 1F, 1F);
|
||||
long j1 = (long)(p_147774_2_ * 3129871) ^ (long)p_147774_4_ * 116129781L;
|
||||
j1 = j1 * j1 * 42317861L + j1 * 11L;
|
||||
double d19 = (double)p_147774_2_;
|
||||
double d0 = (double)p_147774_3_;
|
||||
double d1 = (double)p_147774_4_;
|
||||
d19 += ((double)((float)(j1 >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D;
|
||||
d1 += ((double)((float)(j1 >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D;
|
||||
int i1 = world.getBlockMetadata(p_147774_2_, p_147774_3_, p_147774_4_);
|
||||
boolean flag = false;
|
||||
boolean flag1 = BlockDoublePlant.func_149887_c(i1);
|
||||
int k1;
|
||||
tessellator.setBrightness(p_147774_1_.getMixedBrightnessForBlock(world, p_147774_2_, p_147774_3_, p_147774_4_));
|
||||
tessellator.setColorOpaque_F(1F, 1F, 1F);
|
||||
long j1 = p_147774_2_ * 3129871 ^ p_147774_4_ * 116129781L;
|
||||
j1 = j1 * j1 * 42317861L + j1 * 11L;
|
||||
int i1 = world.getBlockMetadata(p_147774_2_, p_147774_3_, p_147774_4_);
|
||||
boolean flag1 = BlockDoublePlant.func_149887_c(i1);
|
||||
if (flag1)
|
||||
{
|
||||
if (world.getBlock(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
if (world.getBlock(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
BlockDoublePlant.func_149890_d(world.getBlockMetadata(p_147774_2_, p_147774_3_ - 1, p_147774_4_));
|
||||
}
|
||||
else
|
||||
{
|
||||
BlockDoublePlant.func_149890_d(i1);
|
||||
}
|
||||
|
||||
k1 = BlockDoublePlant.func_149890_d(world.getBlockMetadata(p_147774_2_, p_147774_3_ - 1, p_147774_4_));
|
||||
}
|
||||
else
|
||||
{
|
||||
k1 = BlockDoublePlant.func_149890_d(i1);
|
||||
}
|
||||
|
||||
RenderSpecialFlower.drawCrossedSquares(world, block, p_147774_2_, p_147774_3_, p_147774_4_, p_147774_2_, p_147774_3_, p_147774_4_, 1F, renderer);
|
||||
return true;
|
||||
RenderSpecialFlower.drawCrossedSquares(world, block, p_147774_2_, p_147774_3_, p_147774_4_, p_147774_2_, p_147774_3_, p_147774_4_, 1F, renderer);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,5 +62,5 @@ public class RenderDoubleFlower implements ISimpleBlockRenderingHandler {
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idDoubleFlower;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -10,32 +10,30 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.entity;
|
||||
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import net.minecraft.client.model.ModelWither;
|
||||
import net.minecraft.client.renderer.entity.RenderWither;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.boss.BossStatus;
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public class RenderPinkWither extends RenderWither {
|
||||
|
||||
private static final ResourceLocation resource = new ResourceLocation(LibResources.MODEL_PINK_WITHER);
|
||||
|
||||
|
||||
int idk = -1;
|
||||
|
||||
public void doRender(EntityWither p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
|
||||
super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
if(BossStatus.bossName.equals(p_76986_1_.func_145748_c_().getFormattedText())) {
|
||||
BossStatus.statusBarTime = -1;
|
||||
BossStatus.hasColorModifier = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityWither p_110775_1_) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
public void doRender(EntityWither p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
|
||||
super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
if(BossStatus.bossName.equals(p_76986_1_.func_145748_c_().getFormattedText())) {
|
||||
BossStatus.statusBarTime = -1;
|
||||
BossStatus.hasColorModifier = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityWither p_110775_1_) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,12 +20,10 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelMiniIsland;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ package vazkii.botania.common.achievement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
|
||||
public class AchievementMod extends Achievement {
|
||||
|
||||
@@ -27,7 +27,7 @@ public class AchievementMod extends Achievement {
|
||||
super("achievement.botania:" + name, "botania:" + name, x, y, icon, parent);
|
||||
achievements.add(this);
|
||||
registerStat();
|
||||
|
||||
|
||||
if(icon.getItem() instanceof IRelic)
|
||||
((IRelic) icon.getItem()).setBindAchievement(this);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public final class ModAchievements {
|
||||
heiseiDreamPickup = new AchievementMod(LibAchievementNames.HEISEI_DREAM_PICKUP, 5, 6, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HEISEI_DREAM), elfPortalOpen);
|
||||
enderAirMake = new AchievementMod(LibAchievementNames.ENDER_AIR_MAKE, 4, 8, new ItemStack(ModItems.manaResource, 1, 15), elfPortalOpen);
|
||||
corporeaCraft = new AchievementMod(LibAchievementNames.CORPOREA_CRAFT, 2, 8, ModBlocks.corporeaFunnel, enderAirMake);
|
||||
|
||||
|
||||
gaiaGuardianKill = new AchievementMod(LibAchievementNames.GAIA_GUARDIAN_KILL, 2, 4, new ItemStack(ModItems.manaResource, 1, 5), elfPortalOpen).setSpecial();
|
||||
|
||||
spawnerMoverUse = new AchievementMod(LibAchievementNames.SPAWNER_MOVER_USE, -1, 5, ModItems.spawnerMover, gaiaGuardianKill);
|
||||
@@ -110,7 +110,7 @@ public final class ModAchievements {
|
||||
relicOdinRing = new AchievementMod(LibAchievementNames.RELIC_ODIN_RING, -9, 6, ModItems.odinRing, null);
|
||||
relicLokiRing = new AchievementMod(LibAchievementNames.RELIC_LOKI_RING, -5, 6, ModItems.lokiRing, null);
|
||||
relicAesirRing = new AchievementMod(LibAchievementNames.RELIC_AESIR_RING, -7, 5, ModItems.aesirRing, null).setSpecial();
|
||||
|
||||
|
||||
ItemStack desu = new ItemStack(ModItems.manaGun);
|
||||
desu.setStackDisplayName("desu gun");
|
||||
desuGun = new AchievementMod(LibAchievementNames.DESU_GUN, -8, -2, desu, null).setSpecial();
|
||||
|
||||
@@ -117,7 +117,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
par5EntityPlayer.dropPlayerItemWithRandomChoice(bucket, false);
|
||||
stack.stackSize--;
|
||||
}
|
||||
|
||||
|
||||
if(tile.hasLava)
|
||||
tile.setLava(false);
|
||||
else tile.setWater(false);
|
||||
|
||||
@@ -21,16 +21,11 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemShears;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.StatList;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -65,34 +60,33 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int p_149692_1_) {
|
||||
return p_149692_1_ & 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149889_c(World p_149889_1_, int p_149889_2_, int p_149889_3_, int p_149889_4_, int p_149889_5_, int p_149889_6_) {
|
||||
p_149889_1_.setBlock(p_149889_2_, p_149889_3_, p_149889_4_, this, p_149889_5_, p_149889_6_);
|
||||
p_149889_1_.setBlock(p_149889_2_, p_149889_3_ + 1, p_149889_4_, this, p_149889_5_ | 8, p_149889_6_);
|
||||
}
|
||||
public int damageDropped(int p_149692_1_) {
|
||||
return p_149692_1_ & 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
||||
int l = ((MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;
|
||||
p_149689_1_.setBlock(p_149689_2_, p_149689_3_ + 1, p_149689_4_, this, p_149689_6_.getItemDamage() | 8, 2);
|
||||
}
|
||||
|
||||
public void func_149889_c(World p_149889_1_, int p_149889_2_, int p_149889_3_, int p_149889_4_, int p_149889_5_, int p_149889_6_) {
|
||||
p_149889_1_.setBlock(p_149889_2_, p_149889_3_, p_149889_4_, this, p_149889_5_, p_149889_6_);
|
||||
p_149889_1_.setBlock(p_149889_2_, p_149889_3_ + 1, p_149889_4_, this, p_149889_5_ | 8, p_149889_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
||||
p_149689_1_.setBlock(p_149689_2_, p_149689_3_ + 1, p_149689_4_, this, p_149689_6_.getItemDamage() | 8, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_149851_a(World world, int x, int y, int z, boolean fuckifiknow) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
@@ -104,7 +98,7 @@ public class BlockModDoubleFlower extends BlockDoublePlant implements ILexiconab
|
||||
ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 7));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
|
||||
return new ArrayList();
|
||||
|
||||
@@ -151,5 +151,5 @@ public class BlockModFlower extends BlockFlower implements ILexiconable, IPickup
|
||||
world.setBlock(x, y, z, flower, placeMeta, 1 | 2);
|
||||
world.setBlock(x, y + 1, z, flower, placeMeta | 8, 1 | 2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -276,7 +276,7 @@ public final class ModBlocks {
|
||||
pump = new BlockPump();
|
||||
doubleFlower1 = new BlockModDoubleFlower(false);
|
||||
doubleFlower2 = new BlockModDoubleFlower(true);
|
||||
|
||||
|
||||
ModFluffBlocks.init();
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
@@ -290,7 +290,7 @@ public final class ModBlocks {
|
||||
OreDictionary.registerOre(LibOreDict.DOUBLE_FLOWER[i], new ItemStack(doubleFlower1, 1, i));
|
||||
OreDictionary.registerOre(LibOreDict.DOUBLE_FLOWER[i + 8], new ItemStack(doubleFlower2, 1, i));
|
||||
}
|
||||
|
||||
|
||||
// Vanilla OreDict entries
|
||||
OreDictionary.registerOre("dirt", Blocks.dirt);
|
||||
OreDictionary.registerOre("grass", Blocks.grass);
|
||||
|
||||
@@ -80,5 +80,5 @@ public abstract class BlockCorporeaBase extends BlockModContainer<TileCorporeaBa
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return ModAchievements.corporeaCraft;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -35,7 +35,6 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower.IslandType;
|
||||
import vazkii.botania.common.block.tile.TileFloatingFlower;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
|
||||
import vazkii.botania.common.item.ItemGrassSeeds;
|
||||
@@ -135,21 +134,21 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
|
||||
type = IslandType.SNOW;
|
||||
else if(stack.getItem() == ModItems.grassSeeds)
|
||||
type = ItemGrassSeeds.getIslandType(stack);
|
||||
|
||||
|
||||
if(type != null && type != flower.getIslandType()) {
|
||||
if(!world.isRemote) {
|
||||
flower.setIslandType(type);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
stack.stackSize--;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idMiniIsland;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.shinyFlowers;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean func_149851_a(World world, int x, int y, int z, boolean fuckifiknow) {
|
||||
return false;
|
||||
|
||||
@@ -10,42 +10,42 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
|
||||
public interface IFloatingFlower {
|
||||
|
||||
public ItemStack getDisplayStack();
|
||||
|
||||
public IslandType getIslandType();
|
||||
|
||||
|
||||
public void setIslandType(IslandType type);
|
||||
|
||||
public static enum IslandType {
|
||||
GRASS(LibResources.MODEL_MINI_ISLAND),
|
||||
PODZOL(LibResources.MODEL_MINI_ISLAND_PODZOL),
|
||||
MYCEL(LibResources.MODEL_MINI_ISLAND_MYCEL),
|
||||
PODZOL(LibResources.MODEL_MINI_ISLAND_PODZOL),
|
||||
MYCEL(LibResources.MODEL_MINI_ISLAND_MYCEL),
|
||||
SNOW(LibResources.MODEL_MINI_ISLAND_SNOW);
|
||||
|
||||
|
||||
private IslandType(String s) {
|
||||
res = new ResourceLocation(s);
|
||||
}
|
||||
|
||||
|
||||
private final ResourceLocation res;
|
||||
|
||||
|
||||
public static IslandType ofType(String typeStr) {
|
||||
for(IslandType type : IslandType.class.getEnumConstants())
|
||||
if(type.toString().equals(typeStr))
|
||||
return type;
|
||||
|
||||
|
||||
return GRASS;
|
||||
}
|
||||
|
||||
|
||||
public ResourceLocation getResource() {
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -91,12 +91,12 @@ public class BlockPump extends BlockModContainer implements ILexiconable {
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
return ((TilePump) world.getTileEntity(x, y, z)).comparator;
|
||||
|
||||
@@ -97,7 +97,7 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), 1);
|
||||
|
||||
+2
-3
@@ -19,14 +19,13 @@ import net.minecraft.init.Blocks;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileAgricarnation extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -83,7 +82,7 @@ public class SubTileAgricarnation extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.agricarnation;
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
@@ -27,7 +26,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class SubTileBellethorn extends SubTileFunctional {
|
||||
|
||||
public static final int RANGE = 6;
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xBA3421;
|
||||
@@ -88,7 +87,7 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.bellethorne;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
private static final int RANGE_Y = 3;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -72,7 +72,7 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x7B8792;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
int w = 2;
|
||||
int h = 3;
|
||||
int l = 16;
|
||||
|
||||
|
||||
AxisAlignedBB axis = null;
|
||||
switch(orientation) {
|
||||
case 0 :
|
||||
@@ -85,7 +85,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
}
|
||||
return axis;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
@@ -105,7 +105,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
return true;
|
||||
} else return super.onWanded(player, wand);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
AxisAlignedBB aabb = aabbForOrientation();
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SubTileExoflame extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
private static final int RANGE_Y = 2;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
+2
-4
@@ -16,17 +16,15 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileFallenKanade extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 2;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -48,7 +46,7 @@ public class SubTileFallenKanade extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xFFFF00;
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -89,7 +89,7 @@ public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
private static void messWithAttackOnCollideAI(EntityAIAttackOnCollide aiEntry) {
|
||||
ReflectionHelper.setPrivateValue(EntityAIAttackOnCollide.class, aiEntry, IMob.class, LibObfuscation.CLASS_TARGET);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -43,7 +42,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
private static final String TAG_FILTER_TYPE = "filterType";
|
||||
private static final int RANGE_MANA = 10;
|
||||
private static final int RANGE = 6;
|
||||
|
||||
|
||||
int filterType = 0;
|
||||
|
||||
@Override
|
||||
@@ -108,7 +107,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
if(pulledAny && mana > 1)
|
||||
mana--;
|
||||
}
|
||||
|
||||
|
||||
public boolean canAcceptItem(ItemStack stack, List<ItemStack> filter, int filterType) {
|
||||
if(stack == null)
|
||||
return false;
|
||||
@@ -189,7 +188,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), mana > 0 ? RANGE_MANA : RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
@@ -21,13 +21,12 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileHyacidus extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 6;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -65,7 +64,7 @@ public class SubTileHyacidus extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.hyacidus;
|
||||
|
||||
+1
-2
@@ -15,7 +15,6 @@ import net.minecraft.block.material.Material;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -67,7 +66,7 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
public int getColor() {
|
||||
return 0x961283;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
private static final int COST = 12;
|
||||
private static final int RANGE = 8;
|
||||
private static final int RANGE_Y = 5;
|
||||
|
||||
|
||||
private static final Type[] TYPES = new Type[] {
|
||||
Type.FOREST,
|
||||
Type.PLAINS,
|
||||
@@ -107,7 +107,7 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x769897;
|
||||
|
||||
@@ -23,9 +23,9 @@ import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileMedumone extends SubTileFunctional {
|
||||
|
||||
|
||||
private static final int RANGE = 6;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -52,7 +52,7 @@ public class SubTileMedumone extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x3D2204;
|
||||
|
||||
+2
-3
@@ -18,7 +18,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
@@ -27,7 +26,7 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
public class SubTilePollidisiac extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 6;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -64,7 +63,7 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
+2
-3
@@ -33,7 +33,6 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -47,7 +46,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
private static final int RANGE_PLACE_MANA = 8;
|
||||
private static final int RANGE_PLACE = 6;
|
||||
private static final int RANGE_PLACE_Y = 6;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -160,7 +159,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), mana > 0 ? RANGE_PLACE_MANA : RANGE_PLACE);
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
item.worldObj.spawnParticle("explode", item.posX + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, item.posY + item.worldObj.rand.nextFloat() * item.height - d1 * d3, item.posZ + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class SubTileTangleberrie extends SubTileFunctional {
|
||||
float getMotionVelocity() {
|
||||
return 0.05F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Circle(toChunkCoordinates(), getRange());
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.ai.EntityAIAvoidEntity;
|
||||
@@ -23,11 +22,9 @@ import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
@@ -36,7 +33,7 @@ public class SubTileTigerseye extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 10;
|
||||
private static final int RANGE_Y = 4;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -90,7 +87,7 @@ public class SubTileTigerseye extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xB1A618;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class SubTileVinculotus extends SubTileFunctional {
|
||||
public static Set<SubTileVinculotus> existingFlowers = Collections.newSetFromMap(new WeakHashMap());
|
||||
private static boolean registered = false;
|
||||
private static final int RANGE = 64;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -49,7 +49,7 @@ public class SubTileVinculotus extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Circle(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
|
||||
@@ -25,7 +25,6 @@ import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
@@ -113,7 +112,7 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
|
||||
@@ -21,9 +21,9 @@ import vazkii.botania.common.core.helper.ExperienceHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileArcaneRose extends SubTileGenerating {
|
||||
|
||||
|
||||
private static final int RANGE = 1;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -39,7 +39,7 @@ public class SubTileArcaneRose extends SubTileGenerating {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
public int getColor() {
|
||||
return 0x785000;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@ import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -64,7 +63,7 @@ public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.entropinnyum;
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 8000;
|
||||
|
||||
+1
-2
@@ -22,7 +22,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -102,7 +101,7 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
public int getBurnTime() {
|
||||
return 40;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), 1);
|
||||
|
||||
@@ -15,13 +15,12 @@ import net.minecraft.block.BlockCake;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileKekimurus extends SubTileGenerating {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -51,7 +50,7 @@ public class SubTileKekimurus extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -37,7 +36,7 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
|
||||
private static final int RANGE = 8;
|
||||
private static final int RANGE_Y = 16;
|
||||
|
||||
|
||||
boolean ateOnce = false;
|
||||
int ticksWithoutEating = -1;
|
||||
int cooldown = 0;
|
||||
@@ -107,7 +106,7 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
public static final String TAG_WORLD_SPAWNED = "Botania:WorldSpawned";
|
||||
|
||||
private static final int RANGE = 2;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -62,7 +62,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
|
||||
@@ -29,7 +29,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor.Square;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileSpectrolus extends SubTileGenerating {
|
||||
@@ -67,7 +66,7 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 2000;
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.common.block.tile;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
|
||||
@@ -47,12 +46,12 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower {
|
||||
public void setIslandType(IslandType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound cmp) {
|
||||
cmp.setString(TAG_ISLAND_TYPE, type.toString());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
type = IslandType.ofType(cmp.getString(TAG_ISLAND_TYPE));
|
||||
|
||||
@@ -13,14 +13,13 @@ package vazkii.botania.common.block.tile;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower;
|
||||
import vazkii.botania.common.block.decor.IFloatingFlower.IslandType;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
|
||||
public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFloatingFlower {
|
||||
|
||||
public static final String TAG_ISLAND_TYPE = "islandType";
|
||||
IslandType type = IslandType.GRASS;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOnSpecialSoil() {
|
||||
return false;
|
||||
@@ -40,13 +39,13 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo
|
||||
public void setIslandType(IslandType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound cmp) {
|
||||
super.writeCustomNBT(cmp);
|
||||
cmp.setString(TAG_ISLAND_TYPE, type.toString());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
super.readCustomNBT(cmp);
|
||||
|
||||
@@ -23,11 +23,11 @@ public class TilePump extends TileMod {
|
||||
public boolean hasCart = false;
|
||||
public boolean hasCartOnTop = false;
|
||||
public float moving = 0F;
|
||||
|
||||
|
||||
public int comparator;
|
||||
public boolean hasRedstone = false;
|
||||
int lastComparator = 0;
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
hasRedstone = false;
|
||||
@@ -38,7 +38,7 @@ public class TilePump extends TileMod {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
float max = 8F;
|
||||
float min = 0F;
|
||||
|
||||
@@ -66,14 +66,14 @@ public class TilePump extends TileMod {
|
||||
setActive(false);
|
||||
if(active && hasRedstone)
|
||||
setActive(false);
|
||||
|
||||
|
||||
hasCart = false;
|
||||
hasCartOnTop = false;
|
||||
|
||||
|
||||
if(comparator != lastComparator)
|
||||
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
|
||||
lastComparator = comparator;
|
||||
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
|
||||
@@ -172,16 +172,16 @@ public final class ConfigHandler {
|
||||
|
||||
desc = "The density of each Botania flower patch generated, defaults to 16, the lower the number, the less each patch will have.";
|
||||
flowerDensity = loadPropInt("worldgen.flower.density", desc, flowerDensity);
|
||||
|
||||
|
||||
desc = "The size of each Botania flower patch. The larger this is the farther the each patch can spread";
|
||||
flowerPatchSize = loadPropInt("worldgen.flower.patchSize", desc, flowerPatchSize);
|
||||
|
||||
desc = "The chance for a Botania flower patch to be generated. The higher this value is the less patches will exist and the more flower each will have.";
|
||||
flowerPatchChance = loadPropInt("worldgen.flower.patchChance", desc, flowerPatchChance);
|
||||
|
||||
|
||||
desc = "The chance for a Botania flower generated in a patch to be a tall flowe. 0.1 is 10%, 1 is 100%.";
|
||||
flowerTallChance = loadPropDouble("worldgen.flower.tallChance", desc, flowerTallChance);
|
||||
|
||||
|
||||
desc = "The quantity of Botania mushrooms to generate underground, in the world, defaults to 40, the lower the number the less patches generate.";
|
||||
mushroomQuantity = loadPropInt("worldgen.mushroom.quantity", desc, mushroomQuantity);
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemMagnetRing;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
public final class IMCHandler {
|
||||
|
||||
public static void processMessages(ImmutableList<IMCMessage> messageList) {
|
||||
Iterator<IMCMessage> iterator = messageList.iterator();
|
||||
while(iterator.hasNext()) {
|
||||
IMCMessage message = iterator.next();
|
||||
if(message != null && message.key != null && message.key.equals(LibMisc.BLACKLIST_ITEM) && message.isStringMessage()) {
|
||||
String value = message.getStringValue();
|
||||
ItemMagnetRing.addItemToBlackList(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void processMessages(ImmutableList<IMCMessage> messageList) {
|
||||
Iterator<IMCMessage> iterator = messageList.iterator();
|
||||
while(iterator.hasNext()) {
|
||||
IMCMessage message = iterator.next();
|
||||
if(message != null && message.key != null && message.key.equals(LibMisc.BLACKLIST_ITEM) && message.isStringMessage()) {
|
||||
String value = message.getStringValue();
|
||||
ItemMagnetRing.addItemToBlackList(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,7 +201,7 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
public boolean isBuildcraftPipe(TileEntity tile) {
|
||||
return tile instanceof IPipeTile;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
|
||||
ItemLokiRing.breakOnAllCursors(player, item, stack, x, y, z, side);
|
||||
|
||||
@@ -1622,7 +1622,7 @@ public final class ModCraftingRecipes {
|
||||
'I', LibOreDict.MANA_STEEL,
|
||||
'B', new ItemStack(Items.bucket));
|
||||
recipePump = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Double Petal Recipes
|
||||
for(int i = 0; i < 16; i++)
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.petal, 4, i), LibOreDict.DOUBLE_FLOWER[i]);
|
||||
@@ -1631,15 +1631,15 @@ public final class ModCraftingRecipes {
|
||||
// Resolute Ivy Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.keepIvy), LibOreDict.PIXIE_DUST, new ItemStack(Blocks.vine), LibOreDict.ENDER_AIR_BOTTLE);
|
||||
recipeKeepIvy = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Black Hole Talisman Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.blackHoleTalisman),
|
||||
addOreDictRecipe(new ItemStack(ModItems.blackHoleTalisman),
|
||||
" G ", "EAE", " E ",
|
||||
'G', LibOreDict.LIFE_ESSENCE,
|
||||
'E', LibOreDict.ELEMENTIUM,
|
||||
'A', LibOreDict.ENDER_AIR_BOTTLE);
|
||||
recipeBlackHoleTalisman = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
|
||||
// Storage Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -10,15 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IRelic;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class AesirRingRecipe implements IRecipe {
|
||||
|
||||
@@ -47,7 +44,7 @@ public class AesirRingRecipe implements IRecipe {
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
String soulbind = null;
|
||||
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
@@ -58,7 +55,7 @@ public class AesirRingRecipe implements IRecipe {
|
||||
else if(!soulbind.equals(bind))
|
||||
return null;
|
||||
} else return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack stack = new ItemStack(ModItems.aesirRing);
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IPhantomInkable;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemKeepIvy;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
@@ -64,5 +63,5 @@ public class KeepIvyRecipe implements IRecipe {
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -315,7 +315,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(hard) {
|
||||
entityDropItem(new ItemStack(ModItems.ancientWill, 1, rand.nextInt(6)), 1F);
|
||||
entityDropItem(new ItemStack(ModItems.dice), 1F);
|
||||
|
||||
|
||||
if(Math.random() < 0.25)
|
||||
entityDropItem(new ItemStack(ModItems.overgrowthSeed, rand.nextInt(3) + 1), 1F);
|
||||
if(Math.random() < 0.5) {
|
||||
|
||||
@@ -22,35 +22,35 @@ public class EntityPinkWither extends EntityWither {
|
||||
public EntityPinkWither(World p_i1701_1_) {
|
||||
super(p_i1701_1_);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLivingUpdate() {
|
||||
super.onLivingUpdate();
|
||||
|
||||
|
||||
if(Math.random() < 0.1)
|
||||
for(int j = 0; j < 3; ++j) {
|
||||
double d10 = this.func_82214_u(j);
|
||||
double d2 = this.func_82208_v(j);
|
||||
double d4 = this.func_82213_w(j);
|
||||
this.worldObj.spawnParticle("heart", d10 + this.rand.nextGaussian() * 0.30000001192092896D, d2 + this.rand.nextGaussian() * 0.30000001192092896D, d4 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
|
||||
double d10 = func_82214_u(j);
|
||||
double d2 = func_82208_v(j);
|
||||
double d4 = func_82213_w(j);
|
||||
worldObj.spawnParticle("heart", d10 + rand.nextGaussian() * 0.30000001192092896D, d2 + rand.nextGaussian() * 0.30000001192092896D, d4 + rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setAttackTarget(EntityLivingBase p_70624_1_) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void attackEntity(Entity p_70785_1_, float p_70785_2_) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity p_70652_1_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean interact(EntityPlayer player) {
|
||||
player.mountEntity(this);
|
||||
@@ -61,40 +61,40 @@ public class EntityPinkWither extends EntityWither {
|
||||
protected boolean isAIEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// COPYPASTA
|
||||
|
||||
|
||||
private double func_82214_u(int p_82214_1_)
|
||||
{
|
||||
if (p_82214_1_ <= 0)
|
||||
{
|
||||
return this.posX;
|
||||
}
|
||||
else
|
||||
{
|
||||
float f = (this.renderYawOffset + (float)(180 * (p_82214_1_ - 1))) / 180.0F * (float)Math.PI;
|
||||
float f1 = MathHelper.cos(f);
|
||||
return this.posX + (double)f1 * 1.3D;
|
||||
}
|
||||
}
|
||||
|
||||
private double func_82208_v(int p_82208_1_)
|
||||
{
|
||||
return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D;
|
||||
}
|
||||
|
||||
private double func_82213_w(int p_82213_1_)
|
||||
{
|
||||
if (p_82213_1_ <= 0)
|
||||
{
|
||||
return this.posZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
float f = (this.renderYawOffset + (float)(180 * (p_82213_1_ - 1))) / 180.0F * (float)Math.PI;
|
||||
float f1 = MathHelper.sin(f);
|
||||
return this.posZ + (double)f1 * 1.3D;
|
||||
}
|
||||
}
|
||||
private double func_82214_u(int p_82214_1_)
|
||||
{
|
||||
if (p_82214_1_ <= 0)
|
||||
{
|
||||
return posX;
|
||||
}
|
||||
else
|
||||
{
|
||||
float f = (renderYawOffset + 180 * (p_82214_1_ - 1)) / 180.0F * (float)Math.PI;
|
||||
float f1 = MathHelper.cos(f);
|
||||
return posX + f1 * 1.3D;
|
||||
}
|
||||
}
|
||||
|
||||
private double func_82208_v(int p_82208_1_)
|
||||
{
|
||||
return p_82208_1_ <= 0 ? posY + 3.0D : posY + 2.2D;
|
||||
}
|
||||
|
||||
private double func_82213_w(int p_82213_1_)
|
||||
{
|
||||
if (p_82213_1_ <= 0)
|
||||
{
|
||||
return posZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
float f = (renderYawOffset + 180 * (p_82213_1_ - 1)) / 180.0F * (float)Math.PI;
|
||||
float f1 = MathHelper.sin(f);
|
||||
return posZ + f1 * 1.3D;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
ForgeDirection pumpDir = ForgeDirection.getOrientation(meta);
|
||||
boolean did = false;
|
||||
boolean can = false;
|
||||
|
||||
|
||||
if(pumpDir == dir) { // Pool -> Cart
|
||||
can = true;
|
||||
int cartMana = getMana();
|
||||
@@ -106,7 +106,7 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
pool.recieveMana(transfer);
|
||||
setMana(cartMana - transfer);
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,12 +116,12 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
if(!pump.active)
|
||||
pump.setActive(true);
|
||||
}
|
||||
|
||||
|
||||
if(can) {
|
||||
pump.hasCartOnTop = true;
|
||||
pump.comparator = (int) (((double) getMana() / (double) TilePool.MAX_MANA) * 15);
|
||||
pump.comparator = (int) ((double) getMana() / (double) TilePool.MAX_MANA * 15);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.entity;
|
||||
|
||||
import net.minecraft.entity.boss.EntityWither;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibEntityNames;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -36,206 +35,206 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBlackHoleTalisman extends ItemMod {
|
||||
|
||||
private static final String TAG_BLOCK_NAME = "blockName";
|
||||
private static final String TAG_BLOCK_META = "blockMeta";
|
||||
private static final String TAG_BLOCK_COUNT = "blockCount";
|
||||
private static final String TAG_BLOCK_NAME = "blockName";
|
||||
private static final String TAG_BLOCK_META = "blockMeta";
|
||||
private static final String TAG_BLOCK_COUNT = "blockCount";
|
||||
|
||||
IIcon enabledIcon;
|
||||
IIcon enabledIcon;
|
||||
|
||||
public ItemBlackHoleTalisman() {
|
||||
setUnlocalizedName(LibItemNames.BLACK_HOLE_TALISMAN);
|
||||
setMaxStackSize(1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
public ItemBlackHoleTalisman() {
|
||||
setUnlocalizedName(LibItemNames.BLACK_HOLE_TALISMAN);
|
||||
setMaxStackSize(1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
private static void setCount(ItemStack stack, int count) {
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_COUNT, count);
|
||||
}
|
||||
private static void setCount(ItemStack stack, int count) {
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_COUNT, count);
|
||||
}
|
||||
|
||||
public static int remove(ItemStack stack, int count) {
|
||||
int current = getBlockCount(stack);
|
||||
setCount(stack, Math.max(current - count, 0));
|
||||
public static int remove(ItemStack stack, int count) {
|
||||
int current = getBlockCount(stack);
|
||||
setCount(stack, Math.max(current - count, 0));
|
||||
|
||||
return Math.min(current, count);
|
||||
}
|
||||
return Math.min(current, count);
|
||||
}
|
||||
|
||||
public static String getBlockName(ItemStack stack) {
|
||||
return ItemNBTHelper.getString(stack, TAG_BLOCK_NAME, "");
|
||||
}
|
||||
public static String getBlockName(ItemStack stack) {
|
||||
return ItemNBTHelper.getString(stack, TAG_BLOCK_NAME, "");
|
||||
}
|
||||
|
||||
public static Block getBlock(ItemStack stack) {
|
||||
Block block = Block.getBlockFromName(getBlockName(stack));
|
||||
return block;
|
||||
}
|
||||
public static Block getBlock(ItemStack stack) {
|
||||
Block block = Block.getBlockFromName(getBlockName(stack));
|
||||
return block;
|
||||
}
|
||||
|
||||
public static int getBlockMeta(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_BLOCK_META, 0);
|
||||
}
|
||||
public static int getBlockMeta(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_BLOCK_META, 0);
|
||||
}
|
||||
|
||||
public static int getBlockCount(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_BLOCK_COUNT, 0);
|
||||
}
|
||||
public static int getBlockCount(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_BLOCK_COUNT, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
if(getBlock(par1ItemStack) != Blocks.air && par3EntityPlayer.isSneaking()) {
|
||||
int dmg = par1ItemStack.getItemDamage();
|
||||
par1ItemStack.setItemDamage(~dmg & 1);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
if(getBlock(par1ItemStack) != Blocks.air && par3EntityPlayer.isSneaking()) {
|
||||
int dmg = par1ItemStack.getItemDamage();
|
||||
par1ItemStack.setItemDamage(~dmg & 1);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
int meta = par3World.getBlockMetadata(par4, par5, par6);
|
||||
boolean set = setBlock(par1ItemStack, block, meta);
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
if(!set) {
|
||||
Block bBlock = getBlock(par1ItemStack);
|
||||
int bmeta = getBlockMeta(par1ItemStack);
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
int meta = par3World.getBlockMetadata(par4, par5, par6);
|
||||
boolean set = setBlock(par1ItemStack, block, meta);
|
||||
|
||||
TileEntity tile = par3World.getTileEntity(par4, par5, par6);
|
||||
if(tile != null && tile instanceof IInventory) {
|
||||
IInventory inv = (IInventory) tile;
|
||||
int[] slots = inv instanceof ISidedInventory ? ((ISidedInventory) inv).getAccessibleSlotsFromSide(par7) : InventoryHelper.buildSlotsForLinearInventory(inv);
|
||||
for(int slot : slots) {
|
||||
ItemStack stackInSlot = inv.getStackInSlot(slot);
|
||||
if(stackInSlot == null) {
|
||||
ItemStack stack = new ItemStack(bBlock, 1, bmeta);
|
||||
int maxSize = stack.getMaxStackSize();
|
||||
stack.stackSize = remove(par1ItemStack, maxSize);
|
||||
if(stack.stackSize != 0) {
|
||||
if(inv.isItemValidForSlot(slot, stack) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stack, par7))) {
|
||||
inv.setInventorySlotContents(slot, stack);
|
||||
inv.markDirty();
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
} else if(stackInSlot.getItem() == Item.getItemFromBlock(bBlock) && stackInSlot.getItemDamage() == bmeta) {
|
||||
int maxSize = stackInSlot.getMaxStackSize();
|
||||
int missing = maxSize - stackInSlot.stackSize;
|
||||
if(inv.isItemValidForSlot(slot, stackInSlot) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stackInSlot, par7))) {
|
||||
stackInSlot.stackSize += remove(par1ItemStack, missing);
|
||||
inv.markDirty();
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int remove = remove(par1ItemStack, 1);
|
||||
if(remove > 0) {
|
||||
Item.getItemFromBlock(bBlock).onItemUse(new ItemStack(bBlock, 1, bmeta), par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!set) {
|
||||
Block bBlock = getBlock(par1ItemStack);
|
||||
int bmeta = getBlockMeta(par1ItemStack);
|
||||
|
||||
par2EntityPlayer.setCurrentItemOrArmor(0, par1ItemStack);
|
||||
return set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World p_77663_2_, Entity entity, int p_77663_4_, boolean p_77663_5_) {
|
||||
Block block = getBlock(itemstack);
|
||||
if(!entity.worldObj.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.air && entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
int meta = getBlockMeta(itemstack);
|
||||
TileEntity tile = par3World.getTileEntity(par4, par5, par6);
|
||||
if(tile != null && tile instanceof IInventory) {
|
||||
IInventory inv = (IInventory) tile;
|
||||
int[] slots = inv instanceof ISidedInventory ? ((ISidedInventory) inv).getAccessibleSlotsFromSide(par7) : InventoryHelper.buildSlotsForLinearInventory(inv);
|
||||
for(int slot : slots) {
|
||||
ItemStack stackInSlot = inv.getStackInSlot(slot);
|
||||
if(stackInSlot == null) {
|
||||
ItemStack stack = new ItemStack(bBlock, 1, bmeta);
|
||||
int maxSize = stack.getMaxStackSize();
|
||||
stack.stackSize = remove(par1ItemStack, maxSize);
|
||||
if(stack.stackSize != 0) {
|
||||
if(inv.isItemValidForSlot(slot, stack) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stack, par7))) {
|
||||
inv.setInventorySlotContents(slot, stack);
|
||||
inv.markDirty();
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
} else if(stackInSlot.getItem() == Item.getItemFromBlock(bBlock) && stackInSlot.getItemDamage() == bmeta) {
|
||||
int maxSize = stackInSlot.getMaxStackSize();
|
||||
int missing = maxSize - stackInSlot.stackSize;
|
||||
if(inv.isItemValidForSlot(slot, stackInSlot) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stackInSlot, par7))) {
|
||||
stackInSlot.stackSize += remove(par1ItemStack, missing);
|
||||
inv.markDirty();
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int remove = remove(par1ItemStack, 1);
|
||||
if(remove > 0) {
|
||||
Item.getItemFromBlock(bBlock).onItemUse(new ItemStack(bBlock, 1, bmeta), par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int highest = -1;
|
||||
boolean hasFreeSlot = false;
|
||||
int[] counts = new int[player.inventory.getSizeInventory() - player.inventory.armorInventory.length];
|
||||
Arrays.fill(counts, 0);
|
||||
par2EntityPlayer.setCurrentItemOrArmor(0, par1ItemStack);
|
||||
return set;
|
||||
}
|
||||
|
||||
for(int i = 0; i < counts.length; i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if(stack == null) {
|
||||
hasFreeSlot = true;
|
||||
continue;
|
||||
}
|
||||
@Override
|
||||
public void onUpdate(ItemStack itemstack, World p_77663_2_, Entity entity, int p_77663_4_, boolean p_77663_5_) {
|
||||
Block block = getBlock(itemstack);
|
||||
if(!entity.worldObj.isRemote && itemstack.getItemDamage() == 1 && block != Blocks.air && entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
int meta = getBlockMeta(itemstack);
|
||||
|
||||
if(Item.getItemFromBlock(block) == stack.getItem() && stack.getItemDamage() == meta) {
|
||||
counts[i] = stack.stackSize;
|
||||
if(highest == -1)
|
||||
highest = i;
|
||||
else highest = counts[i] > counts[highest] && highest > 8 ? i : highest;
|
||||
}
|
||||
}
|
||||
int highest = -1;
|
||||
boolean hasFreeSlot = false;
|
||||
int[] counts = new int[player.inventory.getSizeInventory() - player.inventory.armorInventory.length];
|
||||
Arrays.fill(counts, 0);
|
||||
|
||||
if(highest == -1) {
|
||||
ItemStack heldItem = player.inventory.getItemStack();
|
||||
if(hasFreeSlot && (heldItem == null || Item.getItemFromBlock(block) == heldItem.getItem() || heldItem.getItemDamage() != meta)) {
|
||||
ItemStack stack = new ItemStack(block, remove(itemstack, 64), meta);
|
||||
if(stack.stackSize != 0)
|
||||
player.inventory.addItemStackToInventory(stack);
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < counts.length; i++) {
|
||||
int count = counts[i];
|
||||
for(int i = 0; i < counts.length; i++) {
|
||||
ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if(stack == null) {
|
||||
hasFreeSlot = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(i == highest || count == 0)
|
||||
continue;
|
||||
if(Item.getItemFromBlock(block) == stack.getItem() && stack.getItemDamage() == meta) {
|
||||
counts[i] = stack.stackSize;
|
||||
if(highest == -1)
|
||||
highest = i;
|
||||
else highest = counts[i] > counts[highest] && highest > 8 ? i : highest;
|
||||
}
|
||||
}
|
||||
|
||||
add(itemstack, count);
|
||||
player.inventory.setInventorySlotContents(i, null);
|
||||
}
|
||||
if(highest == -1) {
|
||||
ItemStack heldItem = player.inventory.getItemStack();
|
||||
if(hasFreeSlot && (heldItem == null || Item.getItemFromBlock(block) == heldItem.getItem() || heldItem.getItemDamage() != meta)) {
|
||||
ItemStack stack = new ItemStack(block, remove(itemstack, 64), meta);
|
||||
if(stack.stackSize != 0)
|
||||
player.inventory.addItemStackToInventory(stack);
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < counts.length; i++) {
|
||||
int count = counts[i];
|
||||
|
||||
int countInHighest = counts[highest];
|
||||
int maxSize = new ItemStack(block, 1, meta).getMaxStackSize();
|
||||
if(countInHighest < maxSize) {
|
||||
int missing = maxSize - countInHighest;
|
||||
ItemStack stackInHighest = player.inventory.getStackInSlot(highest);
|
||||
stackInHighest.stackSize += remove(itemstack, missing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean setBlock(ItemStack stack, Block block, int meta) {
|
||||
if(getBlock(stack) == Blocks.air || getBlockCount(stack) == 0) {
|
||||
ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, Block.blockRegistry.getNameForObject(block));
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_META, meta);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if(i == highest || count == 0)
|
||||
continue;
|
||||
|
||||
private void add(ItemStack stack, int count) {
|
||||
int current = getBlockCount(stack);
|
||||
setCount(stack, current + count);
|
||||
}
|
||||
add(itemstack, count);
|
||||
player.inventory.setInventorySlotContents(i, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
int countInHighest = counts[highest];
|
||||
int maxSize = new ItemStack(block, 1, meta).getMaxStackSize();
|
||||
if(countInHighest < maxSize) {
|
||||
int missing = maxSize - countInHighest;
|
||||
ItemStack stackInHighest = player.inventory.getStackInSlot(highest);
|
||||
stackInHighest.stackSize += remove(itemstack, missing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 == 1 ? enabledIcon : itemIcon;
|
||||
}
|
||||
private boolean setBlock(ItemStack stack, Block block, int meta) {
|
||||
if(getBlock(stack) == Blocks.air || getBlockCount(stack) == 0) {
|
||||
ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, Block.blockRegistry.getNameForObject(block));
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_META, meta);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
if(block != null && block != Blocks.air) {
|
||||
int count = getBlockCount(par1ItemStack);
|
||||
par3List.add(StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") + " (x" + count + ")");
|
||||
}
|
||||
private void add(ItemStack stack, int count) {
|
||||
int current = getBlockCount(stack);
|
||||
setCount(stack, current + count);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 == 1 ? enabledIcon : itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
if(block != null && block != Blocks.air) {
|
||||
int count = getBlockCount(par1ItemStack);
|
||||
par3List.add(StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") + " (x" + count + ")");
|
||||
}
|
||||
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.active"), par3List);
|
||||
else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.inactive"), par3List);
|
||||
}
|
||||
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.active"), par3List);
|
||||
else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.inactive"), par3List);
|
||||
}
|
||||
|
||||
void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class ItemGrassSeeds extends ItemMod {
|
||||
private static final IslandType[] ISLAND_TYPES = {
|
||||
IslandType.GRASS, IslandType.PODZOL, IslandType.MYCEL
|
||||
};
|
||||
|
||||
|
||||
private static final int types = 3;
|
||||
IIcon[] icons;
|
||||
|
||||
@@ -207,7 +207,7 @@ public class ItemGrassSeeds extends ItemMod {
|
||||
list.remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static IslandType getIslandType(ItemStack stack) {
|
||||
return ISLAND_TYPES[Math.min(stack.getItemDamage(), ISLAND_TYPES.length - 1)];
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
public class ItemKeepIvy extends ItemMod {
|
||||
|
||||
public static final String TAG_KEEP = "Botania_keepIvy";
|
||||
|
||||
|
||||
private static final String TAG_PLAYER_KEPT_DROPS = "Botania_playerKeptDrops";
|
||||
private static final String TAG_DROP_COUNT = "dropCount";
|
||||
private static final String TAG_DROP_PREFIX = "dropPrefix";
|
||||
|
||||
|
||||
public ItemKeepIvy() {
|
||||
setUnlocalizedName(LibItemNames.KEEP_IVY);
|
||||
GameRegistry.addRecipe(new KeepIvyRecipe());
|
||||
@@ -44,7 +44,7 @@ public class ItemKeepIvy extends ItemMod {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerDrops(PlayerDropsEvent event) {
|
||||
List<EntityItem> keeps = new ArrayList();
|
||||
@@ -53,14 +53,14 @@ public class ItemKeepIvy extends ItemMod {
|
||||
if(stack != null && ItemNBTHelper.detectNBT(stack) && ItemNBTHelper.getBoolean(stack, TAG_KEEP, false))
|
||||
keeps.add(item);
|
||||
}
|
||||
|
||||
|
||||
if(keeps.size() > 0) {
|
||||
event.drops.removeAll(keeps);
|
||||
|
||||
|
||||
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
cmp.setInteger(TAG_DROP_COUNT, keeps.size());
|
||||
|
||||
|
||||
int i = 0;
|
||||
for(EntityItem keep : keeps) {
|
||||
ItemStack stack = keep.getEntityItem();
|
||||
@@ -69,23 +69,23 @@ public class ItemKeepIvy extends ItemMod {
|
||||
cmp.setTag(TAG_DROP_PREFIX + i, cmp1);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
NBTTagCompound data = event.entityPlayer.getEntityData();
|
||||
if(!data.hasKey(EntityPlayer.PERSISTED_NBT_TAG))
|
||||
data.setTag(EntityPlayer.PERSISTED_NBT_TAG, new NBTTagCompound());
|
||||
|
||||
|
||||
NBTTagCompound persist = data.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
|
||||
persist.setTag(TAG_PLAYER_KEPT_DROPS, cmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerRespawn(PlayerRespawnEvent event) {
|
||||
NBTTagCompound data = event.player.getEntityData();
|
||||
if(data.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) {
|
||||
NBTTagCompound cmp = data.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
|
||||
NBTTagCompound cmp1 = cmp.getCompoundTag(TAG_PLAYER_KEPT_DROPS);
|
||||
|
||||
|
||||
int count = cmp1.getInteger(TAG_DROP_COUNT);
|
||||
for(int i = 0; i < count; i++) {
|
||||
NBTTagCompound cmp2 = cmp1.getCompoundTag(TAG_DROP_PREFIX + i);
|
||||
@@ -96,9 +96,9 @@ public class ItemKeepIvy extends ItemMod {
|
||||
event.player.inventory.addItemStackToInventory(copy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cmp.setTag(TAG_PLAYER_KEPT_DROPS, new NBTTagCompound());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.entity.EntityPinkWither;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
@@ -45,12 +44,12 @@ public class ItemPinkinator extends ItemMod {
|
||||
world.playSoundAtEntity(wither, "random.explode", 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
}
|
||||
player.addStat(ModAchievements.pinkinator, 1);
|
||||
|
||||
|
||||
world.spawnParticle("hugeexplosion", wither.posX, wither.posY, wither.posZ, 1D, 0D, 0D);
|
||||
stack.stackSize--;
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ public final class ModItems {
|
||||
dice = new ItemDice();
|
||||
keepIvy = new ItemKeepIvy();
|
||||
blackHoleTalisman = new ItemBlackHoleTalisman();
|
||||
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -16,5 +16,5 @@ import net.minecraft.item.ItemStack;
|
||||
public interface IRarityBlock {
|
||||
|
||||
public EnumRarity getRarity(ItemStack stack);
|
||||
|
||||
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
|
||||
@@ -130,7 +130,7 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
public static void setCooldown(ItemStack stack, int cooldown) {
|
||||
ItemNBTHelper.setInt(stack, TAG_COOLDOWN, cooldown);
|
||||
}
|
||||
|
||||
|
||||
public static void addItemToBlackList(String item) {
|
||||
BLACKLIST.add(item);
|
||||
}
|
||||
|
||||
@@ -128,10 +128,10 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ
|
||||
ItemLokiRing.breakOnAllCursors(player, this, stack, x, y, z, raycast.sideHit);
|
||||
// ^ Doable with API access through the IInternalMethodHandler.
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side) {
|
||||
if(!isEnabled(stack))
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
package vazkii.botania.common.item.material;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
|
||||
@@ -13,10 +13,6 @@ package vazkii.botania.common.item.relic;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
@@ -25,29 +21,32 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import baubles.api.BaubleType;
|
||||
import vazkii.botania.api.item.IWireframeCoordinateListProvider;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.crafting.recipe.AesirRingRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.KeepIvyRecipe;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordinateListProvider, ICraftAchievement {
|
||||
|
||||
Multimap<String, AttributeModifier> attributes = HashMultimap.create();
|
||||
|
||||
|
||||
public ItemAesirRing() {
|
||||
super(LibItemNames.AESIR_RING);
|
||||
fillModifiers(attributes);
|
||||
GameRegistry.addRecipe(new AesirRingRecipe());
|
||||
RecipeSorter.register("botania:aesirRing", AesirRingRecipe.class, Category.SHAPELESS, "");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
|
||||
((ItemOdinRing) ModItems.odinRing).onValidPlayerWornTick(stack, player);
|
||||
@@ -62,7 +61,7 @@ public class ItemAesirRing extends ItemRelicBauble implements IWireframeCoordina
|
||||
public List<ChunkCoordinates> getWireframesToDraw(EntityPlayer player, ItemStack stack) {
|
||||
return ((IWireframeCoordinateListProvider) ModItems.lokiRing).getWireframesToDraw(player, stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
|
||||
player.getAttributeMap().applyAttributeModifiers(attributes);
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.relic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
@@ -32,12 +28,12 @@ public class ItemDice extends ItemRelic {
|
||||
private static final int[] SIDES_FOR_MOON_PHASES = new int[] {
|
||||
-1, 0, 1, 2, -1, 2, 3, 4
|
||||
};
|
||||
|
||||
|
||||
final ItemStack[] relicStacks;
|
||||
|
||||
|
||||
public ItemDice() {
|
||||
super(LibItemNames.DICE);
|
||||
|
||||
|
||||
relicStacks = new ItemStack[] {
|
||||
new ItemStack(ModItems.infiniteFruit),
|
||||
new ItemStack(ModItems.excaliber),
|
||||
@@ -58,29 +54,29 @@ public class ItemDice extends ItemRelic {
|
||||
relic = world.rand.nextInt(6);
|
||||
|
||||
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
|
||||
if(hasRelicAlready(player, relic)) {
|
||||
player.addChatMessage(new ChatComponentTranslation("botaniamisc.dudDiceRoll", (relic + 1)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_GREEN)));
|
||||
player.addChatMessage(new ChatComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_GREEN)));
|
||||
stack.stackSize--;
|
||||
return stack;
|
||||
}
|
||||
|
||||
player.addChatMessage(new ChatComponentTranslation("botaniamisc.diceRoll", (relic + 1)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_GREEN)));
|
||||
|
||||
player.addChatMessage(new ChatComponentTranslation("botaniamisc.diceRoll", relic + 1).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_GREEN)));
|
||||
return relicStacks[relic].copy();
|
||||
}
|
||||
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
boolean hasRelicAlready(EntityPlayer player, int relic) {
|
||||
if(relic < 0 || relic > 5 || !(player instanceof EntityPlayerMP))
|
||||
return true;
|
||||
|
||||
|
||||
EntityPlayerMP mpPlayer = (EntityPlayerMP) player;
|
||||
Item item = relicStacks[relic].getItem();
|
||||
IRelic irelic = (IRelic) item;
|
||||
Achievement achievement = irelic.getBindAchievement();
|
||||
return mpPlayer.func_147099_x().hasAchievementUnlocked(achievement);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -45,17 +45,17 @@ import com.google.common.collect.Multimap;
|
||||
|
||||
public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEffect {
|
||||
|
||||
private static final String TAG_ATTACKER_USERNAME = "attackerUsername";
|
||||
private static final String TAG_HOME_ID = "homeID";
|
||||
private static final String TAG_ATTACKER_USERNAME = "attackerUsername";
|
||||
private static final String TAG_HOME_ID = "homeID";
|
||||
|
||||
public static ToolMaterial toolMaterial = EnumHelper.addToolMaterial("B_EXCALIBER", 3, -1, 6.2F, 6F, 40);
|
||||
|
||||
|
||||
Achievement achievement;
|
||||
|
||||
|
||||
public ItemExcaliber() {
|
||||
super(toolMaterial, LibItemNames.EXCALIBER);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par3Entity instanceof EntityPlayer) {
|
||||
@@ -73,12 +73,12 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
|
||||
ItemRelic.addBindInfo(p_77624_3_, p_77624_1_, p_77624_2_);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void bindToUsername(String playerName, ItemStack stack) {
|
||||
ItemRelic.bindToUsernameS(playerName, stack);
|
||||
@@ -98,21 +98,21 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
|
||||
public void setBindAchievement(Achievement achievement) {
|
||||
this.achievement = achievement;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
Multimap multimap = HashMultimap.create();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 10, 0));
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 0.3, 1));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
public EntityManaBurst getBurst(EntityPlayer player, ItemStack stack) {
|
||||
@Override
|
||||
public Multimap getItemAttributeModifiers() {
|
||||
Multimap multimap = HashMultimap.create();
|
||||
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 10, 0));
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", 0.3, 1));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
public EntityManaBurst getBurst(EntityPlayer player, ItemStack stack) {
|
||||
EntityManaBurst burst = new EntityManaBurst(player);
|
||||
|
||||
float motionModifier = 7F;
|
||||
@@ -145,7 +145,7 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
|
||||
public void updateBurst(IManaBurst burst, ItemStack stack) {
|
||||
EntityThrowable entity = (EntityThrowable) burst;
|
||||
AxisAlignedBB axis = AxisAlignedBB.getBoundingBox(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).expand(1, 1, 1);
|
||||
|
||||
|
||||
String attacker = ItemNBTHelper.getString(burst.getSourceLens(), TAG_ATTACKER_USERNAME, "");
|
||||
int homeID = ItemNBTHelper.getInt(stack, TAG_HOME_ID, -1);
|
||||
if(homeID == -1) {
|
||||
@@ -154,13 +154,13 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
|
||||
for(EntityLivingBase living : entities) {
|
||||
if(living instanceof EntityPlayer && (((EntityPlayer) living).getCommandSenderName().equals(attacker) || MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled()) || living.hurtTime != 0)
|
||||
continue;
|
||||
|
||||
|
||||
homeID = living.getEntityId();
|
||||
ItemNBTHelper.setInt(stack, TAG_HOME_ID, homeID);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axis);
|
||||
|
||||
if(homeID != -1) {
|
||||
@@ -170,12 +170,12 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
|
||||
Vector3 vecThis = Vector3.fromEntityCenter(entity);
|
||||
Vector3 vecMotion = vecEntity.sub(vecThis);
|
||||
Vector3 vecCurrentMotion = new Vector3(entity.motionX, entity.motionY, entity.motionZ);
|
||||
|
||||
|
||||
vecMotion.normalize().multiply(vecCurrentMotion.mag());
|
||||
burst.setMotion(vecMotion.x, vecMotion.y, vecMotion.z);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(EntityLivingBase living : entities) {
|
||||
if(living instanceof EntityPlayer && (((EntityPlayer) living).getCommandSenderName().equals(attacker) || MinecraftServer.getServer() != null && !MinecraftServer.getServer().isPVPEnabled()))
|
||||
continue;
|
||||
@@ -201,7 +201,7 @@ public class ItemExcaliber extends ItemManasteelSword implements IRelic, ILensEf
|
||||
public boolean doParticles(IManaBurst burst, ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
return BotaniaAPI.rarityRelic;
|
||||
|
||||
@@ -59,12 +59,12 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
private static final String TAG_DIMENSION = "dim";
|
||||
|
||||
IIcon[] signs;
|
||||
|
||||
|
||||
public ItemFlugelEye() {
|
||||
super(LibItemNames.FLUGEL_EYE);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
@@ -84,7 +84,7 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
|
||||
}
|
||||
} else setWarpPoint(stack, segment, player.posX, player.posY, player.posZ, world.provider.dimensionId);
|
||||
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
public static void setRotationBase(ItemStack stack, float rotation) {
|
||||
ItemNBTHelper.setFloat(stack, TAG_ROTATION_BASE, rotation);
|
||||
}
|
||||
|
||||
|
||||
public static void setWarpPoint(ItemStack stack, int warp, double x, double y, double z, int dim) {
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
cmp.setDouble(TAG_POS_X, x);
|
||||
@@ -177,12 +177,12 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
cmp.setInteger(TAG_DIMENSION, dim);
|
||||
ItemNBTHelper.setCompound(stack, TAG_WARP_PREFIX + warp, cmp);
|
||||
}
|
||||
|
||||
|
||||
public static MultiversePosition getWarpPoint(ItemStack stack, int warp) {
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_WARP_PREFIX + warp, true);
|
||||
if(cmp == null)
|
||||
return FALLBACK_POSITION;
|
||||
|
||||
|
||||
double x = cmp.getDouble(TAG_POS_X);
|
||||
double y = cmp.getDouble(TAG_POS_Y);
|
||||
double z = cmp.getDouble(TAG_POS_Z);
|
||||
@@ -240,11 +240,10 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(rotationAngle, 0F, 1F, 0F);
|
||||
GL11.glTranslatef(s * m, -0.75F, 0F);
|
||||
|
||||
|
||||
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
GL11.glScalef(0.75F, 0.75F, 0.75F);
|
||||
GL11.glTranslatef(0F, 0F, 0.5F);
|
||||
int renderPass = 0;
|
||||
IIcon icon = signs[seg];
|
||||
GL11.glRotatef(90F, 0F, 1F, 0F);
|
||||
GL11.glColor4f(1F, 1F, 1F, getWarpPoint(stack, seg).isValid() ? 1F : 0.2F);
|
||||
@@ -253,7 +252,7 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
float f2 = icon.getMinV();
|
||||
float f3 = icon.getMaxV();
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
|
||||
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -295,17 +294,17 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUD(ScaledResolution resolution, EntityPlayer player, ItemStack stack) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
Minecraft.getMinecraft();
|
||||
int slot = getSegmentLookedAt(stack, player);
|
||||
MultiversePosition pos = getWarpPoint(stack, slot);
|
||||
|
||||
|
||||
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
|
||||
String s = StatCollector.translateToLocal("botania.sign" + slot);
|
||||
font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 55, 0xFFD409);
|
||||
|
||||
|
||||
if(pos.isValid()) {
|
||||
int dist = (int) vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(pos.x, pos.y, pos.z, player.posX, player.posY - 1.6, player.posZ);
|
||||
|
||||
|
||||
s = dist == 1 ? StatCollector.translateToLocal("botaniamisc.blockAway") : String.format(StatCollector.translateToLocal("botaniamisc.blocksAway"), dist);
|
||||
font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 40, 0x9999FF);
|
||||
s = StatCollector.translateToLocal("botaniamisc.clickToTeleport");
|
||||
@@ -319,23 +318,23 @@ public class ItemFlugelEye extends ItemRelic {
|
||||
font.drawStringWithShadow(s, resolution.getScaledWidth() / 2 - font.getStringWidth(s) / 2, resolution.getScaledHeight() / 2 - 30, 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class MultiversePosition {
|
||||
|
||||
|
||||
public final double x, y, z;
|
||||
public final int dim;
|
||||
|
||||
|
||||
public MultiversePosition(double x, double y, double z, int dim) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.dim = dim;
|
||||
}
|
||||
|
||||
|
||||
boolean isValid() {
|
||||
return y > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,20 +10,20 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.relic;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class ItemInfiniteFruit extends ItemRelic {
|
||||
|
||||
public ItemInfiniteFruit() {
|
||||
super(LibItemNames.INFINITE_FRUIT);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
|
||||
return 32;
|
||||
@@ -40,17 +40,17 @@ public class ItemInfiniteFruit extends ItemRelic {
|
||||
p_77659_3_.setItemInUse(p_77659_1_, getMaxItemUseDuration(p_77659_1_));
|
||||
return p_77659_1_;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
|
||||
super.onUsingTick(stack, player, count);
|
||||
|
||||
if(count % 5 == 0)
|
||||
player.getFoodStats().addStats(1, 0.1F);
|
||||
|
||||
|
||||
if(count == 5)
|
||||
if(player.canEat(false))
|
||||
ReflectionHelper.setPrivateValue(EntityPlayer.class, player, 20, LibObfuscation.ITEM_IN_USE_COUNT);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -58,18 +58,18 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
super(LibItemNames.LOKI_RING);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
ItemStack lokiRing = getLokiRing(player);
|
||||
if(lokiRing == null || player.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
|
||||
ItemStack heldItemStack = player.getCurrentEquippedItem();
|
||||
ChunkCoordinates originCoords = getOriginPos(lokiRing);
|
||||
MovingObjectPosition lookPos = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 4.5F);
|
||||
|
||||
|
||||
if(heldItemStack == null && event.action == Action.RIGHT_CLICK_BLOCK && player.isSneaking()) {
|
||||
if(originCoords.posY == -1 && lookPos != null) {
|
||||
setOriginPos(lokiRing, lookPos.blockX, lookPos.blockY, lookPos.blockZ);
|
||||
@@ -83,7 +83,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
for(ChunkCoordinates cursor : cursors)
|
||||
if(cursor.posX == lookPos.blockX && cursor.posY == lookPos.blockY && cursor.posZ == lookPos.blockZ)
|
||||
break addCursor;
|
||||
|
||||
|
||||
addCursor(lokiRing, lookPos.blockX - originCoords.posX, lookPos.blockY - originCoords.posY, lookPos.blockZ - originCoords.posZ);
|
||||
}
|
||||
}
|
||||
@@ -100,19 +100,19 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
|
||||
ItemStack lokiRing = getLokiRing(player);
|
||||
if(lokiRing == null || player.worldObj.isRemote || !(item instanceof ISequentialBreaker))
|
||||
return;
|
||||
|
||||
|
||||
List<ChunkCoordinates> cursors = getCursorList(lokiRing);
|
||||
ISequentialBreaker breaker = (ISequentialBreaker) item;
|
||||
World world = player.worldObj;
|
||||
boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0;
|
||||
int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack);
|
||||
boolean dispose = breaker.disposeOfTrashBlocks(stack);
|
||||
|
||||
|
||||
for(int i = 0; i < cursors.size(); i++) {
|
||||
ChunkCoordinates coords = cursors.get(i);
|
||||
int xp = x + coords.posX;
|
||||
@@ -123,7 +123,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
ToolCommons.removeBlockWithDrops(player, stack, player.worldObj, xp, yp, zp, x, y, z, block, new Material[] { block.getMaterial() }, silk, fortune, block.getBlockHardness(world, xp, yp, zp), dispose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.RING;
|
||||
@@ -133,7 +133,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
setCursorList(stack, null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public List<ChunkCoordinates> getWireframesToDraw(EntityPlayer player, ItemStack stack) {
|
||||
@@ -142,7 +142,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
if(lookPos != null && !player.worldObj.isAirBlock(lookPos.blockX, lookPos.blockY, lookPos.blockZ) && lookPos.entityHit == null) {
|
||||
List<ChunkCoordinates> list = getCursorList(stack);
|
||||
ChunkCoordinates origin = getOriginPos(stack);
|
||||
|
||||
|
||||
if(origin.posY != -1) {
|
||||
for(ChunkCoordinates coords : list) {
|
||||
coords.posX += origin.posX;
|
||||
@@ -155,41 +155,41 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
coords.posY += lookPos.blockY;
|
||||
coords.posZ += lookPos.blockZ;
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private static ItemStack getLokiRing(EntityPlayer player) {
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
|
||||
ItemStack stack1 = baubles.getStackInSlot(1);
|
||||
ItemStack stack2 = baubles.getStackInSlot(2);
|
||||
return isLokiRing(stack1) ? stack1 : isLokiRing(stack2) ? stack2 : null;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isLokiRing(ItemStack stack) {
|
||||
return stack != null && (stack.getItem() == ModItems.lokiRing || stack.getItem() == ModItems.aesirRing);
|
||||
}
|
||||
|
||||
|
||||
private static ChunkCoordinates getOriginPos(ItemStack stack) {
|
||||
int x = ItemNBTHelper.getInt(stack, TAG_X_ORIGIN, 0);
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_Y_ORIGIN, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_Z_ORIGIN, 0);
|
||||
return new ChunkCoordinates(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
private static void setOriginPos(ItemStack stack, int x, int y, int z) {
|
||||
ItemNBTHelper.setInt(stack, TAG_X_ORIGIN, x);
|
||||
ItemNBTHelper.setInt(stack, TAG_Y_ORIGIN, y);
|
||||
ItemNBTHelper.setInt(stack, TAG_Z_ORIGIN, z);
|
||||
}
|
||||
|
||||
|
||||
private static List<ChunkCoordinates> getCursorList(ItemStack stack) {
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_CURSOR_LIST, false);
|
||||
List<ChunkCoordinates> cursors = new ArrayList();
|
||||
|
||||
|
||||
int count = cmp.getInteger(TAG_CURSOR_COUNT);
|
||||
for(int i = 0; i < count; i++) {
|
||||
NBTTagCompound cursorCmp = cmp.getCompoundTag(TAG_CURSOR_PREFIX + i);
|
||||
@@ -198,7 +198,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
int z = cursorCmp.getInteger(TAG_Z_OFFSET);
|
||||
cursors.add(new ChunkCoordinates(x, y, z));
|
||||
}
|
||||
|
||||
|
||||
return cursors;
|
||||
}
|
||||
|
||||
@@ -213,10 +213,10 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
}
|
||||
cmp.setInteger(TAG_CURSOR_COUNT, i);
|
||||
}
|
||||
|
||||
|
||||
ItemNBTHelper.setCompound(stack, TAG_CURSOR_LIST, cmp);
|
||||
}
|
||||
|
||||
|
||||
private static NBTTagCompound cursorToCmp(int x, int y, int z) {
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
cmp.setInteger(TAG_X_OFFSET, x);
|
||||
@@ -224,7 +224,7 @@ public class ItemLokiRing extends ItemRelicBauble implements IWireframeCoordinat
|
||||
cmp.setInteger(TAG_Z_OFFSET, z);
|
||||
return cmp;
|
||||
}
|
||||
|
||||
|
||||
private static void addCursor(ItemStack stack, int x, int y, int z) {
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_CURSOR_LIST, false);
|
||||
int count = cmp.getInteger(TAG_CURSOR_COUNT);
|
||||
|
||||
@@ -36,7 +36,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
public class ItemOdinRing extends ItemRelicBauble {
|
||||
|
||||
public static List<String> damageNegations = new ArrayList();
|
||||
|
||||
|
||||
static {
|
||||
damageNegations.add(DamageSource.drown.damageType);
|
||||
damageNegations.add(DamageSource.fall.damageType);
|
||||
@@ -46,15 +46,15 @@ public class ItemOdinRing extends ItemRelicBauble {
|
||||
damageNegations.add(DamageSource.inWall.damageType);
|
||||
damageNegations.add(DamageSource.starve.damageType);
|
||||
}
|
||||
|
||||
|
||||
Multimap<String, AttributeModifier> attributes = HashMultimap.create();
|
||||
|
||||
|
||||
public ItemOdinRing() {
|
||||
super(LibItemNames.ODIN_RING);
|
||||
fillModifiers(attributes);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
|
||||
if(player.ticksExisted % 10 == 0)
|
||||
@@ -62,7 +62,7 @@ public class ItemOdinRing extends ItemRelicBauble {
|
||||
if(player.isBurning())
|
||||
player.extinguish();
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerAttacked(LivingAttackEvent event) {
|
||||
if(event.entityLiving instanceof EntityPlayer) {
|
||||
@@ -71,23 +71,23 @@ public class ItemOdinRing extends ItemRelicBauble {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack getOdinRing(EntityPlayer player) {
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
|
||||
ItemStack stack1 = baubles.getStackInSlot(1);
|
||||
ItemStack stack2 = baubles.getStackInSlot(2);
|
||||
return isOdinRing(stack1) ? stack1 : isOdinRing(stack2) ? stack2 : null;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isOdinRing(ItemStack stack) {
|
||||
return stack != null && (stack.getItem() == ModItems.odinRing || stack.getItem() == ModItems.aesirRing);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
|
||||
player.getAttributeMap().applyAttributeModifiers(attributes);
|
||||
|
||||
@@ -30,25 +30,25 @@ import vazkii.botania.common.item.ItemMod;
|
||||
public class ItemRelic extends ItemMod implements IRelic {
|
||||
|
||||
private static final String TAG_SOULBIND = "soulbind";
|
||||
|
||||
|
||||
Achievement achievement;
|
||||
|
||||
|
||||
public ItemRelic(String name) {
|
||||
setUnlocalizedName(name);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) {
|
||||
if(p_77663_3_ instanceof EntityPlayer)
|
||||
updateRelic(p_77663_1_, (EntityPlayer) p_77663_3_);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List p_77624_3_, boolean p_77624_4_) {
|
||||
addBindInfo(p_77624_3_, p_77624_1_, p_77624_2_);
|
||||
}
|
||||
|
||||
|
||||
public static void addBindInfo(List list, ItemStack stack, EntityPlayer player) {
|
||||
if(GuiScreen.isShiftKeyDown()) {
|
||||
String bind = getSoulbindUsernameS(stack);
|
||||
@@ -59,33 +59,33 @@ public class ItemRelic extends ItemMod implements IRelic {
|
||||
if(!isRightPlayer(player, stack))
|
||||
addStringToTooltip(String.format(StatCollector.translateToLocal("botaniamisc.notYourSagittarius"), bind), list);
|
||||
}
|
||||
|
||||
|
||||
addStringToTooltip("", list);
|
||||
String name = stack.getUnlocalizedName() + ".poem";
|
||||
for(int i = 0; i < 4; i++)
|
||||
addStringToTooltip(EnumChatFormatting.ITALIC + StatCollector.translateToLocal(name + i), list);
|
||||
} else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list);
|
||||
}
|
||||
|
||||
|
||||
static void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
|
||||
public static String getSoulbindUsernameS(ItemStack stack) {
|
||||
return ItemNBTHelper.getString(stack, TAG_SOULBIND, "");
|
||||
}
|
||||
|
||||
|
||||
public static void updateRelic(ItemStack stack, EntityPlayer player) {
|
||||
if(stack == null || !(stack.getItem() instanceof IRelic))
|
||||
return;
|
||||
|
||||
|
||||
String soulbind = getSoulbindUsernameS(stack);
|
||||
if(soulbind.isEmpty()) {
|
||||
player.addStat(((IRelic) stack.getItem()).getBindAchievement(), 1);
|
||||
bindToPlayer(player, stack);
|
||||
soulbind = getSoulbindUsernameS(stack);
|
||||
}
|
||||
|
||||
|
||||
if(!isRightPlayer(player, stack) && player.ticksExisted % 10 == 0)
|
||||
player.attackEntityFrom(damageSource(), 6);
|
||||
}
|
||||
@@ -93,28 +93,28 @@ public class ItemRelic extends ItemMod implements IRelic {
|
||||
public static void bindToPlayer(EntityPlayer player, ItemStack stack) {
|
||||
bindToUsernameS(player.getCommandSenderName(), stack);
|
||||
}
|
||||
|
||||
|
||||
public static void bindToUsernameS(String username, ItemStack stack) {
|
||||
ItemNBTHelper.setString(stack, TAG_SOULBIND, username);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isRightPlayer(EntityPlayer player, ItemStack stack) {
|
||||
return isRightPlayer(player.getCommandSenderName(), stack);
|
||||
}
|
||||
|
||||
|
||||
public static boolean isRightPlayer(String player, ItemStack stack) {
|
||||
return getSoulbindUsernameS(stack).equals(player);
|
||||
}
|
||||
|
||||
|
||||
public static DamageSource damageSource() {
|
||||
return new DamageSource("botania-relic");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void bindToUsername(String playerName, ItemStack stack) {
|
||||
bindToUsernameS(playerName, stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSoulbindUsername(ItemStack stack) {
|
||||
return getSoulbindUsernameS(stack);
|
||||
@@ -129,7 +129,7 @@ public class ItemRelic extends ItemMod implements IRelic {
|
||||
public void setBindAchievement(Achievement achievement) {
|
||||
this.achievement = achievement;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
return BotaniaAPI.rarityRelic;
|
||||
|
||||
@@ -26,7 +26,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemBauble;
|
||||
public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
|
||||
Achievement achievement;
|
||||
|
||||
|
||||
public ItemRelicBauble(String name) {
|
||||
super(name);
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
if(p_77663_3_ instanceof EntityPlayer)
|
||||
ItemRelic.updateRelic(p_77663_1_, (EntityPlayer) p_77663_3_);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWornTick(ItemStack stack, EntityLivingBase player) {
|
||||
super.onWornTick(stack, player);
|
||||
@@ -47,17 +47,17 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
onValidPlayerWornTick(stack, ePlayer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addHiddenTooltip(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
super.addHiddenTooltip(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
ItemRelic.addBindInfo(par3List, par1ItemStack, par2EntityPlayer);
|
||||
}
|
||||
|
||||
|
||||
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
|
||||
return player instanceof EntityPlayer && ItemRelic.isRightPlayer((EntityPlayer) player, stack);
|
||||
@@ -67,7 +67,7 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
public void bindToUsername(String playerName, ItemStack stack) {
|
||||
ItemRelic.bindToUsernameS(playerName, stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSoulbindUsername(ItemStack stack) {
|
||||
return ItemRelic.getSoulbindUsernameS(stack);
|
||||
@@ -82,10 +82,10 @@ public abstract class ItemRelicBauble extends ItemBauble implements IRelic {
|
||||
public void setBindAchievement(Achievement achievement) {
|
||||
this.achievement = achievement;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
return BotaniaAPI.rarityRelic;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -12,30 +12,30 @@ package vazkii.botania.common.item.relic;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemThorRing extends ItemRelicBauble {
|
||||
|
||||
public ItemThorRing() {
|
||||
super(LibItemNames.THOR_RING);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack getThorRing(EntityPlayer player) {
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
|
||||
ItemStack stack1 = baubles.getStackInSlot(1);
|
||||
ItemStack stack2 = baubles.getStackInSlot(2);
|
||||
return isThorRing(stack1) ? stack1 : isThorRing(stack2) ? stack2 : null;
|
||||
}
|
||||
|
||||
|
||||
private static boolean isThorRing(ItemStack stack) {
|
||||
return stack != null && (stack.getItem() == ModItems.thorRing || stack.getItem() == ModItems.aesirRing);
|
||||
}
|
||||
|
||||
@@ -665,7 +665,7 @@ public final class LexiconData {
|
||||
|
||||
crystalBow = new ALexiconEntry(LibLexicon.TOOL_CRYSTAL_BOW, categoryTools);
|
||||
crystalBow.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeCrystalBow));
|
||||
|
||||
|
||||
// ENDER ENTRIES
|
||||
enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder);
|
||||
enderAir.setPriority().setLexiconPages(new PageText("0"));
|
||||
@@ -714,10 +714,10 @@ public final class LexiconData {
|
||||
|
||||
keepIvy = new ALexiconEntry(LibLexicon.ENDER_KEEP_IVY, categoryEnder);
|
||||
keepIvy.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeKeepIvy));
|
||||
|
||||
|
||||
blackHoleTalisman = new ALexiconEntry(LibLexicon.ENDER_BLACK_HOLE_TALISMAN, categoryEnder);
|
||||
blackHoleTalisman.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeBlackHoleTalisman));
|
||||
|
||||
|
||||
// BAUBLES ENTRIES
|
||||
baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles);
|
||||
baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2"));
|
||||
@@ -816,10 +816,10 @@ public final class LexiconData {
|
||||
|
||||
elvenLore = new ALexiconEntry(LibLexicon.ALF_LORE, categoryAlfhomancy);
|
||||
elvenLore.setLexiconPages(new PageText("0"), new PageLoreText("1"), new PageLoreText("2"), new PageLoreText("3"), new PageLoreText("4"), new PageLoreText("5"), new PageLoreText("6"), new PageLoreText("7")).setIcon(new ItemStack(Items.writable_book));
|
||||
|
||||
|
||||
relics = new ALexiconEntry(LibLexicon.ALF_RELICS, categoryAlfhomancy);
|
||||
relics.setLexiconPages(new PageText("0")).setIcon(new ItemStack(ModItems.dice));
|
||||
|
||||
|
||||
// MISCLENAEOUS ENTRIES
|
||||
unstableBlocks = new BLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc);
|
||||
unstableBlocks.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_UNSTABLE_BLOCK), new PageCraftingRecipe("2", ModCraftingRecipes.recipesUnstableBlocks), new PageText("3"), new PageImage("4", LibResources.ENTRY_UNSTABLE_BEACON), new PageCraftingRecipe("5", ModCraftingRecipes.recipesManaBeacons), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipesSignalFlares));
|
||||
|
||||
@@ -49,7 +49,7 @@ public final class LibAchievementNames {
|
||||
public static final String RELIC_ODIN_RING = "odinRing";
|
||||
public static final String RELIC_LOKI_RING = "lokiRing";
|
||||
public static final String RELIC_AESIR_RING = "aesirRing";
|
||||
|
||||
|
||||
public static final String DESU_GUN = "desuGun";
|
||||
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public final class LibItemNames {
|
||||
public static final String DICE = "dice";
|
||||
public static final String KEEP_IVY = "keepIvy";
|
||||
public static final String BLACK_HOLE_TALISMAN = "blackHoleTalisman";
|
||||
|
||||
|
||||
public static final String[] LENS_NAMES = new String[] {
|
||||
"lensNormal",
|
||||
"lensSpeed",
|
||||
|
||||
@@ -45,15 +45,15 @@ public final class LibOreDict {
|
||||
"mysticFlowerPink", "mysticFlowerGray", "mysticFlowerLightGray",
|
||||
"mysticFlowerCyan", "mysticFlowerPurple", "mysticFlowerBlue",
|
||||
"mysticFlowerBrown", "mysticFlowerGreen", "mysticFlowerRed",
|
||||
"mysticFlowerBlack" };
|
||||
|
||||
"mysticFlowerBlack" };
|
||||
|
||||
public static final String[] DOUBLE_FLOWER = new String[] { "mysticFlowerWhiteDouble",
|
||||
"mysticFlowerOrangeDouble", "mysticFlowerMagentaDouble",
|
||||
"mysticFlowerLightBlueDouble", "mysticFlowerYellowDouble", "mysticFlowerLimeDouble",
|
||||
"mysticFlowerPinkDouble", "mysticFlowerGrayDouble", "mysticFlowerLightGrayDouble",
|
||||
"mysticFlowerCyanDouble", "mysticFlowerPurpleDouble", "mysticFlowerBlueDouble",
|
||||
"mysticFlowerBrownDouble", "mysticFlowerGreenDouble", "mysticFlowerRedDouble",
|
||||
"mysticFlowerBlackDouble" };
|
||||
"mysticFlowerBlackDouble" };
|
||||
|
||||
public static final String[] PETAL = new String[] { "petalWhite",
|
||||
"petalOrange", "petalMagenta", "petalLightBlue", "petalYellow",
|
||||
|
||||
Reference in new issue
Block a user