Skip to content

Commit

Permalink
Fixes and new Textures,
Browse files Browse the repository at this point in the history
FOR EXPERIMENTAL MODPACKS, Go ahead, give it a spin :)
  • Loading branch information
tgame14 committed Jan 17, 2014
1 parent 92c2ef6 commit 989f77e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/tgame/apptherm/blocks/BlockInfo.java
Expand Up @@ -28,7 +28,7 @@ public class BlockInfo {
public static final String EXHAUST_KEY = "MEExhaust";
public static final String EXHAUST_UNLOCALIZED_NAME = "exhaustme";
public static final String EXHAUST_TE_KEY = "TileEntityMEExhaust";
public static final String[] EXHAUST_TEXTURES = { "exhaustFace",
public static final String[] EXHAUST_TEXTURES = { "exhaustTop",
"machineSide", "machineBot" };

public static int MONITOR_ID;
Expand All @@ -53,7 +53,7 @@ public class BlockInfo {
public static final String INTAKE_KEY = "SimpleFan";
public static final String INTAKE_UNLOCALIZED_NAME = "simplefanme";
public static final String INTAKE_TE_KEY = "TileEntitySimpleFan";
public static final String[] INTAKE_TEXTURES = { "airFace", "airFaceActive" };
public static final String[] INTAKE_TEXTURES = { "airFaceActive", "airFaceActive" };

public static int EAS_ID;
public static final int EAS_DEFAULT = config++;
Expand Down
Expand Up @@ -22,7 +22,7 @@

public class BlockAirIntake extends BlockContainer {

protected boolean isPowered;
public boolean isPowered;

public BlockAirIntake(int id) {
super(id, Material.iron);
Expand All @@ -32,7 +32,7 @@ public BlockAirIntake(int id) {
this.setStepSound(Block.soundMetalFootstep);
this.setUnlocalizedName("appliedthermodynamics."
+ BlockInfo.INTAKE_UNLOCALIZED_NAME);

this.isPowered = false;

}
Expand Down Expand Up @@ -62,29 +62,22 @@ public void registerIcons(IconRegister iconregister) {
this.activeIcon = iconregister.registerIcon(ModInfo.RESOURCE_LOCATION
+ ":" + BlockInfo.INTAKE_TEXTURES[1]);
}

private Icon getFaceStatus() {
if (this.isPowered) {
return this.activeIcon;
}
return this.frontIcon;

private Icon getFrontFaceState() {
return this.isPowered ? activeIcon : frontIcon;
}

@SideOnly(Side.CLIENT)

@Override
public Icon getIcon(int side, int metadata) {
return side == 3 ? getFaceStatus() : side == 0 ? bottomIcon
return side == 3 ? getFrontFaceState() : side == 0 ? bottomIcon
: side == 1 ? topIcon : sideIcon;
}

@Override
public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z,
int side) {
TileEntity tileentity = blockAccess.getBlockTileEntity(x, y, z);
TileEntitySimpleFan tile = null;

if (tileentity != null && tileentity instanceof TileEntitySimpleFan)
tile = (TileEntitySimpleFan) tileentity;
this.isPowered = tile.isPowered();

int metadata = blockAccess.getBlockMetadata(x, y, z);

Expand Down Expand Up @@ -123,5 +116,5 @@ public void onBlockPlacedBy(World world, int x, int y, int z,
public TileEntity createNewTileEntity(World world) {
return new TileEntitySimpleFan();
}

}
@@ -1,6 +1,7 @@
package com.tgame.apptherm.client.renderers;

import net.minecraft.block.Block;
import net.minecraft.client.renderer.IconFlipped;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
Expand All @@ -17,12 +18,16 @@
public class ATBlockRendererHelper implements ISimpleBlockRenderingHandler {

public static int myRenderID = RenderingRegistry.getNextAvailableRenderId();

protected Icon faceIcon, botIcon, topIcon, sideIcon;

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
Block block, int modelId, RenderBlocks renderer) {

ForgeDirection dir = ForgeDirection.SOUTH;



switch (world.getBlockMetadata(x, y, z)) {
case 2:
Expand All @@ -38,7 +43,11 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
dir = ForgeDirection.EAST;
break;
}
return false;

renderFace(dir, block, x, y, z, faceIcon, renderer);
renderRestOfSides(dir, block, x, y, z, sideIcon, renderer);

return true;
}

// renders the rest of the sides of the Block other than the face.
Expand Down
@@ -1,5 +1,9 @@
package com.tgame.apptherm.tileentities;

import com.tgame.apptherm.blocks.networked.BlockAirIntake;
import com.tgame.apptherm.util.ModInfo;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
Expand Down Expand Up @@ -56,7 +60,7 @@ public boolean isValid() {
}

@Override
public boolean isPowered() {
public boolean isPowered() {
return this.powerstatus;
}

Expand Down
@@ -1,8 +1,11 @@
{
"animation":{
"width":1,
"height":3,
"frametime":4,
"frames":[0,1,2,3]
"frametime": 2,
"frames": [
0,
1,
2,
3
]
}
}

0 comments on commit 989f77e

Please sign in to comment.