Auto cleanup

This commit is contained in:
Shadows_of_Fire 2019-02-27 13:53:05 -05:00
parent 82020bcd49
commit 0d8f38710e
204 changed files with 1242 additions and 1307 deletions

View file

@ -14,7 +14,7 @@ import io.netty.util.internal.ConcurrentSet;
public class Network{ public class Network{
public final ConcurrentSet<IConnectionPair> connections = new ConcurrentSet<IConnectionPair>(); public final ConcurrentSet<IConnectionPair> connections = new ConcurrentSet<>();
public int changeAmount; public int changeAmount;
@Override @Override

View file

@ -33,11 +33,11 @@ public class CoffeeIngredient {
} }
public boolean matches(ItemStack stack) { public boolean matches(ItemStack stack) {
return input.apply(stack); return this.input.apply(stack);
} }
public Ingredient getInput() { public Ingredient getInput() {
return input; return this.input;
} }
public PotionEffect[] getEffects() { public PotionEffect[] getEffects() {
@ -53,6 +53,6 @@ public class CoffeeIngredient {
} }
public int getMaxAmplifier() { public int getMaxAmplifier() {
return maxAmplifier; return this.maxAmplifier;
} }
} }

View file

@ -35,23 +35,23 @@ public class CompostRecipe{
} }
public boolean matches(ItemStack stack) { public boolean matches(ItemStack stack) {
return input.apply(stack); return this.input.apply(stack);
} }
public Ingredient getInput() { public Ingredient getInput() {
return input; return this.input;
} }
public ItemStack getOutput() { public ItemStack getOutput() {
return output; return this.output;
} }
public IBlockState getInputDisplay() { public IBlockState getInputDisplay() {
return inputDisplay; return this.inputDisplay;
} }
public IBlockState getOutputDisplay() { public IBlockState getOutputDisplay() {
return outputDisplay; return this.outputDisplay;
} }
} }

View file

@ -33,23 +33,23 @@ public class CrusherRecipe {
} }
public boolean matches(ItemStack stack) { public boolean matches(ItemStack stack) {
return input.apply(stack); return this.input.apply(stack);
} }
public ItemStack getOutputOne() { public ItemStack getOutputOne() {
return outputOne; return this.outputOne;
} }
public ItemStack getOutputTwo() { public ItemStack getOutputTwo() {
return outputTwo; return this.outputTwo;
} }
public int getSecondChance() { public int getSecondChance() {
return outputChance; return this.outputChance;
} }
public Ingredient getInput() { public Ingredient getInput() {
return input; return this.input;
} }
} }

View file

@ -48,22 +48,22 @@ public class EmpowererRecipe {
} }
public boolean matches(ItemStack base, ItemStack stand1, ItemStack stand2, ItemStack stand3, ItemStack stand4) { public boolean matches(ItemStack base, ItemStack stand1, ItemStack stand2, ItemStack stand3, ItemStack stand4) {
if (!input.apply(base)) return false; if (!this.input.apply(base)) return false;
List<Ingredient> matches = new ArrayList<>(); List<Ingredient> matches = new ArrayList<>();
ItemStack[] stacks = { stand1, stand2, stand3, stand4 }; ItemStack[] stacks = { stand1, stand2, stand3, stand4 };
boolean[] unused = { true, true, true, true }; boolean[] unused = { true, true, true, true };
for (ItemStack s : stacks) { for (ItemStack s : stacks) {
if (unused[0] && modifier1.apply(s)) { if (unused[0] && this.modifier1.apply(s)) {
matches.add(modifier1); matches.add(this.modifier1);
unused[0] = false; unused[0] = false;
} else if (unused[1] && modifier2.apply(s)) { } else if (unused[1] && this.modifier2.apply(s)) {
matches.add(modifier2); matches.add(this.modifier2);
unused[1] = false; unused[1] = false;
} else if (unused[2] && modifier3.apply(s)) { } else if (unused[2] && this.modifier3.apply(s)) {
matches.add(modifier3); matches.add(this.modifier3);
unused[2] = false; unused[2] = false;
} else if (unused[3] && modifier4.apply(s)) { } else if (unused[3] && this.modifier4.apply(s)) {
matches.add(modifier4); matches.add(this.modifier4);
unused[3] = false; unused[3] = false;
} }
} }
@ -72,38 +72,38 @@ public class EmpowererRecipe {
} }
public Ingredient getInput() { public Ingredient getInput() {
return input; return this.input;
} }
public ItemStack getOutput() { public ItemStack getOutput() {
return output; return this.output;
} }
public Ingredient getStandOne() { public Ingredient getStandOne() {
return modifier1; return this.modifier1;
} }
public Ingredient getStandTwo() { public Ingredient getStandTwo() {
return modifier2; return this.modifier2;
} }
public Ingredient getStandThree() { public Ingredient getStandThree() {
return modifier3; return this.modifier3;
} }
public Ingredient getStandFour() { public Ingredient getStandFour() {
return modifier4; return this.modifier4;
} }
public int getTime() { public int getTime() {
return time; return this.time;
} }
public int getEnergyPerStand() { public int getEnergyPerStand() {
return energyPerStand; return this.energyPerStand;
} }
public float[] getParticleColors() { public float[] getParticleColors() {
return particleColor; return this.particleColor;
} }
} }

View file

