summaryrefslogtreecommitdiff
path: root/ihl/enviroment
diff options
context:
space:
mode:
authorFoghrye4 <foghrye4@gmail.com>2017-01-27 11:32:28 +0300
committerFoghrye4 <foghrye4@gmail.com>2017-01-27 11:32:28 +0300
commit2db8e30b1d2151fdde5d08a6c06aef55f0c397d2 (patch)
treee8cd0022f3a30a5c952092e0ea4c7ffdafcdf7bb /ihl/enviroment
parentffe23313fb7421b0a1849b420baf708999023f7b (diff)
License, readme and stuff
Diffstat (limited to 'ihl/enviroment')
-rw-r--r--ihl/enviroment/LightBulbBlock.java4
-rw-r--r--ihl/enviroment/LightBulbModel.java8
-rw-r--r--ihl/enviroment/LightBulbTileEntity.java6
-rw-r--r--ihl/enviroment/MirrorBlock.java24
-rw-r--r--ihl/enviroment/MirrorRender.java10
-rw-r--r--ihl/enviroment/MirrorTileEntity.java29
-rw-r--r--ihl/enviroment/SpotlightTileEntity.java5
7 files changed, 13 insertions, 73 deletions
diff --git a/ihl/enviroment/LightBulbBlock.java b/ihl/enviroment/LightBulbBlock.java
index 7175949..d78b667 100644
--- a/ihl/enviroment/LightBulbBlock.java
+++ b/ihl/enviroment/LightBulbBlock.java
@@ -38,10 +38,10 @@ public class LightBulbBlock extends Block implements ITileEntityProvider
public static void init()
{
glowningAir = new GlowningAirBlock();
+ new LightBulbBlock("lightBulb");
+ new SpotlightBlock("spotlight");
GameRegistry.registerBlock(glowningAir, "glowningAir");
- LightBulbBlock mblock = new LightBulbBlock("lightBulb");
GameRegistry.registerTileEntity(LightBulbTileEntity.class, "lightBulb");
- SpotlightBlock sblock = new SpotlightBlock("spotlight");
GameRegistry.registerTileEntity(SpotlightTileEntity.class, "spotlight");
SpotlightTileEntity.createLightSphereVectors();
}
diff --git a/ihl/enviroment/LightBulbModel.java b/ihl/enviroment/LightBulbModel.java
index 710d7fb..bca6305 100644
--- a/ihl/enviroment/LightBulbModel.java
+++ b/ihl/enviroment/LightBulbModel.java
@@ -48,12 +48,4 @@ public class LightBulbModel extends ModelBase
BaseON.drawFromInside = false;
BaseON.addTube("SpyralNorth", -0.5F, -0.5F, 0.5F, 1, 1, 7, 0f, 1f, ForgeDirection.NORTH);
}
-
- private void setRotation(IHLModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
-
}
diff --git a/ihl/enviroment/LightBulbTileEntity.java b/ihl/enviroment/LightBulbTileEntity.java
index 0d8f399..c82bc57 100644
--- a/ihl/enviroment/LightBulbTileEntity.java
+++ b/ihl/enviroment/LightBulbTileEntity.java
@@ -18,7 +18,6 @@ import ic2.api.network.INetworkDataProvider;
import ic2.api.tile.IWrenchable;
import ic2.core.IC2;
import ic2.core.ITickCallback;
-import ic2.core.network.NetworkManager;
import ihl.utils.IHLUtils;
public class LightBulbTileEntity extends TileEntity implements IEnergySink, IWrenchable, INetworkDataProvider
@@ -58,7 +57,8 @@ public class LightBulbTileEntity extends TileEntity implements IEnergySink, IWre
super.validate();
IC2.tickHandler.addSingleTickCallback(this.worldObj, new ITickCallback()
{
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void tickCallback(World world)
{
if (!LightBulbTileEntity.this.isInvalid() && world.blockExists(LightBulbTileEntity.this.xCoord, LightBulbTileEntity.this.yCoord, LightBulbTileEntity.this.zCoord))
@@ -238,7 +238,7 @@ public class LightBulbTileEntity extends TileEntity implements IEnergySink, IWre
@Override
public List<String> getNetworkedFields()
{
- Vector ret = new Vector(2);
+ Vector<String> ret = new Vector<String>(2);
ret.add("active");
ret.add("facing");
return ret;
diff --git a/ihl/enviroment/MirrorBlock.java b/ihl/enviroment/MirrorBlock.java
index fd1418e..d7d7473 100644
--- a/ihl/enviroment/MirrorBlock.java
+++ b/ihl/enviroment/MirrorBlock.java
@@ -13,16 +13,12 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
-import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class MirrorBlock extends Block implements ITileEntityProvider {
- private String unlocalizedName;
- private IIcon blockIconSide;
-
public MirrorBlock(String unlocalizedName1)
{
super(Material.glass);
@@ -36,7 +32,7 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
public static void init()
{
- MirrorBlock mblock = new MirrorBlock("mirror");
+ new MirrorBlock("mirror");
GameRegistry.registerTileEntity(MirrorTileEntity.class, "mirror");
}
@@ -76,8 +72,6 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
{
MirrorTileEntity ate = (MirrorTileEntity) te;
int var2 = ate.getFacing() & 7;
- float var4 = 0.375F;
- float var5 = 0.625F;
float var6 = 0.5F;
float var7 = 0.09F;
if (var2 == 0)
@@ -111,8 +105,6 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
private void setBlockBoundsBasedOnFacing(int facing)
{
int var2 = facing & 7;
- float var4 = 0.375F;
- float var5 = 0.625F;
float var6 = 0.5F;
float var7 = 0.09F;
if (var2 == 0)
@@ -205,18 +197,4 @@ public class MirrorBlock extends Block implements ITileEntityProvider {
{
this.dropBlockAsItem(world, x, y, z, IHLUtils.getThisModItemStack("dustGlass"));
}
- /* @Override
- public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer player,int i,float pos_x,float pos_y,float pos_z){
- TileEntity te = world.getTileEntity(x,y,z);
- if(IC2.platform.isRendering())
- {
- MirrorTileEntity rtu = (MirrorTileEntity)te;
- if(player.getCurrentEquippedItem()==null)
- {
- IC2.platform.messagePlayer(player, "ic2.tooltip.mode", new Object[] {"Facing " + rtu.getFacing()});
- }
- }
- return false;
- }
- */
}
diff --git a/ihl/enviroment/MirrorRender.java b/ihl/enviroment/MirrorRender.java
index 9e06f90..2166e7b 100644
--- a/ihl/enviroment/MirrorRender.java
+++ b/ihl/enviroment/MirrorRender.java
@@ -15,12 +15,8 @@ import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.BufferUtils;
-import org.lwjgl.opengl.ARBFramebufferObject;
import org.lwjgl.opengl.Display;
-import org.lwjgl.opengl.EXTFramebufferObject;
import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL14;
-import org.lwjgl.opengl.GL20;
import org.lwjgl.opengl.GL30;
import org.lwjgl.util.glu.GLU;
import org.lwjgl.util.glu.Project;
@@ -42,7 +38,6 @@ private final int[] ydepth;
private final int[] textureU;
private final int[] textureV;
private final Minecraft mc;
-private static final boolean useARB = true;
public MirrorRender()
{
@@ -54,7 +49,6 @@ public MirrorRender()
}
public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z, float f) {
- Tessellator tessellator=Tessellator.instance;
float[] mAxis = tile.getMirrorAxis();
if(texture==-1)
{
@@ -73,10 +67,6 @@ public void renderAModelAt(MirrorTileEntity tile, double x, double y, double z,
GL30.glRenderbufferStorage(GL30.GL_RENDERBUFFER, GL11.GL_DEPTH_COMPONENT, textureWidth, textureHeight);
GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL30.GL_RENDERBUFFER, depthBuffer);
GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D, texture, 0);
- IntBuffer drawBuffs = BufferUtils.createIntBuffer(1);
- drawBuffs.put(0, GL30.GL_COLOR_ATTACHMENT0);
- GL20.glDrawBuffers(drawBuffs);// SPme parts of code here mindlessly taken from TheArni/Advanced-Graphics-Processing-Units. https://github.com/TheArni/Advanced-Graphics-Processing-Units/
-
if (GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) != GL30.GL_FRAMEBUFFER_COMPLETE)
{
IHLMod.log.error("Something went wrong while creating frame buffer!");
diff --git a/ihl/enviroment/MirrorTileEntity.java b/ihl/enviroment/MirrorTileEntity.java
index 083f61d..1808816 100644
--- a/ihl/enviroment/MirrorTileEntity.java
+++ b/ihl/enviroment/MirrorTileEntity.java
@@ -22,11 +22,10 @@ import ihl.utils.IHLUtils;
public class MirrorTileEntity extends TileEntityBlock
{
- public final List<BlockWithCoordinates> bwc = new ArrayList();
- public final List<Entity> reflectedEntity = new ArrayList();
- public final List<TileEntity> reflectedTileEntity = new ArrayList();
+ public final List<BlockWithCoordinates> bwc = new ArrayList<BlockWithCoordinates>();
+ public final List<Entity> reflectedEntity = new ArrayList<Entity>();
+ public final List<TileEntity> reflectedTileEntity = new ArrayList<TileEntity>();
private int bwcListPos=0;
- private int reflectedEntityListPos=0;
private int reflectedTileEntityListPos=0;
private int reflectionVolumePos=0;
boolean firstTick=true;
@@ -52,7 +51,8 @@ public class MirrorTileEntity extends TileEntityBlock
public MirrorTileEntity()
{}
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
public void updateEntityClient()
{
super.updateEntityClient();
@@ -189,24 +189,6 @@ public class MirrorTileEntity extends TileEntityBlock
}
}
- private void dropMirrorStatusByDirection(ForgeDirection direction)
- {
- for(int i=1;i<=IHLMod.config.mirrorReflectionRange+2;i++)
- {
- TileEntity t = worldObj.getTileEntity(xCoord+direction.offsetX*i,yCoord+direction.offsetY*i, zCoord+direction.offsetZ*i);
- if(t instanceof MirrorTileEntity)
- {
- MirrorTileEntity te = (MirrorTileEntity) t;
- te.firstTick=false;
- }
- else
- {
- break;
- }
- }
-
- }
-
private boolean isBlockVisible(Block block, int x, int y, int z)
{
if(block instanceof MirrorBlock)
@@ -329,7 +311,6 @@ public class MirrorTileEntity extends TileEntityBlock
}
if(reflectionVolumeSize>0)
{
- int range=IHLMod.config.mirrorReflectionRange;
//reflectionVolumePos = x+y*maxX+z*maxX*maxY;
int z = reflectionVolumePos / (maxX-minX) / (maxY-minY);
int y = (reflectionVolumePos % ((maxX-minX) * (maxY-minY)))/ (maxX-minX);
diff --git a/ihl/enviroment/SpotlightTileEntity.java b/ihl/enviroment/SpotlightTileEntity.java
index 04b340b..b8bebab 100644
--- a/ihl/enviroment/SpotlightTileEntity.java
+++ b/ihl/enviroment/SpotlightTileEntity.java
@@ -1,7 +1,6 @@
package ihl.enviroment;
import ic2.api.network.INetworkTileEntityEventListener;
import ic2.core.IC2;
-import ic2.core.network.NetworkManager;
import ihl.IHLModInfo;
import ihl.i_hate_liquids.XYZ;
import ihl.utils.IHLUtils;
@@ -24,8 +23,8 @@ public class SpotlightTileEntity extends LightBulbTileEntity implements INetwork
{
Vec3 directionVector=Vec3.createVectorHelper(1, 0, 0);
private static final int maxLightRange=128;
- private final Set<XYZ> xyzGlowningAir = new HashSet();
- private static final Set<Vec3> lightSphereVectors = new HashSet();
+ private final Set<XYZ> xyzGlowningAir = new HashSet<XYZ>();
+ private static final Set<Vec3> lightSphereVectors = new HashSet<Vec3>();
public float rotationPitch=0f;
public float rotationYaw=0f;
public float prevRotationPitch=0f;