mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-18 11:29:30 +00:00
Move XP obelisk into proper package and refactor obelisks a bit
This commit is contained in:
1 parent
79516999fe
commit
adabb82f72
17 files changed
+344
-519
No files matched your search
@@ -86,7 +86,9 @@ import crazypants.enderio.machine.killera.KillerJoeRenderer;
|
||||
import crazypants.enderio.machine.killera.TileKillerJoe;
|
||||
import crazypants.enderio.machine.light.BlockElectricLight;
|
||||
import crazypants.enderio.machine.light.ElectricLightRenderer;
|
||||
import crazypants.enderio.machine.obelisk.BlockObeliskAbstract;
|
||||
import crazypants.enderio.machine.obelisk.ObeliskRenderer;
|
||||
import crazypants.enderio.machine.obelisk.ObeliskSpecialRenderer;
|
||||
import crazypants.enderio.machine.obelisk.attractor.BlockAttractor;
|
||||
import crazypants.enderio.machine.obelisk.attractor.TileAttractor;
|
||||
import crazypants.enderio.machine.obelisk.aversion.AversionObeliskRenderer;
|
||||
@@ -94,6 +96,8 @@ import crazypants.enderio.machine.obelisk.aversion.BlockAversionObelisk;
|
||||
import crazypants.enderio.machine.obelisk.aversion.TileAversionObelisk;
|
||||
import crazypants.enderio.machine.obelisk.weather.BlockWeatherObelisk;
|
||||
import crazypants.enderio.machine.obelisk.weather.TileWeatherObelisk;
|
||||
import crazypants.enderio.machine.obelisk.xp.BlockExperienceObelisk;
|
||||
import crazypants.enderio.machine.obelisk.xp.TileExperienceOblisk;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedFenceGate;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedFenceGateRenderer;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
|
||||
@@ -120,8 +124,6 @@ import crazypants.enderio.machine.vacuum.BlockVacuumChest;
|
||||
import crazypants.enderio.machine.vacuum.VacuumChestRenderer;
|
||||
import crazypants.enderio.machine.vat.BlockVat;
|
||||
import crazypants.enderio.machine.vat.TileVat;
|
||||
import crazypants.enderio.machine.xp.BlockExperienceObelisk;
|
||||
import crazypants.enderio.machine.xp.TileExperienceOblisk;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.FusedQuartzFrameRenderer;
|
||||
import crazypants.enderio.material.FusedQuartzRenderer;
|
||||
@@ -252,24 +254,27 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new SoulBinderRenderer());
|
||||
|
||||
BlockAttractor.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
ObeliskRenderer<TileAttractor> attRen = new ObeliskRenderer<TileAttractor>(new ItemStack(EnderIO.itemMaterial, 1, Material.ATTRACTOR_CRYSTAL.ordinal()));
|
||||
RenderingRegistry.registerBlockHandler(attRen);
|
||||
|
||||
ObeliskRenderer defaultObeliskRenderer = new ObeliskRenderer();
|
||||
BlockObeliskAbstract.defaultObeliskRenderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
RenderingRegistry.registerBlockHandler(defaultObeliskRenderer);
|
||||
|
||||
ObeliskSpecialRenderer<TileAttractor> attRen = new ObeliskSpecialRenderer<TileAttractor>(new ItemStack(EnderIO.itemMaterial, 1,
|
||||
Material.ATTRACTOR_CRYSTAL.ordinal()), defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAttractor.class, attRen);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockAttractor), attRen);
|
||||
|
||||
AversionObeliskRenderer sgr = new AversionObeliskRenderer();
|
||||
BlockAversionObelisk.renderId = BlockAttractor.renderId;
|
||||
AversionObeliskRenderer sgr = new AversionObeliskRenderer(defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAversionObelisk.class, sgr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockSpawnGuard), sgr);
|
||||
|
||||
ObeliskRenderer<TileExperienceOblisk> eor = new ObeliskRenderer<TileExperienceOblisk>(new ItemStack(EnderIO.itemXpTransfer));
|
||||
BlockExperienceObelisk.renderId = BlockAttractor.renderId;
|
||||
ObeliskSpecialRenderer<TileExperienceOblisk> eor = new ObeliskSpecialRenderer<TileExperienceOblisk>(new ItemStack(EnderIO.itemXpTransfer),
|
||||
defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileExperienceOblisk.class, eor);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockExperianceOblisk), eor);
|
||||
|
||||
ObeliskRenderer<TileWeatherObelisk> twr = new ObeliskRenderer<TileWeatherObelisk>(
|
||||
new ItemStack(EnderIO.itemMaterial, 1, Material.WEATHER_CRYSTAL.ordinal()));
|
||||
BlockWeatherObelisk.renderId = BlockAttractor.renderId;
|
||||
ObeliskSpecialRenderer<TileWeatherObelisk> twr = new ObeliskSpecialRenderer<TileWeatherObelisk>(new ItemStack(EnderIO.itemMaterial, 1,
|
||||
Material.WEATHER_CRYSTAL.ordinal()), defaultObeliskRenderer);
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileWeatherObelisk.class, twr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockWeatherObelisk), twr);
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ import crazypants.enderio.machine.monitor.BlockPowerMonitor;
|
||||
import crazypants.enderio.machine.obelisk.attractor.BlockAttractor;
|
||||
import crazypants.enderio.machine.obelisk.aversion.BlockAversionObelisk;
|
||||
import crazypants.enderio.machine.obelisk.weather.BlockWeatherObelisk;
|
||||
import crazypants.enderio.machine.obelisk.xp.BlockExperienceObelisk;
|
||||
import crazypants.enderio.machine.obelisk.xp.ItemXpTransfer;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedCarpet;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedFence;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedFenceGate;
|
||||
@@ -127,8 +129,6 @@ import crazypants.enderio.machine.vacuum.BlockVacuumChest;
|
||||
import crazypants.enderio.machine.vat.BlockVat;
|
||||
import crazypants.enderio.machine.vat.VatRecipeManager;
|
||||
import crazypants.enderio.machine.wireless.BlockWirelessCharger;
|
||||
import crazypants.enderio.machine.xp.BlockExperienceObelisk;
|
||||
import crazypants.enderio.machine.xp.ItemXpTransfer;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.BlockDarkIronBars;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
|
||||
@@ -301,8 +301,4 @@ public abstract class AbstractMachineBlock<T extends AbstractMachineEntity> exte
|
||||
public int getDefaultDisplayMask(World world, int x, int y, int z) {
|
||||
return IWailaInfoProvider.ALL_BITS;
|
||||
}
|
||||
|
||||
protected void setObeliskBounds() {
|
||||
setBlockBounds(0.11f, 0, 0.11f, 0.91f, 0.48f, 0.91f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package crazypants.enderio.machine.obelisk;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
|
||||
public abstract class BlockObeliskAbstract<T extends AbstractMachineEntity> extends AbstractMachineBlock<T> {
|
||||
|
||||
public static int defaultObeliskRenderId;
|
||||
|
||||
protected BlockObeliskAbstract(ModObject mo, Class<T> teClass) {
|
||||
super(mo, teClass);
|
||||
setBlockBounds(0.11f, 0, 0.11f, 0.91f, 0.48f, 0.91f);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSideIconKey(boolean active) {
|
||||
return getMachineFrontIconKey(active);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackIconKey(boolean active) {
|
||||
return getMachineFrontIconKey(active);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTopIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineTop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return defaultObeliskRenderId;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if(isActive(world, x, y, z) && shouldDoWorkThisTick(world, x, y, z, 5)) {
|
||||
float startX = x + 1.0F;
|
||||
float startY = y + 0.85F;
|
||||
float startZ = z + 1.0F;
|
||||
for (int i = 0; i < 1; i++) {
|
||||
float xOffset = -0.2F - rand.nextFloat() * 0.6F;
|
||||
float yOffset = -0.1F + rand.nextFloat() * 0.2F;
|
||||
float zOffset = -0.2F - rand.nextFloat() * 0.6F;
|
||||
|
||||
EntityFX fx = Minecraft.getMinecraft().renderGlobal.doSpawnParticle("spell", startX + xOffset, startY + yOffset, startZ + zOffset, 0.0D, 0.0D, 0.0D);
|
||||
if(fx != null) {
|
||||
fx.setRBGColorF(0.2f, 0.2f, 0.8f);
|
||||
fx.motionY *= 0.5f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,150 +1,26 @@
|
||||
package crazypants.enderio.machine.obelisk;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.Timer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.obelisk.attractor.BlockAttractor;
|
||||
import crazypants.render.BoundingBox;
|
||||
import crazypants.render.CubeRenderer;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.render.VertexTransform;
|
||||
import crazypants.vecmath.Vector3d;
|
||||
import crazypants.vecmath.Vector3f;
|
||||
import crazypants.vecmath.Vertex;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ObeliskRenderer<T extends TileEntity> extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler, IItemRenderer {
|
||||
public class ObeliskRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
private VertXForm xform = new VertXForm();
|
||||
private VertXForm2 xform2 = new VertXForm2();
|
||||
private ItemStack floatingStack;
|
||||
|
||||
private Random rand = new Random();
|
||||
|
||||
public ObeliskRenderer(ItemStack itemStack) {
|
||||
this.floatingStack = itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
switch(type) {
|
||||
case ENTITY:
|
||||
GL11.glTranslatef(0, 0.25f, 0);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
GL11.glRotatef(22, 0, 0, 1);
|
||||
GL11.glRotatef(-10, 1, 0, 0);
|
||||
GL11.glTranslatef(0.3f, -0.4f, -0.4f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glTranslatef(0.75f, 0, 0);
|
||||
break;
|
||||
case INVENTORY:
|
||||
GL11.glTranslatef(8, 9, 0);
|
||||
GL11.glScalef(12F, 12F, 12F);
|
||||
GL11.glScalef(1.0F, 1.0F, -1F);
|
||||
GL11.glRotatef(210F, 1, 0, 0);
|
||||
GL11.glRotatef(-45F, 0, 1, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
renderInventoryBlock(EnderIO.blockAttractor, item.getItemDamage(), 0, (RenderBlocks) data[0]);
|
||||
Timer t = RenderUtil.getTimer();
|
||||
renderItemStack(null, Minecraft.getMinecraft().theWorld, 0, 0, 0, t.renderPartialTicks);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private EntityItem ei = null;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {
|
||||
|
||||
World world = te.getWorldObj();
|
||||
float f = world.getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
|
||||
int l = world.getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
|
||||
int l1 = l % 65536;
|
||||
int l2 = l / 65536;
|
||||
Tessellator.instance.setColorOpaque_F(f, f, f);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2);
|
||||
|
||||
renderItemStack((T) te, world, x, y, z, tick);
|
||||
}
|
||||
|
||||
private void renderItemStack(T te, World world, double x, double y, double z, float tick) {
|
||||
if(ei == null) {
|
||||
ei = new EntityItem(world, 0, 0, 0, getFloatingItem(te));
|
||||
}
|
||||
|
||||
ei.setEntityItemStack(getFloatingItem(te));
|
||||
ei.hoverStart = (float) ((world.getTotalWorldTime() * 0.05f + (tick * 0.05f)) % (Math.PI * 2));
|
||||
ei.age = 0;
|
||||
|
||||
glPushMatrix();
|
||||
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
glTranslated(x + 0.5, y + 0.7, z + 0.5);
|
||||
glScalef(1.1f, 1.1f, 1.1f);
|
||||
glDepthMask(true);
|
||||
|
||||
if(te != null) {
|
||||
rand.setSeed(te.xCoord + te.yCoord + te.zCoord);
|
||||
rand.nextBoolean();
|
||||
if(Minecraft.getMinecraft().gameSettings.fancyGraphics) {
|
||||
glRotatef(rand.nextFloat() * 360f, 0, 1, 0);
|
||||
}
|
||||
ei.hoverStart += rand.nextFloat();
|
||||
}
|
||||
|
||||
RenderManager.instance.renderEntityWithPosYaw(ei, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
glPopAttrib();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param te CAN BE NULL
|
||||
*/
|
||||
protected ItemStack getFloatingItem(T te) {
|
||||
return floatingStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
@@ -195,7 +71,7 @@ public class ObeliskRenderer<T extends TileEntity> extends TileEntitySpecialRend
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockAttractor.renderId;
|
||||
return BlockObeliskAbstract.defaultObeliskRenderId;
|
||||
}
|
||||
|
||||
private static class VertXForm implements VertexTransform {
|
||||
@@ -267,5 +143,4 @@ public class ObeliskRenderer<T extends TileEntity> extends TileEntitySpecialRend
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package crazypants.enderio.machine.obelisk;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Timer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.*;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ObeliskSpecialRenderer<T extends TileEntity> extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||
|
||||
private ItemStack floatingStack;
|
||||
|
||||
private Random rand = new Random();
|
||||
private ObeliskRenderer blockRen;
|
||||
|
||||
public ObeliskSpecialRenderer(ItemStack itemStack, ObeliskRenderer renderer) {
|
||||
this.floatingStack = itemStack;
|
||||
this.blockRen = renderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return helper == ItemRendererHelper.ENTITY_BOBBING || helper == ItemRendererHelper.ENTITY_ROTATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
switch(type) {
|
||||
case ENTITY:
|
||||
GL11.glTranslatef(0, 0.25f, 0);
|
||||
break;
|
||||
case EQUIPPED:
|
||||
GL11.glRotatef(22, 0, 0, 1);
|
||||
GL11.glRotatef(-10, 1, 0, 0);
|
||||
GL11.glTranslatef(0.3f, -0.4f, -0.4f);
|
||||
break;
|
||||
case EQUIPPED_FIRST_PERSON:
|
||||
GL11.glTranslatef(0.75f, 0, 0);
|
||||
break;
|
||||
case INVENTORY:
|
||||
GL11.glTranslatef(8, 9, 0);
|
||||
GL11.glScalef(12F, 12F, 12F);
|
||||
GL11.glScalef(1.0F, 1.0F, -1F);
|
||||
GL11.glRotatef(210F, 1, 0, 0);
|
||||
GL11.glRotatef(-45F, 0, 1, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
blockRen.renderInventoryBlock(EnderIO.blockAttractor, item.getItemDamage(), 0, (RenderBlocks) data[0]);
|
||||
Timer t = RenderUtil.getTimer();
|
||||
renderItemStack(null, Minecraft.getMinecraft().theWorld, 0, 0, 0, t.renderPartialTicks);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
private EntityItem ei = null;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {
|
||||
|
||||
World world = te.getWorldObj();
|
||||
float f = world.getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
|
||||
int l = world.getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
|
||||
int l1 = l % 65536;
|
||||
int l2 = l / 65536;
|
||||
Tessellator.instance.setColorOpaque_F(f, f, f);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2);
|
||||
|
||||
renderItemStack((T) te, world, x, y, z, tick);
|
||||
}
|
||||
|
||||
private void renderItemStack(T te, World world, double x, double y, double z, float tick) {
|
||||
if(ei == null) {
|
||||
ei = new EntityItem(world, 0, 0, 0, getFloatingItem(te));
|
||||
}
|
||||
|
||||
ei.setEntityItemStack(getFloatingItem(te));
|
||||
ei.hoverStart = (float) ((world.getTotalWorldTime() * 0.05f + (tick * 0.05f)) % (Math.PI * 2));
|
||||
ei.age = 0;
|
||||
|
||||
glPushMatrix();
|
||||
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
glTranslated(x + 0.5, y + 0.7, z + 0.5);
|
||||
glScalef(1.1f, 1.1f, 1.1f);
|
||||
glDepthMask(true);
|
||||
|
||||
if(te != null) {
|
||||
rand.setSeed(te.xCoord + te.yCoord + te.zCoord);
|
||||
rand.nextBoolean();
|
||||
if(Minecraft.getMinecraft().gameSettings.fancyGraphics) {
|
||||
glRotatef(rand.nextFloat() * 360f, 0, 1, 0);
|
||||
}
|
||||
ei.hoverStart += rand.nextFloat();
|
||||
}
|
||||
|
||||
RenderManager.instance.renderEntityWithPosYaw(ei, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||
glPopAttrib();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param te CAN BE NULL
|
||||
*/
|
||||
protected ItemStack getFloatingItem(T te) {
|
||||
return floatingStack;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,5 @@
|
||||
package crazypants.enderio.machine.obelisk.attractor;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -12,11 +8,9 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.obelisk.BlockObeliskAbstract;
|
||||
|
||||
public class BlockAttractor extends AbstractMachineBlock<TileAttractor> {
|
||||
|
||||
public static int renderId;
|
||||
public class BlockAttractor extends BlockObeliskAbstract<TileAttractor> {
|
||||
|
||||
public static BlockAttractor create() {
|
||||
BlockAttractor res = new BlockAttractor();
|
||||
@@ -26,7 +20,6 @@ public class BlockAttractor extends AbstractMachineBlock<TileAttractor> {
|
||||
|
||||
protected BlockAttractor() {
|
||||
super(ModObject.blockAttractor, TileAttractor.class);
|
||||
setObeliskBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,74 +49,4 @@ public class BlockAttractor extends AbstractMachineBlock<TileAttractor> {
|
||||
protected int getGuiId() {
|
||||
return GuiHandler.GUI_ID_ATTRACTOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSideIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTopIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineTop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if(isActive(world, x, y, z) && shouldDoWorkThisTick(world, x, y, z, 5)) {
|
||||
float startX = x + 1.0F;
|
||||
float startY = y + 0.85F;
|
||||
float startZ = z + 1.0F;
|
||||
for (int i = 0; i < 1; i++) {
|
||||
float xOffset = -0.2F - rand.nextFloat() * 0.6F;
|
||||
float yOffset = -0.1F + rand.nextFloat() * 0.2F;
|
||||
float zOffset = -0.2F - rand.nextFloat() * 0.6F;
|
||||
|
||||
EntityFX fx = Minecraft.getMinecraft().renderGlobal.doSpawnParticle("spell", startX + xOffset, startY + yOffset, startZ + zOffset, 0.0D, 0.0D, 0.0D);
|
||||
if(fx != null) {
|
||||
fx.setRBGColorF(0.2f, 0.2f, 0.8f);
|
||||
fx.motionY *= 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-6
@@ -6,15 +6,16 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.item.skull.BlockEndermanSkull;
|
||||
import crazypants.enderio.machine.obelisk.ObeliskRenderer;
|
||||
import crazypants.enderio.machine.obelisk.ObeliskSpecialRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class AversionObeliskRenderer extends ObeliskRenderer<TileAversionObelisk> {
|
||||
public class AversionObeliskRenderer extends ObeliskSpecialRenderer<TileAversionObelisk> {
|
||||
|
||||
private ItemStack offStack = new ItemStack(EnderIO.blockEndermanSkull, 1, BlockEndermanSkull.SkullType.TORMENTED.ordinal());
|
||||
private ItemStack onStack = new ItemStack(EnderIO.blockEndermanSkull, 1, BlockEndermanSkull.SkullType.REANIMATED_TORMENTED.ordinal());
|
||||
|
||||
public AversionObeliskRenderer() {
|
||||
super(null);
|
||||
public AversionObeliskRenderer(ObeliskRenderer renderer) {
|
||||
super(null, renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,7 +29,4 @@ public class AversionObeliskRenderer extends ObeliskRenderer<TileAversionObelisk
|
||||
}
|
||||
return offStack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+9
-90
@@ -1,42 +1,33 @@
|
||||
package crazypants.enderio.machine.obelisk.aversion;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.obelisk.BlockObeliskAbstract;
|
||||
|
||||
public class BlockAversionObelisk extends AbstractMachineBlock<TileAversionObelisk> {
|
||||
public class BlockAversionObelisk extends BlockObeliskAbstract<TileAversionObelisk> {
|
||||
|
||||
public static int renderId;
|
||||
|
||||
public static BlockAversionObelisk create() {
|
||||
BlockAversionObelisk res = new BlockAversionObelisk();
|
||||
res.init();
|
||||
|
||||
|
||||
//Just making sure its loaded
|
||||
AversionObeliskController.instance.toString();
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected BlockAversionObelisk() {
|
||||
super(ModObject.blockSpawnGuard, TileAversionObelisk.class);
|
||||
setObeliskBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileAversionObelisk) {
|
||||
return new ContainerAversionObelisk(player.inventory, (TileAversionObelisk)te);
|
||||
return new ContainerAversionObelisk(player.inventory, (TileAversionObelisk) te);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -45,85 +36,13 @@ public class BlockAversionObelisk extends AbstractMachineBlock<TileAversionObeli
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te instanceof TileAversionObelisk) {
|
||||
return new GuiAversionObelisk(player.inventory, (TileAversionObelisk)te);
|
||||
return new GuiAversionObelisk(player.inventory, (TileAversionObelisk) te);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGuiId() {
|
||||
protected int getGuiId() {
|
||||
return GuiHandler.GUI_ID_SPAWN_GUARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSideIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTopIconKey(boolean active) {
|
||||
return "enderio:blockSoulMachineTop";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if(isActive(world, x, y, z) && shouldDoWorkThisTick(world, x, y, z, 5)) {
|
||||
float startX = x + 1.0F;
|
||||
float startY = y + 0.85F;
|
||||
float startZ = z + 1.0F;
|
||||
for (int i = 0; i < 1; i++) {
|
||||
float xOffset = -0.2F - rand.nextFloat() * 0.6F;
|
||||
float yOffset = -0.1F + rand.nextFloat() * 0.2F;
|
||||
float zOffset = -0.2F - rand.nextFloat() * 0.6F;
|
||||
|
||||
EntityFX fx = Minecraft.getMinecraft().renderGlobal.doSpawnParticle("spell", startX + xOffset, startY + yOffset, startZ + zOffset, 0.0D, 0.0D, 0.0D);
|
||||
if(fx != null) {
|
||||
fx.setRBGColorF(0.2f, 0.2f, 0.8f);
|
||||
fx.motionY *= 0.5f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,12 +8,10 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.obelisk.BlockObeliskAbstract;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class BlockWeatherObelisk extends AbstractMachineBlock<TileWeatherObelisk> {
|
||||
|
||||
public static int renderId;
|
||||
public class BlockWeatherObelisk extends BlockObeliskAbstract<TileWeatherObelisk> {
|
||||
|
||||
public static BlockWeatherObelisk create() {
|
||||
BlockWeatherObelisk ret = new BlockWeatherObelisk();
|
||||
@@ -26,7 +24,6 @@ public class BlockWeatherObelisk extends AbstractMachineBlock<TileWeatherObelisk
|
||||
|
||||
private BlockWeatherObelisk() {
|
||||
super(ModObject.blockWeatherObelisk, TileWeatherObelisk.class);
|
||||
setObeliskBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,52 +36,14 @@ public class BlockWeatherObelisk extends AbstractMachineBlock<TileWeatherObelisk
|
||||
return new GuiWeatherObelisk(player.inventory, (TileWeatherObelisk) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGuiId() {
|
||||
return GuiHandler.GUI_ID_WEATHER_OBELISK;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
if(active) {
|
||||
return "enderio:blockAttractorSideOn";
|
||||
}
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSideIconKey(boolean active) {
|
||||
return getMachineFrontIconKey(active);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackIconKey(boolean active) {
|
||||
return getMachineFrontIconKey(active);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
; // no active smoke
|
||||
; // no active particles
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package crazypants.enderio.machine.obelisk.xp;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.obelisk.BlockObeliskAbstract;
|
||||
|
||||
public class BlockExperienceObelisk extends BlockObeliskAbstract<TileExperienceOblisk> {
|
||||
|
||||
public static BlockExperienceObelisk create() {
|
||||
BlockExperienceObelisk res = new BlockExperienceObelisk();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
private BlockExperienceObelisk() {
|
||||
super(ModObject.blockExperienceObelisk, TileExperienceOblisk.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int blockSide) {
|
||||
return getIcon(blockSide, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(ForgeDirection.getOrientation(side) == ForgeDirection.UP) {
|
||||
return EnderIO.blockAttractor.getIcon(side, 0);
|
||||
}
|
||||
return EnderIO.blockAttractor.getOnIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerExperienceObelisk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GuiExperienceObelisk(player.inventory, (TileExperienceOblisk) world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGuiId() {
|
||||
return GuiHandler.GUI_ID_XP_OBELISK;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
; // Has no particles
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
package crazypants.enderio.machine.obelisk.xp;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public class ContainerExperianceObelisk extends Container {
|
||||
public class ContainerExperienceObelisk extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer arg0) {
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
package crazypants.enderio.machine.obelisk.xp;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
@@ -17,7 +17,7 @@ import crazypants.enderio.xp.PacketGivePlayerXP;
|
||||
import crazypants.render.RenderUtil;
|
||||
import crazypants.util.Lang;
|
||||
|
||||
public class GuiExperianceObelisk extends GuiMachineBase<TileExperienceOblisk> {
|
||||
public class GuiExperienceObelisk extends GuiMachineBase<TileExperienceOblisk> {
|
||||
|
||||
private IconButtonEIO p;
|
||||
private IconButtonEIO pp;
|
||||
@@ -27,8 +27,8 @@ public class GuiExperianceObelisk extends GuiMachineBase<TileExperienceOblisk> {
|
||||
private IconButtonEIO mm;
|
||||
private IconButtonEIO mmm;
|
||||
|
||||
public GuiExperianceObelisk(InventoryPlayer par1InventoryPlayer, TileExperienceOblisk te) {
|
||||
super(te, new ContainerExperianceObelisk());
|
||||
public GuiExperienceObelisk(InventoryPlayer par1InventoryPlayer, TileExperienceOblisk te) {
|
||||
super(te, new ContainerExperienceObelisk());
|
||||
ySize = 115;
|
||||
|
||||
int spacing = 5;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
package crazypants.enderio.machine.obelisk.xp;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
package crazypants.enderio.machine.obelisk.xp;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
package crazypants.enderio.machine.obelisk.xp;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -1,147 +0,0 @@
|
||||
package crazypants.enderio.machine.xp;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
|
||||
public class BlockExperienceObelisk extends AbstractMachineBlock<TileExperienceOblisk> {
|
||||
|
||||
public static BlockExperienceObelisk create() {
|
||||
BlockExperienceObelisk res = new BlockExperienceObelisk();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
public static int renderId;
|
||||
|
||||
private BlockExperienceObelisk() {
|
||||
super(ModObject.blockExperienceObelisk, TileExperienceOblisk.class);
|
||||
setObeliskBounds();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int blockSide) {
|
||||
return getIcon(blockSide, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(ForgeDirection.getOrientation(side) == ForgeDirection.UP){
|
||||
return EnderIO.blockAttractor.getIcon(side,0);
|
||||
}
|
||||
return EnderIO.blockAttractor.getOnIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLightOpacity() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
// ItemXpTransfer.onActivated(player, world, x, y - 1, z, side);
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
|
||||
// super.onBlockClicked(world, x, y, z, player);
|
||||
//
|
||||
// // copypasta from ItemXpTransfer.transferFromPlayerToBlock
|
||||
//
|
||||
// if(world.isRemote || player.experienceTotal <= 0) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// y--;
|
||||
// TileEntity te = world.getTileEntity(x, y, z);
|
||||
// if(!(te instanceof IFluidHandler)) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// IFluidHandler fh = (IFluidHandler) te;
|
||||
// ForgeDirection dir = ForgeDirection.UP; // no side passed :(
|
||||
// if(!fh.canFill(dir, EnderIO.fluidXpJuice)) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// int canTake = player.experienceTotal - XpUtil.getExperienceForLevel(player.experienceLevel - 1);
|
||||
//
|
||||
// int fluidVolume = XpUtil.experianceToLiquid(canTake);
|
||||
// FluidStack fs = new FluidStack(EnderIO.fluidXpJuice, fluidVolume);
|
||||
// int takenVolume = fh.fill(dir, fs, true);
|
||||
// if(takenVolume <= 0) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// int xpToTake = XpUtil.liquidToExperiance(takenVolume);
|
||||
// XpUtil.addPlayerXP(player, -xpToTake);
|
||||
// ItemXpTransfer.sendXPUpdate(player, world, x, y, z, false);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForTooltip(ItemStack itemStack) {
|
||||
return getUnlocalizedName();
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void registerBlockIcons(IIconRegister iIconRegister) {
|
||||
//
|
||||
// blockIcon = iIconRegister.registerIcon("enderio:blockAttractorSide");
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerExperianceObelisk();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GuiExperianceObelisk(player.inventory, (TileExperienceOblisk)world.getTileEntity(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGuiId() {
|
||||
return GuiHandler.GUI_ID_XP_OBELISK;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getMachineFrontIconKey(boolean active) {
|
||||
//Not actualy used, but give it something so it doesn't print an error
|
||||
return "enderio:blockAttractorSide";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user