This commit is contained in:
Vasco Lavos committed 2014-07-23 22:10:45 +01:00
1 parent a585936773
commit d1b9c65a89
16 files changed
+82 -87

No files matched your search

@@ -82,7 +82,7 @@ public final class BoundTileRenderer {
axis.maxZ -= pos.posZ;
GL11.glScalef(1F, 1F, -1F);
GL11.glLineWidth(1F);
renderBlockOutline(axis);
@@ -97,48 +97,48 @@ public final class BoundTileRenderer {
private void renderBlockOutline(AxisAlignedBB aabb) {
Tessellator tessellator = Tessellator.instance;
double ix = aabb.minX;
double iy = aabb.minY;
double iz = aabb.minZ;
double ax = aabb.maxX;
double ay = aabb.maxY;
double az = aabb.maxZ;
tessellator.startDrawing(GL11.GL_LINES);
tessellator.addVertex(ix, iy, iz);
tessellator.addVertex(ix, ay, iz);
tessellator.addVertex(ix, ay, iz);
tessellator.addVertex(ax, ay, iz);
tessellator.addVertex(ax, ay, iz);
tessellator.addVertex(ax, iy, iz);
tessellator.addVertex(ax, iy, iz);
tessellator.addVertex(ix, iy, iz);
tessellator.addVertex(ix, iy, az);
tessellator.addVertex(ix, ay, az);
tessellator.addVertex(ix, iy, az);
tessellator.addVertex(ax, iy, az);
tessellator.addVertex(ax, iy, az);
tessellator.addVertex(ax, ay, az);
tessellator.addVertex(ix, ay, az);
tessellator.addVertex(ax, ay, az);
tessellator.addVertex(ix, iy, iz);
tessellator.addVertex(ix, iy, az);
tessellator.addVertex(ix, ay, iz);
tessellator.addVertex(ix, ay, az);
tessellator.addVertex(ax, iy, iz);
tessellator.addVertex(ax, iy, az);
tessellator.addVertex(ax, ay, iz);
tessellator.addVertex(ax, ay, az);
@@ -13,7 +13,6 @@ 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;
@@ -20,7 +20,6 @@ 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 {
@@ -11,17 +11,16 @@
*/
package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
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 {
@@ -30,7 +29,7 @@ public class RenderTileSpawnerClaw extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity var1, double d0, double d1, double d2, float var8) {
// TileTinyPotato potato = (TileTinyPotato) var1;
// TileTinyPotato potato = (TileTinyPotato) var1;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -40,15 +39,15 @@ public class RenderTileSpawnerClaw extends TileEntitySpecialRenderer {
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);
// 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);
@@ -11,19 +11,18 @@
*/
package vazkii.botania.common.block;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.tile.TileSpawnerClaw;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.TileSpawnerClaw;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable {
@@ -31,12 +30,12 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable
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
@@ -46,17 +45,17 @@ public class BlockSpawnerClaw extends BlockModContainer implements ILexiconable
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();
@@ -234,7 +234,7 @@ public final class ModBlocks {
miniIsland = new BlockMiniIsland();
tinyPotato = new BlockTinyPotato();
spawnerClaw = new BlockSpawnerClaw();
livingwoodStairs = new BlockLivingwoodStairs();
livingwoodSlab = new BlockLivingwoodSlab(false);
livingwoodSlabFull = new BlockLivingwoodSlab(true);
@@ -11,7 +11,6 @@
*/
package vazkii.botania.common.block.tile;
import java.awt.Color;
import java.util.List;
import net.minecraft.entity.Entity;
@@ -31,9 +30,9 @@ 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);
@@ -44,18 +43,18 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
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;
logic.field_98287_c = (logic.field_98287_c + 1000.0F / (logic.spawnDelay + 200.0F)) % 360.0D;
} else if(logic.spawnDelay == -1)
resetTimer(logic);
resetTimer(logic);
if(logic.spawnDelay > 0) {
--logic.spawnDelay;
@@ -74,16 +73,16 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
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();
int j = logic.getSpawnerWorld().getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(logic.getSpawnerX(), logic.getSpawnerY(), logic.getSpawnerZ(), logic.getSpawnerX() + 1, logic.getSpawnerY() + 1, 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;
double d2 = logic.getSpawnerX() + (logic.getSpawnerWorld().rand.nextDouble() - logic.getSpawnerWorld().rand.nextDouble()) * spawnRange;
double d3 = logic.getSpawnerY() + logic.getSpawnerWorld().rand.nextInt(3) - 1;
double d4 = 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);
@@ -108,25 +107,25 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
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;
logic.spawnDelay = minSpawnDelay;
else {
int i = maxSpawnDelay - minSpawnDelay;
logic.spawnDelay = minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i);
}
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));
if(potentialEntitySpawns != null && potentialEntitySpawns.size() > 0)
logic.setRandomEntity((MobSpawnerBaseLogic.WeightedRandomMinecart)WeightedRandom.getRandomItem(logic.getSpawnerWorld().rand, potentialEntitySpawns));
logic.func_98267_a(1);
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);
@@ -78,7 +78,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.forestEye);
addItem(ModItems.spawnerMover);
addBlock(ModBlocks.spawnerClaw);
addBlock(ModBlocks.livingrock);
addBlock(ModBlocks.livingwood);
addBlock(ModBlocks.openCrate);
@@ -212,7 +212,7 @@ public class Vector3
public Vector3 zCrossProduct() {
double d = y;
double d1 = -x;
x = d;
y = d1;
@@ -240,7 +240,7 @@ public class Vector3
public boolean isInside(AxisAlignedBB aabb) {
return x >= aabb.minX && y >= aabb.maxY && z >= aabb.minZ && x < aabb.maxX && y < aabb.maxY && z < aabb.maxZ;
}
public boolean isZero() {
return x == 0 && y == 0 && z == 0;
}
@@ -1030,14 +1030,14 @@ public final class ModCrafingRecipes {
recipeSkyDirtRod = BotaniaAPI.getLatestAddedRecipe();
// Life Imbuer Recipe
addOreDictRecipe(new ItemStack(ModBlocks.spawnerClaw),
addOreDictRecipe(new ItemStack(ModBlocks.spawnerClaw),
"BSB", "PMP", "P P",
'B', new ItemStack(Items.blaze_rod),
'S', LibOreDict.ELEMENTIUM,
'P', new ItemStack(ModBlocks.prismarine, 1, 2),
'M', new ItemStack(ModBlocks.storage));
recipeSpawnerClaw = BotaniaAPI.getLatestAddedRecipe();
// Mana and Terrasteel Block Recipes
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
"III", "III", "III",
@@ -44,7 +44,7 @@ public final class ModRuneRecipes {
public static RecipeRuneAltar recipePrideRune;
public static RecipeRuneAltar recipeHead;
public static void init() {
final int costTier1 = 2500;
final int costTier2 = 4000;
@@ -78,7 +78,7 @@ public final class ModRuneRecipes {
recipeWrathRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 13), costTier3, LibOreDict.MANA_DIAMOND, LibOreDict.MANA_DIAMOND, LibOreDict.RUNE[7], LibOreDict.RUNE[2]);
recipeEnvyRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 14), costTier3, LibOreDict.MANA_DIAMOND, LibOreDict.MANA_DIAMOND, LibOreDict.RUNE[7], LibOreDict.RUNE[0]);
recipePrideRune = BotaniaAPI.registerRuneAltarRecipe(new ItemStack(ModItems.rune, 2, 15), costTier3, LibOreDict.MANA_DIAMOND, LibOreDict.MANA_DIAMOND, LibOreDict.RUNE[5], LibOreDict.RUNE[1]);
recipeHead = new HeadRecipe(new ItemStack(Items.skull, 1, 3), 22500, new ItemStack(Items.skull), LibOreDict.PIXIE_DUST, LibOreDict.PRISMARINE_SHARD, new ItemStack(Items.name_tag), new ItemStack(Items.golden_apple));
BotaniaAPI.runeAltarRecipes.add(recipeHead);
}
@@ -21,15 +21,15 @@ import vazkii.botania.common.core.helper.ItemNBTHelper;
public class HeadRecipe extends RecipeRuneAltar {
String name = "";
public HeadRecipe(ItemStack output, int mana, Object... inputs) {
super(output, mana, inputs);
}
@Override
public boolean matches(IInventory inv) {
boolean matches = super.matches(inv);
if(matches) {
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
@@ -43,10 +43,10 @@ public class HeadRecipe extends RecipeRuneAltar {
}
}
}
return matches;
}
@Override
public ItemStack getOutput() {
ItemStack stack = new ItemStack(Items.skull, 1, 3);
@@ -60,7 +60,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
double heightscale = world.rand.nextDouble() + 0.5;
spawnBurst(world, srcx, srcy, srcz, pointy, heightscale);
}
public void spawnBurst(World world, int srcx, int srcy, int srcz, ItemStack lens) {
boolean pointy = ItemNBTHelper.getBoolean(lens, TAG_POINTY, false);
double heightscale = ItemNBTHelper.getDouble(lens, TAG_HEIGHTSCALE, 1);
@@ -112,7 +112,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet
}
}
}
private boolean inRange(int x,int y,int z,int srcx, int srcy, int srcz, int range, double heightscale, boolean pointy) {
if(y >= srcy)
return MathHelper.pointDistanceSpace(x, 0, z, srcx, 0, srcz) < range;
@@ -73,13 +73,13 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
Vector3 spreaderVec = Vector3.fromTileEntityCenter(spreader);
Vector3 blockVec = new Vector3(par4 + 0.5, par5 + 0.5, par6 + 0.5);
AxisAlignedBB axis = par3World.getBlock(par4, par5, par6).getCollisionBoundingBoxFromPool(par3World, par4, par5, par6);
System.out.println(axis);
if(!blockVec.isInside(axis))
blockVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2);
blockVec = new Vector3(axis.minX + (axis.maxX - axis.minX) / 2, axis.minY + (axis.maxY - axis.minY) / 2, axis.minZ + (axis.maxZ - axis.minZ) / 2);
System.out.println(spreaderVec + " " + blockVec);
Vector3 diffVec = blockVec.copy().sub(spreaderVec);
Vector3 diffVec2D = new Vector3(diffVec.x, diffVec.z, 0);
Vector3 rotVec = new Vector3(0, 1, 0);
@@ -279,7 +279,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
ChunkCoordinates bound = getBoundSpreader(stack);
if(bound.posY != -1)
return bound;
MovingObjectPosition pos = Minecraft.getMinecraft().objectMouseOver;
if(pos != null) {
TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
@@ -402,7 +402,7 @@ public final class LexiconData {
spawnerClaw = new ALexiconEntry(LibLexicon.DEVICE_SPAWNER_CLAW, categoryDevices);
spawnerClaw.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeSpawnerClaw));
// TOOLS ENTRIES
manaBlaster = new BLexiconEntry(LibLexicon.TOOL_MANA_BLASTER, categoryTools);
manaBlaster.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManaBlaster));
@@ -566,7 +566,7 @@ public final class LexiconData {
tinyPotato = new BLexiconEntry(LibLexicon.MISC_TINY_POTATO, categoryMisc);
tinyPotato.setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", ModManaInfusionRecipes.tinyPotatoRecipe));
headCreating = new ALexiconEntry(LibLexicon.MISC_HEAD_CREATING, categoryMisc);
headCreating.setLexiconPages(new PageText("0"), new PageRuneRecipe("1", ModRuneRecipes.recipeHead));
}
@@ -62,6 +62,6 @@ public final class LibObfuscation {
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" };
}