@ -41,19 +41,19 @@ public class LensConversionRecipe {
} }
public Ingredient getInput() { public Ingredient getInput() {
return input; return this.input;
} }
public ItemStack getOutput() { public ItemStack getOutput() {
return output; return this.output;
} }
public int getEnergyUsed() { public int getEnergyUsed() {
return energy; return this.energy;
} }
public Lens getType() { public Lens getType() {
return type; return this.type;
} }
public void transformHook(ItemStack stack, IBlockState state, BlockPos pos, IAtomicReconstructor tile) { public void transformHook(ItemStack stack, IBlockState state, BlockPos pos, IAtomicReconstructor tile) {

View file

@ -6,6 +6,7 @@ import de.ellpeck.actuallyadditions.mod.blocks.render.IHasModel;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper; import de.ellpeck.actuallyadditions.mod.util.FluidStateMapper;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -21,7 +22,7 @@ import java.util.Map;
public class ClientRegistryHandler{ public class ClientRegistryHandler{
public static final Map<ItemStack, ModelResourceLocation> MODEL_LOCATIONS_FOR_REGISTERING = new HashMap<ItemStack, ModelResourceLocation>(); public static final Map<ItemStack, ModelResourceLocation> MODEL_LOCATIONS_FOR_REGISTERING = new HashMap<>();
/** /**
* (Excerpted from Tinkers' Construct with permission, thanks guys!) * (Excerpted from Tinkers' Construct with permission, thanks guys!)
@ -30,7 +31,7 @@ public class ClientRegistryHandler{
Block block = fluid.getBlock(); Block block = fluid.getBlock();
Item item = Item.getItemFromBlock(block); Item item = Item.getItemFromBlock(block);
FluidStateMapper mapper = new FluidStateMapper(fluid); FluidStateMapper mapper = new FluidStateMapper(fluid);
ModelLoader.registerItemVariants(item); ModelBakery.registerItemVariants(item);
ModelLoader.setCustomMeshDefinition(item, mapper); ModelLoader.setCustomMeshDefinition(item, mapper);
ModelLoader.setCustomStateMapper(block, mapper); ModelLoader.setCustomStateMapper(block, mapper);
} }

View file

@ -88,7 +88,7 @@ public class BlockCoffeeMachine extends BlockContainerBase{
@Override @Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
int rotation = MathHelper.floor((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3; int rotation = MathHelper.floor(player.rotationYaw*4.0F/360.0F+0.5D) & 3;
if(rotation == 0){ if(rotation == 0){
world.setBlockState(pos, this.getStateFromMeta(0), 2); world.setBlockState(pos, this.getStateFromMeta(0), 2);

View file

@ -139,7 +139,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay {
} }
} }
tile.markDirty(); tile.markDirty();
world.notifyBlockUpdate(pos, getDefaultState(), getDefaultState(), 3); world.notifyBlockUpdate(pos, this.getDefaultState(), this.getDefaultState(), 3);
} }
} else { } else {
return true; return true;

View file

@ -34,7 +34,6 @@ import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation; import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
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;
@ -105,12 +104,7 @@ public class BlockCrystalCluster extends BlockBase implements IColorProvidingBlo
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IBlockColor getBlockColor(){ public IBlockColor getBlockColor(){
return new IBlockColor(){ return (state, world, pos, tintIndex) -> BlockCrystalCluster.this.crystal.clusterColor;
@Override
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex){
return BlockCrystalCluster.this.crystal.clusterColor;
}
};
} }
@Override @Override
@ -121,12 +115,7 @@ public class BlockCrystalCluster extends BlockBase implements IColorProvidingBlo
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IItemColor getItemColor(){ public IItemColor getItemColor(){
return new IItemColor(){ return (stack, tintIndex) -> BlockCrystalCluster.this.crystal.clusterColor;
@Override
public int colorMultiplier(ItemStack stack, int tintIndex){
return BlockCrystalCluster.this.crystal.clusterColor;
}
};
} }
@Override @Override

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks; package de.ellpeck.actuallyadditions.mod.blocks;
import com.google.common.base.Predicate;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping; import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping;
import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.BlockStateContainer;
@ -34,12 +33,7 @@ import java.util.List;
//Most of this is just copied from BlockHopper, no credit taken. Or clue what it is. //Most of this is just copied from BlockHopper, no credit taken. Or clue what it is.
public class BlockItemViewerHopping extends BlockItemViewer{ public class BlockItemViewerHopping extends BlockItemViewer{
public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate<EnumFacing>(){ public static final PropertyDirection FACING = PropertyDirection.create("facing", facing -> facing != EnumFacing.UP);
@Override
public boolean apply(EnumFacing facing){
return facing != EnumFacing.UP;
}
});
private static final AxisAlignedBB BASE_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.625D, 1.0D); private static final AxisAlignedBB BASE_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.625D, 1.0D);
private static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D); private static final AxisAlignedBB SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D);

View file

@ -76,7 +76,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{
TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos());
if(tile instanceof TileEntityMiner){ if(tile instanceof TileEntityMiner){
TileEntityMiner miner = (TileEntityMiner)tile; TileEntityMiner miner = (TileEntityMiner)tile;
String info = miner.checkY == 0 ? "Done Mining!" : (miner.checkY == -1 ? "Calculating positions..." : "Mining at "+(miner.getPos().getX()+miner.checkX)+", "+miner.checkY+", "+(miner.getPos().getZ()+miner.checkZ)+"."); String info = miner.checkY == 0 ? "Done Mining!" : miner.checkY == -1 ? "Calculating positions..." : "Mining at "+(miner.getPos().getX()+miner.checkX)+", "+miner.checkY+", "+(miner.getPos().getZ()+miner.checkZ)+".";
minecraft.fontRenderer.drawStringWithShadow(info, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-20, StringUtil.DECIMAL_COLOR_WHITE); minecraft.fontRenderer.drawStringWithShadow(info, resolution.getScaledWidth()/2+5, resolution.getScaledHeight()/2-20, StringUtil.DECIMAL_COLOR_WHITE);
} }
} }

View file

@ -54,8 +54,8 @@ public class BlockShockSuppressor extends BlockContainerBase{
if(!suppressor.isRedstonePowered){ if(!suppressor.isRedstonePowered){
BlockPos supPos = suppressor.getPos(); BlockPos supPos = suppressor.getPos();
List<Entity> entitiesToRemove = new ArrayList<Entity>(); List<Entity> entitiesToRemove = new ArrayList<>();
List<BlockPos> posesToRemove = new ArrayList<BlockPos>(); List<BlockPos> posesToRemove = new ArrayList<>();
for(BlockPos pos : affectedBlocks){ for(BlockPos pos : affectedBlocks){
if(pos.distanceSq(supPos) <= rangeSq){ if(pos.distanceSq(supPos) <= rangeSq){

View file

@ -118,7 +118,7 @@ public class BlockSlabs extends BlockBase{
if(state.getBlock() == this.block){ if(state.getBlock() == this.block){
BlockSlabs theBlock = (BlockSlabs)this.block; BlockSlabs theBlock = (BlockSlabs)this.block;
if((facing == EnumFacing.UP && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.BOTTOM) || (facing == EnumFacing.DOWN && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP)){ if(facing == EnumFacing.UP && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.BOTTOM || facing == EnumFacing.DOWN && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP){
IBlockState newState = theBlock.fullBlockState; IBlockState newState = theBlock.fullBlockState;
AxisAlignedBB bound = newState.getCollisionBoundingBox(world, pos); AxisAlignedBB bound = newState.getCollisionBoundingBox(world, pos);
@ -145,7 +145,7 @@ public class BlockSlabs extends BlockBase{
IBlockState state = worldIn.getBlockState(pos); IBlockState state = worldIn.getBlockState(pos);
if(state.getBlock() == this.block){ if(state.getBlock() == this.block){
if((side == EnumFacing.UP && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.BOTTOM) || (side == EnumFacing.DOWN && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP)){ if(side == EnumFacing.UP && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.BOTTOM || side == EnumFacing.DOWN && state.getValue(BlockSlab.HALF) == BlockSlab.EnumBlockHalf.TOP){
return true; return true;
} }
} }

View file

@ -189,14 +189,14 @@ public class BlockTinyTorch extends BlockBase{
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand){ public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand){
if(rand.nextBoolean()){ if(rand.nextBoolean()){
EnumFacing enumfacing = stateIn.getValue(BlockTorch.FACING); EnumFacing enumfacing = stateIn.getValue(BlockTorch.FACING);
double d0 = (double)pos.getX()+0.5D; double d0 = pos.getX()+0.5D;
double d1 = (double)pos.getY()+0.4D; double d1 = pos.getY()+0.4D;
double d2 = (double)pos.getZ()+0.5D; double d2 = pos.getZ()+0.5D;
if(enumfacing.getAxis().isHorizontal()){ if(enumfacing.getAxis().isHorizontal()){
EnumFacing enumfacing1 = enumfacing.getOpposite(); EnumFacing enumfacing1 = enumfacing.getOpposite();
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+0.35D*(double)enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*(double)enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0+0.35D*enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D);
worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+0.35D*(double)enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*(double)enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0+0.35D*enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D);
} }
else{ else{
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D);

View file

@ -117,7 +117,7 @@ public class BlockWallAA extends BlockBase{
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){ public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){
IBlockState state = worldIn.getBlockState(pos); IBlockState state = worldIn.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();
return block != Blocks.BARRIER && (!(block != this && !(block instanceof BlockFenceGate)) || ((state.getMaterial().isOpaque() && state.isFullCube()) && state.getMaterial() != Material.GOURD)); return block != Blocks.BARRIER && (!(block != this && !(block instanceof BlockFenceGate)) || state.getMaterial().isOpaque() && state.isFullCube() && state.getMaterial() != Material.GOURD);
} }

View file

@ -45,6 +45,7 @@ public class BlockBase extends Block implements ItemBlockBase.ICustomRarity, IHa
return true; return true;
} }
@Override
public void registerRendering(){ public void registerRendering(){
ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory");
} }

View file

@ -45,6 +45,7 @@ public class BlockBushBase extends BlockBush implements ItemBlockBase.ICustomRar
return true; return true;
} }
@Override
public void registerRendering(){ public void registerRendering(){
ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory");
} }

View file

@ -74,6 +74,7 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
return true; return true;
} }
@Override
public void registerRendering(){ public void registerRendering(){
ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory");
} }
@ -246,7 +247,7 @@ public abstract class BlockContainerBase extends BlockContainer implements ItemB
base.writeSyncableNBT(data, TileEntityBase.NBTType.SAVE_BLOCK); base.writeSyncableNBT(data, TileEntityBase.NBTType.SAVE_BLOCK);
//Remove unnecessarily saved default values to avoid unstackability //Remove unnecessarily saved default values to avoid unstackability
List<String> keysToRemove = new ArrayList<String>(); List<String> keysToRemove = new ArrayList<>();
for(String key : data.getKeySet()){ for(String key : data.getKeySet()){
NBTBase tag = data.getTag(key); NBTBase tag = data.getTag(key);
//Remove only ints because they are the most common ones //Remove only ints because they are the most common ones

View file

@ -69,6 +69,7 @@ public class BlockPlant extends BlockCrops implements ItemBlockBase.ICustomRarit
return false; return false;
} }
@Override
public void registerRendering(){ public void registerRendering(){
ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory");
} }

View file

@ -52,6 +52,7 @@ public class BlockStair extends BlockStairs implements ItemBlockBase.ICustomRari
return true; return true;
} }
@Override
public void registerRendering(){ public void registerRendering(){
ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory"); ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory");
} }

View file

@ -40,10 +40,10 @@ public enum TheWildPlants implements IStringSerializable {
} }
public EnumRarity getRarity() { public EnumRarity getRarity() {
return rarity; return this.rarity;
} }
public Block getNormalVersion() { public Block getNormalVersion() {
return normal; return this.normal;
} }
} }

View file

@ -35,8 +35,8 @@ public class CompostModel implements IBakedModel {
for (EnumFacing face : EnumFacing.values()) { for (EnumFacing face : EnumFacing.values()) {
builder = ImmutableList.builder(); builder = ImmutableList.builder();
if (!display.isBuiltInRenderer()) { if (!this.display.isBuiltInRenderer()) {
for (BakedQuad quad : display.getQuads(flowerState, face, 0)) { for (BakedQuad quad : this.display.getQuads(flowerState, face, 0)) {
Transformer transformer = new Transformer(transform, quad.getFormat()); Transformer transformer = new Transformer(transform, quad.getFormat());
quad.pipe(transformer); quad.pipe(transformer);
builder.add(transformer.build()); builder.add(transformer.build());
@ -46,29 +46,29 @@ public class CompostModel implements IBakedModel {
faces.put(face, builder.build()); faces.put(face, builder.build());
} }
if (!display.isBuiltInRenderer()) { if (!this.display.isBuiltInRenderer()) {
builder = ImmutableList.builder(); builder = ImmutableList.builder();
for (BakedQuad quad : display.getQuads(flowerState, null, 0)) { for (BakedQuad quad : this.display.getQuads(flowerState, null, 0)) {
Transformer transformer = new Transformer(transform, quad.getFormat()); Transformer transformer = new Transformer(transform, quad.getFormat());
quad.pipe(transformer); quad.pipe(transformer);
builder.add(transformer.build()); builder.add(transformer.build());
} }
builder.addAll(compostBase.getQuads(null, null, 0)); builder.addAll(compostBase.getQuads(null, null, 0));
this.general = builder.build(); this.general = builder.build();
} else general = ImmutableList.of(); } else this.general = ImmutableList.of();
this.faces = Maps.immutableEnumMap(faces); this.faces = Maps.immutableEnumMap(faces);
} }
@Override @Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) { public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
if (side == null) return general; if (side == null) return this.general;
return faces.get(side); return this.faces.get(side);
} }
@Override @Override
public boolean isAmbientOcclusion() { public boolean isAmbientOcclusion() {
return compostBase.isAmbientOcclusion() && display.isAmbientOcclusion(); return compostBase.isAmbientOcclusion() && this.display.isAmbientOcclusion();
} }
@Override @Override

View file

@ -37,7 +37,7 @@ public class RenderBatteryBox extends TileEntitySpecialRenderer<TileEntityBatter
return; return;
} }
ItemStack stack = ((TileEntityBatteryBox)tile).inv.getStackInSlot(0); ItemStack stack = tile.inv.getStackInSlot(0);
if(StackUtil.isValid(stack) && stack.getItem() instanceof ItemBattery){ if(StackUtil.isValid(stack) && stack.getItem() instanceof ItemBattery){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F);
@ -71,7 +71,7 @@ public class RenderBatteryBox extends TileEntitySpecialRenderer<TileEntityBatter
double boop = Minecraft.getSystemTime()/800D; double boop = Minecraft.getSystemTime()/800D;
GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D); GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D);
GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); GlStateManager.rotate((float)(boop*40D%360), 0, 1, 0);
float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F; float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F;
GlStateManager.scale(scale, scale, scale); GlStateManager.scale(scale, scale, scale);

View file

@ -31,14 +31,14 @@ public class RenderDisplayStand extends TileEntitySpecialRenderer<TileEntityDisp
return; return;
} }
ItemStack stack = ((TileEntityDisplayStand)tile).inv.getStackInSlot(0); ItemStack stack = tile.inv.getStackInSlot(0);
if(StackUtil.isValid(stack)){ if(StackUtil.isValid(stack)){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F);
double boop = Minecraft.getSystemTime()/800D; double boop = Minecraft.getSystemTime()/800D;
GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D); GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D);
GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); GlStateManager.rotate((float)(boop*40D%360), 0, 1, 0);
float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F; float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F;
GlStateManager.scale(scale, scale, scale); GlStateManager.scale(scale, scale, scale);

View file

@ -35,14 +35,14 @@ public class RenderEmpowerer extends TileEntitySpecialRenderer<TileEntityEmpower
return; return;
} }
ItemStack stack = ((TileEntityEmpowerer)tile).inv.getStackInSlot(0); ItemStack stack = tile.inv.getStackInSlot(0);
if(StackUtil.isValid(stack)){ if(StackUtil.isValid(stack)){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F); GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F);
double boop = Minecraft.getSystemTime()/800D; double boop = Minecraft.getSystemTime()/800D;
GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D); GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D);
GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); GlStateManager.rotate((float)(boop*40D%360), 0, 1, 0);
float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F; float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F;
GlStateManager.scale(scale, scale, scale); GlStateManager.scale(scale, scale, scale);
@ -56,7 +56,7 @@ public class RenderEmpowerer extends TileEntitySpecialRenderer<TileEntityEmpower
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }
int index = ((TileEntityEmpowerer)tile).recipeForRenderIndex; int index = tile.recipeForRenderIndex;
if(index >= 0 && ActuallyAdditionsAPI.EMPOWERER_RECIPES.size() > index){ if(index >= 0 && ActuallyAdditionsAPI.EMPOWERER_RECIPES.size() > index){
EmpowererRecipe recipe = ActuallyAdditionsAPI.EMPOWERER_RECIPES.get(index); EmpowererRecipe recipe = ActuallyAdditionsAPI.EMPOWERER_RECIPES.get(index);
if(recipe != null){ if(recipe != null){

View file

@ -43,7 +43,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
@Override @Override
public void render(TileEntityLaserRelay tile, double x, double y, double z, float par5, int par6, float f){ public void render(TileEntityLaserRelay tile, double x, double y, double z, float par5, int par6, float f){
if(tile instanceof TileEntityLaserRelay){ if(tile instanceof TileEntityLaserRelay){
TileEntityLaserRelay relay = (TileEntityLaserRelay)tile; TileEntityLaserRelay relay = tile;
boolean hasInvis = false; boolean hasInvis = false;
EntityPlayer player = Minecraft.getMinecraft().player; EntityPlayer player = Minecraft.getMinecraft().player;
@ -56,7 +56,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
} }
ItemStack hand = player.getHeldItemMainhand(); ItemStack hand = player.getHeldItemMainhand();
if(hasGoggles || (StackUtil.isValid(hand) && (hand.getItem() == ConfigValues.itemCompassConfigurator || hand.getItem() instanceof ItemLaserWrench)) || "themattabase".equals(player.getName())){ if(hasGoggles || StackUtil.isValid(hand) && (hand.getItem() == ConfigValues.itemCompassConfigurator || hand.getItem() instanceof ItemLaserWrench) || "themattabase".equals(player.getName())){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
float yTrans = tile.getBlockMetadata() == 0 ? 0.2F : 0.8F; float yTrans = tile.getBlockMetadata() == 0 ? 0.2F : 0.8F;
@ -64,7 +64,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
GlStateManager.scale(0.2F, 0.2F, 0.2F); GlStateManager.scale(0.2F, 0.2F, 0.2F);
double boop = Minecraft.getSystemTime()/800D; double boop = Minecraft.getSystemTime()/800D;
GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0); GlStateManager.rotate((float)(boop*40D%360), 0, 1, 0);
AssetUtil.renderItemInWorld(upgrade); AssetUtil.renderItemInWorld(upgrade);
@ -85,7 +85,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
boolean otherInvis = StackUtil.isValid(secondUpgrade) && secondUpgrade.getItem() == InitItems.itemLaserUpgradeInvisibility; boolean otherInvis = StackUtil.isValid(secondUpgrade) && secondUpgrade.getItem() == InitItems.itemLaserUpgradeInvisibility;
if(hasGoggles || !hasInvis || !otherInvis){ if(hasGoggles || !hasInvis || !otherInvis){
float[] color = hasInvis && otherInvis ? COLOR_INFRARED : (relay.type == LaserType.ITEM ? COLOR_ITEM : (relay.type == LaserType.FLUID ? COLOR_FLUIDS : COLOR)); float[] color = hasInvis && otherInvis ? COLOR_INFRARED : relay.type == LaserType.ITEM ? COLOR_ITEM : relay.type == LaserType.FLUID ? COLOR_FLUIDS : COLOR;
AssetUtil.renderLaser(first.getX()+0.5, first.getY()+0.5, first.getZ()+0.5, second.getX()+0.5, second.getY()+0.5, second.getZ()+0.5, 120, hasInvis && otherInvis ? 0.1F : 0.35F, 0.05, color); AssetUtil.renderLaser(first.getX()+0.5, first.getY()+0.5, first.getZ()+0.5, second.getX()+0.5, second.getY()+0.5, second.getZ()+0.5, 120, hasInvis && otherInvis ? 0.1F : 0.35F, 0.05, color);
} }

View file

@ -27,10 +27,9 @@ public class RenderReconstructorLens extends TileEntitySpecialRenderer<TileEntit
@Override @Override
public void render(TileEntityAtomicReconstructor tile, double x, double y, double z, float par5, int par6, float f){ public void render(TileEntityAtomicReconstructor tile, double x, double y, double z, float par5, int par6, float f){
if(!(tile instanceof TileEntityAtomicReconstructor)){ if(tile == null) return;
return;
} ItemStack stack = tile.inv.getStackInSlot(0);
ItemStack stack = ((TileEntityAtomicReconstructor)tile).inv.getStackInSlot(0);
if(StackUtil.isValid(stack) && stack.getItem() instanceof ILensItem){ if(StackUtil.isValid(stack) && stack.getItem() instanceof ILensItem){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();

View file

@ -29,18 +29,18 @@ public class Transformer extends VertexTransformer {
@Override @Override
public void put(int element, float... data) { public void put(int element, float... data) {
VertexFormatElement.EnumUsage usage = parent.getVertexFormat().getElement(element).getUsage(); VertexFormatElement.EnumUsage usage = this.parent.getVertexFormat().getElement(element).getUsage();
// transform normals and position // transform normals and position
if (usage == VertexFormatElement.EnumUsage.POSITION && data.length >= 3) { if (usage == VertexFormatElement.EnumUsage.POSITION && data.length >= 3) {
Vector4f vec = new Vector4f(data); Vector4f vec = new Vector4f(data);
vec.setW(1.0f); vec.setW(1.0f);
transformation.transform(vec); this.transformation.transform(vec);
data = new float[4]; data = new float[4];
vec.get(data); vec.get(data);
} else if (usage == VertexFormatElement.EnumUsage.NORMAL && data.length >= 3) { } else if (usage == VertexFormatElement.EnumUsage.NORMAL && data.length >= 3) {
Vector3f vec = new Vector3f(data); Vector3f vec = new Vector3f(data);
normalTransformation.transform(vec); this.normalTransformation.transform(vec);
vec.normalize(); vec.normalize();
data = new float[4]; data = new float[4];
vec.get(data); vec.get(data);
@ -49,6 +49,6 @@ public class Transformer extends VertexTransformer {
} }
public UnpackedBakedQuad build() { public UnpackedBakedQuad build() {
return ((UnpackedBakedQuad.Builder) parent).build(); return ((UnpackedBakedQuad.Builder) this.parent).build();
} }
} }

View file

@ -13,7 +13,6 @@ package de.ellpeck.actuallyadditions.mod.booklet;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
@ -127,12 +126,12 @@ public final class InitBooklet{
for(IBookletPage page : chapter.getAllPages()){ for(IBookletPage page : chapter.getAllPages()){
pageCount++; pageCount++;
List<ItemStack> items = new ArrayList<ItemStack>(); List<ItemStack> items = new ArrayList<>();
page.getItemStacksForPage(items); page.getItemStacksForPage(items);
List<FluidStack> fluids = new ArrayList<FluidStack>(); List<FluidStack> fluids = new ArrayList<>();
page.getFluidStacksForPage(fluids); page.getFluidStacksForPage(fluids);
if((items != null && !items.isEmpty()) || (fluids != null && !fluids.isEmpty())){ if(items != null && !items.isEmpty() || fluids != null && !fluids.isEmpty()){
if(!ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA.contains(page)){ if(!ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA.contains(page)){
ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA.add(page); ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA.add(page);
infoCount++; infoCount++;
@ -143,29 +142,20 @@ public final class InitBooklet{
} }
} }
Collections.sort(ActuallyAdditionsAPI.BOOKLET_ENTRIES, new Comparator<IBookletEntry>(){ Collections.sort(ActuallyAdditionsAPI.BOOKLET_ENTRIES, (entry1, entry2) -> {
@Override
public int compare(IBookletEntry entry1, IBookletEntry entry2){
Integer prio1 = entry1.getSortingPriority(); Integer prio1 = entry1.getSortingPriority();
Integer prio2 = entry2.getSortingPriority(); Integer prio2 = entry2.getSortingPriority();
return prio2.compareTo(prio1); return prio2.compareTo(prio1);
}
}); });
Collections.sort(ActuallyAdditionsAPI.ALL_CHAPTERS, new Comparator<IBookletChapter>(){ Collections.sort(ActuallyAdditionsAPI.ALL_CHAPTERS, (chapter1, chapter2) -> {
@Override
public int compare(IBookletChapter chapter1, IBookletChapter chapter2){
Integer prio1 = chapter1.getSortingPriority(); Integer prio1 = chapter1.getSortingPriority();
Integer prio2 = chapter2.getSortingPriority(); Integer prio2 = chapter2.getSortingPriority();
return prio2.compareTo(prio1); return prio2.compareTo(prio1);
}
}); });
Collections.sort(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, new Comparator<IBookletPage>(){ Collections.sort(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, (page1, page2) -> {
@Override
public int compare(IBookletPage page1, IBookletPage page2){
Integer prio1 = page1.getSortingPriority(); Integer prio1 = page1.getSortingPriority();
Integer prio2 = page2.getSortingPriority(); Integer prio2 = page2.getSortingPriority();
return prio2.compareTo(prio1); return prio2.compareTo(prio1);
}
}); });
ActuallyAdditions.LOGGER.info("Registered a total of "+chapCount+" booklet chapters, where "+infoCount+" out of "+pageCount+" booklet pages contain information about items or fluids!"); ActuallyAdditions.LOGGER.info("Registered a total of "+chapCount+" booklet chapters, where "+infoCount+" out of "+pageCount+" booklet pages contain information about items or fluids!");
@ -176,7 +166,7 @@ public final class InitBooklet{
chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText()); chaptersIntroduction[0] = new BookletChapter("bookTutorial", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook).setNoText());
chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant(); chaptersIntroduction[1] = new BookletChapter("videoGuide", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.YOUTUBE_ICON.ordinal()), new PageLinkButton(1, "https://www.youtube.com/watch?v=fhjz0Ew56pM"), new PageLinkButton(2, "https://www.youtube.com/playlist?list=PLJeFZ64pT89MrTRZYzD_rtHFajPVlt6cF")).setImportant();
new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3)); new BookletChapter("intro", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemBooklet), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3));
ArrayList<BookletPage> crystalPages = new ArrayList<BookletPage>(); ArrayList<BookletPage> crystalPages = new ArrayList<>();
crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "page_atomic_reconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard())); crystalPages.addAll(Arrays.asList(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityAtomicReconstructor.ENERGY_USE), new PageTextOnly(2), new PageTextOnly(3), new PagePicture(4, "page_atomic_reconstructor", 0).setNoText(), new PageTextOnly(5), new PageCrafting(6, BlockCrafting.recipeAtomicReconstructor).setWildcard()));
for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){ for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){
crystalPages.add(new PageReconstructor(7+i, LensRecipeHandler.MAIN_PAGE_RECIPES.get(i)).setNoText()); crystalPages.add(new PageReconstructor(7+i, LensRecipeHandler.MAIN_PAGE_RECIPES.get(i)).setNoText());
@ -186,7 +176,7 @@ public final class InitBooklet{
chaptersIntroduction[2] = new BookletChapter("engineerHouse", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.EMERALD), new PageTextOnly(1), new PagePicture(2, "page_engineer_house", 145)); chaptersIntroduction[2] = new BookletChapter("engineerHouse", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.EMERALD), new PageTextOnly(1), new PagePicture(2, "page_engineer_house", 145));
chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial(); chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial();
chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityCoalGenerator.PRODUCE), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText()); chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityCoalGenerator.PRODUCE), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText());
ArrayList<BookletPage> empowererPages = new ArrayList<BookletPage>(); ArrayList<BookletPage> empowererPages = new ArrayList<>();
empowererPages.addAll(Arrays.asList(new PageTextOnly(1), new PagePicture(2, "page_empowerer", 137), new PageCrafting(3, BlockCrafting.recipeEmpowerer), new PageCrafting(4, BlockCrafting.recipeDisplayStand))); empowererPages.addAll(Arrays.asList(new PageTextOnly(1), new PagePicture(2, "page_empowerer", 137), new PageCrafting(3, BlockCrafting.recipeEmpowerer), new PageCrafting(4, BlockCrafting.recipeDisplayStand)));
for(int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++){ for(int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++){
empowererPages.add(new PageEmpowerer(7+i, EmpowererHandler.MAIN_PAGE_RECIPES.get(i)).setNoText()); empowererPages.add(new PageEmpowerer(7+i, EmpowererHandler.MAIN_PAGE_RECIPES.get(i)).setNoText());
@ -206,7 +196,7 @@ public final class InitBooklet{
chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("<lowest>", AAWorldGen.QUARTZ_MIN).addTextReplacement("<highest>", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("<lowest>", AAWorldGen.QUARTZ_MIN).addTextReplacement("<highest>", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText());
new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setWildcard()).setSpecial(); new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setWildcard()).setSpecial();
new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText()); new BookletChapter("coalStuff", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText());
ArrayList<BookletPage> lampPages = new ArrayList<BookletPage>(); ArrayList<BookletPage> lampPages = new ArrayList<>();
lampPages.add(new PageTextOnly(lampPages.size()+1)); lampPages.add(new PageTextOnly(lampPages.size()+1));
lampPages.add(new PageTextOnly(lampPages.size()+1)); lampPages.add(new PageTextOnly(lampPages.size()+1));
lampPages.add(new PageCrafting(lampPages.size()+1, BlockCrafting.recipePowerer).setWildcard().setNoText()); lampPages.add(new PageCrafting(lampPages.size()+1, BlockCrafting.recipePowerer).setWildcard().setNoText());
@ -298,7 +288,7 @@ public final class InitBooklet{
new BookletChapter("foods", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), new PageCrafting(1, FoodCrafting.recipeBacon).setNoText(), new PageFurnace(2, new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal())).setNoText(), new PageCrafting(3, FoodCrafting.recipeHamburger).setNoText(), new PageCrafting(4, FoodCrafting.recipeBigCookie).setNoText(), new PageCrafting(5, FoodCrafting.recipeSubSandwich).setNoText(), new PageCrafting(6, FoodCrafting.recipeFrenchFry).setNoText(), new PageCrafting(7, FoodCrafting.recipeFrenchFries).setNoText(), new PageCrafting(8, FoodCrafting.recipeFishNChips).setNoText(), new PageCrafting(9, FoodCrafting.recipeCheese).setNoText(), new PageCrafting(10, FoodCrafting.recipePumpkinStew).setNoText(), new PageCrafting(11, FoodCrafting.recipeCarrotJuice).setNoText(), new PageCrafting(12, FoodCrafting.recipeSpaghetti).setNoText(), new PageCrafting(13, FoodCrafting.recipeNoodle).setNoText(), new PageCrafting(14, FoodCrafting.recipeChocolate).setNoText(), new PageCrafting(15, FoodCrafting.recipeChocolateCake).setNoText(), new PageCrafting(16, FoodCrafting.recipeToast).setNoText(), new PageFurnace(17, new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal())).setNoText(), new PageCrafting(18, FoodCrafting.recipeChocolateToast).setNoText(), new PageCrafting(1, FoodCrafting.recipePizza).setNoText()); new BookletChapter("foods", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), new PageCrafting(1, FoodCrafting.recipeBacon).setNoText(), new PageFurnace(2, new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE_BREAD.ordinal())).setNoText(), new PageCrafting(3, FoodCrafting.recipeHamburger).setNoText(), new PageCrafting(4, FoodCrafting.recipeBigCookie).setNoText(), new PageCrafting(5, FoodCrafting.recipeSubSandwich).setNoText(), new PageCrafting(6, FoodCrafting.recipeFrenchFry).setNoText(), new PageCrafting(7, FoodCrafting.recipeFrenchFries).setNoText(), new PageCrafting(8, FoodCrafting.recipeFishNChips).setNoText(), new PageCrafting(9, FoodCrafting.recipeCheese).setNoText(), new PageCrafting(10, FoodCrafting.recipePumpkinStew).setNoText(), new PageCrafting(11, FoodCrafting.recipeCarrotJuice).setNoText(), new PageCrafting(12, FoodCrafting.recipeSpaghetti).setNoText(), new PageCrafting(13, FoodCrafting.recipeNoodle).setNoText(), new PageCrafting(14, FoodCrafting.recipeChocolate).setNoText(), new PageCrafting(15, FoodCrafting.recipeChocolateCake).setNoText(), new PageCrafting(16, FoodCrafting.recipeToast).setNoText(), new PageFurnace(17, new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal())).setNoText(), new PageCrafting(18, FoodCrafting.recipeChocolateToast).setNoText(), new PageCrafting(1, FoodCrafting.recipePizza).setNoText());
new BookletChapter("leafBlower", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemLeafBlowerAdvanced), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLeafBlower).setNoText(), new PageCrafting(3, ItemCrafting.recipeLeafBlowerAdvanced).setNoText()).setImportant(); new BookletChapter("leafBlower", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemLeafBlowerAdvanced), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLeafBlower).setNoText(), new PageCrafting(3, ItemCrafting.recipeLeafBlowerAdvanced).setNoText()).setImportant();
new BookletChapter("playerProbe", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPlayerProbe), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipePlayerProbe).setNoText()).setSpecial(); new BookletChapter("playerProbe", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemPlayerProbe), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipePlayerProbe).setNoText()).setSpecial();
ArrayList<BookletPage> aiotPages = new ArrayList<BookletPage>(); ArrayList<BookletPage> aiotPages = new ArrayList<>();
aiotPages.add(new PageTextOnly(aiotPages.size()+1)); aiotPages.add(new PageTextOnly(aiotPages.size()+1));
for(IRecipe recipe : ToolCrafting.RECIPES_PAXELS){ for(IRecipe recipe : ToolCrafting.RECIPES_PAXELS){
aiotPages.add(new PageCrafting(aiotPages.size()+1, recipe).setWildcard().setNoText()); aiotPages.add(new PageCrafting(aiotPages.size()+1, recipe).setWildcard().setNoText());
@ -307,7 +297,7 @@ public final class InitBooklet{
new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "page_jam_house", 150), new PageTextOnly(3)); new BookletChapter("jams", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemJams), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemJams, 1, Util.WILDCARD)), new PagePicture(2, "page_jam_house", 150), new PageTextOnly(3));
ArrayList<BookletPage> potionRingPages = new ArrayList<BookletPage>(); ArrayList<BookletPage> potionRingPages = new ArrayList<>();
potionRingPages.add(new PageTextOnly(potionRingPages.size()+1)); potionRingPages.add(new PageTextOnly(potionRingPages.size()+1));
for(IRecipe recipe : ItemCrafting.RECIPES_POTION_RINGS){ for(IRecipe recipe : ItemCrafting.RECIPES_POTION_RINGS){
potionRingPages.add(new PageCrafting(potionRingPages.size()+1, recipe).setNoText()); potionRingPages.add(new PageCrafting(potionRingPages.size()+1, recipe).setNoText());

View file

@ -91,7 +91,7 @@ public class BookmarkButton extends GuiButton{
public void drawHover(int mouseX, int mouseY){ public void drawHover(int mouseX, int mouseY){
if(this.isMouseOver()){ if(this.isMouseOver()){
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
if(this.assignedPage != null){ if(this.assignedPage != null){
IBookletChapter chapter = this.assignedPage.getChapter(); IBookletChapter chapter = this.assignedPage.getChapter();

View file

@ -30,7 +30,7 @@ public class BookletChapterCoffee extends BookletChapter{
} }
private static IBookletPage[] getPages(IBookletPage... pages){ private static IBookletPage[] getPages(IBookletPage... pages){
List<IBookletPage> allPages = new ArrayList<IBookletPage>(); List<IBookletPage> allPages = new ArrayList<>();
allPages.addAll(Arrays.asList(pages)); allPages.addAll(Arrays.asList(pages));
for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS){ for(CoffeeIngredient ingredient : ActuallyAdditionsAPI.COFFEE_MACHINE_INGREDIENTS){

View file

@ -28,7 +28,7 @@ public class BookletChapterCrusher extends BookletChapter{
} }
private static IBookletPage[] getPages(IBookletPage... pages){ private static IBookletPage[] getPages(IBookletPage... pages){
List<IBookletPage> allPages = new ArrayList<IBookletPage>(); List<IBookletPage> allPages = new ArrayList<>();
allPages.addAll(Arrays.asList(pages)); allPages.addAll(Arrays.asList(pages));
for(CrusherRecipe recipe : CrusherCrafting.MISC_RECIPES){ for(CrusherRecipe recipe : CrusherCrafting.MISC_RECIPES){

View file

@ -33,7 +33,7 @@ public class BookletEntry implements IBookletEntry{
private final String identifier; private final String identifier;
private final int priority; private final int priority;
private final List<IBookletChapter> chapters = new ArrayList<IBookletChapter>(); private final List<IBookletChapter> chapters = new ArrayList<>();
private TextFormatting color; private TextFormatting color;
public BookletEntry(String identifier){ public BookletEntry(String identifier){
@ -52,7 +52,7 @@ public class BookletEntry implements IBookletEntry{
private static boolean fitsFilter(IBookletPage page, String searchBarText){ private static boolean fitsFilter(IBookletPage page, String searchBarText){
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
List<ItemStack> items = new ArrayList<ItemStack>(); List<ItemStack> items = new ArrayList<>();
page.getItemStacksForPage(items); page.getItemStacksForPage(items);
if(!items.isEmpty()){ if(!items.isEmpty()){
for(ItemStack stack : items){ for(ItemStack stack : items){
@ -67,7 +67,7 @@ public class BookletEntry implements IBookletEntry{
} }
} }
List<FluidStack> fluids = new ArrayList<FluidStack>(); List<FluidStack> fluids = new ArrayList<>();
page.getFluidStacksForPage(fluids); page.getFluidStacksForPage(fluids);
if(!fluids.isEmpty()){ if(!fluids.isEmpty()){
for(FluidStack stack : fluids){ for(FluidStack stack : fluids){
@ -116,7 +116,7 @@ public class BookletEntry implements IBookletEntry{
if(searchBarText != null && !searchBarText.isEmpty()){ if(searchBarText != null && !searchBarText.isEmpty()){
String search = searchBarText.toLowerCase(Locale.ROOT); String search = searchBarText.toLowerCase(Locale.ROOT);
List<IBookletChapter> fittingChapters = new ArrayList<IBookletChapter>(); List<IBookletChapter> fittingChapters = new ArrayList<>();
for(IBookletChapter chapter : this.getAllChapters()){ for(IBookletChapter chapter : this.getAllChapters()){
if(chapter.getLocalizedName().toLowerCase(Locale.ROOT).contains(search)){ if(chapter.getLocalizedName().toLowerCase(Locale.ROOT).contains(search)){
fittingChapters.add(chapter); fittingChapters.add(chapter);

View file

@ -81,7 +81,7 @@ public abstract class GuiBooklet extends GuiBookletBase{
} }
} }
else{ else{
return (float)conf/100F; return conf/100F;
} }
} }
@ -330,7 +330,7 @@ public abstract class GuiBooklet extends GuiBookletBase{
@Override @Override
protected void keyTyped(char typedChar, int key) throws IOException{ protected void keyTyped(char typedChar, int key) throws IOException{
if(key == Keyboard.KEY_ESCAPE || (key == this.mc.gameSettings.keyBindInventory.getKeyCode() && (!this.hasSearchBar() || !this.searchField.isFocused()))){ if(key == Keyboard.KEY_ESCAPE || key == this.mc.gameSettings.keyBindInventory.getKeyCode() && (!this.hasSearchBar() || !this.searchField.isFocused())){
this.mc.displayGuiScreen(this.previousScreen); this.mc.displayGuiScreen(this.previousScreen);
} }
else if(this.hasSearchBar() & this.searchField.isFocused()){ else if(this.hasSearchBar() & this.searchField.isFocused()){

View file

@ -87,7 +87,7 @@ public class GuiEntry extends GuiBooklet{
} }
} }
int idOffset = this.entryPage*(BUTTONS_PER_PAGE*2); int idOffset = this.entryPage*BUTTONS_PER_PAGE*2;
for(int x = 0; x < 2; x++){ for(int x = 0; x < 2; x++){
for(int y = 0; y < BUTTONS_PER_PAGE; y++){ for(int y = 0; y < BUTTONS_PER_PAGE; y++){
int id = y+x*BUTTONS_PER_PAGE; int id = y+x*BUTTONS_PER_PAGE;
@ -105,7 +105,7 @@ public class GuiEntry extends GuiBooklet{
@Override @Override
protected void actionPerformed(GuiButton button) throws IOException{ protected void actionPerformed(GuiButton button) throws IOException{
if(button instanceof EntryButton){ if(button instanceof EntryButton){
int actualId = button.id+this.entryPage*(BUTTONS_PER_PAGE*2); int actualId = button.id+this.entryPage*BUTTONS_PER_PAGE*2;
if(this.chapters.size() > actualId){ if(this.chapters.size() > actualId){
IBookletChapter chapter = this.chapters.get(actualId); IBookletChapter chapter = this.chapters.get(actualId);

View file

@ -103,7 +103,7 @@ public class GuiMainPage extends GuiBooklet{
} }
private static List<IBookletEntry> getDisplayedEntries(){ private static List<IBookletEntry> getDisplayedEntries(){
List<IBookletEntry> displayed = new ArrayList<IBookletEntry>(); List<IBookletEntry> displayed = new ArrayList<>();
for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){ for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){
if(entry.visibleOnFrontPage()){ if(entry.visibleOnFrontPage()){
@ -196,13 +196,13 @@ public class GuiMainPage extends GuiBooklet{
} }
} }
List<String> configText = new ArrayList<String>(); List<String> configText = new ArrayList<>();
configText.add(TextFormatting.GOLD+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".configButton.name")); configText.add(TextFormatting.GOLD+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".configButton.name"));
configText.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet."+ActuallyAdditions.MODID+".configButton.desc", ActuallyAdditions.NAME).replaceAll("\\\\n", "\n"), 200)); configText.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet."+ActuallyAdditions.MODID+".configButton.desc", ActuallyAdditions.NAME).replaceAll("\\\\n", "\n"), 200));
this.configButton = new TexturedButton(RES_LOC_GADGETS, -388, this.guiLeft+16, this.guiTop+this.ySize-30, 188, 14, 16, 16, configText); this.configButton = new TexturedButton(RES_LOC_GADGETS, -388, this.guiLeft+16, this.guiTop+this.ySize-30, 188, 14, 16, 16, configText);
this.buttonList.add(this.configButton); this.buttonList.add(this.configButton);
List<String> achievementText = new ArrayList<String>(); List<String> achievementText = new ArrayList<>();
achievementText.add(TextFormatting.GOLD+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".achievementButton.name")); achievementText.add(TextFormatting.GOLD+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".achievementButton.name"));
achievementText.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet."+ActuallyAdditions.MODID+".achievementButton.desc", ActuallyAdditions.NAME), 200)); achievementText.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("booklet."+ActuallyAdditions.MODID+".achievementButton.desc", ActuallyAdditions.NAME), 200));
//this.achievementButton = new TexturedButton(RES_LOC_GADGETS, -389, this.guiLeft+36, this.guiTop+this.ySize-30, 204, 14, 16, 16, achievementText); //this.achievementButton = new TexturedButton(RES_LOC_GADGETS, -389, this.guiLeft+36, this.guiTop+this.ySize-30, 204, 14, 16, 16, achievementText);
@ -293,7 +293,7 @@ public class GuiMainPage extends GuiBooklet{
int quoteSize = this.quote.size(); int quoteSize = this.quote.size();
for(int i = 0; i < quoteSize; i++){ for(int i = 0; i < quoteSize; i++){
this.renderScaledAsciiString(TextFormatting.ITALIC+this.quote.get(i), this.guiLeft+25, this.guiTop+90+(i*8), 0, false, this.getMediumFontSize()); this.renderScaledAsciiString(TextFormatting.ITALIC+this.quote.get(i), this.guiLeft+25, this.guiTop+90+i*8, 0, false, this.getMediumFontSize());
} }
this.renderScaledAsciiString("- "+this.quoteGuy, this.guiLeft+60, this.guiTop+93+quoteSize*8, 0, false, this.getLargeFontSize()); this.renderScaledAsciiString("- "+this.quoteGuy, this.guiLeft+60, this.guiTop+93+quoteSize*8, 0, false, this.getLargeFontSize());
} }

View file

@ -37,7 +37,7 @@ import java.util.List;
public class GuiPage extends GuiBooklet{ public class GuiPage extends GuiBooklet{
public final IBookletPage[] pages = new IBookletPage[2]; public final IBookletPage[] pages = new IBookletPage[2];
private final List<ItemDisplay> itemDisplays = new ArrayList<ItemDisplay>(); private final List<ItemDisplay> itemDisplays = new ArrayList<>();
private int pageTimer; private int pageTimer;
private GuiButton buttonViewOnline; private GuiButton buttonViewOnline;
@ -132,7 +132,7 @@ public class GuiPage extends GuiBooklet{
} }
private List<String> getWebLinks(){ private List<String> getWebLinks(){
List<String> links = new ArrayList<String>(); List<String> links = new ArrayList<>();
for(IBookletPage page : this.pages){ for(IBookletPage page : this.pages){
if(page != null){ if(page != null){

View file

@ -28,11 +28,11 @@ import java.util.*;
public class BookletPage implements IBookletPage{ public class BookletPage implements IBookletPage{
protected final HashMap<String, String> textReplacements = new HashMap<String, String>(); protected final HashMap<String, String> textReplacements = new HashMap<>();
protected final int localizationKey; protected final int localizationKey;
private final int priority; private final int priority;
private final List<ItemStack> itemsForPage = new ArrayList<ItemStack>(); private final List<ItemStack> itemsForPage = new ArrayList<>();
private final List<FluidStack> fluidsForPage = new ArrayList<FluidStack>(); private final List<FluidStack> fluidsForPage = new ArrayList<>();
protected IBookletChapter chapter; protected IBookletChapter chapter;
protected boolean hasNoText; protected boolean hasNoText;

View file

@ -53,7 +53,7 @@ public class PageCoffeeMachine extends BookletPage{
PageTextOnly.renderTextToPage(gui, this, startX+6, startY+90); PageTextOnly.renderTextToPage(gui, this, startX+6, startY+90);
if(counter++ % 50 == 0) gui.addOrModifyItemRenderer(stacks[rotate++ % stacks.length], startX+5+82, startY+10+1, 1F, true); if(this.counter++ % 50 == 0) gui.addOrModifyItemRenderer(this.stacks[this.rotate++ % this.stacks.length], startX+5+82, startY+10+1, 1F, true);
} }
@Override @Override
@ -61,7 +61,7 @@ public class PageCoffeeMachine extends BookletPage{
public void initGui(GuiBookletBase gui, int startX, int startY){ public void initGui(GuiBookletBase gui, int startX, int startY){
super.initGui(gui, startX, startY); super.initGui(gui, startX, startY);
gui.addOrModifyItemRenderer(stacks[0], startX+5+82, startY+10+1, 1F, true); gui.addOrModifyItemRenderer(this.stacks[0], startX+5+82, startY+10+1, 1F, true);
gui.addOrModifyItemRenderer(this.outcome, startX+5+36, startY+10+42, 1F, false); gui.addOrModifyItemRenderer(this.outcome, startX+5+36, startY+10+42, 1F, false);
gui.addOrModifyItemRenderer(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), startX+5+37, startY+10+1, 1F, true); gui.addOrModifyItemRenderer(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), startX+5+37, startY+10+1, 1F, true);

View file

@ -33,7 +33,7 @@ public class PageCrusherRecipe extends BookletPage{
public PageCrusherRecipe(int localizationKey, CrusherRecipe recipe){ public PageCrusherRecipe(int localizationKey, CrusherRecipe recipe){
super(localizationKey); super(localizationKey);
this.recipe = recipe; this.recipe = recipe;
stacks = recipe.getInput().getMatchingStacks(); this.stacks = recipe.getInput().getMatchingStacks();
} }
@Override @Override
@ -48,7 +48,7 @@ public class PageCrusherRecipe extends BookletPage{
PageTextOnly.renderTextToPage(gui, this, startX+6, startY+100); PageTextOnly.renderTextToPage(gui, this, startX+6, startY+100);
if(counter++ % 50 == 0) gui.addOrModifyItemRenderer(stacks[rotate++ % stacks.length], startX+38+18, startY+6+1, 1F, true); if(this.counter++ % 50 == 0) gui.addOrModifyItemRenderer(this.stacks[this.rotate++ % this.stacks.length], startX+38+18, startY+6+1, 1F, true);
} }
@Override @Override
@ -57,7 +57,7 @@ public class PageCrusherRecipe extends BookletPage{
super.initGui(gui, startX, startY); super.initGui(gui, startX, startY);
if(this.recipe != null){ if(this.recipe != null){
gui.addOrModifyItemRenderer(stacks[rotate++ % stacks.length], startX+38+18, startY+6+1, 1F, true); gui.addOrModifyItemRenderer(this.stacks[this.rotate++ % this.stacks.length], startX+38+18, startY+6+1, 1F, true);
gui.addOrModifyItemRenderer(this.recipe.getOutputOne(), startX+38+4, startY+6+53, 1F, false); gui.addOrModifyItemRenderer(this.recipe.getOutputOne(), startX+38+4, startY+6+53, 1F, false);
if(StackUtil.isValid(this.recipe.getOutputTwo())){ if(StackUtil.isValid(this.recipe.getOutputTwo())){

View file

@ -56,7 +56,7 @@ public class PageEmpowerer extends BookletPage{
gui.renderScaledAsciiString("("+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".empowererRecipe")+")", startX+6, startY+85, 0, false, gui.getMediumFontSize()); gui.renderScaledAsciiString("("+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".empowererRecipe")+")", startX+6, startY+85, 0, false, gui.getMediumFontSize());
PageTextOnly.renderTextToPage(gui, this, startX+6, startY+100); PageTextOnly.renderTextToPage(gui, this, startX+6, startY+100);
if(recipe != null) updateInputs(gui, startX, startY); if(this.recipe != null) this.updateInputs(gui, startX, startY);
} }
@Override @Override
@ -65,25 +65,25 @@ public class PageEmpowerer extends BookletPage{
super.initGui(gui, startX, startY); super.initGui(gui, startX, startY);
if(this.recipe != null){ if(this.recipe != null){
gui.addOrModifyItemRenderer(stand1[0], startX+5+26, startY+10+1, 1F, true); gui.addOrModifyItemRenderer(this.stand1[0], startX+5+26, startY+10+1, 1F, true);
gui.addOrModifyItemRenderer(stand2[0], startX+5+1, startY+10+26, 1F, true); gui.addOrModifyItemRenderer(this.stand2[0], startX+5+1, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(stand3[0], startX+5+51, startY+10+26, 1F, true); gui.addOrModifyItemRenderer(this.stand3[0], startX+5+51, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(stand4[0], startX+5+26, startY+10+51, 1F, true); gui.addOrModifyItemRenderer(this.stand4[0], startX+5+26, startY+10+51, 1F, true);
gui.addOrModifyItemRenderer(inputs[0], startX+5+26, startY+10+26, 1F, true); gui.addOrModifyItemRenderer(this.inputs[0], startX+5+26, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(this.recipe.getOutput(), startX+5+96, startY+10+26, 1F, false); gui.addOrModifyItemRenderer(this.recipe.getOutput(), startX+5+96, startY+10+26, 1F, false);
} }
} }
private void updateInputs(GuiBookletBase gui, int startX, int startY) { private void updateInputs(GuiBookletBase gui, int startX, int startY) {
if(counter++ % 50 == 0) { if(this.counter++ % 50 == 0) {
rotate++; this.rotate++;
gui.addOrModifyItemRenderer(stand1[rotate % stand1.length], startX+5+26, startY+10+1, 1F, true); gui.addOrModifyItemRenderer(this.stand1[this.rotate % this.stand1.length], startX+5+26, startY+10+1, 1F, true);
gui.addOrModifyItemRenderer(stand2[rotate % stand2.length], startX+5+1, startY+10+26, 1F, true); gui.addOrModifyItemRenderer(this.stand2[this.rotate % this.stand2.length], startX+5+1, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(stand3[rotate % stand3.length], startX+5+51, startY+10+26, 1F, true); gui.addOrModifyItemRenderer(this.stand3[this.rotate % this.stand3.length], startX+5+51, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(stand4[rotate % stand4.length], startX+5+26, startY+10+51, 1F, true); gui.addOrModifyItemRenderer(this.stand4[this.rotate % this.stand4.length], startX+5+26, startY+10+51, 1F, true);
gui.addOrModifyItemRenderer(inputs[rotate % inputs.length], startX+5+26, startY+10+26, 1F, true); gui.addOrModifyItemRenderer(this.inputs[this.rotate % this.inputs.length], startX+5+26, startY+10+26, 1F, true);
} }
} }

View file

@ -50,7 +50,7 @@ public class PageReconstructor extends BookletPage{
PageTextOnly.renderTextToPage(gui, this, startX+6, startY+88); PageTextOnly.renderTextToPage(gui, this, startX+6, startY+88);
if(this.recipe != null){ if(this.recipe != null){
if(counter++ % 50 == 0) gui.addOrModifyItemRenderer(stacks[rotate++ % stacks.length], startX+30+1, startY+10+13, 1F, true); if(this.counter++ % 50 == 0) gui.addOrModifyItemRenderer(this.stacks[this.rotate++ % this.stacks.length], startX+30+1, startY+10+13, 1F, true);
} }
} }
@ -60,7 +60,7 @@ public class PageReconstructor extends BookletPage{
super.initGui(gui, startX, startY); super.initGui(gui, startX, startY);
if(this.recipe != null){ if(this.recipe != null){
gui.addOrModifyItemRenderer(stacks[0], startX+30+1, startY+10+13, 1F, true); gui.addOrModifyItemRenderer(this.stacks[0], startX+30+1, startY+10+13, 1F, true);
gui.addOrModifyItemRenderer(this.recipe.getOutput(), startX+30+47, startY+10+13, 1F, false); gui.addOrModifyItemRenderer(this.recipe.getOutput(), startX+30+47, startY+10+13, 1F, false);
} }
} }

View file

@ -27,7 +27,7 @@ public class GuiConfiguration extends GuiConfig{
} }
private static List<IConfigElement> getConfigElements(){ private static List<IConfigElement> getConfigElements(){
List<IConfigElement> list = new ArrayList<IConfigElement>(); List<IConfigElement> list = new ArrayList<>();
for(int i = 0; i < ConfigCategories.values().length; i++){ for(int i = 0; i < ConfigCategories.values().length; i++){
ConfigCategories cat = ConfigCategories.values()[i]; ConfigCategories cat = ConfigCategories.values()[i];
ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment); ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment);

View file

@ -103,11 +103,11 @@ public final class BlockCrafting{
private static class FireworkIngredient extends Ingredient { private static class FireworkIngredient extends Ingredient {
ItemStack firework = new ItemStack(Items.FIREWORKS); ItemStack firework = new ItemStack(Items.FIREWORKS);
ItemStack[] fireworks = new ItemStack[] {firework}; ItemStack[] fireworks = new ItemStack[] {this.firework};
@Override @Override
public ItemStack[] getMatchingStacks() { public ItemStack[] getMatchingStacks() {
return fireworks; return this.fireworks;
} }
@Override @Override

View file

@ -37,8 +37,8 @@ import java.util.ArrayList;
public final class ItemCrafting{ public final class ItemCrafting{
public static final ArrayList<IRecipe> RECIPES_POTION_RINGS = new ArrayList<IRecipe>(); public static final ArrayList<IRecipe> RECIPES_POTION_RINGS = new ArrayList<>();
public static final ArrayList<IRecipe> RECIPES_DRILL_COLORING = new ArrayList<IRecipe>(); public static final ArrayList<IRecipe> RECIPES_DRILL_COLORING = new ArrayList<>();
public static IRecipe recipePhantomConnector; public static IRecipe recipePhantomConnector;
public static IRecipe recipeCoil; public static IRecipe recipeCoil;
public static IRecipe recipeCoilAdvanced; public static IRecipe recipeCoilAdvanced;

View file

@ -25,7 +25,7 @@ import java.util.ArrayList;
public final class ToolCrafting{ public final class ToolCrafting{
public static final ArrayList<IRecipe> RECIPES_PAXELS = new ArrayList<IRecipe>(); public static final ArrayList<IRecipe> RECIPES_PAXELS = new ArrayList<>();
public static void init(){ public static void init(){

View file

@ -350,7 +350,7 @@ public class CreativeTab extends CreativeTabs{
} }
public void add(Item item){ public void add(Item item){
if(item != null && (!(item instanceof IDisableableItem) || (item instanceof IDisableableItem && !((IDisableableItem) item).isDisabled()))){ if(item != null && (!(item instanceof IDisableableItem) || item instanceof IDisableableItem && !((IDisableableItem) item).isDisabled())){
item.getSubItems(INSTANCE, this.list); item.getSubItems(INSTANCE, this.list);
} }
} }

View file

@ -57,7 +57,7 @@ public final class PlayerData{
public int batWingsFlyTime; public int batWingsFlyTime;
public IBookletPage[] bookmarks = new IBookletPage[12]; public IBookletPage[] bookmarks = new IBookletPage[12];
public List<String> completedTrials = new ArrayList<String>(); public List<String> completedTrials = new ArrayList<>();
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public GuiBooklet lastOpenBooklet; public GuiBooklet lastOpenBooklet;

View file

@ -27,8 +27,8 @@ public class WorldData extends WorldSavedData {
public static final String DATA_TAG = ActuallyAdditions.MODID + "data"; public static final String DATA_TAG = ActuallyAdditions.MODID + "data";
private static WorldData data; private static WorldData data;
public final ConcurrentSet<Network> laserRelayNetworks = new ConcurrentSet<Network>(); public final ConcurrentSet<Network> laserRelayNetworks = new ConcurrentSet<>();
public final ConcurrentHashMap<UUID, PlayerSave> playerSaveData = new ConcurrentHashMap<UUID, PlayerSave>(); public final ConcurrentHashMap<UUID, PlayerSave> playerSaveData = new ConcurrentHashMap<>();
public WorldData(String name) { public WorldData(String name) {
super(name); super(name);

View file

@ -87,7 +87,7 @@ public class EntityWorm extends Entity{
if(!isFarmland || state.getValue(BlockFarmland.MOISTURE) < 7){ if(!isFarmland || state.getValue(BlockFarmland.MOISTURE) < 7){
if(isMiddlePose || this.world.rand.nextFloat() >= 0.45F){ if(isMiddlePose || this.world.rand.nextFloat() >= 0.45F){
if(!isFarmland) DefaultFarmerBehavior.useHoeAt(world, pos); if(!isFarmland) DefaultFarmerBehavior.useHoeAt(this.world, pos);
state = this.world.getBlockState(pos); state = this.world.getBlockState(pos);
isFarmland = state.getBlock() instanceof BlockFarmland; isFarmland = state.getBlock() instanceof BlockFarmland;

View file

@ -43,10 +43,10 @@ public class RenderWorm extends Render<EntityWorm>{
@Override @Override
public void doRender(EntityWorm entity, double x, double y, double z, float entityYaw, float partialTicks){ public void doRender(EntityWorm entity, double x, double y, double z, float entityYaw, float partialTicks){
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
bindEntityTexture(entity); this.bindEntityTexture(entity);
GlStateManager.translate(x, y+0.7F, z); GlStateManager.translate(x, y+0.7F, z);
double boop = Minecraft.getSystemTime()/70D; double boop = Minecraft.getSystemTime()/70D;
GlStateManager.rotate(-(float)((boop%360)), 0, 1, 0); GlStateManager.rotate(-(float)(boop%360), 0, 1, 0);
GlStateManager.translate(0, 0, 0.4); GlStateManager.translate(0, 0, 0.4);
stack.setStackDisplayName(entity.getName()); stack.setStackDisplayName(entity.getName());

View file

@ -68,7 +68,7 @@ public class WorldGenLushCaves{
} }
private void genTreesAndTallGrass(World world, BlockPos center, int radius, int amount, Random rand, StructureBoundingBox box){ private void genTreesAndTallGrass(World world, BlockPos center, int radius, int amount, Random rand, StructureBoundingBox box){
List<BlockPos> possiblePoses = new ArrayList<BlockPos>(); List<BlockPos> possiblePoses = new ArrayList<>();
for(double x = -radius; x < radius; x++){ for(double x = -radius; x < radius; x++){
for(double y = -radius; y < radius; y++){ for(double y = -radius; y < radius; y++){
for(double z = -radius; z < radius; z++){ for(double z = -radius; z < radius; z++){
@ -152,7 +152,7 @@ public class WorldGenLushCaves{
for(double x = -radius; x < radius; x++){ for(double x = -radius; x < radius; x++){
for(double y = -radius; y < radius; y++){ for(double y = -radius; y < radius; y++){
for(double z = -radius; z < radius; z++){ for(double z = -radius; z < radius; z++){
if(Math.sqrt((x*x)+(y*y)+(z*z)) < radius){ if(Math.sqrt(x*x+y*y+z*z) < radius){
BlockPos pos = center.add(x, y, z); BlockPos pos = center.add(x, y, z);
//Note: order matters, checkIndestructable will generate chunks if order is reversed //Note: order matters, checkIndestructable will generate chunks if order is reversed
if(boundingBox.isVecInside(pos) && !this.checkIndestructable(world, pos)){ if(boundingBox.isVecInside(pos) && !this.checkIndestructable(world, pos)){

View file

@ -209,7 +209,7 @@ public class ContainerBag extends Container implements IButtonReactor {
@Override @Override
public boolean canInteractWith(EntityPlayer player) { public boolean canInteractWith(EntityPlayer player) {
return !sack.isEmpty() && player.getHeldItemMainhand() == sack; return !this.sack.isEmpty() && player.getHeldItemMainhand() == this.sack;
} }
@Override @Override

View file

@ -104,6 +104,6 @@ public class ContainerDropper extends Container{
@Override @Override
public void onContainerClosed(EntityPlayer playerIn) { public void onContainerClosed(EntityPlayer playerIn) {
super.onContainerClosed(playerIn); super.onContainerClosed(playerIn);
if (!player.isSpectator()) dropper.getWorld().notifyNeighborsOfStateChange(dropper.getPos(), InitBlocks.blockDropper, false); if (!this.player.isSpectator()) this.dropper.getWorld().notifyNeighborsOfStateChange(this.dropper.getPos(), InitBlocks.blockDropper, false);
} }
} }

View file

@ -55,7 +55,7 @@ public class ContainerEnergizer extends Container {
for (int k = 0; k < 4; ++k) { for (int k = 0; k < 4; ++k) {
final EntityEquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k]; final EntityEquipmentSlot slot = VALID_EQUIPMENT_SLOTS[k];
this.addSlotToContainer(new Slot(player.inventory, 36 + (3 - k), 102, 19 + k * 18) { this.addSlotToContainer(new Slot(player.inventory, 36 + 3 - k, 102, 19 + k * 18) {
@Override @Override
public int getSlotStackLimit() { public int getSlotStackLimit() {
return 1; return 1;

View file

@ -49,7 +49,7 @@ public class ContainerEnervator extends Container{
for(int k = 0; k < 4; ++k){ for(int k = 0; k < 4; ++k){
final EntityEquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k]; final EntityEquipmentSlot slot = ContainerEnergizer.VALID_EQUIPMENT_SLOTS[k];
this.addSlotToContainer(new Slot(player.inventory, 36+(3-k), 102, 19+k*18){ this.addSlotToContainer(new Slot(player.inventory, 36+3-k, 102, 19+k*18){
@Override @Override
public int getSlotStackLimit(){ public int getSlotStackLimit(){
return 1; return 1;

View file

@ -35,7 +35,7 @@ public class ContainerFilter extends Container{
for(int i = 0; i < 4; i++){ for(int i = 0; i < 4; i++){
for(int j = 0; j < 6; j++){ for(int j = 0; j < 6; j++){
this.addSlotToContainer(new SlotFilter(this.filterInventory, j+(i*6), 35+j*18, 10+i*18)); this.addSlotToContainer(new SlotFilter(this.filterInventory, j+i*6, 35+j*18, 10+i*18));
} }
} }

View file

@ -31,7 +31,7 @@ public class ContainerGiantChest extends Container{
for(int i = 0; i < 9; i++){ for(int i = 0; i < 9; i++){
for(int j = 0; j < 13; j++){ for(int j = 0; j < 13; j++){
this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileChest.inv, (9*13*page)+j+(i*13), 5+j*18, 5+i*18)); this.addSlotToContainer(new SlotItemHandlerUnconditioned(this.tileChest.inv, 9*13*page+j+i*13, 5+j*18, 5+i*18));
} }
} }

View file

@ -65,7 +65,7 @@ public class ContainerGrinder extends Container{
ItemStack currentStack = newStack.copy(); ItemStack currentStack = newStack.copy();
//Slots in Inventory to shift from //Slots in Inventory to shift from
if(slot == TileEntityGrinder.SLOT_OUTPUT_1_1 || slot == TileEntityGrinder.SLOT_OUTPUT_1_2 || (this.isDouble && (slot == TileEntityGrinder.SLOT_OUTPUT_2_1 || slot == TileEntityGrinder.SLOT_OUTPUT_2_2))){ if(slot == TileEntityGrinder.SLOT_OUTPUT_1_1 || slot == TileEntityGrinder.SLOT_OUTPUT_1_2 || this.isDouble && (slot == TileEntityGrinder.SLOT_OUTPUT_2_1 || slot == TileEntityGrinder.SLOT_OUTPUT_2_2)){
if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, true)){ if(!this.mergeItemStack(newStack, inventoryStart, hotbarEnd+1, true)){
return StackUtil.getEmpty(); return StackUtil.getEmpty();
} }

View file

@ -82,7 +82,7 @@ public class EnergyDisplay extends Gui{
if(this.isMouseOver(mouseX, mouseY)){ if(this.isMouseOver(mouseX, mouseY)){
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
List<String> text = new ArrayList<String>(); List<String> text = new ArrayList<>();
text.add(this.getOverlayText()); text.add(this.getOverlayText());
GuiUtils.drawHoveringText(text, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); GuiUtils.drawHoveringText(text, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer);
} }

View file

@ -63,14 +63,14 @@ public class FilterSettingsGui extends Gui{
this.metaButton.displayString = (this.theSettings.respectMeta ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"ME"; this.metaButton.displayString = (this.theSettings.respectMeta ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"ME";
this.nbtButton.displayString = (this.theSettings.respectNBT ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"NB"; this.nbtButton.displayString = (this.theSettings.respectNBT ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"NB";
this.modButton.displayString = (this.theSettings.respectMod ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"MO"; this.modButton.displayString = (this.theSettings.respectMod ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"MO";
this.oredictButton.displayString = (this.theSettings.respectOredict == 0 ? TextFormatting.RED : (this.theSettings.respectOredict == 1 ? TextFormatting.GREEN : TextFormatting.DARK_GREEN))+"OR"; this.oredictButton.displayString = (this.theSettings.respectOredict == 0 ? TextFormatting.RED : this.theSettings.respectOredict == 1 ? TextFormatting.GREEN : TextFormatting.DARK_GREEN)+"OR";
} }
public void drawHover(int mouseX, int mouseY){ public void drawHover(int mouseX, int mouseY){
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
if(this.whitelistButton.isMouseOver()){ if(this.whitelistButton.isMouseOver()){
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
list.add(TextFormatting.BOLD+(this.theSettings.isWhitelist ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.whitelist") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.blacklist"))); list.add(TextFormatting.BOLD+(this.theSettings.isWhitelist ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.whitelist") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.blacklist")));
list.addAll(mc.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".gui.whitelistInfo"), 200)); list.addAll(mc.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".gui.whitelistInfo"), 200));
GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer);
@ -82,7 +82,7 @@ public class FilterSettingsGui extends Gui{
GuiUtils.drawHoveringText(Collections.singletonList(TextFormatting.BOLD+(this.theSettings.respectNBT ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectNBT") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.ignoreNBT"))), mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); GuiUtils.drawHoveringText(Collections.singletonList(TextFormatting.BOLD+(this.theSettings.respectNBT ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectNBT") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.ignoreNBT"))), mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer);
} }
else if(this.modButton.isMouseOver()){ else if(this.modButton.isMouseOver()){
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
list.add(TextFormatting.BOLD+(this.theSettings.respectMod ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectMod") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.ignoreMod"))); list.add(TextFormatting.BOLD+(this.theSettings.respectMod ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectMod") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.ignoreMod")));
list.addAll(mc.fontRenderer.listFormattedStringToWidth(StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectModInfo"), 200)); list.addAll(mc.fontRenderer.listFormattedStringToWidth(StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectModInfo"), 200));
@ -90,8 +90,8 @@ public class FilterSettingsGui extends Gui{
GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer); GuiUtils.drawHoveringText(list, mouseX, mouseY, mc.displayWidth, mc.displayHeight, -1, mc.fontRenderer);
} }
else if(this.oredictButton.isMouseOver()){ else if(this.oredictButton.isMouseOver()){
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
list.add(TextFormatting.BOLD+(this.theSettings.respectOredict == 0 ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.ignoreOredict") : (this.theSettings.respectOredict == 1 ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectOredictSoft") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectOredictHard")))); list.add(TextFormatting.BOLD+(this.theSettings.respectOredict == 0 ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.ignoreOredict") : this.theSettings.respectOredict == 1 ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectOredictSoft") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.respectOredictHard")));
String type = null; String type = null;
if(this.theSettings.respectOredict == 1){ if(this.theSettings.respectOredict == 1){

View file

@ -90,7 +90,7 @@ public class FluidDisplay extends Gui{
GlStateManager.disableAlpha(); GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
int i = this.fluidReference.getFluidAmount()*83/this.fluidReference.getCapacity(); int i = this.fluidReference.getFluidAmount()*83/this.fluidReference.getCapacity();
GuiInputter.drawModalRectWithCustomSizedTexture(barX+1, barY+84-i, 36, 172, 16, i, 16, 512); Gui.drawModalRectWithCustomSizedTexture(barX+1, barY+84-i, 36, 172, 16, i, 16, 512);
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();
GlStateManager.popMatrix(); GlStateManager.popMatrix();

View file

@ -103,7 +103,7 @@ public class GuiBag extends GuiWtfMojang{
this.filter.drawHover(mouseX, mouseY); this.filter.drawHover(mouseX, mouseY);
if(this.buttonAutoInsert.isMouseOver()){ if(this.buttonAutoInsert.isMouseOver()){
List<String> text = new ArrayList<String>(); List<String> text = new ArrayList<>();
text.add(TextFormatting.BOLD+"Auto-Insert "+(this.container.autoInsert ? "On" : "Off")); text.add(TextFormatting.BOLD+"Auto-Insert "+(this.container.autoInsert ? "On" : "Off"));
text.addAll(this.mc.fontRenderer.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200)); text.addAll(this.mc.fontRenderer.listFormattedStringToWidth("Turn this on to make items that get picked up automatically go into the bag.", 200));
text.addAll(this.mc.fontRenderer.listFormattedStringToWidth(TextFormatting.GRAY+""+TextFormatting.ITALIC+"Note that this WON'T work when you are holding the bag in your hand.", 200)); text.addAll(this.mc.fontRenderer.listFormattedStringToWidth(TextFormatting.GRAY+""+TextFormatting.ITALIC+"Note that this WON'T work when you are holding the bag in your hand.", 200));

View file

@ -41,7 +41,7 @@ public class GuiFeeder extends GuiWtfMojang{
public void drawScreen(int x, int y, float f){ public void drawScreen(int x, int y, float f){
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
if(x >= this.guiLeft+69 && y >= this.guiTop+30 && x <= this.guiLeft+69+10 && y <= this.guiTop+30+10){ if(x >= this.guiLeft+69 && y >= this.guiTop+30 && x <= this.guiLeft+69+10 && y <= this.guiTop+30+10){
String[] array = new String[]{(this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.animals")), ((this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD) ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.enoughToBreed") : (this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.tooMany") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.notEnough")))}; String[] array = new String[]{this.tileFeeder.currentAnimalAmount+" "+StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.animals"), this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.enoughToBreed") : this.tileFeeder.currentAnimalAmount >= TileEntityFeeder.THRESHOLD ? StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.tooMany") : StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.notEnough")};
this.drawHoveringText(Arrays.asList(array), x, y); this.drawHoveringText(Arrays.asList(array), x, y);
} }
} }

View file

@ -51,7 +51,7 @@ public class GuiGiantChest extends GuiWtfMojang{
this.buttonList.add(new GuiButton(this.page-1, this.guiLeft+13, this.guiTop+172, 20, 20, "<")); this.buttonList.add(new GuiButton(this.page-1, this.guiLeft+13, this.guiTop+172, 20, 20, "<"));
} }
if((this.page == 0 && this.chest instanceof TileEntityGiantChestMedium) || (this.page <= 1 && this.chest instanceof TileEntityGiantChestLarge)){ if(this.page == 0 && this.chest instanceof TileEntityGiantChestMedium || this.page <= 1 && this.chest instanceof TileEntityGiantChestLarge){
this.buttonList.add(new GuiButton(this.page+1, this.guiLeft+209, this.guiTop+172, 20, 20, ">")); this.buttonList.add(new GuiButton(this.page+1, this.guiLeft+209, this.guiTop+172, 20, 20, ">"));
} }
} }

View file

@ -79,7 +79,7 @@ public class GuiLaserRelayItemWhitelist extends GuiWtfMojang{
super.drawScreen(x, y, f); super.drawScreen(x, y, f);
if(this.buttonSmartWhitelistLeft.isMouseOver() || this.buttonSmartWhitelistRight.isMouseOver()){ if(this.buttonSmartWhitelistLeft.isMouseOver() || this.buttonSmartWhitelistRight.isMouseOver()){
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<>();
list.add(TextFormatting.BOLD+StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.smart")); list.add(TextFormatting.BOLD+StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.smart"));
list.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.smartInfo"), 200)); list.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.smartInfo"), 200));
this.drawHoveringText(list, x, y); this.drawHoveringText(list, x, y);

View file

@ -76,7 +76,7 @@ public class GuiOilGenerator extends GuiWtfMojang{
this.drawCenteredString(this.fontRenderer, "for "+ this.generator.maxBurnTime + " t", this.guiLeft + 87, this.guiTop + 75, 0xFFFFFF); this.drawCenteredString(this.fontRenderer, "for "+ this.generator.maxBurnTime + " t", this.guiLeft + 87, this.guiTop + 75, 0xFFFFFF);
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.scale(0.75, 0.75, 1); GlStateManager.scale(0.75, 0.75, 1);
float xS = (this.guiLeft + 87) * 1.365F - fontRenderer.getStringWidth("(per 50 mB)") / 2F; float xS = (this.guiLeft + 87) * 1.365F - this.fontRenderer.getStringWidth("(per 50 mB)") / 2F;
StringUtil.renderScaledAsciiString(this.fontRenderer, "(per 50 mB)", xS, (this.guiTop + 85) * 1.345F, 0xFFFFFF, true, 0.75F); StringUtil.renderScaledAsciiString(this.fontRenderer, "(per 50 mB)", xS, (this.guiTop + 85) * 1.345F, 0xFFFFFF, true, 0.75F);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
} }

View file

@ -67,7 +67,7 @@ public class GuiPhantomPlacer extends GuiWtfMojang{
if(!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()){ if(!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()){
String loc = "info."+ActuallyAdditions.MODID+".placer.sides"; String loc = "info."+ActuallyAdditions.MODID+".placer.sides";
List<String> textList = new ArrayList<String>(); List<String> textList = new ArrayList<>();
textList.add(TextFormatting.GOLD+StringUtil.localize(loc+".1")); textList.add(TextFormatting.GOLD+StringUtil.localize(loc+".1"));
textList.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localize(loc+".2"), 200)); textList.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localize(loc+".2"), 200));
this.drawHoveringText(textList, mouseX, mouseY); this.drawHoveringText(textList, mouseX, mouseY);

View file

@ -24,7 +24,7 @@ import java.util.List;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class TexturedButton extends GuiButton{ public class TexturedButton extends GuiButton{
public final List<String> textList = new ArrayList<String>(); public final List<String> textList = new ArrayList<>();
private final ResourceLocation resLoc; private final ResourceLocation resLoc;
public int texturePosX; public int texturePosX;
public int texturePosY; public int texturePosY;

View file

@ -28,7 +28,7 @@ public class SlotItemHandlerUnconditioned extends SlotItemHandler {
@Override @Override
public boolean isItemValid(ItemStack stack) { public boolean isItemValid(ItemStack stack) {
if (stack.isEmpty() || !inv.canAccept(getSlotIndex(), stack, false)) return false; if (stack.isEmpty() || !this.inv.canAccept(this.getSlotIndex(), stack, false)) return false;
ItemStack currentStack = this.inv.getStackInSlot(this.getSlotIndex()); ItemStack currentStack = this.inv.getStackInSlot(this.getSlotIndex());
this.inv.setStackInSlot(this.getSlotIndex(), ItemStack.EMPTY); this.inv.setStackInSlot(this.getSlotIndex(), ItemStack.EMPTY);

View file

@ -78,7 +78,7 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
@Override @Override
public boolean canHarvestBlock(IBlockState state, ItemStack stack){ public boolean canHarvestBlock(IBlockState state, ItemStack stack){
return this.hasExtraWhitelist(state.getBlock()) || state.getMaterial().isToolNotRequired() || (state.getBlock() == Blocks.SNOW_LAYER || state.getBlock() == Blocks.SNOW || (state.getBlock() == Blocks.OBSIDIAN ? this.toolMaterial.getHarvestLevel() >= 3 : (state.getBlock() != Blocks.DIAMOND_BLOCK && state.getBlock() != Blocks.DIAMOND_ORE ? (state.getBlock() != Blocks.EMERALD_ORE && state.getBlock() != Blocks.EMERALD_BLOCK ? (state.getBlock() != Blocks.GOLD_BLOCK && state.getBlock() != Blocks.GOLD_ORE ? (state.getBlock() != Blocks.IRON_BLOCK && state.getBlock() != Blocks.IRON_ORE ? (state.getBlock() != Blocks.LAPIS_BLOCK && state.getBlock() != Blocks.LAPIS_ORE ? (state.getBlock() != Blocks.REDSTONE_ORE && state.getBlock() != Blocks.LIT_REDSTONE_ORE ? (state.getMaterial() == Material.ROCK || (state.getMaterial() == Material.IRON || state.getMaterial() == Material.ANVIL)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2))); return this.hasExtraWhitelist(state.getBlock()) || state.getMaterial().isToolNotRequired() || state.getBlock() == Blocks.SNOW_LAYER || state.getBlock() == Blocks.SNOW || (state.getBlock() == Blocks.OBSIDIAN ? this.toolMaterial.getHarvestLevel() >= 3 : state.getBlock() != Blocks.DIAMOND_BLOCK && state.getBlock() != Blocks.DIAMOND_ORE ? state.getBlock() != Blocks.EMERALD_ORE && state.getBlock() != Blocks.EMERALD_BLOCK ? state.getBlock() != Blocks.GOLD_BLOCK && state.getBlock() != Blocks.GOLD_ORE ? state.getBlock() != Blocks.IRON_BLOCK && state.getBlock() != Blocks.IRON_ORE ? state.getBlock() != Blocks.LAPIS_BLOCK && state.getBlock() != Blocks.LAPIS_ORE ? state.getBlock() != Blocks.REDSTONE_ORE && state.getBlock() != Blocks.LIT_REDSTONE_ORE ? state.getMaterial() == Material.ROCK || state.getMaterial() == Material.IRON || state.getMaterial() == Material.ANVIL : this.toolMaterial.getHarvestLevel() >= 2 : this.toolMaterial.getHarvestLevel() >= 1 : this.toolMaterial.getHarvestLevel() >= 1 : this.toolMaterial.getHarvestLevel() >= 2 : this.toolMaterial.getHarvestLevel() >= 2 : this.toolMaterial.getHarvestLevel() >= 2);
} }
private boolean hasExtraWhitelist(Block block){ private boolean hasExtraWhitelist(Block block){
@ -110,12 +110,7 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public IItemColor getItemColor(){ public IItemColor getItemColor(){
return new IItemColor(){ return (stack, pass) -> pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF;
@Override
public int colorMultiplier(ItemStack stack, int pass){
return pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF;
}
};
} }
@Override @Override

View file

@ -75,7 +75,7 @@ public class ItemBattery extends ItemEnergy{
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand){
if(!worldIn.isRemote && player.isSneaking()){ if(!worldIn.isRemote && player.isSneaking()){
ItemUtil.changeEnabled(player, hand); ItemUtil.changeEnabled(player, hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }
return super.onItemRightClick(worldIn, player, hand); return super.onItemRightClick(worldIn, player, hand);
} }

View file

@ -80,7 +80,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
//TheAchievements.OPEN_BOOKLET.get(player); //TheAchievements.OPEN_BOOKLET.get(player);
//TheAchievements.OPEN_BOOKLET_MILESTONE.get(player); //TheAchievements.OPEN_BOOKLET_MILESTONE.get(player);
} }
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }
@Override @Override

View file

@ -44,7 +44,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{
ItemStack heldStack = player.getHeldItem(hand); ItemStack heldStack = player.getHeldItem(hand);
if(player.isSneaking()){ if(player.isSneaking()){
TileEntity tileHit = world.getTileEntity(pos); TileEntity tileHit = world.getTileEntity(pos);
if(tileHit != null && start.isInstance(tileHit)){ if(tileHit != null && this.start.isInstance(tileHit)){
if(!world.isRemote){ if(!world.isRemote){
//Copy Slots //Copy Slots

View file

@ -140,7 +140,7 @@ public class ItemCoffee extends ItemFoodBase{
@Override @Override
public boolean effect(ItemStack stack){ public boolean effect(ItemStack stack){
PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack); PotionEffect[] effects = ActuallyAdditionsAPI.methodHandler.getEffectsFromStack(stack);
ArrayList<PotionEffect> effectsNew = new ArrayList<PotionEffect>(); ArrayList<PotionEffect> effectsNew = new ArrayList<>();
if(effects != null && effects.length > 0){ if(effects != null && effects.length > 0){
for(PotionEffect effect : effects){ for(PotionEffect effect : effects){
if(effect.getAmplifier() > 0){ if(effect.getAmplifier() > 0){

View file

@ -34,7 +34,7 @@ public class ItemCrafterOnAStick extends ItemBase{
if(!world.isRemote){ if(!world.isRemote){
player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.CRAFTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }

View file

@ -67,9 +67,7 @@ public class ItemCrystalShard extends ItemBase implements IColorProvidingItem{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IItemColor getItemColor(){ public IItemColor getItemColor(){
return new IItemColor(){ return (stack, tintIndex) -> {
@Override
public int colorMultiplier(ItemStack stack, int tintIndex){
int damage = stack.getItemDamage(); int damage = stack.getItemDamage();
if(damage >= 0 && damage < BlockCrystal.ALL_CRYSTALS.length){ if(damage >= 0 && damage < BlockCrystal.ALL_CRYSTALS.length){
return BlockCrystal.ALL_CRYSTALS[damage].clusterColor; return BlockCrystal.ALL_CRYSTALS[damage].clusterColor;
@ -77,7 +75,6 @@ public class ItemCrystalShard extends ItemBase implements IColorProvidingItem{
else{ else{
return 0; return 0;
} }
}
}; };
} }
} }

View file

@ -167,7 +167,7 @@ public class ItemDrill extends ItemEnergy{
if(!world.isRemote && player.isSneaking() && hand == EnumHand.MAIN_HAND){ if(!world.isRemote && player.isSneaking() && hand == EnumHand.MAIN_HAND){
player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.DRILL.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.PASS, player.getHeldItem(hand));
} }
@Override @Override
@ -205,7 +205,7 @@ public class ItemDrill extends ItemEnergy{
@Override @Override
public float getDestroySpeed(ItemStack stack, IBlockState state){ public float getDestroySpeed(ItemStack stack, IBlockState state){
return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) ? (this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.getEfficiencyFromUpgrade(stack) : 1.0F) : 0.1F; return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) ? this.hasExtraWhitelist(state.getBlock()) || state.getBlock().getHarvestTool(state) == null || state.getBlock().getHarvestTool(state).isEmpty() || this.getToolClasses(stack).contains(state.getBlock().getHarvestTool(state)) ? this.getEfficiencyFromUpgrade(stack) : 1.0F : 0.1F;
} }
@Override @Override
@ -251,12 +251,12 @@ public class ItemDrill extends ItemEnergy{
@Override @Override
public boolean canHarvestBlock(IBlockState state, ItemStack stack){ public boolean canHarvestBlock(IBlockState state, ItemStack stack){
Block block = state.getBlock(); Block block = state.getBlock();
return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && (this.hasExtraWhitelist(block) || state.getMaterial().isToolNotRequired() || (block == Blocks.SNOW_LAYER || block == Blocks.SNOW || (block == Blocks.OBSIDIAN ? HARVEST_LEVEL >= 3 : (block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE ? (block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK ? (block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE ? (block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE ? (block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE ? (block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE ? (state.getMaterial() == Material.ROCK || (state.getMaterial() == Material.IRON || state.getMaterial() == Material.ANVIL)) : HARVEST_LEVEL >= 2) : HARVEST_LEVEL >= 1) : HARVEST_LEVEL >= 1) : HARVEST_LEVEL >= 2) : HARVEST_LEVEL >= 2) : HARVEST_LEVEL >= 2)))); return this.getEnergyStored(stack) >= this.getEnergyUsePerBlock(stack) && (this.hasExtraWhitelist(block) || state.getMaterial().isToolNotRequired() || block == Blocks.SNOW_LAYER || block == Blocks.SNOW || (block == Blocks.OBSIDIAN ? HARVEST_LEVEL >= 3 : block != Blocks.DIAMOND_BLOCK && block != Blocks.DIAMOND_ORE ? block != Blocks.EMERALD_ORE && block != Blocks.EMERALD_BLOCK ? block != Blocks.GOLD_BLOCK && block != Blocks.GOLD_ORE ? block != Blocks.IRON_BLOCK && block != Blocks.IRON_ORE ? block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE ? block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE ? state.getMaterial() == Material.ROCK || state.getMaterial() == Material.IRON || state.getMaterial() == Material.ANVIL : HARVEST_LEVEL >= 2 : HARVEST_LEVEL >= 1 : HARVEST_LEVEL >= 1 : HARVEST_LEVEL >= 2 : HARVEST_LEVEL >= 2 : HARVEST_LEVEL >= 2));
} }
@Override @Override
public Set<String> getToolClasses(ItemStack stack){ public Set<String> getToolClasses(ItemStack stack){
HashSet<String> hashSet = new HashSet<String>(); HashSet<String> hashSet = new HashSet<>();
hashSet.add("pickaxe"); hashSet.add("pickaxe");
hashSet.add("shovel"); hashSet.add("shovel");
return hashSet; return hashSet;
@ -468,7 +468,7 @@ public class ItemDrill extends ItemEnergy{
Block block = state.getBlock(); Block block = state.getBlock();
float hardness = state.getBlockHardness(world, pos); float hardness = state.getBlockHardness(world, pos);
boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getDestroySpeed(stack, world.getBlockState(pos)) > 1.0F); boolean canHarvest = (ForgeHooks.canHarvestBlock(block, player, world, pos) || this.canHarvestBlock(state, stack)) && (!isExtra || this.getDestroySpeed(stack, world.getBlockState(pos)) > 1.0F);
if(hardness >= 0.0F && (!isExtra || (canHarvest && !block.hasTileEntity(world.getBlockState(pos))))){ if(hardness >= 0.0F && (!isExtra || canHarvest && !block.hasTileEntity(world.getBlockState(pos)))){
if(!player.capabilities.isCreativeMode){ if(!player.capabilities.isCreativeMode){
this.extractEnergyInternal(stack, use, false); this.extractEnergyInternal(stack, use, false);
} }
@ -497,6 +497,6 @@ public class ItemDrill extends ItemEnergy{
@Override @Override
public boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack) { public boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack) {
return !(newStack.isItemEqual(oldStack)); return !newStack.isItemEqual(oldStack);
} }
} }

View file

@ -43,9 +43,9 @@ public class ItemDrillUpgrade extends ItemBase{
ItemStack stack = player.getHeldItem(hand); ItemStack stack = player.getHeldItem(hand);
if(!world.isRemote && this.type == UpgradeType.PLACER){ if(!world.isRemote && this.type == UpgradeType.PLACER){
this.setSlotToPlaceFrom(stack, player.inventory.currentItem); this.setSlotToPlaceFrom(stack, player.inventory.currentItem);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} }
return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack); return new ActionResult<>(EnumActionResult.FAIL, stack);
} }
public void setSlotToPlaceFrom(ItemStack stack, int slot){ public void setSlotToPlaceFrom(ItemStack stack, int slot){

View file

@ -69,12 +69,7 @@ public class ItemDust extends ItemBase implements IColorProvidingItem{
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public IItemColor getItemColor(){ public IItemColor getItemColor(){
return new IItemColor(){ return (stack, pass) -> stack.getItemDamage() >= ALL_DUSTS.length ? 0xFFFFFF : ALL_DUSTS[stack.getItemDamage()].color;
@Override
public int colorMultiplier(ItemStack stack, int pass){
return stack.getItemDamage() >= ALL_DUSTS.length ? 0xFFFFFF : ALL_DUSTS[stack.getItemDamage()].color;
}
};
} }
@Override @Override

View file

@ -32,7 +32,7 @@ import java.util.Set;
public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles{ public class ItemEngineerGoggles extends ItemArmorAA implements IGoggles{
private final Set<Entity> cachedGlowingEntities = new ConcurrentSet<Entity>(); private final Set<Entity> cachedGlowingEntities = new ConcurrentSet<>();
private final boolean displayMobs; private final boolean displayMobs;

View file

@ -44,7 +44,7 @@ public class ItemFilter extends ItemBase{
if(!world.isRemote && hand == EnumHand.MAIN_HAND){ if(!world.isRemote && hand == EnumHand.MAIN_HAND){
player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ); player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.FILTER.ordinal(), world, (int)player.posX, (int)player.posY, (int)player.posZ);
} }
return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.PASS, player.getHeldItem(hand));
} }
@Override @Override

View file

@ -62,7 +62,7 @@ public class ItemFoods extends ItemFoodBase{
@Override @Override
public EnumAction getItemUseAction(ItemStack stack){ public EnumAction getItemUseAction(ItemStack stack){
return stack.getItemDamage() >= ALL_FOODS.length ? EnumAction.EAT : (ALL_FOODS[stack.getItemDamage()].getsDrunken ? EnumAction.DRINK : EnumAction.EAT); return stack.getItemDamage() >= ALL_FOODS.length ? EnumAction.EAT : ALL_FOODS[stack.getItemDamage()].getsDrunken ? EnumAction.DRINK : EnumAction.EAT;
} }
@Override @Override

View file

@ -45,7 +45,7 @@ public class ItemGrowthRing extends ItemEnergy{
int energyUse = 300; int energyUse = 300;
if(StackUtil.isValid(equipped) && equipped == stack && this.getEnergyStored(stack) >= energyUse){ if(StackUtil.isValid(equipped) && equipped == stack && this.getEnergyStored(stack) >= energyUse){
List<BlockPos> blocks = new ArrayList<BlockPos>(); List<BlockPos> blocks = new ArrayList<>();
//Adding all possible Blocks //Adding all possible Blocks
if(player.world.getTotalWorldTime()%30 == 0){ if(player.world.getTotalWorldTime()%30 == 0){

View file

@ -47,7 +47,7 @@ public class ItemHairyBall extends ItemBase{
public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){ public void livingUpdateEvent(LivingEvent.LivingUpdateEvent event){
//Ocelots dropping Hair Balls //Ocelots dropping Hair Balls
if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && event.getEntityLiving() != null && event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote){ if(ConfigBoolValues.DO_CAT_DROPS.isEnabled() && event.getEntityLiving() != null && event.getEntityLiving().world != null && !event.getEntityLiving().world.isRemote){
if((event.getEntityLiving() instanceof EntityOcelot && ((EntityOcelot)event.getEntityLiving()).isTamed()) || (event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving().getUniqueID().equals(KittyVanCatUUID))){ if(event.getEntityLiving() instanceof EntityOcelot && ((EntityOcelot)event.getEntityLiving()).isTamed() || event.getEntityLiving() instanceof EntityPlayer && event.getEntityLiving().getUniqueID().equals(this.KittyVanCatUUID)){
if(event.getEntityLiving().world.rand.nextInt(ConfigIntValues.FUR_CHANCE.getValue()) == 0){ if(event.getEntityLiving().world.rand.nextInt(ConfigIntValues.FUR_CHANCE.getValue()) == 0){
EntityItem item = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall)); EntityItem item = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX+0.5, event.getEntityLiving().posY+0.5, event.getEntityLiving().posZ+0.5, new ItemStack(InitItems.itemHairyBall));
event.getEntityLiving().world.spawnEntity(item); event.getEntityLiving().world.spawnEntity(item);
@ -70,7 +70,7 @@ public class ItemHairyBall extends ItemBase{
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, world.rand.nextFloat()*0.1F+0.9F); world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, world.rand.nextFloat()*0.1F+0.9F);
} }
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} }
public ItemStack getRandomReturnItem(Random rand){ public ItemStack getRandomReturnItem(Random rand){

View file

@ -109,11 +109,6 @@ public class ItemJams extends ItemFoodBase implements IColorProvidingItem{
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IItemColor getItemColor(){ public IItemColor getItemColor(){
return new IItemColor(){ return (stack, pass) -> pass > 0 ? stack.getItemDamage() >= ALL_JAMS.length ? 0xFFFFFF : ALL_JAMS[stack.getItemDamage()].color : 0xFFFFFF;
@Override
public int colorMultiplier(ItemStack stack, int pass){
return pass > 0 ? (stack.getItemDamage() >= ALL_JAMS.length ? 0xFFFFFF : ALL_JAMS[stack.getItemDamage()].color) : 0xFFFFFF;
}
};
} }
} }

View file

@ -48,7 +48,7 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{
@Override @Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand){
player.setActiveHand(hand); player.setActiveHand(hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }
@ -96,18 +96,18 @@ public class ItemLeafBlower extends ItemBase implements IDisplayStandItem{
* @param z The Z Position of the Player * @param z The Z Position of the Player
*/ */
public boolean breakStuff(World world, int x, int y, int z){ public boolean breakStuff(World world, int x, int y, int z){
ArrayList<BlockPos> breakPositions = new ArrayList<BlockPos>(); ArrayList<BlockPos> breakPositions = new ArrayList<>();
int rangeSides = 5; int rangeSides = 5;
int rangeUp = 1; int rangeUp = 1;
for(int reachX = -rangeSides; reachX < rangeSides+1; reachX++){ for(int reachX = -rangeSides; reachX < rangeSides+1; reachX++){
for(int reachZ = -rangeSides; reachZ < rangeSides+1; reachZ++){ for(int reachZ = -rangeSides; reachZ < rangeSides+1; reachZ++){
for(int reachY = (this.isAdvanced ? -rangeSides : -rangeUp); reachY < (this.isAdvanced ? rangeSides : rangeUp)+1; reachY++){ for(int reachY = this.isAdvanced ? -rangeSides : -rangeUp; reachY < (this.isAdvanced ? rangeSides : rangeUp)+1; reachY++){
//The current Block to break //The current Block to break
BlockPos pos = new BlockPos(x+reachX, y+reachY, z+reachZ); BlockPos pos = new BlockPos(x+reachX, y+reachY, z+reachZ);
Block block = world.getBlockState(pos).getBlock(); Block block = world.getBlockState(pos).getBlock();
if(block != null && ((block instanceof BlockBush || block instanceof IShearable) && (this.isAdvanced || !block.isLeaves(world.getBlockState(pos), world, pos)))){ if(block != null && (block instanceof BlockBush || block instanceof IShearable) && (this.isAdvanced || !block.isLeaves(world.getBlockState(pos), world, pos))){
breakPositions.add(pos); breakPositions.add(pos);
} }
} }

View file

@ -73,7 +73,7 @@ public class ItemMagnetRing extends ItemEnergy{
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand){ public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand){
if(!worldIn.isRemote && player.isSneaking()){ if(!worldIn.isRemote && player.isSneaking()){
ItemUtil.changeEnabled(player, hand); ItemUtil.changeEnabled(player, hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
} }
return super.onItemRightClick(worldIn, player, hand); return super.onItemRightClick(worldIn, player, hand);
} }

View file

@ -51,7 +51,7 @@ public class ItemPickaxeAA extends ItemToolAA{
if(block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE){ if(block != Blocks.LAPIS_BLOCK && block != Blocks.LAPIS_ORE){
if(block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE){ if(block != Blocks.REDSTONE_ORE && block != Blocks.LIT_REDSTONE_ORE){
Material material = blockIn.getMaterial(); Material material = blockIn.getMaterial();
return material == Material.ROCK || (material == Material.IRON || material == Material.ANVIL); return material == Material.ROCK || material == Material.IRON || material == Material.ANVIL;
} }
else{ else{
return this.toolMaterial.getHarvestLevel() >= 2; return this.toolMaterial.getHarvestLevel() >= 2;

View file

@ -113,7 +113,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
ItemStack equippedStack = thePlayer.getHeldItemMainhand(); ItemStack equippedStack = thePlayer.getHeldItemMainhand();
ItemStack offhandStack = thePlayer.getHeldItemOffhand(); ItemStack offhandStack = thePlayer.getHeldItemOffhand();
if(this.effectEntity(thePlayer, stack, (StackUtil.isValid(equippedStack) && stack == equippedStack) || (StackUtil.isValid(offhandStack) && stack == offhandStack))){ if(this.effectEntity(thePlayer, stack, StackUtil.isValid(equippedStack) && stack == equippedStack || StackUtil.isValid(offhandStack) && stack == offhandStack)){
if(world.getTotalWorldTime()%10 == 0){ if(world.getTotalWorldTime()%10 == 0){
setStoredBlaze(stack, storedBlaze-1); setStoredBlaze(stack, storedBlaze-1);
} }
@ -175,12 +175,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public IItemColor getItemColor(){ public IItemColor getItemColor(){
return new IItemColor(){ return (stack, tintIndex) -> stack.getItemDamage() >= ALL_RINGS.length ? 0xFFFFFF : ALL_RINGS[stack.getItemDamage()].color;
@Override
public int colorMultiplier(ItemStack stack, int tintIndex){
return stack.getItemDamage() >= ALL_RINGS.length ? 0xFFFFFF : ALL_RINGS[stack.getItemDamage()].color;
}
};
} }
@Override @Override
@ -232,7 +227,7 @@ public class ItemPotionRing extends ItemBase implements IColorProvidingItem, IDi
ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()]; ThePotionRings effect = ThePotionRings.values()[stack.getItemDamage()];
Potion potion = Potion.getPotionById(effect.effectID); Potion potion = Potion.getPotionById(effect.effectID);
PotionEffect activeEffect = thePlayer.getActivePotionEffect(potion); PotionEffect activeEffect = thePlayer.getActivePotionEffect(potion);
if(!effect.needsWaitBeforeActivating || (activeEffect == null || activeEffect.getDuration() <= 1)){ if(!effect.needsWaitBeforeActivating || activeEffect == null || activeEffect.getDuration() <= 1){
if(!((ItemPotionRing)stack.getItem()).isAdvanced){ if(!((ItemPotionRing)stack.getItem()).isAdvanced){
if(canUseBasic){ if(canUseBasic){
thePlayer.addPotionEffect(new PotionEffect(potion, effect.activeTime, effect.normalAmplifier, true, false)); thePlayer.addPotionEffect(new PotionEffect(potion, effect.activeTime, effect.normalAmplifier, true, false));

View file

@ -33,7 +33,7 @@ public class ItemResonantRice extends ItemBase{
stack.shrink(1); stack.shrink(1);
world.createExplosion(null, player.posX, player.posY, player.posZ, 0.5F, true); world.createExplosion(null, player.posX, player.posY, player.posZ, 0.5F, true);
} }
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return new ActionResult<>(EnumActionResult.SUCCESS, stack);
} }

View file

@ -92,28 +92,28 @@ public class ItemWaterBowl extends ItemBase{
} }
if(trace == null){ if(trace == null){
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack); return new ActionResult<>(EnumActionResult.PASS, stack);
} }
else if(trace.typeOfHit != RayTraceResult.Type.BLOCK){ else if(trace.typeOfHit != RayTraceResult.Type.BLOCK){
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack); return new ActionResult<>(EnumActionResult.PASS, stack);
} }
else{ else{
BlockPos pos = trace.getBlockPos(); BlockPos pos = trace.getBlockPos();
if(!world.isBlockModifiable(player, pos)){ if(!world.isBlockModifiable(player, pos)){
return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack); return new ActionResult<>(EnumActionResult.FAIL, stack);
} }
else{ else{
BlockPos pos1 = world.getBlockState(pos).getBlock().isReplaceable(world, pos) && trace.sideHit == EnumFacing.UP ? pos : pos.offset(trace.sideHit); BlockPos pos1 = world.getBlockState(pos).getBlock().isReplaceable(world, pos) && trace.sideHit == EnumFacing.UP ? pos : pos.offset(trace.sideHit);
if(!player.canPlayerEdit(pos1, trace.sideHit, stack)){ if(!player.canPlayerEdit(pos1, trace.sideHit, stack)){
return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack); return new ActionResult<>(EnumActionResult.FAIL, stack);
} }
else if(this.tryPlaceContainedLiquid(player, world, pos1, false)){ else if(this.tryPlaceContainedLiquid(player, world, pos1, false)){
return !player.capabilities.isCreativeMode ? new ActionResult<ItemStack>(EnumActionResult.SUCCESS, new ItemStack(Items.BOWL)) : new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); return !player.capabilities.isCreativeMode ? new ActionResult<>(EnumActionResult.SUCCESS, new ItemStack(Items.BOWL)) : new ActionResult<>(EnumActionResult.SUCCESS, stack);
} }
else{ else{
return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack); return new ActionResult<>(EnumActionResult.FAIL, stack);
} }
} }
} }
@ -134,12 +134,12 @@ public class ItemWaterBowl extends ItemBase{
} }
boolean change = false; boolean change = false;
if((lastX != 0 && lastX != (int)entity.posX) || (lastY != 0 && lastY != (int)entity.posY)){ if(lastX != 0 && lastX != (int)entity.posX || lastY != 0 && lastY != (int)entity.posY){
if(!entity.isSneaking()){ if(!entity.isSneaking()){
if(entity instanceof EntityPlayer){ if(entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer)entity; EntityPlayer player = (EntityPlayer)entity;
if(this.tryPlaceContainedLiquid(player, world, player.getPosition(), true)){ if(this.tryPlaceContainedLiquid(player, world, player.getPosition(), true)){
checkReplace(player, stack, new ItemStack(Items.BOWL), itemSlot); this.checkReplace(player, stack, new ItemStack(Items.BOWL), itemSlot);
} }
} }
} }
@ -184,7 +184,7 @@ public class ItemWaterBowl extends ItemBase{
world.playSound(player, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F+(world.rand.nextFloat()-world.rand.nextFloat())*0.8F); world.playSound(player, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F+(world.rand.nextFloat()-world.rand.nextFloat())*0.8F);
for(int k = 0; k < 8; k++){ for(int k = 0; k < 8; k++){
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)pos.getX()+Math.random(), (double)pos.getY()+Math.random(), (double)pos.getZ()+Math.random(), 0.0D, 0.0D, 0.0D); world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, pos.getX()+Math.random(), pos.getY()+Math.random(), pos.getZ()+Math.random(), 0.0D, 0.0D, 0.0D);
} }
} }
else{ else{

View file

@ -72,7 +72,7 @@ public class ItemWingsOfTheBats extends ItemBase{
PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player); PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player);
if(data != null){ if(data != null){
double diff = MAX_FLY_TIME-data.batWingsFlyTime; double diff = MAX_FLY_TIME-data.batWingsFlyTime;
return 1-(diff/MAX_FLY_TIME); return 1-diff/MAX_FLY_TIME;
} }
} }
return super.getDurabilityForDisplay(stack); return super.getDurabilityForDisplay(stack);

View file

@ -38,7 +38,7 @@ public class ItemArmorAA extends ItemArmor implements IDisableableItem{
this.name = name; this.name = name;
this.rarity = rarity; this.rarity = rarity;
this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(name) +". It will not be registered."); this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(name) +". It will not be registered.");
if(!disabled) this.register(); if(!this.disabled) this.register();
} }
private void register(){ private void register(){
@ -71,6 +71,6 @@ public class ItemArmorAA extends ItemArmor implements IDisableableItem{
@Override @Override
public boolean isDisabled() { public boolean isDisabled() {
return disabled; return this.disabled;
} }
} }

View file

@ -34,8 +34,8 @@ public class ItemHoeAA extends ItemHoe implements IDisableableItem {
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(name) +". It will not be registered."); this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(this.name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(this.name) +". It will not be registered.");
if(!disabled) this.register(); if(!this.disabled) this.register();
} }
private void register(){ private void register(){
@ -69,6 +69,6 @@ public class ItemHoeAA extends ItemHoe implements IDisableableItem {
@Override @Override
public boolean isDisabled() { public boolean isDisabled() {
return disabled; return this.disabled;
} }
} }

View file

@ -34,8 +34,8 @@ public class ItemSwordAA extends ItemSword implements IDisableableItem {
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(name) +". It will not be registered."); this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(this.name), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(this.name) +". It will not be registered.");
if(!disabled) this.register(); if(!this.disabled) this.register();
} }
private void register(){ private void register(){
@ -73,6 +73,6 @@ public class ItemSwordAA extends ItemSword implements IDisableableItem {
@Override @Override
public boolean isDisabled() { public boolean isDisabled() {
return disabled; return this.disabled;
} }
} }

View file

@ -44,7 +44,7 @@ public class ItemToolAA extends ItemTool implements IDisableableItem{
this.name = unlocalizedName; this.name = unlocalizedName;
this.rarity = rarity; this.rarity = rarity;
this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(unlocalizedName), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(unlocalizedName) +". It will not be registered."); this.disabled = ConfigurationHandler.config.getBoolean("Disable: " + StringUtil.badTranslate(unlocalizedName), "Tool Control", false, "This will disable the " + StringUtil.badTranslate(unlocalizedName) +". It will not be registered.");
if(!disabled) this.register(); if(!this.disabled) this.register();
} }
private void register(){ private void register(){
@ -89,6 +89,6 @@ public class ItemToolAA extends ItemTool implements IDisableableItem{
@Override @Override
public boolean isDisabled() { public boolean isDisabled() {
return disabled; return this.disabled;
} }
} }

View file

@ -39,7 +39,7 @@ import net.minecraftforge.oredict.OreDictionary;
public final class LensRecipeHandler { public final class LensRecipeHandler {
public static final ArrayList<LensConversionRecipe> MAIN_PAGE_RECIPES = new ArrayList<LensConversionRecipe>(); public static final ArrayList<LensConversionRecipe> MAIN_PAGE_RECIPES = new ArrayList<>();
public static LensConversionRecipe recipeColorLens; public static LensConversionRecipe recipeColorLens;
public static LensConversionRecipe recipeSoulSand; public static LensConversionRecipe recipeSoulSand;
public static LensConversionRecipe recipeGreenWall; public static LensConversionRecipe recipeGreenWall;

View file

@ -58,7 +58,7 @@ public class BookletRecipeCategory implements IRecipeCategory<BookletRecipeWrapp
public void setRecipe(IRecipeLayout recipeLayout, BookletRecipeWrapper wrapper, IIngredients ingredients){ public void setRecipe(IRecipeLayout recipeLayout, BookletRecipeWrapper wrapper, IIngredients ingredients){
recipeLayout.getItemStacks().init(0, true, 70, -4); recipeLayout.getItemStacks().init(0, true, 70, -4);
List<ItemStack> list = new ArrayList<ItemStack>(); List<ItemStack> list = new ArrayList<>();
wrapper.thePage.getItemStacksForPage(list); wrapper.thePage.getItemStacksForPage(list);
recipeLayout.getItemStacks().set(0, list); recipeLayout.getItemStacks().set(0, list);
} }

Some files were not shown because too many files have changed in this diff Show more