Skip to content

Commit

Permalink
fix moar things
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 30, 2014
1 parent 5076fc0 commit 4326ff3
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 102 deletions.
20 changes: 20 additions & 0 deletions resources/sounds.json
@@ -0,0 +1,20 @@
{
"frypan_hit": {
"category": "neutral",
"sounds": [
"frypan_hit"
]
},
"little_saw": {
"category": "neutral",
"sounds": [
"little_saw"
]
},
"frypan_hit": {
"category": "neutral",
"sounds": [
"launcher_clank"
]
}
}
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/TConstruct.java
Expand Up @@ -157,7 +157,7 @@ public void init (FMLInitializationEvent event)
}

DimensionBlacklist.getBadBimensions();
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool), 2);
GameRegistry.registerWorldGenerator(new SlimeIslandGen(TRepo.slimePool,2), 2);

PluginController.getController().init();

Expand Down
13 changes: 7 additions & 6 deletions src/main/java/tconstruct/client/TClientEvents.java
Expand Up @@ -49,11 +49,12 @@ public void onSound (SoundLoadEvent event)
initSounds = true;
try
{
SoundManager soundmanager = event.manager;
soundmanager.addSound("tinker:frypan_hit.ogg");
soundmanager.addSound("tinker:little_saw.ogg");
/* SoundManager soundmanager = event.manager;
soundmanager.addSound("tinker:frypan_hit.ogg");
soundmanager.addSound("tinker:little_saw.ogg");
soundmanager.addSound("tinker:launcher_clank.ogg");
TConstruct.logger.info("Successfully loaded sounds.");
*/
}
catch (Exception e)
{
Expand All @@ -71,7 +72,7 @@ public void onSound (SoundLoadEvent event)
public void preStitch (TextureStitchEvent.Pre event)
{
TextureMap register = event.map;
if (register.textureType == 0)
if (register.getTextureType() == 0)
{
stillIcons[0] = register.registerIcon("tinker:liquid_pigiron");
flowIcons[0] = register.registerIcon("tinker:liquid_pigiron");
Expand All @@ -81,11 +82,11 @@ public void preStitch (TextureStitchEvent.Pre event)
@SubscribeEvent
public void postStitch (TextureStitchEvent.Post event)
{
if (event.map.textureType == 0)
if (event.map.getTextureType() == 0)
{
for (int i = 0; i < TRepo.fluidBlocks.length; i++)
{
TRepo.fluids[i].setIcons(TRepo.fluidBlocks[i].getIcon(0, 0), TRepo.fluidBlocks[i].getIcon(2, 0));
TRepo.fluids[i].setIcons(TRepo.fluidBlocks[i].func_149691_a(0, 0), TRepo.fluidBlocks[i].func_149691_a(2, 0));
}
TRepo.pigIronFluid.setIcons(stillIcons[0], flowIcons[0]);
}
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/tconstruct/client/TClientTickHandler.java
Expand Up @@ -10,38 +10,38 @@
import tconstruct.TConstruct;
import tconstruct.common.TContent;
import tconstruct.common.TRepo;
import cpw.mods.fml.common.ITickHandler;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.common.gameevent.TickEvent.Type;

public class TClientTickHandler implements ITickHandler
public class TClientTickHandler
{
Minecraft mc = Minecraft.getMinecraft();
//TControls controlInstance = ((TProxyClient)TConstruct.proxy).controlInstance;

@Override
public void tickEnd (EnumSet<TickType> type, Object... tickData)
{
TRepo.oreBerry.setGraphicsLevel(Blocks.leaves.graphicsLevel);
TRepo.oreBerrySecond.setGraphicsLevel(Blocks.leaves.graphicsLevel);
TRepo.slimeLeaves.setGraphicsLevel(Blocks.leaves.graphicsLevel);
/*if (mc.thePlayer != null && !mc.thePlayer.isAirBorne)
controlInstance.landOnGround();*/
}

@Override
public EnumSet<TickType> ticks ()
//TControls controlInstance = ((TProxyClient)TConstruct.proxy).controlInstance;
public TClientTickHandler()
{
return EnumSet.of(TickType.RENDER);
}

@Override
public void tickStart (EnumSet<TickType> type, Object... tickData)
@SubscribeEvent
public void onTick (ClientTickEvent event)
{

if (event.phase.equals(Phase.END) && event.type.equals(Type.RENDER))
{
TRepo.oreBerry.setGraphicsLevel(Blocks.leaves.graphicsLevel);
TRepo.oreBerrySecond.setGraphicsLevel(Blocks.leaves.graphicsLevel);
TRepo.slimeLeaves.setGraphicsLevel(Blocks.leaves.graphicsLevel);
/*if (mc.thePlayer != null && !mc.thePlayer.isAirBorne)
controlInstance.landOnGround();*/
}
}

@Override
public String getLabel ()
/* @Override
public EnumSet<TickType> ticks ()
{
return null;
return EnumSet.of(TickType.RENDER);
}
*/
}
Expand Up @@ -312,7 +312,7 @@ public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block
private void renderLiquidPart (IBlockAccess world, int x, int y, int z, Block block, RenderBlocks renderer, CastingChannelLogic logic)
{
FluidStack liquid = logic.liquid;
int color = block.colorMultiplier(world, x, y, z);
int color = block.func_149720_d(world, x, y, z);
float red = (color >> 16 & 0xFF) / 255.0F;
float green = (color >> 8 & 0xFF) / 255.0F;
float blue = (color & 0xFF) / 255.0F;
Expand Down
Expand Up @@ -79,7 +79,7 @@ public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block
renderer.func_147784_q(block, x, y, z);
}

renderer.clearOverrideBlockTexture();
renderer.func_147771_a();

renderer.field_147837_f = false;
return true;
Expand Down
46 changes: 24 additions & 22 deletions src/main/java/tconstruct/client/block/PaneRender.java
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;

Expand Down Expand Up @@ -56,9 +57,9 @@ public static boolean renderPaneInWorld (RenderBlocks renderblocks, IBlockAccess
{
int l = iblockaccess.getHeight();
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(pane.getMixedBrightnessForBlock(iblockaccess, x, y, z));
tessellator.setBrightness(pane.func_149677_c(iblockaccess, x, y, z));
float f = 1.0F;
int i1 = pane.colorMultiplier(iblockaccess, x, y, z);
int i1 = pane.func_149720_d(iblockaccess, x, y, z);
float f1 = (float) (i1 >> 16 & 0xff) / 255F;
float f2 = (float) (i1 >> 8 & 0xff) / 255F;
float f3 = (float) (i1 & 0xff) / 255F;
Expand All @@ -76,8 +77,8 @@ public static boolean renderPaneInWorld (RenderBlocks renderblocks, IBlockAccess
boolean flag1 = false;
IIcon icon;
IIcon icon1;
int meta = iblockaccess.func_147439_aMetadata(x, y, z);
icon = renderblocks.func_147439_aIconFromSideAndMetadata(pane, 0, meta);
int meta = iblockaccess.getBlockMetadata(x, y, z);
icon = renderblocks.func_147787_a(pane, 0, meta);
icon1 = pane.getSideTextureIndex(meta);

meta = icon.getIconWidth();
Expand Down Expand Up @@ -127,10 +128,11 @@ public static boolean renderPaneInWorld (RenderBlocks renderblocks, IBlockAccess
double xMidUp = (double) x + 0.5D + 0.0625D;
double zMidDown = ((double) z + 0.5D) - 0.0625D;
double zMidUp = (double) z + 0.5D + 0.0625D;
boolean west = pane.canConnectTo(iblockaccess.func_147439_a(x, y, z - 1));
boolean east = pane.canConnectTo(iblockaccess.func_147439_a(x, y, z + 1));
boolean south = pane.canConnectTo(iblockaccess.func_147439_a(x - 1, y, z));
boolean north = pane.canConnectTo(iblockaccess.func_147439_a(x + 1, y, z));
boolean west = pane.canConnectTo(iblockaccess, x, y, z - 1, ForgeDirection.NORTH);
boolean east = pane.canConnectTo(iblockaccess, x, y, z + 1, ForgeDirection.SOUTH);
boolean south = pane.canConnectTo(iblockaccess, x - 1, y, z, ForgeDirection.EAST);
boolean north = pane.canConnectTo(iblockaccess, x + 1, y, z, ForgeDirection.WEST);

boolean renderAbove = pane.func_149646_a(iblockaccess, x, y + 1, z, 1);
boolean renderBelow = pane.func_149646_a(iblockaccess, x, y - 1, z, 0);
if ((!south || !north) && (south || north || west || east))
Expand Down Expand Up @@ -184,14 +186,14 @@ else if (!south && north)
tessellator.addVertexWithUV(xMid, y + 0, zMidUp, d6, d9);
tessellator.addVertexWithUV(xMid, y + 1, zMidUp, d6, d7);
}
if (renderAbove || y < l - 1 && iblockaccess.isAirBlock(x + 1, y + 1, z))
if (renderAbove || y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x + 1, y + 1, z))
{
tessellator.addVertexWithUV(xMid, (double) (y + 1) + 0.01D, zMidUp, d6, d7);
tessellator.addVertexWithUV(xTop, (double) (y + 1) + 0.01D, zMidUp, d6, d8);
tessellator.addVertexWithUV(xTop, (double) (y + 1) + 0.01D, zMidDown, d5, d8);
tessellator.addVertexWithUV(xMid, (double) (y + 1) + 0.01D, zMidDown, d5, d7);
}
if (renderBelow || y > 1 && iblockaccess.isAirBlock(x + 1, y - 1, z))
if (renderBelow || y > 1 && WorldHelper.isAirBlock(iblockaccess, x + 1, y - 1, z))
{
tessellator.addVertexWithUV(xMid, (double) y - 0.01D, zMidUp, d6, d7);
tessellator.addVertexWithUV(xTop, (double) y - 0.01D, zMidUp, d6, d8);
Expand Down Expand Up @@ -219,14 +221,14 @@ else if (!south && north)
}
else
{
if (y < l - 1 && iblockaccess.isAirBlock(x - 1, y + 1, z))
if (y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x - 1, y + 1, z))
{
tessellator.addVertexWithUV(xBot, (double) (y + 1) + 0.01D, zMidUp, d6, d8);
tessellator.addVertexWithUV(xMid, (double) (y + 1) + 0.01D, zMidUp, d6, d9);
tessellator.addVertexWithUV(xMid, (double) (y + 1) + 0.01D, zMidDown, d5, d9);
tessellator.addVertexWithUV(xBot, (double) (y + 1) + 0.01D, zMidDown, d5, d8);
}
if (y < l - 1 && iblockaccess.isAirBlock(x + 1, y + 1, z))
if (y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x + 1, y + 1, z))
{
tessellator.addVertexWithUV(xMid, (double) (y + 1) + 0.01D, zMidUp, d6, d7);
tessellator.addVertexWithUV(xTop, (double) (y + 1) + 0.01D, zMidUp, d6, d8);
Expand All @@ -243,14 +245,14 @@ else if (!south && north)
}
else
{
if (y > 1 && iblockaccess.isAirBlock(x - 1, y - 1, z))
if (y > 1 && WorldHelper.isAirBlock(iblockaccess, x - 1, y - 1, z))
{
tessellator.addVertexWithUV(xBot, (double) y - 0.01D, zMidUp, d6, d8);
tessellator.addVertexWithUV(xMid, (double) y - 0.01D, zMidUp, d6, d9);
tessellator.addVertexWithUV(xMid, (double) y - 0.01D, zMidDown, d5, d9);
tessellator.addVertexWithUV(xBot, (double) y - 0.01D, zMidDown, d5, d8);
}
if (y > 1 && iblockaccess.isAirBlock(x + 1, y - 1, z))
if (y > 1 && WorldHelper.isAirBlock(iblockaccess, x + 1, y - 1, z))
{
tessellator.addVertexWithUV(xMid, (double) y - 0.01D, zMidUp, d6, d7);
tessellator.addVertexWithUV(xTop, (double) y - 0.01D, zMidUp, d6, d8);
Expand Down Expand Up @@ -278,14 +280,14 @@ else if (!south && north)
tessellator.addVertexWithUV(xMidUp, y + 0, zMid, d6, d9);
tessellator.addVertexWithUV(xMidUp, y + 1, zMid, d6, d7);
}
if (renderAbove || y < l - 1 && iblockaccess.isAirBlock(x, y + 1, z - 1))
if (renderAbove || y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x, y + 1, z - 1))
{
tessellator.addVertexWithUV(xMidDown, y + 1, zBot, d6, d7);
tessellator.addVertexWithUV(xMidDown, y + 1, zMid, d6, d8);
tessellator.addVertexWithUV(xMidUp, y + 1, zMid, d5, d8);
tessellator.addVertexWithUV(xMidUp, y + 1, zBot, d5, d7);
}
if (renderBelow || y > 1 && iblockaccess.isAirBlock(x, y - 1, z - 1))
if (renderBelow || y > 1 && WorldHelper.isAirBlock(iblockaccess, x, y - 1, z - 1))
{
tessellator.addVertexWithUV(xMidDown, y, zBot, d6, d7);
tessellator.addVertexWithUV(xMidDown, y, zMid, d6, d8);
Expand All @@ -310,14 +312,14 @@ else if (!west && east)
tessellator.addVertexWithUV(xMidDown, y + 0, zMid, d6, d9);
tessellator.addVertexWithUV(xMidDown, y + 1, zMid, d6, d7);
}
if (renderAbove || y < l - 1 && iblockaccess.isAirBlock(x, y + 1, z + 1))
if (renderAbove || y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x, y + 1, z + 1))
{
tessellator.addVertexWithUV(xMidDown, y + 1, zMid, d5, d8);
tessellator.addVertexWithUV(xMidDown, y + 1, zTop, d5, d9);
tessellator.addVertexWithUV(xMidUp, y + 1, zTop, d6, d9);
tessellator.addVertexWithUV(xMidUp, y + 1, zMid, d6, d8);
}
if (renderBelow || y > 1 && iblockaccess.isAirBlock(x, y - 1, z + 1))
if (renderBelow || y > 1 && WorldHelper.isAirBlock(iblockaccess, x, y - 1, z + 1))
{
tessellator.addVertexWithUV(xMidDown, y, zMid, d5, d8);
tessellator.addVertexWithUV(xMidDown, y, zTop, d5, d9);
Expand Down Expand Up @@ -345,14 +347,14 @@ else if (!west && east)
}
else
{
if (y < l - 1 && iblockaccess.isAirBlock(x, y + 1, z - 1))
if (y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x, y + 1, z - 1))
{
tessellator.addVertexWithUV(xMidDown, y + 1, zBot, d6, d7);
tessellator.addVertexWithUV(xMidDown, y + 1, zMid, d6, d8);
tessellator.addVertexWithUV(xMidUp, y + 1, zMid, d5, d8);
tessellator.addVertexWithUV(xMidUp, y + 1, zBot, d5, d7);
}
if (y < l - 1 && iblockaccess.isAirBlock(x, y + 1, z + 1))
if (y < l - 1 && WorldHelper.isAirBlock(iblockaccess, x, y + 1, z + 1))
{
tessellator.addVertexWithUV(xMidDown, y + 1, zMid, d5, d8);
tessellator.addVertexWithUV(xMidDown, y + 1, zTop, d5, d9);
Expand All @@ -373,14 +375,14 @@ else if (!west && east)
}
else
{
if (y > 1 && iblockaccess.isAirBlock(x, y - 1, z - 1))
if (y > 1 && WorldHelper.isAirBlock(iblockaccess, x, y - 1, z - 1))
{
tessellator.addVertexWithUV(xMidDown, y, zBot, d6, d7);
tessellator.addVertexWithUV(xMidDown, y, zMid, d6, d8);
tessellator.addVertexWithUV(xMidUp, y, zMid, d5, d8);
tessellator.addVertexWithUV(xMidUp, y, zBot, d5, d7);
}
if (y > 1 && iblockaccess.isAirBlock(x, y - 1, z + 1))
if (y > 1 && WorldHelper.isAirBlock(iblockaccess, x, y - 1, z + 1))
{
tessellator.addVertexWithUV(xMidDown, y, zMid, d5, d8);
tessellator.addVertexWithUV(xMidDown, y, zTop, d5, d9);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/client/block/SlimeChannelRender.java
Expand Up @@ -74,11 +74,11 @@ public boolean renderRotatedBlock (Block block, int x, int y, int z, IBlockAcces
u3 = iconStill.getInterpolatedU(8.0F + (zFlow - xFlow) * 16.0F);
v3 = iconStill.getInterpolatedV(8.0F + (-zFlow - xFlow) * 16.0F);
}
int color = block.colorMultiplier(world, x, y, z);
int color = block.func_149720_d(world, x, y, z);
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setBrightness(block.func_149677_c(world, x, y, z));
tessellator.setColorOpaque_F(LIGHT_Y_POS * red, LIGHT_Y_POS * green, LIGHT_Y_POS * blue);

tessellator.addVertexWithUV(x + 0, y + 0.5, z + 0, u2, v2);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/client/block/TankAirRender.java
Expand Up @@ -36,9 +36,9 @@ public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block
if (item.getItem() instanceof ItemBlock)
{
Block inv = BlockUtils.getBlockFromItemStack(item);
renderer.setOverrideBlockTexture(inv.func_149691_a(1, item.getItemDamage()));
renderer.renderBlockByRenderType(inv, x, y, z);
renderer.clearOverrideBlockTexture();
renderer.func_147757_a(inv.func_149691_a(1, item.getItemDamage()));
renderer.func_147805_b(inv, x, y, z);
renderer.func_147771_a();
}
}
else if (logic.hasFluids())
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/common/TRecipes.java
Expand Up @@ -508,7 +508,7 @@ protected static void addRecipesForCraftingTable ()
GameRegistry.addShapelessRecipe(new ItemStack(TRepo.craftedSoil, 2, 1), Items.clay_ball, Blocks.sand, Blocks.gravel);
GameRegistry.addShapelessRecipe(new ItemStack(TRepo.craftedSoil, 8, 1), new ItemStack(Blocks.clay, 1, Short.MAX_VALUE), Blocks.sand, Blocks.sand, Blocks.sand, Blocks.sand, Blocks.gravel,
Blocks.gravel, Blocks.gravel, Blocks.gravel);
GameRegistry.addShapelessRecipe(new ItemStack(TRepo.craftedSoil, 2, 6), Items.netherStalkSeeds, Blocks.soul_sand, Blocks.gravel);
GameRegistry.addShapelessRecipe(new ItemStack(TRepo.craftedSoil, 2, 6), Items.nether_wart, Blocks.soul_sand, Blocks.gravel);
// Graveyard Soil Recipes
GameRegistry.addShapelessRecipe(new ItemStack(TRepo.craftedSoil, 1, 3), Blocks.dirt, Items.rotten_flesh, new ItemStack(Items.dye, 1, 15));
// Silky Cloth Recipes
Expand Down
43 changes: 0 additions & 43 deletions src/main/java/tconstruct/common/TimeTicker.java

This file was deleted.

0 comments on commit 4326ff3

Please sign in to comment.