Some more "minor fixes", if you want to call it that.

(I declare you completely nuts if you do, though.)
This commit is contained in:
Ellpeck 2016-01-08 15:21:05 +01:00
parent f602eccca0
commit 92b9b7a844
77 changed files with 440 additions and 273 deletions

View file

@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.BlockPistonBase; import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
@ -39,6 +40,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{ public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public BlockAtomicReconstructor(String name){ public BlockAtomicReconstructor(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -47,6 +50,11 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public EnumRarity getRarity(ItemStack stack){ public EnumRarity getRarity(ItemStack stack){
return EnumRarity.EPIC; return EnumRarity.EPIC;

View file

@ -21,6 +21,7 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
@ -37,6 +38,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBookletStand extends BlockContainerBase implements IHudDisplay{ public class BlockBookletStand extends BlockContainerBase implements IHudDisplay{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3);
public BlockBookletStand(String name){ public BlockBookletStand(String name){
super(Material.wood, name); super(Material.wood, name);
this.setHarvestLevel("axe", 0); this.setHarvestLevel("axe", 0);
@ -48,6 +51,11 @@ public class BlockBookletStand extends BlockContainerBase implements IHudDisplay
this.setBlockBounds(f, 0F, f, 1F-f, 1F-4*f, 1F-f); this.setBlockBounds(f, 0F, f, 1F-f, 1F-4*f, 1F-f);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public int getRenderType(){ public int getRenderType(){
return AssetUtil.TESR_RENDER_ID; return AssetUtil.TESR_RENDER_ID;

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase; import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -31,6 +32,7 @@ import net.minecraft.world.World;
public class BlockBreaker extends BlockContainerBase{ public class BlockBreaker extends BlockContainerBase{
private boolean isPlacer; private boolean isPlacer;
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public BlockBreaker(boolean isPlacer, String name){ public BlockBreaker(boolean isPlacer, String name){
super(Material.rock, name); super(Material.rock, name);
@ -41,6 +43,11 @@ public class BlockBreaker extends BlockContainerBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker(); return this.isPlacer ? new TileEntityBreaker.TileEntityPlacer() : new TileEntityBreaker();

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -34,6 +35,8 @@ import java.util.Random;
public class BlockCoalGenerator extends BlockContainerBase{ public class BlockCoalGenerator extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
public BlockCoalGenerator(String name){ public BlockCoalGenerator(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -43,6 +46,11 @@ public class BlockCoalGenerator extends BlockContainerBase{
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityCoalGenerator(); return new TileEntityCoalGenerator();

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -30,6 +31,8 @@ import net.minecraft.world.World;
public class BlockCoffeeMachine extends BlockContainerBase{ public class BlockCoffeeMachine extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3);
public BlockCoffeeMachine(String name){ public BlockCoffeeMachine(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -41,6 +44,11 @@ public class BlockCoffeeMachine extends BlockContainerBase{
this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f); this.setBlockBounds(f, 0F, f, 1F-f, 1F-2*f, 1F-f);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public int getRenderType(){ public int getRenderType(){
return AssetUtil.TESR_RENDER_ID; return AssetUtil.TESR_RENDER_ID;

View file

@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -39,6 +40,7 @@ import java.util.Random;
public class BlockColoredLamp extends BlockBase{ public class BlockColoredLamp extends BlockBase{
public static TheColoredLampColors[] allLampTypes = TheColoredLampColors.values(); public static TheColoredLampColors[] allLampTypes = TheColoredLampColors.values();
private static final PropertyInteger META = PropertyInteger.create("meta", 0, allLampTypes.length-1);
public boolean isOn; public boolean isOn;
public BlockColoredLamp(boolean isOn, String name){ public BlockColoredLamp(boolean isOn, String name){
@ -49,6 +51,11 @@ public class BlockColoredLamp extends BlockBase{
this.isOn = isOn; this.isOn = isOn;
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public Item getItemDropped(IBlockState state, Random rand, int par3){ public Item getItemDropped(IBlockState state, Random rand, int par3){
return Item.getItemFromBlock(InitBlocks.blockColoredLamp); return Item.getItemFromBlock(InitBlocks.blockColoredLamp);

View file

@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -31,6 +32,7 @@ import java.util.List;
public class BlockCrystal extends BlockBase{ public class BlockCrystal extends BlockBase{
public static final TheCrystals[] allCrystals = TheCrystals.values(); public static final TheCrystals[] allCrystals = TheCrystals.values();
private static final PropertyInteger META = PropertyInteger.create("meta", 0, allCrystals.length-1);
public BlockCrystal(String name){ public BlockCrystal(String name){
super(Material.rock, name); super(Material.rock, name);
@ -39,6 +41,11 @@ public class BlockCrystal extends BlockBase{
this.setHarvestLevel("pickaxe", 1); this.setHarvestLevel("pickaxe", 1);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public int damageDropped(IBlockState state){ public int damageDropped(IBlockState state){
return this.getMetaFromState(state); return this.getMetaFromState(state);

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase; import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -30,6 +31,8 @@ import net.minecraft.world.World;
public class BlockDirectionalBreaker extends BlockContainerBase{ public class BlockDirectionalBreaker extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public BlockDirectionalBreaker(String name){ public BlockDirectionalBreaker(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -38,6 +41,11 @@ public class BlockDirectionalBreaker extends BlockContainerBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityDirectionalBreaker(); return new TileEntityDirectionalBreaker();

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase; import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -29,6 +30,8 @@ import net.minecraft.world.World;
public class BlockDropper extends BlockContainerBase{ public class BlockDropper extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public BlockDropper(String name){ public BlockDropper(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -36,6 +39,10 @@ public class BlockDropper extends BlockContainerBase{
this.setResistance(10.0F); this.setResistance(10.0F);
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockPistonBase; import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -30,6 +31,8 @@ import net.minecraft.world.World;
public class BlockFluidCollector extends BlockContainerBase{ public class BlockFluidCollector extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
private boolean isPlacer; private boolean isPlacer;
public BlockFluidCollector(boolean isPlacer, String name){ public BlockFluidCollector(boolean isPlacer, String name){
@ -41,6 +44,11 @@ public class BlockFluidCollector extends BlockContainerBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector(); return this.isPlacer ? new TileEntityFluidCollector.TileEntityFluidPlacer() : new TileEntityFluidCollector();

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -36,6 +37,8 @@ import java.util.Random;
public class BlockFurnaceDouble extends BlockContainerBase{ public class BlockFurnaceDouble extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 7);
public BlockFurnaceDouble(String name){ public BlockFurnaceDouble(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -45,6 +48,11 @@ public class BlockFurnaceDouble extends BlockContainerBase{
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityFurnaceDouble(); return new TileEntityFurnaceDouble();

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -35,6 +36,7 @@ import java.util.Random;
public class BlockGrinder extends BlockContainerBase{ public class BlockGrinder extends BlockContainerBase{
private final boolean isDouble; private final boolean isDouble;
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
public BlockGrinder(boolean isDouble, String name){ public BlockGrinder(boolean isDouble, String name){
super(Material.rock, name); super(Material.rock, name);
@ -46,6 +48,11 @@ public class BlockGrinder extends BlockContainerBase{
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder(); return this.isDouble ? new TileEntityGrinder.TileEntityGrinderDouble() : new TileEntityGrinder();

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase; import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -26,6 +27,8 @@ import net.minecraft.world.World;
public class BlockLampPowerer extends BlockBase{ public class BlockLampPowerer extends BlockBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public BlockLampPowerer(String name){ public BlockLampPowerer(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -34,6 +37,11 @@ public class BlockLampPowerer extends BlockBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){ public void onNeighborBlockChange(World world, BlockPos pos, IBlockState state, Block neighborBlock){
this.updateLamp(world, pos); this.updateLamp(world, pos);

View file

@ -15,6 +15,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -31,6 +32,8 @@ import java.util.List;
public class BlockLaserRelay extends BlockContainerBase{ public class BlockLaserRelay extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5);
public BlockLaserRelay(String name){ public BlockLaserRelay(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -39,6 +42,11 @@ public class BlockLaserRelay extends BlockContainerBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, pos); this.setBlockBoundsBasedOnState(world, pos);

View file

@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheMiscBlocks;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -29,6 +30,7 @@ import java.util.List;
public class BlockMisc extends BlockBase{ public class BlockMisc extends BlockBase{
public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values(); public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values();
private static final PropertyInteger META = PropertyInteger.create("meta", 0, allMiscBlocks.length-1);
public BlockMisc(String name){ public BlockMisc(String name){
super(Material.rock, name); super(Material.rock, name);
@ -37,6 +39,11 @@ public class BlockMisc extends BlockBase{
this.setHarvestLevel("pickaxe", 1); this.setHarvestLevel("pickaxe", 1);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public int damageDropped(IBlockState state){ public int damageDropped(IBlockState state){
return this.getMetaFromState(state); return this.getMetaFromState(state);

View file

@ -18,6 +18,7 @@ import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -34,6 +35,8 @@ import java.util.Random;
public class BlockOilGenerator extends BlockContainerBase{ public class BlockOilGenerator extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
public BlockOilGenerator(String name){ public BlockOilGenerator(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -43,6 +46,11 @@ public class BlockOilGenerator extends BlockContainerBase{
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityOilGenerator(); return new TileEntityOilGenerator();

View file

@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -37,6 +38,8 @@ public class BlockSlabs extends BlockBase{
this(name, fullBlock, 0); this(name, fullBlock, 0);
} }
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 1);
public BlockSlabs(String name, Block fullBlock, int meta){ public BlockSlabs(String name, Block fullBlock, int meta){
super(fullBlock.getMaterial(), name); super(fullBlock.getMaterial(), name);
this.setHardness(1.5F); this.setHardness(1.5F);
@ -45,6 +48,11 @@ public class BlockSlabs extends BlockBase{
this.meta = meta; this.meta = meta;
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){ public void addCollisionBoxesToList(World world, BlockPos pos, IBlockState state, AxisAlignedBB axis, List list, Entity entity){
this.setBlockBoundsBasedOnState(world, pos); this.setBlockBoundsBasedOnState(world, pos);

View file

@ -20,6 +20,7 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -38,6 +39,8 @@ import java.util.Random;
public class BlockSmileyCloud extends BlockContainerBase{ public class BlockSmileyCloud extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3);
public BlockSmileyCloud(String name){ public BlockSmileyCloud(String name){
super(Material.cloth, name); super(Material.cloth, name);
this.setHardness(0.5F); this.setHardness(0.5F);
@ -45,6 +48,10 @@ public class BlockSmileyCloud extends BlockContainerBase{
this.setStepSound(soundTypeCloth); this.setStepSound(soundTypeCloth);
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public int getRenderType(){ public int getRenderType(){

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockBase;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
@ -34,6 +35,8 @@ import java.util.Random;
public class BlockTreasureChest extends BlockBase{ public class BlockTreasureChest extends BlockBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3);
public BlockTreasureChest(String name){ public BlockTreasureChest(String name){
super(Material.wood, name); super(Material.wood, name);
this.setHarvestLevel("axe", 0); this.setHarvestLevel("axe", 0);
@ -43,6 +46,11 @@ public class BlockTreasureChest extends BlockBase{
this.setTickRandomly(true); this.setTickRandomly(true);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){ public void randomDisplayTick(World world, BlockPos pos, IBlockState state, Random rand){

View file

@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -37,12 +38,18 @@ import java.util.List;
public class BlockWildPlant extends BlockBushBase{ public class BlockWildPlant extends BlockBushBase{
public static final TheWildPlants[] allWildPlants = TheWildPlants.values(); public static final TheWildPlants[] allWildPlants = TheWildPlants.values();
private static final PropertyInteger META = PropertyInteger.create("meta", 0, allWildPlants.length-1);
public BlockWildPlant(String name){ public BlockWildPlant(String name){
super(name); super(name);
this.setStepSound(soundTypeGrass); this.setStepSound(soundTypeGrass);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public boolean canBlockStay(World world, BlockPos pos, IBlockState state){ public boolean canBlockStay(World world, BlockPos pos, IBlockState state){
BlockPos offset = PosUtil.offset(pos, 0, -1, 0); BlockPos offset = PosUtil.offset(pos, 0, -1, 0);

View file

@ -19,6 +19,7 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityXPSolidifier;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
@ -33,6 +34,8 @@ import net.minecraft.world.World;
public class BlockXPSolidifier extends BlockContainerBase{ public class BlockXPSolidifier extends BlockContainerBase{
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 3);
public BlockXPSolidifier(String name){ public BlockXPSolidifier(String name){
super(Material.rock, name); super(Material.rock, name);
this.setHarvestLevel("pickaxe", 0); this.setHarvestLevel("pickaxe", 0);
@ -41,6 +44,11 @@ public class BlockXPSolidifier extends BlockContainerBase{
this.setStepSound(soundTypeStone); this.setStepSound(soundTypeStone);
} }
@Override
protected PropertyInteger getMetaProperty(){
return META;
}
@Override @Override
public TileEntity createNewTileEntity(World world, int par2){ public TileEntity createNewTileEntity(World world, int par2){
return new TileEntityXPSolidifier(); return new TileEntityXPSolidifier();

View file

@ -162,13 +162,13 @@ public class InitBlocks{
blockCoalGenerator = new BlockCoalGenerator("blockCoalGenerator"); blockCoalGenerator = new BlockCoalGenerator("blockCoalGenerator");
blockOilGenerator = new BlockOilGenerator("blockOilGenerator"); blockOilGenerator = new BlockOilGenerator("blockOilGenerator");
blockFermentingBarrel = new BlockFermentingBarrel("blockFermentingBarrel"); blockFermentingBarrel = new BlockFermentingBarrel("blockFermentingBarrel");
blockRice = new BlockPlant("blockRice", 6, 1, 2); blockRice = new BlockPlant("blockRice", 1, 2);
CompatUtil.registerMFRPlant(blockRice); CompatUtil.registerMFRPlant(blockRice);
blockCanola = new BlockPlant("blockCanola", 4, 5, 5); blockCanola = new BlockPlant("blockCanola", 5, 5);
CompatUtil.registerMFRPlant(blockCanola); CompatUtil.registerMFRPlant(blockCanola);
blockFlax = new BlockPlant("blockFlax", 6, 2, 4); blockFlax = new BlockPlant("blockFlax", 2, 4);
CompatUtil.registerMFRPlant(blockFlax); CompatUtil.registerMFRPlant(blockFlax);
blockCoffee = new BlockPlant("blockCoffee", 6, 2, 2); blockCoffee = new BlockPlant("blockCoffee", 2, 2);
CompatUtil.registerMFRPlant(blockCoffee); CompatUtil.registerMFRPlant(blockCoffee);
blockCompost = new BlockCompost("blockCompost"); blockCompost = new BlockCompost("blockCompost");
blockMisc = new BlockMisc("blockMisc"); blockMisc = new BlockMisc("blockMisc");

View file

@ -12,9 +12,9 @@ package de.ellpeck.actuallyadditions.mod.blocks.base;
import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.creative.CreativeTab;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState; import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -61,16 +61,20 @@ public class BlockBase extends Block{
@Override @Override
protected BlockState createBlockState(){ protected BlockState createBlockState(){
return new BlockState(this, PosUtil.META); return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
} }
@Override @Override
public IBlockState getStateFromMeta(int meta){ public IBlockState getStateFromMeta(int meta){
return getDefaultState().withProperty(PosUtil.META, meta); return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta);
} }
@Override @Override
public int getMetaFromState(IBlockState state){ public int getMetaFromState(IBlockState state){
return state.getValue(PosUtil.META); return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
}
protected PropertyInteger getMetaProperty(){
return null;
} }
} }

View file

@ -12,8 +12,8 @@ package de.ellpeck.actuallyadditions.mod.blocks.base;
import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.creative.CreativeTab;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.block.BlockBush; import net.minecraft.block.BlockBush;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState; import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
@ -25,7 +25,6 @@ public class BlockBushBase extends BlockBush{
private String name; private String name;
public BlockBushBase(String name){ public BlockBushBase(String name){
this.setStepSound(soundTypeGrass);
this.name = name; this.name = name;
this.register(); this.register();
@ -60,16 +59,20 @@ public class BlockBushBase extends BlockBush{
@Override @Override
protected BlockState createBlockState(){ protected BlockState createBlockState(){
return new BlockState(this, PosUtil.META); return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
} }
@Override @Override
public IBlockState getStateFromMeta(int meta){ public IBlockState getStateFromMeta(int meta){
return getDefaultState().withProperty(PosUtil.META, meta); return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta);
} }
@Override @Override
public int getMetaFromState(IBlockState state){ public int getMetaFromState(IBlockState state){
return state.getValue(PosUtil.META); return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
}
protected PropertyInteger getMetaProperty(){
return null;
} }
} }

View file

@ -13,12 +13,12 @@ package de.ellpeck.actuallyadditions.mod.blocks.base;
import de.ellpeck.actuallyadditions.mod.creative.CreativeTab; import de.ellpeck.actuallyadditions.mod.creative.CreativeTab;
import de.ellpeck.actuallyadditions.mod.tile.*; import de.ellpeck.actuallyadditions.mod.tile.*;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.Util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockRedstoneTorch; import net.minecraft.block.BlockRedstoneTorch;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockState; import net.minecraft.block.state.BlockState;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@ -262,16 +262,20 @@ public abstract class BlockContainerBase extends BlockContainer{
@Override @Override
protected BlockState createBlockState(){ protected BlockState createBlockState(){
return new BlockState(this, PosUtil.META); return this.getMetaProperty() == null ? super.createBlockState() : new BlockState(this, this.getMetaProperty());
} }
@Override @Override
public IBlockState getStateFromMeta(int meta){ public IBlockState getStateFromMeta(int meta){
return getDefaultState().withProperty(PosUtil.META, meta); return this.getMetaProperty() == null ? super.getStateFromMeta(meta) : this.getDefaultState().withProperty(this.getMetaProperty(), meta);
} }
@Override @Override
public int getMetaFromState(IBlockState state){ public int getMetaFromState(IBlockState state){
return state.getValue(PosUtil.META); return this.getMetaProperty() == null ? super.getMetaFromState(state) : state.getValue(this.getMetaProperty());
}
protected PropertyInteger getMetaProperty(){
return null;
} }
} }

View file

@ -30,14 +30,12 @@ public class BlockPlant extends BlockCrops{
public Item seedItem; public Item seedItem;
public Item returnItem; public Item returnItem;
public int returnMeta; public int returnMeta;
private int stages;
private String name; private String name;
private int minDropAmount; private int minDropAmount;
private int addDropAmount; private int addDropAmount;
public BlockPlant(String name, int stages, int minDropAmount, int addDropAmount){ public BlockPlant(String name, int minDropAmount, int addDropAmount){
this.name = name; this.name = name;
this.stages = stages;
this.minDropAmount = minDropAmount; this.minDropAmount = minDropAmount;
this.addDropAmount = addDropAmount; this.addDropAmount = addDropAmount;

View file

@ -23,12 +23,12 @@ public class RenderInventory{
/*@Override /*@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer){ public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer){
GL11.glPushMatrix(); GlStateManager.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(this.tileRender.resLoc); Minecraft.getMinecraft().renderEngine.bindTexture(this.tileRender.resLoc);
GL11.glTranslatef(0F, 1F, 0F); GlStateManager.glTranslatef(0F, 1F, 0F);
GL11.glRotatef(180F, 1F, 0F, 0F); GlStateManager.glRotatef(180F, 1F, 0F, 0F);
this.tileRender.theModel.render(0.0625F); this.tileRender.theModel.render(0.0625F);
GL11.glPopMatrix(); GlStateManager.glPopMatrix();
} }
@Override @Override

View file

@ -12,8 +12,8 @@ package de.ellpeck.actuallyadditions.mod.blocks.render;
import de.ellpeck.actuallyadditions.mod.blocks.render.model.ModelBaseAA; import de.ellpeck.actuallyadditions.mod.blocks.render.model.ModelBaseAA;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
public class RenderLaserRelay extends RenderTileEntity{ public class RenderLaserRelay extends RenderTileEntity{
@ -24,38 +24,38 @@ public class RenderLaserRelay extends RenderTileEntity{
@Override @Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int par6){ public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int par6){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y-0.5F, (float)z+0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -2.0F, 0.0F); GlStateManager.translate(0.0F, -2.0F, 0.0F);
this.bindTexture(resLoc); this.bindTexture(resLoc);
int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld()); int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld());
if(meta == 0){ if(meta == 0){
GL11.glRotatef(180F, 1F, 0F, 0F); GlStateManager.rotate(180F, 1F, 0F, 0F);
GL11.glTranslatef(0F, -2F, 0F); GlStateManager.translate(0F, -2F, 0F);
} }
else if(meta == 3){ else if(meta == 3){
GL11.glRotatef(-90, 1F, 0F, 0F); GlStateManager.rotate(-90, 1F, 0F, 0F);
GL11.glTranslatef(0F, -1F, 1F); GlStateManager.translate(0F, -1F, 1F);
} }
else if(meta == 2){ else if(meta == 2){
GL11.glRotatef(90, 1F, 0F, 0F); GlStateManager.rotate(90, 1F, 0F, 0F);
GL11.glTranslatef(0F, -1F, -1F); GlStateManager.translate(0F, -1F, -1F);
} }
else if(meta == 4){ else if(meta == 4){
GL11.glRotatef(90, 0F, 0F, 1F); GlStateManager.rotate(90, 0F, 0F, 1F);
GL11.glTranslatef(1F, -1F, 0F); GlStateManager.translate(1F, -1F, 0F);
} }
else if(meta == 5){ else if(meta == 5){
GL11.glRotatef(90, 0F, 0F, -1F); GlStateManager.rotate(90, 0F, 0F, -1F);
GL11.glTranslatef(-1F, -1F, 0F); GlStateManager.translate(-1F, -1F, 0F);
} }
GL11.glScalef(0.85F, 0.85F, 0.85F); GlStateManager.scale(0.85F, 0.85F, 0.85F);
GL11.glTranslatef(0F, 0.2657F, 0F); GlStateManager.translate(0F, 0.2657F, 0F);
theModel.render(0.0625F); theModel.render(0.0625F);
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }

View file

@ -15,10 +15,10 @@ import de.ellpeck.actuallyadditions.api.lens.ILensItem;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
public class RenderReconstructorLens extends TileEntitySpecialRenderer{ public class RenderReconstructorLens extends TileEntitySpecialRenderer{
@ -30,48 +30,48 @@ public class RenderReconstructorLens extends TileEntitySpecialRenderer{
ItemStack stack = ((TileEntityAtomicReconstructor)tile).getStackInSlot(0); ItemStack stack = ((TileEntityAtomicReconstructor)tile).getStackInSlot(0);
if(stack != null && stack.getItem() instanceof ILensItem){ if(stack != null && stack.getItem() instanceof ILensItem){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y-0.5F, (float)z+0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F);
int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld()); int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld());
if(meta == 0){ if(meta == 0){
GL11.glTranslatef(0F, -0.5F, 0F); GlStateManager.translate(0F, -0.5F, 0F);
GL11.glTranslatef(-0.25F, 0F, -0.25F); GlStateManager.translate(-0.25F, 0F, -0.25F);
GL11.glRotatef(90F, 1F, 0F, 0F); GlStateManager.rotate(90F, 1F, 0F, 0F);
} }
if(meta == 1){ if(meta == 1){
GL11.glTranslatef(0F, -1.5F-0.5F/16F, 0F); GlStateManager.translate(0F, -1.5F-0.5F/16F, 0F);
GL11.glTranslatef(-0.25F, 0F, -0.25F); GlStateManager.translate(-0.25F, 0F, -0.25F);
GL11.glRotatef(90F, 1F, 0F, 0F); GlStateManager.rotate(90F, 1F, 0F, 0F);
} }
if(meta == 2){ if(meta == 2){
GL11.glTranslatef(0F, -1F, 0F); GlStateManager.translate(0F, -1F, 0F);
GL11.glTranslatef(0F, 0F, -0.5F); GlStateManager.translate(0F, 0F, -0.5F);
GL11.glTranslatef(-0.25F, -0.25F, 0F); GlStateManager.translate(-0.25F, -0.25F, 0F);
} }
if(meta == 3){ if(meta == 3){
GL11.glTranslatef(0F, -1F, 0F); GlStateManager.translate(0F, -1F, 0F);
GL11.glTranslatef(0F, 0F, 0.5F+0.5F/16F); GlStateManager.translate(0F, 0F, 0.5F+0.5F/16F);
GL11.glTranslatef(-0.25F, -0.25F, 0F); GlStateManager.translate(-0.25F, -0.25F, 0F);
} }
if(meta == 4){ if(meta == 4){
GL11.glTranslatef(0F, -1F, 0F); GlStateManager.translate(0F, -1F, 0F);
GL11.glTranslatef(0.5F+0.5F/16F, 0F, 0F); GlStateManager.translate(0.5F+0.5F/16F, 0F, 0F);
GL11.glTranslatef(0F, -0.25F, 0.25F); GlStateManager.translate(0F, -0.25F, 0.25F);
GL11.glRotatef(90F, 0F, 1F, 0F); GlStateManager.rotate(90F, 0F, 1F, 0F);
} }
if(meta == 5){ if(meta == 5){
GL11.glTranslatef(0F, -1F, 0F); GlStateManager.translate(0F, -1F, 0F);
GL11.glTranslatef(-0.5F, 0F, 0F); GlStateManager.translate(-0.5F, 0F, 0F);
GL11.glTranslatef(0F, -0.25F, 0.25F); GlStateManager.translate(0F, -0.25F, 0.25F);
GL11.glRotatef(90F, 0F, 1F, 0F); GlStateManager.rotate(90F, 0F, 1F, 0F);
} }
GL11.glScalef(0.5F, 0.5F, 0.5F); GlStateManager.scale(0.5F, 0.5F, 0.5F);
AssetUtil.renderItemInWorld(stack, 0); AssetUtil.renderItemInWorld(stack, 0);
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }
} }

View file

@ -19,10 +19,9 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class RenderSmileyCloud extends RenderTileEntity{ public class RenderSmileyCloud extends RenderTileEntity{
@ -39,7 +38,7 @@ public class RenderSmileyCloud extends RenderTileEntity{
} }
TileEntitySmileyCloud theCloud = (TileEntitySmileyCloud)tile; TileEntitySmileyCloud theCloud = (TileEntitySmileyCloud)tile;
GL11.glPushMatrix(); GlStateManager.pushMatrix();
{ {
if(theCloud.flyHeight == 0){ if(theCloud.flyHeight == 0){
theCloud.flyHeight = tile.getWorld().rand.nextInt(30)+30; theCloud.flyHeight = tile.getWorld().rand.nextInt(30)+30;
@ -53,28 +52,28 @@ public class RenderSmileyCloud extends RenderTileEntity{
} }
if(time-(bobHeight/2) >= theCloud.lastFlyHeight){ if(time-(bobHeight/2) >= theCloud.lastFlyHeight){
GL11.glTranslated(0, (time-theCloud.lastFlyHeight)/300, 0); GlStateManager.translate(0, (time-theCloud.lastFlyHeight)/300, 0);
} }
else{ else{
GL11.glTranslated(0, -(time-theCloud.lastFlyHeight)/300+(double)bobHeight/300, 0); GlStateManager.translate(0, -(time-theCloud.lastFlyHeight)/300+(double)bobHeight/300, 0);
} }
GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y-0.5F, (float)z+0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -2F, 0.0F); GlStateManager.translate(0.0F, -2F, 0.0F);
GL11.glPushMatrix(); GlStateManager.pushMatrix();
{ {
if(theModel.doesRotate()){ if(theModel.doesRotate()){
int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld()); int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld());
if(meta == 0){ if(meta == 0){
GL11.glRotatef(180F, 0F, 1F, 0F); GlStateManager.rotate(180F, 0F, 1F, 0F);
} }
if(meta == 1){ if(meta == 1){
GL11.glRotatef(90F, 0F, 1F, 0F); GlStateManager.rotate(90F, 0F, 1F, 0F);
} }
if(meta == 3){ if(meta == 3){
GL11.glRotatef(270F, 0F, 1F, 0F); GlStateManager.rotate(270F, 0F, 1F, 0F);
} }
} }
@ -103,28 +102,28 @@ public class RenderSmileyCloud extends RenderTileEntity{
} }
} }
} }
GL11.glPopMatrix(); GlStateManager.popMatrix();
if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI){ if(theCloud.name != null && !theCloud.name.isEmpty() && !Minecraft.getMinecraft().gameSettings.hideGUI){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
{ {
GL11.glTranslatef(0F, 0.1F, 0F); GlStateManager.translate(0F, 0.1F, 0F);
GL11.glRotatef(180F, 1F, 0F, 0F); GlStateManager.rotate(180F, 1F, 0F, 0F);
GL11.glRotatef(180F, 0F, 1F, 0F); GlStateManager.rotate(180F, 0F, 1F, 0F);
GL11.glRotatef(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
float f = 1.6F; float f = 1.6F;
float f1 = 0.016666668F*f; float f1 = 0.016666668F*f;
GL11.glScalef(-f1, -f1, f1); GlStateManager.scale(-f1, -f1, f1);
GL11.glDisable(GL11.GL_LIGHTING); GlStateManager.disableLighting();
GL11.glTranslatef(0.0F, 0F/f1, 0.0F); GlStateManager.translate(0.0F, 0F/f1, 0.0F);
GL11.glDepthMask(false); GlStateManager.depthMask(false);
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
//TODO Fix nameplate with Smiley Cloud //TODO Fix nameplate with Smiley Cloud
/*Tessellator tessellator = Tessellator.getInstance(); /*Tessellator tessellator = Tessellator.getInstance();
GL11.glDisable(GL11.GL_TEXTURE_2D); GlStateManager.glDisable(GlStateManager.GL_TEXTURE_2D);
tessellator.startDrawingQuads(); tessellator.startDrawingQuads();
int i = Minecraft.getMinecraft().fontRendererObj.getStringWidth(theCloud.name)/2; int i = Minecraft.getMinecraft().fontRendererObj.getStringWidth(theCloud.name)/2;
tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
@ -133,20 +132,20 @@ public class RenderSmileyCloud extends RenderTileEntity{
tessellator.addVertex(i+1, 8.0D, 0.0D); tessellator.addVertex(i+1, 8.0D, 0.0D);
tessellator.addVertex(i+1, -1.0D, 0.0D); tessellator.addVertex(i+1, -1.0D, 0.0D);
tessellator.draw(); tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);*/ GlStateManager.glEnable(GlStateManager.GL_TEXTURE_2D);*/
GL11.glDepthMask(true); GlStateManager.depthMask(true);
Minecraft.getMinecraft().fontRendererObj.drawString(theCloud.name, -Minecraft.getMinecraft().fontRendererObj.getStringWidth(theCloud.name)/2, 0, StringUtil.DECIMAL_COLOR_WHITE); Minecraft.getMinecraft().fontRendererObj.drawString(theCloud.name, -Minecraft.getMinecraft().fontRendererObj.getStringWidth(theCloud.name)/2, 0, StringUtil.DECIMAL_COLOR_WHITE);
GL11.glEnable(GL11.GL_LIGHTING); GlStateManager.enableLighting();
GL11.glDisable(GL11.GL_BLEND); GlStateManager.disableBlend();
GL11.glColor4f(1F, 1F, 1F, 1F); GlStateManager.color(1F, 1F, 1F, 1F);
GL11.glScalef(1F/-f1, 1F/-f1, 1F/f1); GlStateManager.scale(1F/-f1, 1F/-f1, 1F/f1);
} }
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }

View file

@ -13,10 +13,10 @@ package de.ellpeck.actuallyadditions.mod.blocks.render;
import de.ellpeck.actuallyadditions.mod.blocks.render.model.ModelBaseAA; import de.ellpeck.actuallyadditions.mod.blocks.render.model.ModelBaseAA;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.PosUtil; import de.ellpeck.actuallyadditions.mod.util.PosUtil;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class RenderTileEntity extends TileEntitySpecialRenderer{ public class RenderTileEntity extends TileEntitySpecialRenderer{
@ -30,29 +30,29 @@ public class RenderTileEntity extends TileEntitySpecialRenderer{
@Override @Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int i){ public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5, int i){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glTranslatef((float)x+0.5F, (float)y-0.5F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y-0.5F, (float)z+0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(0.0F, -2.0F, 0.0F); GlStateManager.translate(0.0F, -2.0F, 0.0F);
this.bindTexture(resLoc); this.bindTexture(resLoc);
if(theModel.doesRotate()){ if(theModel.doesRotate()){
int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld()); int meta = PosUtil.getMetadata(tile.getPos(), tile.getWorld());
if(meta == 0){ if(meta == 0){
GL11.glRotatef(180F, 0F, 1F, 0F); GlStateManager.rotate(180F, 0F, 1F, 0F);
} }
if(meta == 1){ if(meta == 1){
GL11.glRotatef(90F, 0F, 1F, 0F); GlStateManager.rotate(90F, 0F, 1F, 0F);
} }
if(meta == 3){ if(meta == 3){
GL11.glRotatef(270F, 0F, 1F, 0F); GlStateManager.rotate(270F, 0F, 1F, 0F);
} }
} }
theModel.render(0.0625F); theModel.render(0.0625F);
theModel.renderExtra(0.0625F, tile); theModel.renderExtra(0.0625F, tile);
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }

View file

@ -14,9 +14,9 @@ import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
public class ModelCompost extends ModelBaseAA{ public class ModelCompost extends ModelBaseAA{
@ -76,7 +76,7 @@ public class ModelCompost extends ModelBaseAA{
public void renderExtra(float f, TileEntity tile){ public void renderExtra(float f, TileEntity tile){
//Hehe //Hehe
if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){ if("ShadowfactsDev".equals(Minecraft.getMinecraft().thePlayer.getName())){
GL11.glTranslatef(0F, 1F, 0F); GlStateManager.translate(0F, 1F, 0F);
} }
if(tile instanceof TileEntityCompost){ if(tile instanceof TileEntityCompost){

View file

@ -11,6 +11,7 @@
package de.ellpeck.actuallyadditions.mod.blocks.render.model; package de.ellpeck.actuallyadditions.mod.blocks.render.model;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
@ -153,8 +154,8 @@ public class ModelLaserRelay extends ModelBaseAA{
@Override @Override
public void render(float f){ public void render(float f){
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bottom.render(f); bottom.render(f);
laserPillar.render(f); laserPillar.render(f);
laserBase.render(f); laserBase.render(f);

View file

@ -11,7 +11,6 @@
package de.ellpeck.actuallyadditions.mod.booklet; package de.ellpeck.actuallyadditions.mod.booklet;
import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements; import de.ellpeck.actuallyadditions.mod.achievement.InitAchievements;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.achievement.GuiAchievements; import net.minecraft.client.gui.achievement.GuiAchievements;
import net.minecraft.stats.StatFileWriter; import net.minecraft.stats.StatFileWriter;
@ -24,12 +23,12 @@ public class GuiAAAchievements extends GuiAchievements{
public GuiAAAchievements(GuiScreen screen, StatFileWriter writer){ public GuiAAAchievements(GuiScreen screen, StatFileWriter writer){
super(screen, writer); super(screen, writer);
ReflectionHelper.setPrivateValue(GuiAchievements.class, this, InitAchievements.pageNumber, 21); ReflectionHelper.setPrivateValue(GuiAchievements.class, this, InitAchievements.pageNumber, 20);
} }
@Override @Override
public void initGui(){ public void initGui(){
super.initGui(); super.initGui();
((GuiButton)buttonList.get(1)).displayString = InitAchievements.theAchievementPage.getName(); this.buttonList.get(1).displayString = InitAchievements.theAchievementPage.getName();
} }
} }

View file

@ -32,6 +32,7 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IChatComponent; import net.minecraft.util.IChatComponent;
@ -40,7 +41,6 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -118,10 +118,10 @@ public class GuiBooklet extends GuiScreen implements IBookletGui{
//So don't fuck with everything unintentionally //So don't fuck with everything unintentionally
// //
//(This fixes your fuckery) //(This fixes your fuckery)
GL11.glScalef(1.0F, 1.0F, 1.0F); GlStateManager.scale(1.0F, 1.0F, 1.0F);
//Draws the Background //Draws the Background
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? resLocChristmas : (ClientProxy.pumpkinBlurPumpkinBlur ? resLocHalloween : (ClientProxy.bulletForMyValentine ? resLocValentine : resLoc))); this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? resLocChristmas : (ClientProxy.pumpkinBlurPumpkinBlur ? resLocHalloween : (ClientProxy.bulletForMyValentine ? resLocValentine : resLoc)));
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);

View file

@ -18,10 +18,9 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.KeyUtil; import de.ellpeck.actuallyadditions.mod.util.KeyUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList; import java.util.ArrayList;
@ -57,24 +56,24 @@ public class BookmarkButton extends GuiButton{
public void drawButton(Minecraft minecraft, int x, int y){ public void drawButton(Minecraft minecraft, int x, int y){
if(this.visible){ if(this.visible){
minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc); minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
int k = this.getHoverState(this.hovered); int k = this.getHoverState(this.hovered);
if(k == 0){ if(k == 0){
k = 1; k = 1;
} }
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(770, 771);
int renderHeight = 25; int renderHeight = 25;
this.drawTexturedModalRect(this.xPosition, this.yPosition, 146+(this.assignedEntry.entry == null ? 0 : 16), 194-renderHeight+k*renderHeight, this.width, renderHeight); this.drawTexturedModalRect(this.xPosition, this.yPosition, 146+(this.assignedEntry.entry == null ? 0 : 16), 194-renderHeight+k*renderHeight, this.width, renderHeight);
this.mouseDragged(minecraft, x, y); this.mouseDragged(minecraft, x, y);
if(this.assignedEntry.entry != null){ if(this.assignedEntry.entry != null){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
AssetUtil.renderStackToGui(this.assignedEntry.chapter != null && this.assignedEntry.chapter.getDisplayItemStack() != null ? this.assignedEntry.chapter.getDisplayItemStack() : new ItemStack(InitItems.itemBooklet), this.xPosition+2, this.yPosition+1, 0.725F); AssetUtil.renderStackToGui(this.assignedEntry.chapter != null && this.assignedEntry.chapter.getDisplayItemStack() != null ? this.assignedEntry.chapter.getDisplayItemStack() : new ItemStack(InitItems.itemBooklet), this.xPosition+2, this.yPosition+1, 0.725F);
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }
} }

View file

@ -15,8 +15,7 @@ import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
public class IndexButton extends GuiButton{ public class IndexButton extends GuiButton{
@ -31,27 +30,27 @@ public class IndexButton extends GuiButton{
@Override @Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY){ public void drawButton(Minecraft minecraft, int mouseX, int mouseY){
if(this.visible){ if(this.visible){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition+this.width && mouseY < this.yPosition+this.height; this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition+this.width && mouseY < this.yPosition+this.height;
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(770, 771);
this.mouseDragged(minecraft, mouseX, mouseY); this.mouseDragged(minecraft, mouseX, mouseY);
int textOffsetX = 0; int textOffsetX = 0;
if(this.chap != null){ if(this.chap != null){
if(this.chap.getDisplayItemStack() != null){ if(this.chap.getDisplayItemStack() != null){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
AssetUtil.renderStackToGui(this.chap.getDisplayItemStack(), this.xPosition-4, this.yPosition, 0.725F); AssetUtil.renderStackToGui(this.chap.getDisplayItemStack(), this.xPosition-4, this.yPosition, 0.725F);
GL11.glPopMatrix(); GlStateManager.popMatrix();
textOffsetX = 10; textOffsetX = 10;
} }
} }
if(this.hovered){ if(this.hovered){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
AssetUtil.drawHorizontalGradientRect(this.xPosition+textOffsetX-1, this.yPosition+this.height-1, this.xPosition+this.gui.getFontRenderer().getStringWidth(this.displayString)+textOffsetX+1, this.yPosition+this.height, 0x80 << 24 | 22271, 22271, this.zLevel); AssetUtil.drawHorizontalGradientRect(this.xPosition+textOffsetX-1, this.yPosition+this.height-1, this.xPosition+this.gui.getFontRenderer().getStringWidth(this.displayString)+textOffsetX+1, this.yPosition+this.height, 0x80 << 24 | 22271, 22271, this.zLevel);
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
this.gui.getFontRenderer().drawString(this.displayString, this.xPosition+textOffsetX, this.yPosition+(this.height-8)/2, 0); this.gui.getFontRenderer().drawString(this.displayString, this.xPosition+textOffsetX, this.yPosition+(this.height-8)/2, 0);

View file

@ -13,8 +13,7 @@ package de.ellpeck.actuallyadditions.mod.booklet.button;
import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet; import de.ellpeck.actuallyadditions.mod.booklet.GuiBooklet;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -47,16 +46,16 @@ public class TexturedButton extends GuiButton{
public void drawButton(Minecraft minecraft, int x, int y){ public void drawButton(Minecraft minecraft, int x, int y){
if(this.visible){ if(this.visible){
minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc); minecraft.getTextureManager().bindTexture(GuiBooklet.resLoc);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
int k = this.getHoverState(this.hovered); int k = this.getHoverState(this.hovered);
if(k == 0){ if(k == 0){
k = 1; k = 1;
} }
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(770, 771);
this.drawTexturedModalRect(this.xPosition, this.yPosition, this.texturePosX, this.texturePosY-this.height+k*this.height, this.width, this.height); this.drawTexturedModalRect(this.xPosition, this.yPosition, this.texturePosX, this.texturePosY-this.height+k*this.height, this.width, this.height);
this.mouseDragged(minecraft, x, y); this.mouseDragged(minecraft, x, y);
} }

View file

@ -51,7 +51,7 @@ public class HudEvent{
} }
} }
if(posHit != null){ if(posHit != null && posHit.getBlockPos() != null){
Block blockHit = PosUtil.getBlock(posHit.getBlockPos(), minecraft.theWorld); Block blockHit = PosUtil.getBlock(posHit.getBlockPos(), minecraft.theWorld);
TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos()); TileEntity tileHit = minecraft.theWorld.getTileEntity(posHit.getBlockPos());

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBreaker;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiBreaker extends GuiContainer{ public class GuiBreaker extends GuiContainer{
@ -46,7 +46,7 @@ public class GuiBreaker extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -16,11 +16,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCanolaPress;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -58,7 +58,7 @@ public class GuiCanolaPress extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -52,7 +52,7 @@ public class GuiCoalGenerator extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -21,12 +21,12 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -86,7 +86,7 @@ public class GuiCoffeeMachine extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -14,11 +14,11 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerCrafter;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiCrafter extends GuiContainer{ public class GuiCrafter extends GuiContainer{
@ -39,7 +39,7 @@ public class GuiCrafter extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
} }

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -53,7 +53,7 @@ public class GuiDirectionalBreaker extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -14,11 +14,11 @@ import de.ellpeck.actuallyadditions.mod.inventory.ContainerDrill;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiDrill extends GuiContainer{ public class GuiDrill extends GuiContainer{
@ -38,7 +38,7 @@ public class GuiDrill extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+54, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+54, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper; import de.ellpeck.actuallyadditions.mod.tile.TileEntityDropper;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiDropper extends GuiContainer{ public class GuiDropper extends GuiContainer{
@ -46,7 +46,7 @@ public class GuiDropper extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnergizer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -52,7 +52,7 @@ public class GuiEnergizer extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator; import de.ellpeck.actuallyadditions.mod.tile.TileEntityEnervator;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -52,7 +52,7 @@ public class GuiEnervator extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -17,11 +17,11 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Arrays; import java.util.Arrays;
@ -54,7 +54,7 @@ public class GuiFeeder extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+70, 0, 0, 176, 86);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);

View file

@ -16,11 +16,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFermentingBarrel;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -59,7 +59,7 @@ public class GuiFermentingBarrel extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -16,11 +16,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityFluidCollector;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -54,7 +54,7 @@ public class GuiFluidCollector extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -52,7 +52,7 @@ public class GuiFurnaceDouble extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiGiantChest extends GuiContainer{ public class GuiGiantChest extends GuiContainer{
@ -43,7 +43,7 @@ public class GuiGiantChest extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 242, 190); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 242, 190);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -59,7 +59,7 @@ public class GuiGrinder extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -23,7 +23,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -31,7 +31,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -165,7 +164,7 @@ public class GuiInputter extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93+(isAdvanced ? OFFSET_ADVANCED : 0), 0, 0, 176, 86);
@ -282,12 +281,12 @@ public class GuiInputter extends GuiContainer{
public void drawButton(Minecraft mc, int x, int y){ public void drawButton(Minecraft mc, int x, int y){
if(this.visible){ if(this.visible){
mc.getTextureManager().bindTexture(resLoc); mc.getTextureManager().bindTexture(resLoc);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
int k = this.getHoverState(this.hovered); int k = this.getHoverState(this.hovered);
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(770, 771);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 176, k*16, 16, 16); this.drawTexturedModalRect(this.xPosition, this.yPosition, 176, k*16, 16, 16);
this.mouseDragged(mc, x, y); this.mouseDragged(mc, x, y);
@ -319,12 +318,12 @@ public class GuiInputter extends GuiContainer{
public void drawButton(Minecraft mc, int x, int y){ public void drawButton(Minecraft mc, int x, int y){
if(this.visible){ if(this.visible){
mc.getTextureManager().bindTexture(resLoc); mc.getTextureManager().bindTexture(resLoc);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height; this.hovered = x >= this.xPosition && y >= this.yPosition && x < this.xPosition+this.width && y < this.yPosition+this.height;
int k = this.getHoverState(this.hovered); int k = this.getHoverState(this.hovered);
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
OpenGlHelper.glBlendFunc(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(770, 771);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 192, k*8, 8, 8); this.drawTexturedModalRect(this.xPosition, this.yPosition, 192, k*8, 8, 8);
this.mouseDragged(mc, x, y); this.mouseDragged(mc, x, y);
} }

View file

@ -20,11 +20,11 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiMiner extends GuiContainer{ public class GuiMiner extends GuiContainer{
@ -63,7 +63,7 @@ public class GuiMiner extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -16,11 +16,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -57,7 +57,7 @@ public class GuiOilGenerator extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiPhantomPlacer extends GuiContainer{ public class GuiPhantomPlacer extends GuiContainer{
@ -46,7 +46,7 @@ public class GuiPhantomPlacer extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -21,12 +21,12 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -83,7 +83,7 @@ public class GuiRangedCollector extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+86, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+86, 0, 0, 176, 86);

View file

@ -15,11 +15,11 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
import java.util.Collections; import java.util.Collections;
@ -52,7 +52,7 @@ public class GuiRepairer extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -21,13 +21,13 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import java.io.IOException; import java.io.IOException;
@ -82,7 +82,7 @@ public class GuiSmileyCloud extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(resLoc); this.mc.getTextureManager().bindTexture(resLoc);
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);

View file

@ -20,12 +20,12 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GuiXPSolidifier extends GuiContainer{ public class GuiXPSolidifier extends GuiContainer{
@ -86,7 +86,7 @@ public class GuiXPSolidifier extends GuiContainer{
@Override @Override
public void drawGuiContainerBackgroundLayer(float f, int x, int y){ public void drawGuiContainerBackgroundLayer(float f, int x, int y){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION);
this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86);

View file

@ -16,10 +16,10 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList; import java.util.ArrayList;
@ -377,30 +377,30 @@ public class SmileyCloudEasterEggs{
} }
private static void renderHoldingItem(boolean leftHand, ItemStack stack){ private static void renderHoldingItem(boolean leftHand, ItemStack stack){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glRotatef(180F, 0F, 0F, 1F); GlStateManager.rotate(180F, 0F, 0F, 1F);
GL11.glRotatef(270F, 0F, 1F, 0F); GlStateManager.rotate(270F, 0F, 1F, 0F);
GL11.glTranslatef(0F, -1.5F, 0F); GlStateManager.translate(0F, -1.5F, 0F);
GL11.glTranslatef(-0.5F, 0.2F, leftHand ? 0.55F : -0.5F); GlStateManager.translate(-0.5F, 0.2F, leftHand ? 0.55F : -0.5F);
GL11.glScalef(0.75F, 0.75F, 0.75F); GlStateManager.scale(0.75F, 0.75F, 0.75F);
AssetUtil.renderItemInWorld(stack, 0); AssetUtil.renderItemInWorld(stack, 0);
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
private static void renderHeadBlock(Block block, int meta, float rotation){ private static void renderHeadBlock(Block block, int meta, float rotation){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glDisable(GL11.GL_LIGHTING); GlStateManager.disableLighting();
GL11.glTranslatef(-0.015F, 0.6F, 0.075F); GlStateManager.translate(-0.015F, 0.6F, 0.075F);
GL11.glScalef(0.3F, 0.3F, 0.3F); GlStateManager.scale(0.3F, 0.3F, 0.3F);
GL11.glRotatef(180F, 1F, 0F, 0F); GlStateManager.rotate(180F, 1F, 0F, 0F);
GL11.glRotatef(rotation, 0F, 1F, 0F); GlStateManager.rotate(rotation, 0F, 1F, 0F);
AssetUtil.renderBlockInWorld(block, meta); AssetUtil.renderBlockInWorld(block, meta);
GL11.glEnable(GL11.GL_LIGHTING); GlStateManager.enableLighting();
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }

View file

@ -14,12 +14,12 @@ import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.entity.player.EnumPlayerModelParts;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.util.Calendar; import java.util.Calendar;
@ -55,33 +55,33 @@ public class RenderSpecial{
this.lastTimeForBobbing = time; this.lastTimeForBobbing = time;
} }
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glTranslated(0D, -0.775D+offsetUp, 0D); GlStateManager.translate(0D, -0.775D+offsetUp, 0D);
GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F);
GL11.glScalef(size, size, size); GlStateManager.scale(size, size, size);
if(time-(bobHeight/2) >= lastTimeForBobbing){ if(time-(bobHeight/2) >= lastTimeForBobbing){
GL11.glTranslated(0, (time-this.lastTimeForBobbing)/100, 0); GlStateManager.translate(0, (time-this.lastTimeForBobbing)/100, 0);
} }
else{ else{
GL11.glTranslated(0, -(time-lastTimeForBobbing)/100+bobHeight/100, 0); GlStateManager.translate(0, -(time-lastTimeForBobbing)/100+bobHeight/100, 0);
} }
GL11.glRotated(theTime/20, 0, 1, 0); GlStateManager.rotate((float)(theTime/20), 0, 1, 0);
GL11.glDisable(GL11.GL_LIGHTING); GlStateManager.disableLighting();
if(this.theThingToRender != null){ if(this.theThingToRender != null){
if(isBlock){ if(isBlock){
AssetUtil.renderBlockInWorld(Block.getBlockFromItem(this.theThingToRender.getItem()), this.theThingToRender.getItemDamage()); AssetUtil.renderBlockInWorld(Block.getBlockFromItem(this.theThingToRender.getItem()), this.theThingToRender.getItemDamage());
} }
else{ else{
GL11.glTranslatef(-0.5F, 0F, 0F); GlStateManager.translate(-0.5F, 0F, 0F);
AssetUtil.renderItemInWorld(this.theThingToRender, 0); AssetUtil.renderItemInWorld(this.theThingToRender, 0);
} }
} }
GL11.glEnable(GL11.GL_LIGHTING); GlStateManager.enableLighting();
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
} }

View file

@ -25,9 +25,9 @@ import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -136,8 +136,8 @@ public class NEIBookletRecipe extends TemplateRecipeHandler implements INEIRecip
@Override @Override
public void drawForeground(int recipe){ public void drawForeground(int recipe){
GL11.glColor4f(1F, 1F, 1F, 1F); GlStateManager.color(1F, 1F, 1F, 1F);
GL11.glDisable(GL11.GL_LIGHTING); GlStateManager.disableLighting();
this.drawExtras(recipe); this.drawExtras(recipe);
} }

View file

@ -30,8 +30,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -128,7 +128,7 @@ public class NEICoffeeMachineRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 126, 88); GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 126, 88);
} }

View file

@ -25,8 +25,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.Collections; import java.util.Collections;
@ -98,7 +98,7 @@ public class NEICompostRecipe extends TemplateRecipeHandler implements INEIRecip
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
} }

View file

@ -25,8 +25,8 @@ import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -104,7 +104,7 @@ public class NEICrusherRecipe extends TemplateRecipeHandler implements INEIRecip
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(60, 13, 60, 13, 56, 79); GuiDraw.drawTexturedModalRect(60, 13, 60, 13, 56, 79);
} }
@ -163,7 +163,7 @@ public class NEICrusherRecipe extends TemplateRecipeHandler implements INEIRecip
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(33, 20, 33, 20, 110, 70); GuiDraw.drawTexturedModalRect(33, 20, 33, 20, 110, 70);
} }

View file

@ -23,9 +23,9 @@ import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.item.crafting.FurnaceRecipes;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.Collections; import java.util.Collections;
@ -111,7 +111,7 @@ public class NEIFurnaceDoubleRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(46, 20, 46, 20, 84, 70); GuiDraw.drawTexturedModalRect(46, 20, 46, 20, 84, 70);
} }

View file

@ -24,8 +24,8 @@ import de.ellpeck.actuallyadditions.mod.items.InitItems;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.Collections; import java.util.Collections;
@ -118,7 +118,7 @@ public class NEIHairyBallRecipe extends TemplateRecipeHandler implements INEIRec
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
} }

View file

@ -26,9 +26,9 @@ import de.ellpeck.actuallyadditions.mod.util.*;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -144,7 +144,7 @@ public class NEIReconstructorRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
} }

View file

@ -24,8 +24,8 @@ import de.ellpeck.actuallyadditions.mod.booklet.BookletUtils;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.StringUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.Collections; import java.util.Collections;
@ -116,7 +116,7 @@ public class NEITreasureChestRecipe extends TemplateRecipeHandler implements INE
@Override @Override
public void drawBackground(int recipeIndex){ public void drawBackground(int recipeIndex){
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GuiDraw.changeTexture(getGuiTexture()); GuiDraw.changeTexture(getGuiTexture());
GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60); GuiDraw.drawTexturedModalRect(32, 0, 0, 0, 96, 60);
} }

View file

@ -69,7 +69,7 @@ public class TileEntityLeafGenerator extends TileEntityBase implements IEnergyPr
int meta = PosUtil.getMetadata(theCoord, worldObj); int meta = PosUtil.getMetadata(theCoord, worldObj);
this.worldObj.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12)); this.worldObj.playAuxSFX(2001, theCoord, Block.getIdFromBlock(theBlock)+(meta << 12));
this.worldObj.setBlockToAir(this.getPos()); this.worldObj.setBlockToAir(theCoord);
this.storage.receiveEnergy(ENERGY_PRODUCED, false); this.storage.receiveEnergy(ENERGY_PRODUCED, false);

View file

@ -24,7 +24,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class AssetUtil{ public class AssetUtil{
@ -74,14 +73,14 @@ public class AssetUtil{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public static void renderStackToGui(ItemStack stack, int x, int y, float scale){ public static void renderStackToGui(ItemStack stack, int x, int y, float scale){
GL11.glPushMatrix(); GlStateManager.pushMatrix();
GL11.glEnable(GL11.GL_BLEND); GlStateManager.enableBlend();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting(); RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL11.GL_DEPTH_TEST); GlStateManager.enableDepth();
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GlStateManager.enableRescaleNormal();
GL11.glTranslated(x, y, 0); GlStateManager.translate(x, y, 0);
GL11.glScalef(scale, scale, scale); GlStateManager.scale(scale, scale, scale);
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
boolean flagBefore = mc.fontRendererObj.getUnicodeFlag(); boolean flagBefore = mc.fontRendererObj.getUnicodeFlag();
@ -94,7 +93,7 @@ public class AssetUtil{
if(mc.currentScreen instanceof GuiBooklet || mc.currentScreen == null){ if(mc.currentScreen instanceof GuiBooklet || mc.currentScreen == null){
RenderHelper.disableStandardItemLighting(); RenderHelper.disableStandardItemLighting();
} }
GL11.glPopMatrix(); GlStateManager.popMatrix();
} }
//Copied from Gui.class and changed //Copied from Gui.class and changed
@ -115,10 +114,10 @@ public class AssetUtil{
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR); worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos((double)right, (double)top, (double)zLevel).color(f1, f2, f3, f).endVertex();
worldrenderer.pos((double)left, (double)top, (double)zLevel).color(f1, f2, f3, f).endVertex(); worldrenderer.pos((double)left, (double)top, (double)zLevel).color(f1, f2, f3, f).endVertex();
worldrenderer.pos((double)left, (double)bottom, (double)zLevel).color(f5, f6, f7, f4).endVertex(); worldrenderer.pos((double)left, (double)bottom, (double)zLevel).color(f1, f2, f3, f).endVertex();
worldrenderer.pos((double)right, (double)bottom, (double)zLevel).color(f5, f6, f7, f4).endVertex(); worldrenderer.pos((double)right, (double)bottom, (double)zLevel).color(f5, f6, f7, f4).endVertex();
worldrenderer.pos((double)right, (double)top, (double)zLevel).color(f5, f6, f7, f4).endVertex();
tessellator.draw(); tessellator.draw();
GlStateManager.shadeModel(7424); GlStateManager.shadeModel(7424);
GlStateManager.disableBlend(); GlStateManager.disableBlend();

View file

@ -12,7 +12,7 @@ package de.ellpeck.actuallyadditions.mod.util;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger; import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemBlock;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
@ -22,10 +22,14 @@ import net.minecraft.world.World;
public class PosUtil{ public class PosUtil{
public static final PropertyInteger META = PropertyInteger.create("meta", 0, 15);
public static Block getBlock(BlockPos pos, IBlockAccess world){ public static Block getBlock(BlockPos pos, IBlockAccess world){
return world.getBlockState(pos).getBlock(); if(pos != null){
IBlockState state = world.getBlockState(pos);
if(state != null){
return state.getBlock();
}
}
return null;
} }
public static Material getMaterial(BlockPos pos, IBlockAccess world){ public static Material getMaterial(BlockPos pos, IBlockAccess world){

View file

@ -55,12 +55,12 @@ public class WorldUtil{
} }
public static void pushEnergyToAllSides(World world, BlockPos pos, EnergyStorage storage){ public static void pushEnergyToAllSides(World world, BlockPos pos, EnergyStorage storage){
WorldUtil.pushEnergy(world, pos, EnumFacing.UP, storage); pushEnergy(world, pos, EnumFacing.UP, storage);
WorldUtil.pushEnergy(world, pos, EnumFacing.DOWN, storage); pushEnergy(world, pos, EnumFacing.DOWN, storage);
WorldUtil.pushEnergy(world, pos, EnumFacing.NORTH, storage); pushEnergy(world, pos, EnumFacing.NORTH, storage);
WorldUtil.pushEnergy(world, pos, EnumFacing.EAST, storage); pushEnergy(world, pos, EnumFacing.EAST, storage);
WorldUtil.pushEnergy(world, pos, EnumFacing.SOUTH, storage); pushEnergy(world, pos, EnumFacing.SOUTH, storage);
WorldUtil.pushEnergy(world, pos, EnumFacing.WEST, storage); pushEnergy(world, pos, EnumFacing.WEST, storage);
} }
public static void pushEnergy(World world, BlockPos pos, EnumFacing side, EnergyStorage storage){ public static void pushEnergy(World world, BlockPos pos, EnumFacing side, EnergyStorage storage){
@ -76,7 +76,7 @@ public class WorldUtil{
public static TileEntity getTileEntityFromSide(EnumFacing side, World world, BlockPos pos){ public static TileEntity getTileEntityFromSide(EnumFacing side, World world, BlockPos pos){
BlockPos c = getCoordsFromSide(side, pos, 0); BlockPos c = getCoordsFromSide(side, pos, 0);
if(c != null){ if(c != null){
return world.getTileEntity(pos); return world.getTileEntity(c);
} }
return null; return null;
} }
@ -399,7 +399,7 @@ public class WorldUtil{
else{ else{
//Check the Server if a Block that changed on the Client really changed, if not, revert the change //Check the Server if a Block that changed on the Client really changed, if not, revert the change
//TODO Check if this is the right action //TODO Check if this is the right action
Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, pos, Minecraft.getMinecraft().objectMouseOver.sideHit)); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, pos, Minecraft.getMinecraft().objectMouseOver.sideHit));
} }
return removed; return removed;
} }