mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 19:29:31 +00:00
Added radius viewer functionality to the Manaseer Monocle.
This commit is contained in:
1 parent
fe62632408
commit
0b945e1084
35 files changed
+592
-110
No files matched your search
@@ -13,7 +13,7 @@ package vazkii.botania.api.item;
|
||||
/**
|
||||
* Base Interface for the Manaseer Monocle and items of the sort.
|
||||
* Having a IBauble of this type equipped on the 0th slot (amulet)
|
||||
* will draw bursts without depth testing.
|
||||
* will draw bursts without depth testing and to see sub tile radiuses.
|
||||
*/
|
||||
public interface IBurstViewerBauble {
|
||||
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 31, 2015, 2:59:19 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
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
|
||||
*/
|
||||
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;
|
||||
|
||||
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,6 +152,22 @@ 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).
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public RadiusDescriptor getRadius() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a ChunkCoordinates instance with the position of this sub tile.
|
||||
*/
|
||||
public ChunkCoordinates toChunkCoordinates() {
|
||||
return new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int)
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 31, 2015, 3:16:02 PM (GMT)]
|
||||
*/
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
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);
|
||||
if(tile == null || !(tile instanceof ISubTileContainer))
|
||||
return;
|
||||
ISubTileContainer container = (ISubTileContainer) tile;
|
||||
SubTileEntity subtile = container.getSubTile();
|
||||
if(subtile == null)
|
||||
return;
|
||||
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);
|
||||
int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
|
||||
|
||||
Color colorRGB = new Color(color);
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 32);
|
||||
|
||||
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);
|
||||
tessellator.addVertex(f, f, f);
|
||||
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);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertex(x, f1, 0);
|
||||
tessellator.addVertex(0, f1, 0);
|
||||
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;
|
||||
double y = center.posY;
|
||||
double z = center.posZ + 0.5;
|
||||
GL11.glTranslated(x - RenderManager.renderPosX, y - RenderManager.renderPosY, z - RenderManager.renderPosZ);
|
||||
int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
|
||||
|
||||
Color colorRGB = new Color(color);
|
||||
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 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 xp = Math.cos(rad) * radius;
|
||||
double zp = Math.sin(rad) * radius;
|
||||
tessellator.addVertex(xp, f1, zp);
|
||||
}
|
||||
tessellator.addVertex(0, f1, 0);
|
||||
tessellator.draw();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.DebugHandler;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.core.handler.LightningHandler;
|
||||
import vazkii.botania.client.core.handler.SubTileRadiusRenderHandler;
|
||||
import vazkii.botania.client.core.handler.TooltipHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.client.fx.FXSparkle;
|
||||
@@ -150,6 +151,7 @@ public class ClientProxy extends CommonProxy {
|
||||
MinecraftForge.EVENT_BUS.register(new TooltipHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new BaubleRenderHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new DebugHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new SubTileRadiusRenderHandler());
|
||||
|
||||
if(ConfigHandler.versionCheckEnabled)
|
||||
new VersionChecker().init();
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -96,6 +97,11 @@ public class SubTilePureDaisy extends SubTileEntity {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
|
||||
+11
-3
@@ -17,20 +17,23 @@ import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.block.material.Material;
|
||||
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();
|
||||
|
||||
if(ticksExisted % 6 == 0 && redstoneSignal == 0) {
|
||||
int range = 5;
|
||||
int x = supertile.xCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range;
|
||||
int z = supertile.zCoord + supertile.getWorldObj().rand.nextInt(range * 2 + 1) - range;
|
||||
int x = supertile.xCoord + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1) - RANGE;
|
||||
int z = supertile.zCoord + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1) - RANGE;
|
||||
|
||||
for(int i = 4; i > -2; i--) {
|
||||
int y = supertile.yCoord + i;
|
||||
@@ -76,6 +79,11 @@ public class SubTileAgricarnation extends SubTileFunctional {
|
||||
return 200;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.agricarnation;
|
||||
|
||||
+10
-2
@@ -17,13 +17,17 @@ 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;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileBellethorn extends SubTileFunctional {
|
||||
|
||||
public static final int RANGE = 6;
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xBA3421;
|
||||
@@ -41,11 +45,10 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
final int range = 6;
|
||||
final int manaToUse = getManaCost();
|
||||
|
||||
if(ticksExisted % 5 == 0) {
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE, supertile.yCoord + 1, supertile.zCoord + RANGE));
|
||||
IEntitySelector selector = getSelector();
|
||||
|
||||
for(EntityLivingBase entity : entities) {
|
||||
@@ -81,6 +84,11 @@ public class SubTileBellethorn extends SubTileFunctional {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.bellethorne;
|
||||
|
||||
@@ -19,12 +19,16 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileClayconia extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
private static final int RANGE_Y = 3;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -47,12 +51,10 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
|
||||
public ChunkCoordinates getCoordsToPut() {
|
||||
List<ChunkCoordinates> possibleCoords = new ArrayList();
|
||||
int range = 5;
|
||||
int rangeY = 3;
|
||||
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -rangeY; j < rangeY + 1; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = -RANGE_Y; j < RANGE_Y + 1; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
int x = supertile.xCoord + i;
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
@@ -66,6 +68,11 @@ public class SubTileClayconia extends SubTileFunctional {
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x7B8792;
|
||||
|
||||
+34
-21
@@ -19,6 +19,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -45,27 +46,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
}
|
||||
|
||||
if(windTicks > 0 && redstoneSignal == 0) {
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
int w = 2;
|
||||
int h = 3;
|
||||
int l = 16;
|
||||
|
||||
AxisAlignedBB axis = null;
|
||||
switch(orientation) {
|
||||
case 0 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z - l, x + w + 1, y + h, z);
|
||||
break;
|
||||
case 1 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1);
|
||||
break;
|
||||
case 2 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x - l, y - h, z - w, x, y + h, z + w + 1);
|
||||
break;
|
||||
case 3 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1);
|
||||
}
|
||||
AxisAlignedBB axis = aabbForOrientation();
|
||||
|
||||
if(axis != null) {
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, axis);
|
||||
@@ -80,6 +61,31 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
AxisAlignedBB aabbForOrientation() {
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
int w = 2;
|
||||
int h = 3;
|
||||
int l = 16;
|
||||
|
||||
AxisAlignedBB axis = null;
|
||||
switch(orientation) {
|
||||
case 0 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z - l, x + w + 1, y + h, z);
|
||||
break;
|
||||
case 1 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x - w, y - h, z + 1, x + w + 1, y + h, z + l + 1);
|
||||
break;
|
||||
case 2 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x - l, y - h, z - w, x, y + h, z + w + 1);
|
||||
break;
|
||||
case 3 :
|
||||
axis = AxisAlignedBB.getBoundingBox(x + 1, y - h, z - w, x + l + 1, y + h, z + w + 1);
|
||||
}
|
||||
return axis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
@@ -99,6 +105,13 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
return true;
|
||||
} else return super.onWanded(player, wand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
AxisAlignedBB aabb = aabbForOrientation();
|
||||
aabb.minY = supertile.yCoord;
|
||||
return new RadiusDescriptor.Rectangle(toChunkCoordinates(), aabb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
|
||||
@@ -18,22 +18,24 @@ import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import vazkii.botania.api.item.IExoflameHeatable;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
|
||||
public class SubTileExoflame extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
private static final int RANGE_Y = 2;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
int range = 5;
|
||||
int rangeY = 2;
|
||||
boolean did = false;
|
||||
|
||||
fireFurnaces : {
|
||||
for(int i = -range + 1; i < range + 1; i++)
|
||||
for(int j = -rangeY; j < rangeY + 1; j++)
|
||||
for(int k = -range + 1; k < range + 1; k++) {
|
||||
for(int i = -RANGE + 1; i < RANGE + 1; i++)
|
||||
for(int j = -RANGE_Y; j < RANGE_Y + 1; j++)
|
||||
for(int k = -RANGE + 1; k < RANGE + 1; k++) {
|
||||
int x = supertile.xCoord + i;
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
@@ -102,6 +104,10 @@ public class SubTileExoflame extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
|
||||
+12
-3
@@ -16,23 +16,27 @@ 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();
|
||||
|
||||
final int range = 2;
|
||||
final int cost = 120;
|
||||
|
||||
if(!supertile.getWorldObj().isRemote && supertile.getWorldObj().provider.dimensionId != 1) {
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityPlayer player : players) {
|
||||
if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost) {
|
||||
if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost ) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 2));
|
||||
mana -= cost;
|
||||
}
|
||||
@@ -40,6 +44,11 @@ public class SubTileFallenKanade extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xFFFF00;
|
||||
|
||||
+9
-2
@@ -21,6 +21,7 @@ import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
@@ -28,14 +29,15 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class SubTileHeiseiDream extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 5;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
final int range = 5;
|
||||
final int cost = 100;
|
||||
|
||||
List<IMob> mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
List<IMob> mobs = supertile.getWorldObj().getEntitiesWithinAABB(IMob.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE, supertile.yCoord + RANGE, supertile.zCoord + RANGE));
|
||||
if(mobs.size() > 1 && mana >= cost)
|
||||
for(IMob mob : mobs) {
|
||||
if(mob instanceof EntityLiving) {
|
||||
@@ -87,6 +89,11 @@ 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
|
||||
+11
-2
@@ -31,7 +31,9 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
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;
|
||||
@@ -39,7 +41,9 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
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
|
||||
@@ -104,7 +108,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;
|
||||
@@ -181,6 +185,11 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
else return super.onWanded(player, wand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), mana > 0 ? RANGE_MANA : RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
@@ -19,11 +19,15 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
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();
|
||||
@@ -31,10 +35,9 @@ public class SubTileHyacidus extends SubTileFunctional {
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
final int range = 6;
|
||||
final int cost = 20;
|
||||
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityLivingBase entity : entities) {
|
||||
if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(Potion.poison) == null && mana >= cost && !entity.worldObj.isRemote && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.poison.id, 60, 0));
|
||||
@@ -58,6 +61,11 @@ public class SubTileHyacidus extends SubTileFunctional {
|
||||
return 180;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.hyacidus;
|
||||
|
||||
+12
-5
@@ -13,7 +13,9 @@ package vazkii.botania.common.block.subtile.functional;
|
||||
import net.minecraft.block.Block;
|
||||
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;
|
||||
@@ -21,6 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
|
||||
private static final int COST = 100;
|
||||
int RANGE = 4;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
@@ -30,12 +33,11 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
return;
|
||||
|
||||
if(mana >= COST && !supertile.getWorldObj().isRemote && ticksExisted % 30 == 0) {
|
||||
int range = 4;
|
||||
int x = supertile.xCoord - range + supertile.getWorldObj().rand.nextInt(range * 2 + 1);
|
||||
int y = supertile.yCoord + range;
|
||||
int z = supertile.zCoord - range + supertile.getWorldObj().rand.nextInt(range * 2 + 1);
|
||||
int x = supertile.xCoord - RANGE + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1);
|
||||
int y = supertile.yCoord + RANGE;
|
||||
int z = supertile.zCoord - RANGE + supertile.getWorldObj().rand.nextInt(RANGE * 2 + 1);
|
||||
|
||||
for(int i = 0; i < range * 2; i++) {
|
||||
for(int i = 0; i < RANGE * 2; i++) {
|
||||
Block blockAbove = supertile.getWorldObj().getBlock(x, y + 1, z);
|
||||
if((supertile.getWorldObj().isAirBlock(x, y + 1, z) || blockAbove.isReplaceable(supertile.getWorldObj(), x, y + 1, z)) && blockAbove.getMaterial() != Material.water && ModBlocks.flower.canPlaceBlockAt(supertile.getWorldObj(), x, y + 1, z)) {
|
||||
int color = supertile.getWorldObj().rand.nextInt(16);
|
||||
@@ -65,6 +67,11 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
|
||||
public int getColor() {
|
||||
return 0x961283;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
|
||||
+12
-5
@@ -21,6 +21,7 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.BiomeDictionary.Type;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -29,6 +30,9 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
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,
|
||||
@@ -82,12 +86,10 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
|
||||
public ChunkCoordinates getCoordsToPut() {
|
||||
List<ChunkCoordinates> possibleCoords = new ArrayList();
|
||||
int range = 8;
|
||||
int rangeY = 5;
|
||||
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -rangeY; j < rangeY; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = -RANGE_Y; j < RANGE_Y; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
int x = supertile.xCoord + i;
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
@@ -101,6 +103,11 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x769897;
|
||||
|
||||
@@ -18,19 +18,20 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
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.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileMedumone extends SubTileFunctional {
|
||||
|
||||
|
||||
private static final int RANGE = 6;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
final int range = 6;
|
||||
|
||||
if(mana > 0) {
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1));
|
||||
|
||||
for(EntityLivingBase entity : entities)
|
||||
if(!(entity instanceof EntityPlayer)) {
|
||||
@@ -47,6 +48,11 @@ public class SubTileMedumone extends SubTileFunctional {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x3D2204;
|
||||
|
||||
+11
-3
@@ -17,6 +17,8 @@ import net.minecraft.entity.passive.EntityAnimal;
|
||||
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;
|
||||
@@ -24,16 +26,17 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class SubTilePollidisiac extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 6;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 6;
|
||||
int manaCost = 12;
|
||||
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
|
||||
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
|
||||
for(EntityAnimal animal : animals) {
|
||||
if(mana < manaCost)
|
||||
break;
|
||||
@@ -61,6 +64,11 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
|
||||
+16
-5
@@ -31,7 +31,9 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
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;
|
||||
@@ -40,6 +42,12 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 2;
|
||||
private static final int RANGE_Y = 3;
|
||||
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();
|
||||
@@ -53,15 +61,13 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
boolean scanned = false;
|
||||
List<ChunkCoordinates> validPositions = new ArrayList();
|
||||
|
||||
int range = 2;
|
||||
int rangePlace = mana > 0 ? 8 : 6;
|
||||
int rangePlaceY = 6;
|
||||
int rangePlace = mana > 0 ? RANGE_PLACE_MANA : RANGE_PLACE;
|
||||
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - 3, z - range, x + range + 1, y + 3, z + range + 1));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - RANGE, y - RANGE_Y, z - RANGE, x + RANGE + 1, y + RANGE_Y, z + RANGE + 1));
|
||||
for(EntityItem item : items) {
|
||||
if(item.age < 60 || item.isDead)
|
||||
continue;
|
||||
@@ -71,7 +77,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
if(stackItem instanceof ItemBlock || stackItem instanceof ItemReed) {
|
||||
if(!scanned) {
|
||||
for(int i = -rangePlace; i < rangePlace + 1; i++)
|
||||
for(int j = -rangePlaceY; j < rangePlaceY + 1; j++)
|
||||
for(int j = -RANGE_PLACE_Y; j < RANGE_PLACE_Y + 1; j++)
|
||||
for(int l = -rangePlace; l < rangePlace + 1; l++) {
|
||||
int xp = x + i;
|
||||
int yp = y + j;
|
||||
@@ -154,6 +160,11 @@ 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
|
||||
+9
-3
@@ -22,6 +22,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -34,6 +35,8 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
private static final String TAG_BIND_Z = "bindZ";
|
||||
|
||||
private static final int COST = 24;
|
||||
private static final int RANGE = 2;
|
||||
|
||||
int bindX, bindY = -1, bindZ;
|
||||
|
||||
@Override
|
||||
@@ -41,14 +44,12 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
super.onUpdate();
|
||||
|
||||
if(redstoneSignal == 0 && supertile.getWorldObj().blockExists(bindX, bindY, bindZ)) {
|
||||
int range = 2;
|
||||
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
|
||||
boolean did = false;
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range, z + range + 1));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - RANGE, y - RANGE, z - RANGE, x + RANGE + 1, y + RANGE, z + RANGE + 1));
|
||||
for(EntityItem item : items) {
|
||||
if(item.age < 60 || item.isDead)
|
||||
continue;
|
||||
@@ -88,6 +89,11 @@ 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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.common.Botania;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
@@ -75,6 +76,11 @@ public class SubTileTangleberrie extends SubTileFunctional {
|
||||
float getMotionVelocity() {
|
||||
return 0.05F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Circle(toChunkCoordinates(), getRange());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
|
||||
@@ -12,6 +12,7 @@ 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;
|
||||
@@ -22,25 +23,28 @@ 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;
|
||||
|
||||
public class SubTileTigerseye extends SubTileFunctional {
|
||||
|
||||
private static final int RANGE = 10;
|
||||
private static final int RANGE_Y = 4;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
final int range = 10;
|
||||
final int rangeY = 4;
|
||||
final int cost = 70;
|
||||
|
||||
boolean shouldAfffect = mana >= cost;
|
||||
|
||||
List<EntityLiving> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - rangeY, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + rangeY, supertile.zCoord + range));
|
||||
List<EntityLiving> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE_Y, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE_Y, supertile.zCoord + RANGE));
|
||||
|
||||
for(EntityLiving entity : entities) {
|
||||
List<EntityAITaskEntry> entries = new ArrayList(entity.tasks.taskEntries);
|
||||
@@ -82,6 +86,11 @@ public class SubTileTigerseye extends SubTileFunctional {
|
||||
ReflectionHelper.setPrivateValue(EntityAINearestAttackableTarget.class, aiEntry, EntityEnderCrystal.class, LibObfuscation.TARGET_CLASS); // Something random that won't be around
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0xB1A618;
|
||||
|
||||
@@ -20,6 +20,7 @@ import net.minecraft.entity.monster.EntityEnderman;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -29,7 +30,8 @@ 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();
|
||||
@@ -43,6 +45,11 @@ public class SubTileVinculotus extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Circle(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
@@ -71,7 +78,6 @@ public class SubTileVinculotus extends SubTileFunctional {
|
||||
return;
|
||||
|
||||
int cost = 50;
|
||||
int range = 64;
|
||||
|
||||
if(event.entity instanceof EntityEnderman) {
|
||||
List<SubTileVinculotus> possibleFlowers = new ArrayList();
|
||||
@@ -83,7 +89,7 @@ public class SubTileVinculotus extends SubTileFunctional {
|
||||
double y = flower.supertile.yCoord + 1.5;
|
||||
double z = flower.supertile.zCoord + 0.5;
|
||||
|
||||
if(MathHelper.pointDistanceSpace(x, y, z, event.targetX, event.targetY, event.targetZ) < range)
|
||||
if(MathHelper.pointDistanceSpace(x, y, z, event.targetX, event.targetY, event.targetZ) < RANGE)
|
||||
possibleFlowers.add(flower);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,13 +23,17 @@ import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
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;
|
||||
|
||||
public class SubtileOrechid extends SubTileFunctional {
|
||||
|
||||
private static final int COST = 17500;
|
||||
private static final int RANGE = 5;
|
||||
private static final int RANGE_Y = 3;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
@@ -88,12 +92,10 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
|
||||
public ChunkCoordinates getCoordsToPut() {
|
||||
List<ChunkCoordinates> possibleCoords = new ArrayList();
|
||||
int range = 5;
|
||||
int rangeY = 3;
|
||||
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = -rangeY; j < rangeY; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = -RANGE_Y; j < RANGE_Y; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
int x = supertile.xCoord + i;
|
||||
int y = supertile.yCoord + j;
|
||||
int z = supertile.zCoord + k;
|
||||
@@ -107,6 +109,11 @@ public class SubtileOrechid extends SubTileFunctional {
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
|
||||
+10
-2
@@ -15,12 +15,15 @@ import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
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();
|
||||
@@ -28,7 +31,7 @@ public class SubTileArcaneRose extends SubTileGenerating {
|
||||
if(mana >= getMaxMana())
|
||||
return;
|
||||
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - 1, supertile.yCoord, supertile.zCoord - 1, supertile.xCoord + 2, supertile.yCoord + 1, supertile.zCoord + 2));
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityPlayer player : players)
|
||||
if(ExperienceHelper.getPlayerXP(player) >= 1 && player.onGround) {
|
||||
ExperienceHelper.drainPlayerXP(player, 1);
|
||||
@@ -36,6 +39,11 @@ public class SubTileArcaneRose extends SubTileGenerating {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -27,6 +28,8 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class SubTileEndoflame extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_BURN_TIME = "burnTime";
|
||||
private static final int RANGE = 3;
|
||||
|
||||
int burnTime = 0;
|
||||
|
||||
@Override
|
||||
@@ -36,10 +39,9 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
if(linkedCollector != null) {
|
||||
if(burnTime == 0) {
|
||||
if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) {
|
||||
final int range = 3;
|
||||
boolean didSomething = false;
|
||||
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityItem item : items) {
|
||||
if(item.age >= 59 && !item.isDead) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
@@ -89,6 +91,11 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
public int getColor() {
|
||||
return 0x785000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
|
||||
+10
-2
@@ -15,19 +15,22 @@ import java.util.List;
|
||||
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;
|
||||
|
||||
public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
|
||||
private static final int RANGE = 12;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(mana == 0) {
|
||||
int range = 12;
|
||||
List<EntityTNTPrimed> tnts = supertile.getWorldObj().getEntitiesWithinAABB(EntityTNTPrimed.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
List<EntityTNTPrimed> tnts = supertile.getWorldObj().getEntitiesWithinAABB(EntityTNTPrimed.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityTNTPrimed tnt : tnts) {
|
||||
if(tnt.fuse == 1 && !tnt.isDead) {
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
@@ -57,6 +60,11 @@ public class SubTileEntropinnyum extends SubTileGenerating {
|
||||
return 6500;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
};
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.entropinnyum;
|
||||
|
||||
+9
-2
@@ -18,12 +18,15 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_COOLDOWN = "cooldown";
|
||||
private static final int RANGE = 1;
|
||||
|
||||
int cooldown = 0;
|
||||
int storedMana = 0;
|
||||
|
||||
@@ -40,8 +43,7 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
}
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 1;
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityItem item : items) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead) {
|
||||
@@ -72,6 +74,11 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
cooldown = cmp.getInteger(TAG_COOLDOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 8000;
|
||||
|
||||
@@ -21,6 +21,8 @@ import net.minecraft.item.ItemStack;
|
||||
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;
|
||||
@@ -100,6 +102,11 @@ public class SubTileHydroangeas extends SubTilePassiveGenerating {
|
||||
public int getBurnTime() {
|
||||
return 40;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
|
||||
@@ -13,11 +13,15 @@ package vazkii.botania.common.block.subtile.generating;
|
||||
import net.minecraft.block.Block;
|
||||
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();
|
||||
@@ -25,13 +29,12 @@ public class SubTileKekimurus extends SubTileGenerating {
|
||||
int mana = 1800;
|
||||
|
||||
if(getMaxMana() - this.mana >= mana && !supertile.getWorldObj().isRemote && ticksExisted % 80 == 0) {
|
||||
int range = 5;
|
||||
for(int i = 0; i < range * 2 + 1; i++)
|
||||
for(int j = 0; j < range * 2 + 1; j++)
|
||||
for(int k = 0; k < range * 2 + 1; k++) {
|
||||
int x = supertile.xCoord + i - range;
|
||||
int y = supertile.yCoord + j - range;
|
||||
int z = supertile.zCoord + k - range;
|
||||
for(int i = 0; i < RANGE * 2 + 1; i++)
|
||||
for(int j = 0; j < RANGE * 2 + 1; j++)
|
||||
for(int k = 0; k < RANGE * 2 + 1; k++) {
|
||||
int x = supertile.xCoord + i - RANGE;
|
||||
int y = supertile.yCoord + j - RANGE;
|
||||
int z = supertile.zCoord + k - RANGE;
|
||||
Block block = supertile.getWorldObj().getBlock(x, y, z);
|
||||
if(block instanceof BlockCake) {
|
||||
int meta = supertile.getWorldObj().getBlockMetadata(x, y, z) + 1;
|
||||
@@ -48,6 +51,11 @@ public class SubTileKekimurus extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
|
||||
@@ -23,7 +23,9 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
@@ -33,6 +35,9 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
private static final String TAG_COOLDOWN = "cooldown";
|
||||
private static final String TAG_ATE_ONCE = "ateOnce";
|
||||
|
||||
private static final int RANGE = 8;
|
||||
private static final int RANGE_Y = 16;
|
||||
|
||||
boolean ateOnce = false;
|
||||
int ticksWithoutEating = -1;
|
||||
int cooldown = 0;
|
||||
@@ -51,16 +56,13 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
eatLeaves : {
|
||||
if(getMaxMana() - mana >= manaPerLeaf && !supertile.getWorldObj().isRemote && ticksExisted % 4 == 0) {
|
||||
List<ChunkCoordinates> coords = new ArrayList();
|
||||
int range = 8;
|
||||
int rangeY = 16;
|
||||
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
|
||||
for(int i = -range; i < range + 1; i++)
|
||||
for(int j = 0; j < rangeY; j++)
|
||||
for(int k = -range; k < range + 1; k++) {
|
||||
for(int i = -RANGE; i < RANGE + 1; i++)
|
||||
for(int j = 0; j < RANGE_Y; j++)
|
||||
for(int k = -RANGE; k < RANGE + 1; k++) {
|
||||
int xp = x + i;
|
||||
int yp = y + j;
|
||||
int zp = z + k;
|
||||
@@ -99,9 +101,13 @@ public class SubTileMunchdew extends SubTileGenerating {
|
||||
if(ticksWithoutEating >= 5)
|
||||
cooldown = 1600;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
@@ -28,13 +29,14 @@ 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();
|
||||
|
||||
if(ticksExisted % 5 == 0) {
|
||||
float range = 2F;
|
||||
List<EntitySlime> slimes = supertile.getWorldObj().getEntitiesWithinAABB(EntitySlime.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range));
|
||||
List<EntitySlime> slimes = supertile.getWorldObj().getEntitiesWithinAABB(EntitySlime.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE, supertile.zCoord + RANGE + 1));
|
||||
for(EntitySlime slime : slimes) {
|
||||
if(slime.getEntityData().getBoolean(TAG_WORLD_SPAWNED)) {
|
||||
int size = slime.getSlimeSize();
|
||||
@@ -60,6 +62,11 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
|
||||
+10
-2
@@ -27,13 +27,17 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
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 {
|
||||
|
||||
private static final String TAG_NEXT_COLOR = "nextColor";
|
||||
|
||||
private static final int RANGE = 1;
|
||||
|
||||
int nextColor;
|
||||
|
||||
@Override
|
||||
@@ -41,9 +45,8 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
super.onUpdate();
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 1;
|
||||
Item wool = Item.getItemFromBlock(Blocks.wool);
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
|
||||
for(EntityItem item : items) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack != null && stack.getItem() == wool) {
|
||||
@@ -60,6 +63,11 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadiusDescriptor getRadius() {
|
||||
return new RadiusDescriptor.Square(toChunkCoordinates(), RANGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 2000;
|
||||
|
||||
Reference in new issue
Block a user