mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 04:32:23 +00:00
Added the Life Imbuer.
This commit is contained in:
1 parent
1750f12946
commit
a7d79fa10a
14 files changed
+435
-3
No files matched your search
@@ -38,6 +38,7 @@ import vazkii.botania.client.render.block.RenderAltar;
|
||||
import vazkii.botania.client.render.block.RenderMiniIsland;
|
||||
import vazkii.botania.client.render.block.RenderPool;
|
||||
import vazkii.botania.client.render.block.RenderPylon;
|
||||
import vazkii.botania.client.render.block.RenderSpawnerClaw;
|
||||
import vazkii.botania.client.render.block.RenderSpecialFlower;
|
||||
import vazkii.botania.client.render.block.RenderSpreader;
|
||||
import vazkii.botania.client.render.block.RenderTinyPotato;
|
||||
@@ -52,6 +53,7 @@ import vazkii.botania.client.render.tile.RenderTileMiniIsland;
|
||||
import vazkii.botania.client.render.tile.RenderTilePool;
|
||||
import vazkii.botania.client.render.tile.RenderTilePylon;
|
||||
import vazkii.botania.client.render.tile.RenderTileRuneAltar;
|
||||
import vazkii.botania.client.render.tile.RenderTileSpawnerClaw;
|
||||
import vazkii.botania.client.render.tile.RenderTileSpreader;
|
||||
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
|
||||
import vazkii.botania.common.block.tile.TileAlfPortal;
|
||||
@@ -60,6 +62,7 @@ import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.block.tile.TileMiniIsland;
|
||||
import vazkii.botania.common.block.tile.TilePylon;
|
||||
import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
import vazkii.botania.common.block.tile.TileSpawnerClaw;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
@@ -103,6 +106,7 @@ public class ClientProxy extends CommonProxy {
|
||||
LibRenderIDs.idPylon = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idMiniIsland = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idTinyPotato = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idSpawnerClaw = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderAltar());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSpecialFlower(LibRenderIDs.idSpecialFlower));
|
||||
@@ -111,6 +115,7 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderPylon());
|
||||
RenderingRegistry.registerBlockHandler(new RenderMiniIsland());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTinyPotato());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSpawnerClaw());
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens());
|
||||
if(ConfigHandler.lexicon3dModel)
|
||||
@@ -125,6 +130,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAlfPortal.class, new RenderTileAlfPortal());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileMiniIsland.class, new RenderTileMiniIsland());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileTinyPotato.class, new RenderTileTinyPotato());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileSpawnerClaw.class, new RenderTileSpawnerClaw());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityPixie.class, new RenderPixie());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityVineBall.class, new RenderSnowball(ModItems.vineBall));
|
||||
|
||||
@@ -20,5 +20,6 @@ public final class LibRenderIDs {
|
||||
public static int idPylon = -1;
|
||||
public static int idMiniIsland = -1;
|
||||
public static int idTinyPotato = -1;
|
||||
public static int idSpawnerClaw = -1;
|
||||
|
||||
}
|
||||
@@ -79,6 +79,7 @@ public final class LibResources {
|
||||
public static final String MODEL_PIXIE = PREFIX_MODEL + "pixie.png";
|
||||
public static final String MODEL_MINI_ISLAND = PREFIX_MODEL + "miniIsland.png";
|
||||
public static final String MODEL_TINY_POTATO = PREFIX_MODEL + "tinyPotato.png";
|
||||
public static final String MODEL_SPAWNER_CLAW = PREFIX_MODEL + "spawnerClaw.png";
|
||||
|
||||
public static final String MODEL_CAPE = "/assets/botania/textures/model/cape.png";
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 5:46:38 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelSpawnerClaw extends ModelBase {
|
||||
ModelRenderer Plate;
|
||||
ModelRenderer Claw1;
|
||||
ModelRenderer Claw2;
|
||||
ModelRenderer Claw3;
|
||||
ModelRenderer Claw4;
|
||||
ModelRenderer Claw5;
|
||||
ModelRenderer Claw6;
|
||||
ModelRenderer Claw7;
|
||||
ModelRenderer Claw8;
|
||||
|
||||
public ModelSpawnerClaw() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
|
||||
Plate = new ModelRenderer(this, 0, 0);
|
||||
Plate.addBox(0F, 0F, 0F, 12, 1, 12);
|
||||
Plate.setRotationPoint(-6F, 23F, -6F);
|
||||
Plate.setTextureSize(64, 32);
|
||||
Claw1 = new ModelRenderer(this, 0, 14);
|
||||
Claw1.addBox(0F, 0F, 0F, 2, 1, 3);
|
||||
Claw1.setRotationPoint(-1F, 23F, 6F);
|
||||
Claw1.setTextureSize(64, 32);
|
||||
Claw2 = new ModelRenderer(this, 11, 14);
|
||||
Claw2.addBox(0F, 0F, 0F, 2, 1, 3);
|
||||
Claw2.setRotationPoint(-1F, 23F, -9F);
|
||||
Claw2.setTextureSize(64, 32);
|
||||
Claw3 = new ModelRenderer(this, 0, 19);
|
||||
Claw3.addBox(0F, 0F, 0F, 3, 1, 2);
|
||||
Claw3.setRotationPoint(-9F, 23F, -1F);
|
||||
Claw3.setTextureSize(64, 32);
|
||||
Claw4 = new ModelRenderer(this, 11, 19);
|
||||
Claw4.addBox(0F, 0F, 0F, 3, 1, 2);
|
||||
Claw4.setRotationPoint(6F, 23F, -1F);
|
||||
Claw4.setTextureSize(64, 32);
|
||||
Claw5 = new ModelRenderer(this, 23, 16);
|
||||
Claw5.addBox(0F, 0F, 0F, 2, 5, 1);
|
||||
Claw5.setRotationPoint(-1F, 24F, 8F);
|
||||
Claw5.setTextureSize(64, 32);
|
||||
Claw6 = new ModelRenderer(this, 30, 16);
|
||||
Claw6.addBox(0F, 0F, 0F, 1, 5, 2);
|
||||
Claw6.setRotationPoint(8F, 24F, -1F);
|
||||
Claw6.setTextureSize(64, 32);
|
||||
Claw7 = new ModelRenderer(this, 37, 16);
|
||||
Claw7.addBox(0F, 0F, 0F, 2, 5, 1);
|
||||
Claw7.setRotationPoint(-1F, 24F, -9F);
|
||||
Claw7.setTextureSize(64, 32);
|
||||
Claw8 = new ModelRenderer(this, 44, 16);
|
||||
Claw8.addBox(0F, 0F, 0F, 1, 5, 2);
|
||||
Claw8.setRotationPoint(-9F, 24F, -1F);
|
||||
Claw8.setTextureSize(64, 32);
|
||||
}
|
||||
|
||||
public void render() {
|
||||
float f5 = 1F / 16F;
|
||||
Plate.render(f5);
|
||||
Claw1.render(f5);
|
||||
Claw2.render(f5);
|
||||
Claw3.render(f5);
|
||||
Claw4.render(f5);
|
||||
Claw5.render(f5);
|
||||
Claw6.render(f5);
|
||||
Claw7.render(f5);
|
||||
Claw8.render(f5);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 6:23:54 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.render.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileSpawnerClaw;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderSpawnerClaw implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, 0F, -0.5F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileSpawnerClaw(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return LibRenderIDs.idSpawnerClaw;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 5:46:10 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelSpawnerClaw;
|
||||
import vazkii.botania.client.model.ModelTinyPotato;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderTileSpawnerClaw extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPAWNER_CLAW);
|
||||
private static final ModelSpawnerClaw model = new ModelSpawnerClaw();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) {
|
||||
// TileTinyPotato potato = (TileTinyPotato) var1;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glTranslated(d0, d1, d2);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
|
||||
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
// int meta = potato.getWorldObj() == null ? 3 : potato.getBlockMetadata();
|
||||
// GL11.glRotatef(meta * 90F - 180F, 0F, 1F, 0F);
|
||||
//
|
||||
// int jump = potato.jumpTicks;
|
||||
// float up = (float) -Math.abs(Math.sin((float) jump / 10 * Math.PI)) * 0.2F;
|
||||
// float rot = (float) Math.sin((float) jump / 10 * Math.PI) * 2;
|
||||
//
|
||||
// GL11.glTranslatef(0F, up, 0F);
|
||||
// GL11.glRotatef(rot, 0F, 0F, 1F);
|
||||
|
||||
model.render();
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 5:28:55 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.tile.TileSpawnerClaw;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSpawnerClaw extends BlockModContainer {
|
||||
|
||||
protected BlockSpawnerClaw() {
|
||||
super(Material.iron);
|
||||
setHardness(3.0F);
|
||||
setBlockName(LibBlockNames.SPAWNER_CLAW);
|
||||
|
||||
float f = 1F / 8F;
|
||||
float f1 = 1F / 16F;
|
||||
setBlockBounds(f, 0F, f, 1F - f, f1, 1F - f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
//NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idSpawnerClaw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileSpawnerClaw();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,6 +88,7 @@ import vazkii.botania.common.block.tile.TileOpenCrate;
|
||||
import vazkii.botania.common.block.tile.TilePlatform;
|
||||
import vazkii.botania.common.block.tile.TilePylon;
|
||||
import vazkii.botania.common.block.tile.TileRuneAltar;
|
||||
import vazkii.botania.common.block.tile.TileSpawnerClaw;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.block.tile.TileTinyPlanet;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
@@ -140,6 +141,7 @@ public final class ModBlocks {
|
||||
public static Block seaLamp;
|
||||
public static Block miniIsland;
|
||||
public static Block tinyPotato;
|
||||
public static Block spawnerClaw;
|
||||
|
||||
public static Block livingwoodStairs;
|
||||
public static Block livingwoodSlab;
|
||||
@@ -231,7 +233,8 @@ public final class ModBlocks {
|
||||
seaLamp = new BlockSeaLamp();
|
||||
miniIsland = new BlockMiniIsland();
|
||||
tinyPotato = new BlockTinyPotato();
|
||||
|
||||
spawnerClaw = new BlockSpawnerClaw();
|
||||
|
||||
livingwoodStairs = new BlockLivingwoodStairs();
|
||||
livingwoodSlab = new BlockLivingwoodSlab(false);
|
||||
livingwoodSlabFull = new BlockLivingwoodSlab(true);
|
||||
@@ -369,6 +372,7 @@ public final class ModBlocks {
|
||||
registerTile(TileBifrost.class, LibBlockNames.BIFROST);
|
||||
registerTile(TileMiniIsland.class, LibBlockNames.MINI_ISLAND);
|
||||
registerTile(TileTinyPotato.class, LibBlockNames.TINY_POTATO);
|
||||
registerTile(TileSpawnerClaw.class, LibBlockNames.SPAWNER_CLAW);
|
||||
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_PUREDAISY, SubTilePureDaisy.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class);
|
||||
|
||||
@@ -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 a
|
||||
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
|
||||
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 5:32:11 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
private static final String TAG_MANA = "mana";
|
||||
|
||||
int mana = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
TileEntity tileBelow = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
|
||||
if(mana >= 5 && tileBelow instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tileBelow;
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
|
||||
if(!logic.isActivated()) {
|
||||
if(!worldObj.isRemote)
|
||||
mana -= 6;
|
||||
|
||||
if(logic.getSpawnerWorld().isRemote) {
|
||||
if(logic.spawnDelay > 0)
|
||||
--logic.spawnDelay;
|
||||
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(worldObj, xCoord + 0.3 + Math.random() * 0.5, yCoord - 0.3 + Math.random() * 0.25, zCoord + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
|
||||
logic.field_98284_d = logic.field_98287_c;
|
||||
logic.field_98287_c = (logic.field_98287_c + (double)(1000.0F / ((float)logic.spawnDelay + 200.0F))) % 360.0D;
|
||||
} else if(logic.spawnDelay == -1)
|
||||
resetTimer(logic);
|
||||
|
||||
if(logic.spawnDelay > 0) {
|
||||
--logic.spawnDelay;
|
||||
return;
|
||||
}
|
||||
|
||||
boolean flag = false;
|
||||
|
||||
int spawnCount = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_COUNT);
|
||||
int spawnRange = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_RANGE);
|
||||
int maxNearbyEntities = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_NEARBY_ENTITIES);
|
||||
|
||||
for(int i = 0; i < spawnCount; ++i) {
|
||||
Entity entity = EntityList.createEntityByName(logic.getEntityNameToSpawn(), logic.getSpawnerWorld());
|
||||
|
||||
if (entity == null)
|
||||
return;
|
||||
|
||||
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox((double)logic.getSpawnerX(), (double)logic.getSpawnerY(), (double)logic.getSpawnerZ(), (double)(logic.getSpawnerX() + 1), (double)(logic.getSpawnerY() + 1), (double)(logic.getSpawnerZ() + 1)).expand(spawnRange * 2, 4.0D, spawnRange * 2)).size();
|
||||
|
||||
if (j >= maxNearbyEntities) {
|
||||
resetTimer(logic);
|
||||
return;
|
||||
}
|
||||
|
||||
double d2 = (double)logic.getSpawnerX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
double d3 = (double)(logic.getSpawnerY() + logic.getSpawnerWorld().rand.nextInt(3) - 1);
|
||||
double d4 = (double)logic.getSpawnerZ() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
|
||||
EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
|
||||
entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
|
||||
|
||||
if(entityliving == null || entityliving.getCanSpawnHere()) {
|
||||
logic.func_98265_a(entity);
|
||||
logic.getSpawnerWorld().playAuxSFX(2004, logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), 0);
|
||||
|
||||
if (entityliving != null)
|
||||
entityliving.spawnExplosionParticle();
|
||||
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
resetTimer(logic);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void resetTimer(MobSpawnerBaseLogic logic) {
|
||||
int maxSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_SPAWN_DELAY);
|
||||
int minSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MIN_SPAWN_DELAY);
|
||||
List potentialEntitySpawns = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.POTENTIAL_ENTITY_SPAWNS);
|
||||
|
||||
if(maxSpawnDelay <= minSpawnDelay)
|
||||
logic.spawnDelay = minSpawnDelay;
|
||||
else {
|
||||
int i = maxSpawnDelay - minSpawnDelay;
|
||||
logic.spawnDelay = minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i);
|
||||
}
|
||||
|
||||
if(potentialEntitySpawns != null && potentialEntitySpawns.size() > 0)
|
||||
logic.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(logic.getSpawnerWorld().rand, potentialEntitySpawns));
|
||||
|
||||
logic.func_98267_a(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound cmp) {
|
||||
cmp.setInteger(TAG_MANA, mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
mana = cmp.getInteger(TAG_MANA);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentMana() {
|
||||
return mana;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull() {
|
||||
return mana >= 160;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recieveMana(int mana) {
|
||||
this.mana = Math.min(160, this.mana + mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRecieveManaFromBursts() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,7 +68,6 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.grassHorn);
|
||||
addItem(ModItems.waterRod);
|
||||
addItem(ModItems.openBucket);
|
||||
addItem(ModItems.spawnerMover);
|
||||
addItem(ModItems.rainbowRod);
|
||||
addItem(ModItems.tornadoRod);
|
||||
addItem(ModItems.fireRod);
|
||||
@@ -77,7 +76,9 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.vineBall);
|
||||
addBlock(ModBlocks.forestDrum);
|
||||
addBlock(ModBlocks.forestEye);
|
||||
|
||||
addItem(ModItems.spawnerMover);
|
||||
addBlock(ModBlocks.spawnerClaw);
|
||||
|
||||
addBlock(ModBlocks.livingrock);
|
||||
addBlock(ModBlocks.livingwood);
|
||||
addBlock(ModBlocks.openCrate);
|
||||
|
||||
@@ -49,6 +49,7 @@ public final class LibBlockNames {
|
||||
public static final String SEA_LAMP = "seaLamp";
|
||||
public static final String MINI_ISLAND = "miniIsland";
|
||||
public static final String TINY_POTATO = "tinyPotato";
|
||||
public static final String SPAWNER_CLAW = "spawnerClaw";
|
||||
|
||||
public static final String SPECIAL_FLOWER_PREFIX = FLOWER + ".";
|
||||
|
||||
|
||||
@@ -55,5 +55,13 @@ public final class LibObfuscation {
|
||||
public static final String[] NET_CLIENT_HANDLER = new String[] { "netClientHandler", "field_78774_b", "b" };
|
||||
public static final String[] CURRENT_GAME_TYPE = new String[] { "currentGameType", "field_78779_k", "k" };
|
||||
|
||||
// MobSpawnerBaseLogic
|
||||
public static final String[] SPAWN_RANGE = new String[] { "spawnRange", "field_98290_m", "m" };
|
||||
public static final String[] SPAWN_COUNT = new String[] { "spawnCount", "field_98294_i", "i" };
|
||||
public static final String[] MAX_NEARBY_ENTITIES = new String[] { "maxNearbyEntities", "field_98292_k", "k" };
|
||||
public static final String[] MAX_SPAWN_DELAY = new String[] { "maxSpawnDelay", "field_98293_h", "h" };
|
||||
public static final String[] MIN_SPAWN_DELAY = new String[] { "minSpawnDelay", "field_98283_g", "g" };
|
||||
public static final String[] POTENTIAL_ENTITY_SPAWNS = new String[] { "potentialEntitySpawns", "field_98285_e", "e" };
|
||||
|
||||
}
|
||||
|
||||
@@ -352,6 +352,7 @@ tile.botania:miniIsland13.name=Floating Green Flower
|
||||
tile.botania:miniIsland14.name=Floating Red Flower
|
||||
tile.botania:miniIsland15.name=Floating Black Flower
|
||||
tile.botania:tinyPotato.name=Tiny Potato
|
||||
tile.botania:spawnerClaw.name=Life Imbuer
|
||||
|
||||
# FLOWER NAMES
|
||||
tile.botania:flower..name=Botania Flower
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Reference in new issue
Block a user