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

@ -142,7 +142,7 @@ public final class ActuallyAdditionsAPI{
public static void addCrusherRecipe(ItemStack input, ItemStack outputOne, ItemStack outputTwo, int outputTwoChance){
CRUSHER_RECIPES.add(new CrusherRecipe(Ingredient.fromStacks(input), outputOne, outputTwo.isEmpty() ? ItemStack.EMPTY : outputTwo, outputTwoChance));
}
/**
* Adds a Recipe to the Crusher Recipe Registry
*
@ -208,7 +208,7 @@ public final class ActuallyAdditionsAPI{
public static void addCompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay){
COMPOST_RECIPES.add(new CompostRecipe(input, inputDisplay, output, outputDisplay));
}
/**
* Adds a new conversion recipe to the compost.
*
@ -247,7 +247,7 @@ public final class ActuallyAdditionsAPI{
public static void addEmpowererRecipe(ItemStack input, ItemStack output, ItemStack modifier1, ItemStack modifier2, ItemStack modifier3, ItemStack modifier4, int energyPerStand, int time, float[] particleColor){
EMPOWERER_RECIPES.add(new EmpowererRecipe(input, output, modifier1, modifier2, modifier3, modifier4, energyPerStand, time, particleColor));
}
public static void addEmpowererRecipe(Ingredient input, ItemStack output, Ingredient modifier1, Ingredient modifier2, Ingredient modifier3, Ingredient modifier4, int energyPerStand, int time, float[] particleColor){
EMPOWERER_RECIPES.add(new EmpowererRecipe(input, output, modifier1, modifier2, modifier3, modifier4, energyPerStand, time, particleColor));
}
@ -271,7 +271,7 @@ public final class ActuallyAdditionsAPI{
public static void addReconstructorLensConversionRecipe(ItemStack input, ItemStack output, int energyUse){
addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion);
}
/**
* Adds a recipe to the Atomic Reconstructor conversion lenses
* StackSizes can only be 1 and greater ones will be ignored
@ -285,7 +285,7 @@ public final class ActuallyAdditionsAPI{
public static void addReconstructorLensConversionRecipe(Ingredient input, ItemStack output, int energyUse, LensConversion type){
RECONSTRUCTOR_LENS_CONVERSION_RECIPES.add(new LensConversionRecipe(input, output, energyUse, type));
}
public static void addReconstructorLensConversionRecipe(Ingredient input, ItemStack output, int energyUse){
addReconstructorLensConversionRecipe(input, output, energyUse, lensDefaultConversion);
}

View file

@ -28,8 +28,8 @@ public interface IFarmer extends IEnergyTile{
boolean canAddToSeeds(List<ItemStack> stacks);
boolean canAddToOutput(List<ItemStack> stacks);
void addToSeeds(List<ItemStack> stacks);
void addToOutput(List<ItemStack> stacks);
}

View file

@ -44,7 +44,7 @@ public interface IMethodHandler{
boolean invokeReconstructor(IAtomicReconstructor tile);
boolean addCrusherRecipes(List<ItemStack> inputs, List<ItemStack> outputOnes, int outputOneAmounts, List<ItemStack> outputTwos, int outputTwoAmounts, int outputTwoChance);
@Deprecated //Use Ingredient input on AA API class
boolean addCrusherRecipes(List<ItemStack> inputs, ItemStack outputOne, int outputOneAmount, ItemStack outputTwo, int outputTwoAmount, int outputTwoChance);

View file

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

View file

@ -1,12 +1,12 @@
package de.ellpeck.actuallyadditions.api.misc;
public interface IDisableableItem {
/**
* Represents an item that can be disabled in the configuration of the mod.
* If this returns true, assume the item is not registered with the game, but may still be instantiated.
* @return If the item has not been registered with the Forge Registry.
*/
public boolean isDisabled();
/**
* Represents an item that can be disabled in the configuration of the mod.
* If this returns true, assume the item is not registered with the game, but may still be instantiated.
* @return If the item has not been registered with the Forge Registry.
*/
public boolean isDisabled();
}

View file

@ -25,19 +25,19 @@ public class CoffeeIngredient {
public CoffeeIngredient(ItemStack input, PotionEffect[] effects, int maxAmplifier) {
this(Ingredient.fromStacks(input), maxAmplifier, effects);
}
public CoffeeIngredient(Ingredient input, int maxAmplifier, PotionEffect... effects) {
this.input = input;
this.effects = effects;
this.maxAmplifier = maxAmplifier;
}
public boolean matches(ItemStack stack) {
return input.apply(stack);
return this.input.apply(stack);
}
public Ingredient getInput() {
return input;
return this.input;
}
public PotionEffect[] getEffects() {
@ -51,8 +51,8 @@ public class CoffeeIngredient {
public String getExtraText() {
return "";
}
public int getMaxAmplifier() {
return maxAmplifier;
return this.maxAmplifier;
}
}

View file

@ -26,32 +26,32 @@ public class CompostRecipe{
public CompostRecipe(ItemStack input, Block inputDisplay, ItemStack output, Block outputDisplay) {
this(Ingredient.fromStacks(input), inputDisplay.getDefaultState(), output, outputDisplay.getDefaultState());
}
public CompostRecipe(Ingredient input, IBlockState inputDisplay, ItemStack output, IBlockState outputDisplay){
this.input = input;
this.output = output;
this.inputDisplay = inputDisplay;
this.outputDisplay = outputDisplay;
}
public boolean matches(ItemStack stack) {
return input.apply(stack);
return this.input.apply(stack);
}
public Ingredient getInput() {
return input;
return this.input;
}
public ItemStack getOutput() {
return output;
return this.output;
}
public IBlockState getInputDisplay() {
return inputDisplay;
return this.inputDisplay;
}
public IBlockState getOutputDisplay() {
return outputDisplay;
return this.outputDisplay;
}
}

View file

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

View file

@ -41,19 +41,19 @@ public class LensConversionRecipe {
}
public Ingredient getInput() {
return input;
return this.input;
}
public ItemStack getOutput() {
return output;
return this.output;
}
public int getEnergyUsed() {
return energy;
return this.energy;
}
public Lens getType() {
return type;
return this.type;
}
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.util.FluidStateMapper;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -21,7 +22,7 @@ import java.util.Map;
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!)
@ -30,7 +31,7 @@ public class ClientRegistryHandler{
Block block = fluid.getBlock();
Item item = Item.getItemFromBlock(block);
FluidStateMapper mapper = new FluidStateMapper(fluid);
ModelLoader.registerItemVariants(item);
ModelBakery.registerItemVariants(item);
ModelLoader.setCustomMeshDefinition(item, mapper);
ModelLoader.setCustomStateMapper(block, mapper);
}
@ -52,7 +53,7 @@ public class ClientRegistryHandler{
registerCustomFluidBlockRenderer(InitFluids.fluidCrystalOil);
registerCustomFluidBlockRenderer(InitFluids.fluidEmpoweredOil);
}
@SubscribeEvent
public void onModelBake(ModelBakeEvent e) {
ModelResourceLocation mrl = new ModelResourceLocation(new ResourceLocation(ActuallyAdditions.MODID, "block_compost"), "normal");

View file

@ -44,4 +44,4 @@ public final class InitAchievements{
}
}
*/
*/

View file

@ -143,4 +143,4 @@ public enum TheAchievements{
}
}
}
*/
*/

View file

@ -209,7 +209,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
tooltip.add(StringUtil.localize(base+"1."+this.toPick1)+" "+StringUtil.localize(base+"2."+this.toPick2));
}
}
@Override
public boolean hasComparatorInputOverride(IBlockState state){
return true;
@ -217,11 +217,11 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud
@Override
public int getComparatorInputOverride(IBlockState blockState, World world, BlockPos pos){
TileEntity t = world.getTileEntity(pos);
int i = 0;
if (t instanceof TileEntityAtomicReconstructor) {
i = ((TileEntityAtomicReconstructor) t).getEnergy();
}
TileEntity t = world.getTileEntity(pos);
int i = 0;
if (t instanceof TileEntityAtomicReconstructor) {
i = ((TileEntityAtomicReconstructor) t).getEnergy();
}
return MathHelper.clamp(i / 20000, 0, 15);
}
}

View file

@ -88,7 +88,7 @@ public class BlockCoffeeMachine extends BlockContainerBase{
@Override
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){
world.setBlockState(pos, this.getStateFromMeta(0), 2);

View file

@ -157,8 +157,8 @@ public class BlockColoredLamp extends BlockBase{
if(stack.getItemDamage() >= ALL_LAMP_TYPES.length){
return StringUtil.BUGGED_ITEM_NAME;
}
if(Util.isClient()) return super.getItemStackDisplayName(stack)+(((BlockColoredLamp)this.block).isOn ? " ("+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".onSuffix.desc")+")" : "");
else return super.getItemStackDisplayName(stack);
if(Util.isClient()) return super.getItemStackDisplayName(stack)+(((BlockColoredLamp)this.block).isOn ? " ("+StringUtil.localize("tooltip."+ActuallyAdditions.MODID+".onSuffix.desc")+")" : "");
else return super.getItemStackDisplayName(stack);
}

View file

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

View file

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

View file

@ -63,12 +63,12 @@ public class BlockGiantChest extends BlockContainerBase{
@Override
public TileEntity createNewTileEntity(World world, int par2){
switch(this.type){
case 1:
return new TileEntityGiantChestMedium();
case 2:
return new TileEntityGiantChestLarge();
default:
return new TileEntityGiantChest();
case 1:
return new TileEntityGiantChestMedium();
case 2:
return new TileEntityGiantChestLarge();
default:
return new TileEntityGiantChest();
}
}

View file

@ -104,17 +104,17 @@ public class BlockInputter extends BlockContainerBase{
@Override
public String getItemStackDisplayName(ItemStack stack){
if(Util.isClient()) {
long sysTime = System.currentTimeMillis();
if(Util.isClient()) {
long sysTime = System.currentTimeMillis();
if(this.lastSysTime+5000 < sysTime){
this.lastSysTime = sysTime;
this.toPick = this.rand.nextInt(NAME_FLAVOR_AMOUNTS)+1;
if(this.lastSysTime+5000 < sysTime){
this.lastSysTime = sysTime;
this.toPick = this.rand.nextInt(NAME_FLAVOR_AMOUNTS)+1;
}
return StringUtil.localize(this.getTranslationKey()+".name")+" ("+StringUtil.localize("tile."+ActuallyAdditions.MODID+".block_inputter.add."+this.toPick+".name")+")";
}
return StringUtil.localize(this.getTranslationKey()+".name")+" ("+StringUtil.localize("tile."+ActuallyAdditions.MODID+".block_inputter.add."+this.toPick+".name")+")";
}
else return super.getItemStackDisplayName(stack);
else return super.getItemStackDisplayName(stack);
}
}
}

View file

@ -10,7 +10,6 @@
package de.ellpeck.actuallyadditions.mod.blocks;
import com.google.common.base.Predicate;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewerHopping;
import net.minecraft.block.properties.PropertyDirection;
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.
public class BlockItemViewerHopping extends BlockItemViewer{
public static final PropertyDirection FACING = PropertyDirection.create("facing", new Predicate<EnumFacing>(){
@Override
public boolean apply(EnumFacing facing){
return facing != EnumFacing.UP;
}
});
public static final PropertyDirection FACING = PropertyDirection.create("facing", facing -> 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 SOUTH_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.125D);

View file

@ -99,18 +99,18 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
switch(this.getMetaFromState(state)){
case 1:
return AABB_UP;
case 2:
return AABB_NORTH;
case 3:
return AABB_SOUTH;
case 4:
return AABB_WEST;
case 5:
return AABB_EAST;
default:
return AABB_DOWN;
case 1:
return AABB_UP;
case 2:
return AABB_NORTH;
case 3:
return AABB_SOUTH;
case 4:
return AABB_WEST;
case 5:
return AABB_EAST;
default:
return AABB_DOWN;
}
}
@ -230,18 +230,18 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
@Override
public TileEntity createNewTileEntity(World world, int i){
switch(this.type){
case ITEM:
return new TileEntityLaserRelayItem();
case ITEM_WHITELIST:
return new TileEntityLaserRelayItemWhitelist();
case ENERGY_ADVANCED:
return new TileEntityLaserRelayEnergyAdvanced();
case ENERGY_EXTREME:
return new TileEntityLaserRelayEnergyExtreme();
case FLUIDS:
return new TileEntityLaserRelayFluids();
default:
return new TileEntityLaserRelayEnergy();
case ITEM:
return new TileEntityLaserRelayItem();
case ITEM_WHITELIST:
return new TileEntityLaserRelayItemWhitelist();
case ENERGY_ADVANCED:
return new TileEntityLaserRelayEnergyAdvanced();
case ENERGY_EXTREME:
return new TileEntityLaserRelayEnergyExtreme();
case FLUIDS:
return new TileEntityLaserRelayFluids();
default:
return new TileEntityLaserRelayEnergy();
}
}
@ -281,7 +281,7 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay{
ActuallyAdditionsAPI.connectionHandler.removeRelayFromNetwork(pos, world);
}
@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) {
return BlockFaceShape.UNDEFINED;

View file

@ -76,7 +76,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay{
TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos());
if(tile instanceof TileEntityMiner){
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);
}
}

View file

@ -98,7 +98,7 @@ public class BlockMisc extends BlockBase{
@Override
public int getItemBurnTime(ItemStack stack) {
if(stack.getMetadata() == TheMiscBlocks.CHARCOAL_BLOCK.ordinal()) return 16000;
return super.getItemBurnTime(stack);
return super.getItemBurnTime(stack);
}
}
}

View file

@ -86,18 +86,18 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay{
@Override
public TileEntity createNewTileEntity(World world, int par2){
switch(this.type){
case PLACER:
return new TileEntityPhantomPlacer();
case BREAKER:
return new TileEntityPhantomBreaker();
case LIQUIFACE:
return new TileEntityPhantomLiquiface();
case ENERGYFACE:
return new TileEntityPhantomEnergyface();
case REDSTONEFACE:
return new TileEntityPhantomRedstoneface();
default:
return new TileEntityPhantomItemface();
case PLACER:
return new TileEntityPhantomPlacer();
case BREAKER:
return new TileEntityPhantomBreaker();
case LIQUIFACE:
return new TileEntityPhantomLiquiface();
case ENERGYFACE:
return new TileEntityPhantomEnergyface();
case REDSTONEFACE:
return new TileEntityPhantomRedstoneface();
default:
return new TileEntityPhantomItemface();
}
}

View file

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

View file

@ -37,7 +37,7 @@ public class BlockSlabs extends BlockBase{
public static final AxisAlignedBB AABB_BOTTOM_HALF = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.5D, 1.0D);
private static final AxisAlignedBB AABB_TOP_HALF = new AxisAlignedBB(0.0D, 0.5D, 0.0D, 1.0D, 1.0D, 1.0D);
private final IBlockState fullBlockState;
public BlockSlabs(String name, Block fullBlock){
@ -118,7 +118,7 @@ public class BlockSlabs extends BlockBase{
if(state.getBlock() == 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;
AxisAlignedBB bound = newState.getCollisionBoundingBox(world, pos);
@ -145,7 +145,7 @@ public class BlockSlabs extends BlockBase{
IBlockState state = worldIn.getBlockState(pos);
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;
}
}
@ -162,7 +162,7 @@ public class BlockSlabs extends BlockBase{
AxisAlignedBB bound = newState.getCollisionBoundingBox(world, pos);
if(bound != Block.NULL_AABB && world.checkNoEntityCollision(bound.offset(pos)) && world.setBlockState(pos, newState, 11)){
SoundType soundtype = theBlock.fullBlockState.getBlock().getSoundType(theBlock.fullBlockState, world, pos, player);
SoundType soundtype = theBlock.fullBlockState.getBlock().getSoundType(theBlock.fullBlockState, world, pos, player);
world.playSound(player, pos, soundtype.getPlaceSound(), SoundCategory.BLOCKS, (soundtype.getVolume()+1.0F)/2.0F, soundtype.getPitch()*0.8F);
player.setHeldItem(hand, StackUtil.shrink(stack, 1));

View file

@ -55,16 +55,16 @@ public class BlockTinyTorch extends BlockBase{
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
switch(state.getValue(BlockTorch.FACING)){
case EAST:
return TORCH_EAST_AABB;
case WEST:
return TORCH_WEST_AABB;
case SOUTH:
return TORCH_SOUTH_AABB;
case NORTH:
return TORCH_NORTH_AABB;
default:
return STANDING_AABB;
case EAST:
return TORCH_EAST_AABB;
case WEST:
return TORCH_WEST_AABB;
case SOUTH:
return TORCH_SOUTH_AABB;
case NORTH:
return TORCH_NORTH_AABB;
default:
return STANDING_AABB;
}
}
@ -83,12 +83,12 @@ public class BlockTinyTorch extends BlockBase{
public boolean isFullCube(IBlockState state){
return false;
}
@Override
public boolean isNormalCube(IBlockState state){
return false;
}
@Override
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing facing) {
return BlockFaceShape.UNDEFINED;
@ -189,14 +189,14 @@ public class BlockTinyTorch extends BlockBase{
public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos, Random rand){
if(rand.nextBoolean()){
EnumFacing enumfacing = stateIn.getValue(BlockTorch.FACING);
double d0 = (double)pos.getX()+0.5D;
double d1 = (double)pos.getY()+0.4D;
double d2 = (double)pos.getZ()+0.5D;
double d0 = pos.getX()+0.5D;
double d1 = pos.getY()+0.4D;
double d2 = pos.getZ()+0.5D;
if(enumfacing.getAxis().isHorizontal()){
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.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.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*enumfacing1.getXOffset(), d1+0.22D, d2+0.35D*enumfacing1.getZOffset(), 0.0D, 0.0D, 0.0D);
}
else{
worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0, d1, d2, 0.0D, 0.0D, 0.0D);
@ -210,21 +210,21 @@ public class BlockTinyTorch extends BlockBase{
IBlockState iblockstate = this.getDefaultState();
switch(meta){
case 1:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.EAST);
break;
case 2:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.WEST);
break;
case 3:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.SOUTH);
break;
case 4:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.NORTH);
break;
case 5:
default:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.UP);
case 1:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.EAST);
break;
case 2:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.WEST);
break;
case 3:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.SOUTH);
break;
case 4:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.NORTH);
break;
case 5:
default:
iblockstate = iblockstate.withProperty(BlockTorch.FACING, EnumFacing.UP);
}
return iblockstate;
@ -240,22 +240,22 @@ public class BlockTinyTorch extends BlockBase{
int i = 0;
switch(state.getValue(BlockTorch.FACING)){
case EAST:
i = i | 1;
break;
case WEST:
i = i | 2;
break;
case SOUTH:
i = i | 3;
break;
case NORTH:
i = i | 4;
break;
case DOWN:
case UP:
default:
i = i | 5;
case EAST:
i = i | 1;
break;
case WEST:
i = i | 2;
break;
case SOUTH:
i = i | 3;
break;
case NORTH:
i = i | 4;
break;
case DOWN:
case UP:
default:
i = i | 5;
}
return i;

View file

@ -117,7 +117,7 @@ public class BlockWallAA extends BlockBase{
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos){
IBlockState state = worldIn.getBlockState(pos);
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;
}
@Override
public void registerRendering(){
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;
}
@Override
public void registerRendering(){
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;
}
@Override
public void registerRendering(){
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);
//Remove unnecessarily saved default values to avoid unstackability
List<String> keysToRemove = new ArrayList<String>();
List<String> keysToRemove = new ArrayList<>();
for(String key : data.getKeySet()){
NBTBase tag = data.getTag(key);
//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;
}
@Override
public void registerRendering(){
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;
}
@Override
public void registerRendering(){
ActuallyAdditions.PROXY.addRenderRegister(new ItemStack(this), this.getRegistryName(), "inventory");
}

View file

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

View file

@ -27,7 +27,7 @@ public class CompostModel implements IBakedModel {
public CompostModel(IBlockState flowerState, float height) {
this.display = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState(flowerState);
TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0, -.218F, 0), null, new Vector3f(0.75F, height / 1.81F, 0.75F), null));
ImmutableList.Builder<BakedQuad> builder;
@ -35,8 +35,8 @@ public class CompostModel implements IBakedModel {
for (EnumFacing face : EnumFacing.values()) {
builder = ImmutableList.builder();
if (!display.isBuiltInRenderer()) {
for (BakedQuad quad : display.getQuads(flowerState, face, 0)) {
if (!this.display.isBuiltInRenderer()) {
for (BakedQuad quad : this.display.getQuads(flowerState, face, 0)) {
Transformer transformer = new Transformer(transform, quad.getFormat());
quad.pipe(transformer);
builder.add(transformer.build());
@ -46,29 +46,29 @@ public class CompostModel implements IBakedModel {
faces.put(face, builder.build());
}
if (!display.isBuiltInRenderer()) {
if (!this.display.isBuiltInRenderer()) {
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());
quad.pipe(transformer);
builder.add(transformer.build());
}
builder.addAll(compostBase.getQuads(null, null, 0));
this.general = builder.build();
} else general = ImmutableList.of();
} else this.general = ImmutableList.of();
this.faces = Maps.immutableEnumMap(faces);
}
@Override
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, long rand) {
if (side == null) return general;
return faces.get(side);
if (side == null) return this.general;
return this.faces.get(side);
}
@Override
public boolean isAmbientOcclusion() {
return compostBase.isAmbientOcclusion() && display.isAmbientOcclusion();
return compostBase.isAmbientOcclusion() && this.display.isAmbientOcclusion();
}
@Override

View file

@ -37,7 +37,7 @@ public class RenderBatteryBox extends TileEntitySpecialRenderer<TileEntityBatter
return;
}
ItemStack stack = ((TileEntityBatteryBox)tile).inv.getStackInSlot(0);
ItemStack stack = tile.inv.getStackInSlot(0);
if(StackUtil.isValid(stack) && stack.getItem() instanceof ItemBattery){
GlStateManager.pushMatrix();
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;
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;
GlStateManager.scale(scale, scale, scale);

View file

@ -31,14 +31,14 @@ public class RenderDisplayStand extends TileEntitySpecialRenderer<TileEntityDisp
return;
}
ItemStack stack = ((TileEntityDisplayStand)tile).inv.getStackInSlot(0);
ItemStack stack = tile.inv.getStackInSlot(0);
if(StackUtil.isValid(stack)){
GlStateManager.pushMatrix();
GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F);
double boop = Minecraft.getSystemTime()/800D;
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;
GlStateManager.scale(scale, scale, scale);

View file

@ -35,14 +35,14 @@ public class RenderEmpowerer extends TileEntitySpecialRenderer<TileEntityEmpower
return;
}
ItemStack stack = ((TileEntityEmpowerer)tile).inv.getStackInSlot(0);
ItemStack stack = tile.inv.getStackInSlot(0);
if(StackUtil.isValid(stack)){
GlStateManager.pushMatrix();
GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F);
double boop = Minecraft.getSystemTime()/800D;
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;
GlStateManager.scale(scale, scale, scale);
@ -56,7 +56,7 @@ public class RenderEmpowerer extends TileEntitySpecialRenderer<TileEntityEmpower
GlStateManager.popMatrix();
}
int index = ((TileEntityEmpowerer)tile).recipeForRenderIndex;
int index = tile.recipeForRenderIndex;
if(index >= 0 && ActuallyAdditionsAPI.EMPOWERER_RECIPES.size() > index){
EmpowererRecipe recipe = ActuallyAdditionsAPI.EMPOWERER_RECIPES.get(index);
if(recipe != null){

View file

@ -43,7 +43,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
@Override
public void render(TileEntityLaserRelay tile, double x, double y, double z, float par5, int par6, float f){
if(tile instanceof TileEntityLaserRelay){
TileEntityLaserRelay relay = (TileEntityLaserRelay)tile;
TileEntityLaserRelay relay = tile;
boolean hasInvis = false;
EntityPlayer player = Minecraft.getMinecraft().player;
@ -56,7 +56,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
}
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();
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);
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);
@ -85,7 +85,7 @@ public class RenderLaserRelay extends TileEntitySpecialRenderer<TileEntityLaserR
boolean otherInvis = StackUtil.isValid(secondUpgrade) && secondUpgrade.getItem() == InitItems.itemLaserUpgradeInvisibility;
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);
}

View file

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

View file

@ -43,15 +43,15 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer<TileEntitySmile
boolean renderedEaster = false;
easterEggs:
for(ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.CLOUD_STUFF){
for(String triggerName : cloud.getTriggerNames()){
if(triggerName != null && theCloud.name != null){
if(triggerName.equalsIgnoreCase(theCloud.name)){
GlStateManager.pushMatrix();
for(ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.CLOUD_STUFF){
for(String triggerName : cloud.getTriggerNames()){
if(triggerName != null && theCloud.name != null){
if(triggerName.equalsIgnoreCase(theCloud.name)){
GlStateManager.pushMatrix();
IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos());
if(state.getBlock() == InitBlocks.blockSmileyCloud){
switch(state.getValue(BlockHorizontal.FACING)){
IBlockState state = theCloud.getWorld().getBlockState(theCloud.getPos());
if(state.getBlock() == InitBlocks.blockSmileyCloud){
switch(state.getValue(BlockHorizontal.FACING)){
case NORTH:
GlStateManager.rotate(180, 0, 1, 0);
break;
@ -61,20 +61,20 @@ public class RenderSmileyCloud extends TileEntitySpecialRenderer<TileEntitySmile
case WEST:
GlStateManager.rotate(90, 0, 1, 0);
break;
default:
break;
default:
break;
}
}
cloud.renderExtra(0.0625F);
GlStateManager.popMatrix();
renderedEaster = true;
break easterEggs;
}
cloud.renderExtra(0.0625F);
GlStateManager.popMatrix();
renderedEaster = true;
break easterEggs;
}
}
}
}
String nameLower = theCloud.name.toLowerCase(Locale.ROOT);
if(SpecialRenderInit.SPECIAL_LIST.containsKey(nameLower)){

View file

@ -29,18 +29,18 @@ public class Transformer extends VertexTransformer {
@Override
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
if (usage == VertexFormatElement.EnumUsage.POSITION && data.length >= 3) {
Vector4f vec = new Vector4f(data);
vec.setW(1.0f);
transformation.transform(vec);
this.transformation.transform(vec);
data = new float[4];
vec.get(data);
} else if (usage == VertexFormatElement.EnumUsage.NORMAL && data.length >= 3) {
Vector3f vec = new Vector3f(data);
normalTransformation.transform(vec);
this.normalTransformation.transform(vec);
vec.normalize();
data = new float[4];
vec.get(data);
@ -49,6 +49,6 @@ public class Transformer extends VertexTransformer {
}
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.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI;
@ -127,12 +126,12 @@ public final class InitBooklet{
for(IBookletPage page : chapter.getAllPages()){
pageCount++;
List<ItemStack> items = new ArrayList<ItemStack>();
List<ItemStack> items = new ArrayList<>();
page.getItemStacksForPage(items);
List<FluidStack> fluids = new ArrayList<FluidStack>();
List<FluidStack> fluids = new ArrayList<>();
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)){
ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA.add(page);
infoCount++;
@ -143,29 +142,20 @@ public final class InitBooklet{
}
}
Collections.sort(ActuallyAdditionsAPI.BOOKLET_ENTRIES, new Comparator<IBookletEntry>(){
@Override
public int compare(IBookletEntry entry1, IBookletEntry entry2){
Integer prio1 = entry1.getSortingPriority();
Integer prio2 = entry2.getSortingPriority();
return prio2.compareTo(prio1);
}
Collections.sort(ActuallyAdditionsAPI.BOOKLET_ENTRIES, (entry1, entry2) -> {
Integer prio1 = entry1.getSortingPriority();
Integer prio2 = entry2.getSortingPriority();
return prio2.compareTo(prio1);
});
Collections.sort(ActuallyAdditionsAPI.ALL_CHAPTERS, new Comparator<IBookletChapter>(){
@Override
public int compare(IBookletChapter chapter1, IBookletChapter chapter2){
Integer prio1 = chapter1.getSortingPriority();
Integer prio2 = chapter2.getSortingPriority();
return prio2.compareTo(prio1);
}
Collections.sort(ActuallyAdditionsAPI.ALL_CHAPTERS, (chapter1, chapter2) -> {
Integer prio1 = chapter1.getSortingPriority();
Integer prio2 = chapter2.getSortingPriority();
return prio2.compareTo(prio1);
});
Collections.sort(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, new Comparator<IBookletPage>(){
@Override
public int compare(IBookletPage page1, IBookletPage page2){
Integer prio1 = page1.getSortingPriority();
Integer prio2 = page2.getSortingPriority();
return prio2.compareTo(prio1);
}
Collections.sort(ActuallyAdditionsAPI.BOOKLET_PAGES_WITH_ITEM_OR_FLUID_DATA, (page1, page2) -> {
Integer prio1 = page1.getSortingPriority();
Integer prio2 = page2.getSortingPriority();
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!");
@ -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[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));
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()));
for(int i = 0; i < LensRecipeHandler.MAIN_PAGE_RECIPES.size(); i++){
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[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());
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)));
for(int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++){
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());
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());
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 PageCrafting(lampPages.size()+1, BlockCrafting.recipePowerer).setWildcard().setNoText());
@ -265,7 +255,7 @@ public final class InitBooklet{
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
List<IBookletPage> list = new ArrayList<>();
list.add(new PageTextOnly(1).addTextReplacement("<rf>", TileEntityGrinder.ENERGY_USE));
list.add(new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText());
@ -273,7 +263,7 @@ public final class InitBooklet{
if(CrusherCrafting.recipeIronHorseArmor != null) list.add(new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText());
if(CrusherCrafting.recipeGoldHorseArmor != null) list.add(new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText());
if(CrusherCrafting.recipeDiamondHorseArmor != null) list.add(new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText());
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), list.toArray(new IBookletPage[0]));
new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("<rf>", TileEntityFurnaceDouble.ENERGY_USE));
new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).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("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();
ArrayList<BookletPage> aiotPages = new ArrayList<BookletPage>();
ArrayList<BookletPage> aiotPages = new ArrayList<>();
aiotPages.add(new PageTextOnly(aiotPages.size()+1));
for(IRecipe recipe : ToolCrafting.RECIPES_PAXELS){
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));
ArrayList<BookletPage> potionRingPages = new ArrayList<BookletPage>();
ArrayList<BookletPage> potionRingPages = new ArrayList<>();
potionRingPages.add(new PageTextOnly(potionRingPages.size()+1));
for(IRecipe recipe : ItemCrafting.RECIPES_POTION_RINGS){
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){
if(this.isMouseOver()){
List<String> list = new ArrayList<String>();
List<String> list = new ArrayList<>();
if(this.assignedPage != null){
IBookletChapter chapter = this.assignedPage.getChapter();

View file

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

View file

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

View file

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

View file

@ -81,7 +81,7 @@ public abstract class GuiBooklet extends GuiBookletBase{
}
}
else{
return (float)conf/100F;
return conf/100F;
}
}
@ -330,7 +330,7 @@ public abstract class GuiBooklet extends GuiBookletBase{
@Override
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);
}
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 y = 0; y < BUTTONS_PER_PAGE; y++){
int id = y+x*BUTTONS_PER_PAGE;
@ -105,7 +105,7 @@ public class GuiEntry extends GuiBooklet{
@Override
protected void actionPerformed(GuiButton button) throws IOException{
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){
IBookletChapter chapter = this.chapters.get(actualId);

View file

@ -103,7 +103,7 @@ public class GuiMainPage extends GuiBooklet{
}
private static List<IBookletEntry> getDisplayedEntries(){
List<IBookletEntry> displayed = new ArrayList<IBookletEntry>();
List<IBookletEntry> displayed = new ArrayList<>();
for(IBookletEntry entry : ActuallyAdditionsAPI.BOOKLET_ENTRIES){
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.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.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.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);
@ -242,7 +242,7 @@ public class GuiMainPage extends GuiBooklet{
}
}
}
/*else if(button == this.achievementButton){
/*else if(button == this.achievementButton){
GuiScreen achievements = new GuiAAAchievements(this, this.mc.player.getStatFileWriter());
this.mc.displayGuiScreen(achievements);
}*/
@ -293,7 +293,7 @@ public class GuiMainPage extends GuiBooklet{
int quoteSize = this.quote.size();
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());
}

View file

@ -37,7 +37,7 @@ import java.util.List;
public class GuiPage extends GuiBooklet{
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 GuiButton buttonViewOnline;
@ -132,7 +132,7 @@ public class GuiPage extends GuiBooklet{
}
private List<String> getWebLinks(){
List<String> links = new ArrayList<String>();
List<String> links = new ArrayList<>();
for(IBookletPage page : this.pages){
if(page != null){

View file

@ -62,4 +62,4 @@ public class GuiAAAchievements extends GuiAchievements{
}
}
}
*/
*/

View file

@ -28,11 +28,11 @@ import java.util.*;
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;
private final int priority;
private final List<ItemStack> itemsForPage = new ArrayList<ItemStack>();
private final List<FluidStack> fluidsForPage = new ArrayList<FluidStack>();
private final List<ItemStack> itemsForPage = new ArrayList<>();
private final List<FluidStack> fluidsForPage = new ArrayList<>();
protected IBookletChapter chapter;
protected boolean hasNoText;

View file

@ -52,8 +52,8 @@ public class PageCoffeeMachine extends BookletPage{
gui.renderSplitScaledAsciiString("Hover over this to see the effect!", startX+5, startY+51, 0, false, gui.getSmallFontSize(), 35);
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
@ -61,7 +61,7 @@ public class PageCoffeeMachine extends BookletPage{
public void initGui(GuiBookletBase gui, int startX, int 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(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CUP.ordinal()), startX+5+37, startY+10+1, 1F, true);

View file

@ -129,7 +129,7 @@ public class PageCrafting extends BookletPage{
Ingredient[] ings = new Ingredient[9];
int width = 3;
int height = 3;
if(recipe instanceof BlankRecipe){
this.recipeTypeLocKey = "tooltip."+ActuallyAdditions.MODID+".disabled";
gui.addOrModifyItemRenderer(recipe.getRecipeOutput(), startX+100, startY+25, 1F, false);

View file

@ -33,7 +33,7 @@ public class PageCrusherRecipe extends BookletPage{
public PageCrusherRecipe(int localizationKey, CrusherRecipe recipe){
super(localizationKey);
this.recipe = recipe;
stacks = recipe.getInput().getMatchingStacks();
this.stacks = recipe.getInput().getMatchingStacks();
}
@Override
@ -47,8 +47,8 @@ public class PageCrusherRecipe extends BookletPage{
gui.renderScaledAsciiString("("+StringUtil.localize("booklet."+ActuallyAdditions.MODID+".crusherRecipe")+")", startX+36, startY+85, 0, false, gui.getMediumFontSize());
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
@ -57,7 +57,7 @@ public class PageCrusherRecipe extends BookletPage{
super.initGui(gui, startX, startY);
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);
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());
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
@ -65,25 +65,25 @@ public class PageEmpowerer extends BookletPage{
super.initGui(gui, startX, startY);
if(this.recipe != null){
gui.addOrModifyItemRenderer(stand1[0], startX+5+26, startY+10+1, 1F, true);
gui.addOrModifyItemRenderer(stand2[0], startX+5+1, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(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.stand1[0], startX+5+26, startY+10+1, 1F, true);
gui.addOrModifyItemRenderer(this.stand2[0], startX+5+1, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(this.stand3[0], startX+5+51, startY+10+26, 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);
}
}
private void updateInputs(GuiBookletBase gui, int startX, int startY) {
if(counter++ % 50 == 0) {
rotate++;
gui.addOrModifyItemRenderer(stand1[rotate % 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(stand3[rotate % 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(inputs[rotate % inputs.length], startX+5+26, startY+10+26, 1F, true);
private void updateInputs(GuiBookletBase gui, int startX, int startY) {
if(this.counter++ % 50 == 0) {
this.rotate++;
gui.addOrModifyItemRenderer(this.stand1[this.rotate % this.stand1.length], startX+5+26, startY+10+1, 1F, true);
gui.addOrModifyItemRenderer(this.stand2[this.rotate % this.stand2.length], startX+5+1, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(this.stand3[this.rotate % this.stand3.length], startX+5+51, startY+10+26, 1F, true);
gui.addOrModifyItemRenderer(this.stand4[this.rotate % this.stand4.length], startX+5+26, startY+10+51, 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);
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);
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);
}
}

View file

@ -27,7 +27,7 @@ public class GuiConfiguration extends GuiConfig{
}
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++){
ConfigCategories cat = ConfigCategories.values()[i];
ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment);

View file

@ -13,7 +13,7 @@ package de.ellpeck.actuallyadditions.mod.config.values;
import de.ellpeck.actuallyadditions.mod.config.ConfigCategories;
public enum ConfigIntValues{
RICE_AMOUNT("Rice: Amount", ConfigCategories.WORLD_GEN, 15, 1, 100, "The Amount of Rice generating"),
CANOLA_AMOUNT("Canola: Amount", ConfigCategories.WORLD_GEN, 10, 1, 50, "The Amount of Canola generating"),
FLAX_AMOUNT("Flax: Amount", ConfigCategories.WORLD_GEN, 8, 1, 50, "The Amount of Flax generating"),
@ -30,9 +30,9 @@ public enum ConfigIntValues{
FONT_SIZE_LARGE("Booklet Large Font Size", ConfigCategories.OTHER, 0, 0, 500, "The size of the booklet's large font in percent. Set to 0 to use defaults from the lang file."),
ELEVEN("What is 11", ConfigCategories.OTHER, 11, 0, 12, "11?"),
FUR_CHANCE("Fur Drop Chance", ConfigCategories.OTHER, 5000, 1, Integer.MAX_VALUE, "The 1/n drop chance, per tick, for a fur ball to be dropped."),
RECONSTRUCTOR_POWER("Atomic Reconstructor Power", ConfigCategories.MACHINE_VALUES, 300000, 300000, Integer.MAX_VALUE, "The amount of power the atomic reconstructor can store."),
FARMER_AREA("Farmer Area", ConfigCategories.MACHINE_VALUES, 9, 1, Integer.MAX_VALUE, "The size of the farmer's farming area. Default is 9x9, must be an odd number.");
FUR_CHANCE("Fur Drop Chance", ConfigCategories.OTHER, 5000, 1, Integer.MAX_VALUE, "The 1/n drop chance, per tick, for a fur ball to be dropped."),
RECONSTRUCTOR_POWER("Atomic Reconstructor Power", ConfigCategories.MACHINE_VALUES, 300000, 300000, Integer.MAX_VALUE, "The amount of power the atomic reconstructor can store."),
FARMER_AREA("Farmer Area", ConfigCategories.MACHINE_VALUES, 9, 1, Integer.MAX_VALUE, "The size of the farmer's farming area. Default is 9x9, must be an odd number.");
public final String name;
public final String category;

View file

@ -100,28 +100,28 @@ public final class BlockCrafting{
public static IRecipe recipeFarmer;
public static IRecipe recipeBatteryBox;
private static class FireworkIngredient extends Ingredient {
private static class FireworkIngredient extends Ingredient {
ItemStack firework = new ItemStack(Items.FIREWORKS);
ItemStack[] fireworks = new ItemStack[] {firework};
ItemStack firework = new ItemStack(Items.FIREWORKS);
ItemStack[] fireworks = new ItemStack[] {this.firework};
@Override
public ItemStack[] getMatchingStacks() {
return fireworks;
}
@Override
public ItemStack[] getMatchingStacks() {
return this.fireworks;
}
@Override
public boolean apply(ItemStack stack) {
return stack.getItem() == Items.FIREWORKS;
}
}
@Override
public boolean apply(ItemStack stack) {
return stack.getItem() == Items.FIREWORKS;
}
}
public static void init(){
Block[] removeNBTBlocks = new Block[] { InitBlocks.blockOilGenerator, InitBlocks.blockFluidPlacer, InitBlocks.blockFluidCollector, InitBlocks.blockCanolaPress, InitBlocks.blockFermentingBarrel };
for(Block b : removeNBTBlocks)
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(b), new ItemStack(b));
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(b), new ItemStack(b));
//Battery Box
RecipeHandler.addShapelessOreDictRecipe(new ItemStack(InitBlocks.blockBatteryBox),
@ -160,7 +160,7 @@ public final class BlockCrafting{
'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_CHAR.ordinal()),
'W', "stickWood");
recipesTinyTorch[1] = RecipeUtil.lastIRecipe();
//Firework Box
RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockFireworkBox),
"GFG", "SAS", "CCC",
@ -371,8 +371,8 @@ public final class BlockCrafting{
RecipeHandler.addOreDictRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDER_CASING.ordinal()),
"WSW", "SRS", "WSW",
'W', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ENDERPEARL_BLOCK.ordinal()) : new ItemStack(Items.ENDER_PEARL),
'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()),
'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(Blocks.DIAMOND_BLOCK) : new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()));
'R', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()),
'S', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(Blocks.DIAMOND_BLOCK) : new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()));
recipeEnderCase = RecipeUtil.lastIRecipe();
//Phantom Booster

View file

@ -76,22 +76,22 @@ public final class CrusherCrafting {
MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe());
if(!CrusherRecipeRegistry.hasException("oreRedstone"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreRedstone"), new ItemStack(Items.REDSTONE, 10), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreRedstone"), new ItemStack(Items.REDSTONE, 10), StackUtil.getEmpty(), 0);
if(!CrusherRecipeRegistry.hasException("oreLapis"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreLapis"), new ItemStack(Items.DYE, 12, 4), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreLapis"), new ItemStack(Items.DYE, 12, 4), StackUtil.getEmpty(), 0);
if(!CrusherRecipeRegistry.hasException("coal"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("coal"), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("coal"), new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal()), StackUtil.getEmpty(), 0);
if(!CrusherRecipeRegistry.hasException("oreCoal"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreCoal"), new ItemStack(Items.COAL, 3), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreCoal"), new ItemStack(Items.COAL, 3), StackUtil.getEmpty(), 0);
if(!CrusherRecipeRegistry.hasException("blockCoal"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("blockCoal"), new ItemStack(Items.COAL, 9), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("blockCoal"), new ItemStack(Items.COAL, 9), StackUtil.getEmpty(), 0);
if(!CrusherRecipeRegistry.hasException("oreQuartz"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreQuartz"), new ItemStack(Items.QUARTZ, 3), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("oreQuartz"), new ItemStack(Items.QUARTZ, 3), StackUtil.getEmpty(), 0);
if(!CrusherRecipeRegistry.hasException("cobblestone"))
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("cobblestone"), new ItemStack(Blocks.SAND), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new OreIngredient("cobblestone"), new ItemStack(Blocks.SAND), StackUtil.getEmpty(), 0);
ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT), new ItemStack(Items.FLINT), 50);
if(!CrusherRecipeRegistry.hasException("stone"))
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("stone", false), OreDictionary.getOres("cobblestone", false), 1, NonNullList.withSize(1, StackUtil.getEmpty()), 0, 0);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("stone", false), OreDictionary.getOres("cobblestone", false), 1, NonNullList.withSize(1, StackUtil.getEmpty()), 0, 0);
ActuallyAdditionsAPI.addCrusherRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.RICE.ordinal()), new ItemStack(Items.SUGAR, 2), StackUtil.getEmpty(), 0);
MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe());
@ -100,9 +100,9 @@ public final class CrusherCrafting {
MISC_RECIPES.add(RecipeUtil.lastCrusherRecipe());
if(!CrusherRecipeRegistry.hasException("oreNickel"))
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreNickel", false), OreDictionary.getOres("dustNickel", false), 2, OreDictionary.getOres("dustPlatinum", false), 1, 15);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreNickel", false), OreDictionary.getOres("dustNickel", false), 2, OreDictionary.getOres("dustPlatinum", false), 1, 15);
if(!CrusherRecipeRegistry.hasException("oreIron"))
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreIron", false), OreDictionary.getOres("dustIron", false), 2, OreDictionary.getOres("dustGold", false), 1, 20);
ActuallyAdditionsAPI.addCrusherRecipes(OreDictionary.getOres("oreIron", false), OreDictionary.getOres("dustIron", false), 2, OreDictionary.getOres("dustGold", false), 1, 20);
ItemStack temp = getStack("dustIron");
if (!temp.isEmpty()) {

View file

@ -37,8 +37,8 @@ import java.util.ArrayList;
public final class ItemCrafting{
public static final ArrayList<IRecipe> RECIPES_POTION_RINGS = new ArrayList<IRecipe>();
public static final ArrayList<IRecipe> RECIPES_DRILL_COLORING = new ArrayList<IRecipe>();
public static final ArrayList<IRecipe> RECIPES_POTION_RINGS = new ArrayList<>();
public static final ArrayList<IRecipe> RECIPES_DRILL_COLORING = new ArrayList<>();
public static IRecipe recipePhantomConnector;
public static IRecipe recipeCoil;
public static IRecipe recipeCoilAdvanced;
@ -469,7 +469,7 @@ public final class ItemCrafting{
RecipeHandler.addOreDictRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()),
" R ", "RIR", " R ",
'I', ConfigBoolValues.SUPER_DUPER_HARD_MODE.isEnabled() ? new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()) : new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()),
'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()));
'R', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.REDSTONE.ordinal()));
recipeCoil = RecipeUtil.lastIRecipe();
//Cup

View file

@ -98,7 +98,7 @@ public final class MiscCrafting{
new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()),
new ItemStack(Items.PRISMARINE_SHARD));
ItemCrafting.recipeEnderStar = RecipeUtil.lastIRecipe();
//Spawner Shard -> ingot
GameRegistry.addSmelting(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new ItemStack(Items.IRON_INGOT, 2), 5F);
}

View file

@ -25,7 +25,7 @@ import java.util.ArrayList;
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(){

View file

@ -350,7 +350,7 @@ public class CreativeTab extends CreativeTabs{
}
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);
}
}

View file

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

View file

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

View file

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

View file

@ -29,5 +29,5 @@ public final class InitEntities{
public static void initClient(){
RenderingRegistry.registerEntityRenderingHandler(EntityWorm.class, RenderWorm::new);
}
}

View file

@ -28,7 +28,7 @@ public class RenderWorm extends Render<EntityWorm>{
private static ItemStack stack = ItemStack.EMPTY;
public static void fixItemStack(){
stack = new ItemStack(InitItems.itemWorm);
stack = new ItemStack(InitItems.itemWorm);
}
protected RenderWorm(RenderManager renderManager){
@ -43,10 +43,10 @@ public class RenderWorm extends Render<EntityWorm>{
@Override
public void doRender(EntityWorm entity, double x, double y, double z, float entityYaw, float partialTicks){
GlStateManager.pushMatrix();
bindEntityTexture(entity);
this.bindEntityTexture(entity);
GlStateManager.translate(x, y+0.7F, z);
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);
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){
List<BlockPos> possiblePoses = new ArrayList<BlockPos>();
List<BlockPos> possiblePoses = new ArrayList<>();
for(double x = -radius; x < radius; x++){
for(double y = -radius; y < radius; y++){
for(double z = -radius; z < radius; z++){
@ -152,7 +152,7 @@ public class WorldGenLushCaves{
for(double x = -radius; x < radius; x++){
for(double y = -radius; y < radius; y++){
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);
//Note: order matters, checkIndestructable will generate chunks if order is reversed
if(boundingBox.isVecInside(pos) && !this.checkIndestructable(world, pos)){

View file

@ -102,14 +102,14 @@ public class VillageComponentCustomCropField extends StructureVillagePieces.Hous
private IBlockState getRandomCropType(Random rand){
int randomMeta = MathHelper.getInt(rand, 1, 7);
switch(rand.nextInt(4)){
case 0:
return InitBlocks.blockFlax.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
case 1:
return InitBlocks.blockCoffee.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
case 2:
return InitBlocks.blockRice.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
default:
return InitBlocks.blockCanola.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
case 0:
return InitBlocks.blockFlax.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
case 1:
return InitBlocks.blockCoffee.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
case 2:
return InitBlocks.blockRice.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
default:
return InitBlocks.blockCanola.getDefaultState().withProperty(BlockCrops.AGE, randomMeta);
}
}
}

View file

@ -101,7 +101,7 @@ public class VillageComponentJamHouse extends StructureVillagePieces.House1{
}
@SuppressWarnings("deprecation")
public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){
public void spawnActualHouse(World world, Random rand, StructureBoundingBox sbb){
//Base
this.fillWithBlocks(world, sbb, 1, 0, 8, 9, 0, 10, Blocks.GRASS);
this.fillWithBlocks(world, sbb, 0, 0, 0, 1, 0, 7, Blocks.COBBLESTONE);

View file

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

View file

@ -100,10 +100,10 @@ public class ContainerDropper extends Container{
public boolean canInteractWith(EntityPlayer player){
return this.dropper.canPlayerUse(player);
}
@Override
public void onContainerClosed(EntityPlayer playerIn) {
super.onContainerClosed(playerIn);
if (!player.isSpectator()) dropper.getWorld().notifyNeighborsOfStateChange(dropper.getPos(), InitBlocks.blockDropper, false);
super.onContainerClosed(playerIn);
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) {
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
public int getSlotStackLimit() {
return 1;

View file

@ -49,7 +49,7 @@ public class ContainerEnervator extends Container{
for(int k = 0; k < 4; ++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
public int getSlotStackLimit(){
return 1;

View file

@ -35,7 +35,7 @@ public class ContainerFilter extends Container{
for(int i = 0; i < 4; i++){
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 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();
//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)){
return StackUtil.getEmpty();
}

View file

@ -66,78 +66,78 @@ public class GuiHandler implements IGuiHandler{
tile = (TileEntityBase)world.getTileEntity(new BlockPos(x, y, z));
}
switch(GuiTypes.values()[id]){
case FEEDER:
return new ContainerFeeder(player.inventory, tile);
case GIANT_CHEST:
return new ContainerGiantChest(player.inventory, tile, 0);
case GIANT_CHEST_PAGE_2:
return new ContainerGiantChest(player.inventory, tile, 1);
case GIANT_CHEST_PAGE_3:
return new ContainerGiantChest(player.inventory, tile, 2);
case CRAFTER:
return CompatUtil.getCrafterContainerElement(player, world, x, y, z);
case GRINDER:
return new ContainerGrinder(player.inventory, tile, false);
case GRINDER_DOUBLE:
return new ContainerGrinder(player.inventory, tile, true);
case FURNACE_DOUBLE:
return new ContainerFurnaceDouble(player.inventory, tile);
case INPUTTER:
return new ContainerInputter(player.inventory, tile, false);
case INPUTTER_ADVANCED:
return new ContainerInputter(player.inventory, tile, true);
case REPAIRER:
return new ContainerRepairer(player.inventory, tile);
case BREAKER:
return new ContainerBreaker(player.inventory, tile);
case DROPPER:
return new ContainerDropper(player, tile);
case CANOLA_PRESS:
return new ContainerCanolaPress(player.inventory, tile);
case FERMENTING_BARREL:
return new ContainerFermentingBarrel(player.inventory, tile);
case COAL_GENERATOR:
return new ContainerCoalGenerator(player.inventory, tile);
case OIL_GENERATOR:
return new ContainerOilGenerator(player.inventory, tile);
case PHANTOM_PLACER:
return new ContainerPhantomPlacer(player.inventory, tile);
case FLUID_COLLECTOR:
return new ContainerFluidCollector(player.inventory, tile);
case COFFEE_MACHINE:
return new ContainerCoffeeMachine(player.inventory, tile);
case DRILL:
return new ContainerDrill(player.inventory);
case FILTER:
return new ContainerFilter(player.inventory);
case ENERGIZER:
return new ContainerEnergizer(player, tile);
case ENERVATOR:
return new ContainerEnervator(player, tile);
case XP_SOLIDIFIER:
return new ContainerXPSolidifier(player.inventory, tile);
case CLOUD:
return new ContainerSmileyCloud();
case DIRECTIONAL_BREAKER:
return new ContainerDirectionalBreaker(player.inventory, tile);
case RANGED_COLLECTOR:
return new ContainerRangedCollector(player.inventory, tile);
case MINER:
return new ContainerMiner(player.inventory, tile);
case LASER_RELAY_ITEM_WHITELIST:
return new ContainerLaserRelayItemWhitelist(player.inventory, tile);
case BAG:
return new ContainerBag(player.getHeldItemMainhand(), player.inventory, false);
case VOID_BAG:
return new ContainerBag(player.getHeldItemMainhand(), player.inventory, true);
case BIO_REACTOR:
return new ContainerBioReactor(player.inventory, tile);
case FARMER:
return new ContainerFarmer(player.inventory, tile);
case FIREWORK_BOX:
return new ContainerFireworkBox();
default:
return null;
case FEEDER:
return new ContainerFeeder(player.inventory, tile);
case GIANT_CHEST:
return new ContainerGiantChest(player.inventory, tile, 0);
case GIANT_CHEST_PAGE_2:
return new ContainerGiantChest(player.inventory, tile, 1);
case GIANT_CHEST_PAGE_3:
return new ContainerGiantChest(player.inventory, tile, 2);
case CRAFTER:
return CompatUtil.getCrafterContainerElement(player, world, x, y, z);
case GRINDER:
return new ContainerGrinder(player.inventory, tile, false);
case GRINDER_DOUBLE:
return new ContainerGrinder(player.inventory, tile, true);
case FURNACE_DOUBLE:
return new ContainerFurnaceDouble(player.inventory, tile);
case INPUTTER:
return new ContainerInputter(player.inventory, tile, false);
case INPUTTER_ADVANCED:
return new ContainerInputter(player.inventory, tile, true);
case REPAIRER:
return new ContainerRepairer(player.inventory, tile);
case BREAKER:
return new ContainerBreaker(player.inventory, tile);
case DROPPER:
return new ContainerDropper(player, tile);
case CANOLA_PRESS:
return new ContainerCanolaPress(player.inventory, tile);
case FERMENTING_BARREL:
return new ContainerFermentingBarrel(player.inventory, tile);
case COAL_GENERATOR:
return new ContainerCoalGenerator(player.inventory, tile);
case OIL_GENERATOR:
return new ContainerOilGenerator(player.inventory, tile);
case PHANTOM_PLACER:
return new ContainerPhantomPlacer(player.inventory, tile);
case FLUID_COLLECTOR:
return new ContainerFluidCollector(player.inventory, tile);
case COFFEE_MACHINE:
return new ContainerCoffeeMachine(player.inventory, tile);
case DRILL:
return new ContainerDrill(player.inventory);
case FILTER:
return new ContainerFilter(player.inventory);
case ENERGIZER:
return new ContainerEnergizer(player, tile);
case ENERVATOR:
return new ContainerEnervator(player, tile);
case XP_SOLIDIFIER:
return new ContainerXPSolidifier(player.inventory, tile);
case CLOUD:
return new ContainerSmileyCloud();
case DIRECTIONAL_BREAKER:
return new ContainerDirectionalBreaker(player.inventory, tile);
case RANGED_COLLECTOR:
return new ContainerRangedCollector(player.inventory, tile);
case MINER:
return new ContainerMiner(player.inventory, tile);
case LASER_RELAY_ITEM_WHITELIST:
return new ContainerLaserRelayItemWhitelist(player.inventory, tile);
case BAG:
return new ContainerBag(player.getHeldItemMainhand(), player.inventory, false);
case VOID_BAG:
return new ContainerBag(player.getHeldItemMainhand(), player.inventory, true);
case BIO_REACTOR:
return new ContainerBioReactor(player.inventory, tile);
case FARMER:
return new ContainerFarmer(player.inventory, tile);
case FIREWORK_BOX:
return new ContainerFireworkBox();
default:
return null;
}
}
@ -148,93 +148,93 @@ public class GuiHandler implements IGuiHandler{
tile = (TileEntityBase)world.getTileEntity(new BlockPos(x, y, z));
}
switch(GuiTypes.values()[id]){
case FEEDER:
return new GuiFeeder(player.inventory, tile);
case GIANT_CHEST:
return new GuiGiantChest(player.inventory, tile, 0);
case GIANT_CHEST_PAGE_2:
return new GuiGiantChest(player.inventory, tile, 1);
case GIANT_CHEST_PAGE_3:
return new GuiGiantChest(player.inventory, tile, 2);
case CRAFTER:
return CompatUtil.getCrafterGuiElement(player, world, x, y, z);
case GRINDER:
return new GuiGrinder(player.inventory, tile);
case GRINDER_DOUBLE:
return new GuiGrinder.GuiGrinderDouble(player.inventory, tile);
case FURNACE_DOUBLE:
return new GuiFurnaceDouble(player.inventory, tile);
case INPUTTER:
return new GuiInputter(player.inventory, tile, false);
case INPUTTER_ADVANCED:
return new GuiInputter(player.inventory, tile, true);
case REPAIRER:
return new GuiRepairer(player.inventory, tile);
case BREAKER:
return new GuiBreaker(player.inventory, tile);
case DROPPER:
return new GuiDropper(player, tile);
case CANOLA_PRESS:
return new GuiCanolaPress(player.inventory, tile);
case FERMENTING_BARREL:
return new GuiFermentingBarrel(player.inventory, tile);
case COAL_GENERATOR:
return new GuiCoalGenerator(player.inventory, tile);
case OIL_GENERATOR:
return new GuiOilGenerator(player.inventory, tile);
case PHANTOM_PLACER:
return new GuiPhantomPlacer(player.inventory, tile);
case FLUID_COLLECTOR:
return new GuiFluidCollector(player.inventory, tile);
case COFFEE_MACHINE:
return new GuiCoffeeMachine(player.inventory, tile);
case DRILL:
return new GuiDrill(player.inventory);
case FILTER:
return new GuiFilter(player.inventory);
case ENERGIZER:
return new GuiEnergizer(player, tile);
case ENERVATOR:
return new GuiEnervator(player, tile);
case XP_SOLIDIFIER:
return new GuiXPSolidifier(player.inventory, tile);
case CLOUD:
return new GuiSmileyCloud(tile, x, y, z, world);
case BOOK:
if(ItemBooklet.forcedPage != null){
GuiBooklet gui = BookletUtils.createBookletGuiFromPage(null, ItemBooklet.forcedPage);
ItemBooklet.forcedPage = null;
return gui;
case FEEDER:
return new GuiFeeder(player.inventory, tile);
case GIANT_CHEST:
return new GuiGiantChest(player.inventory, tile, 0);
case GIANT_CHEST_PAGE_2:
return new GuiGiantChest(player.inventory, tile, 1);
case GIANT_CHEST_PAGE_3:
return new GuiGiantChest(player.inventory, tile, 2);
case CRAFTER:
return CompatUtil.getCrafterGuiElement(player, world, x, y, z);
case GRINDER:
return new GuiGrinder(player.inventory, tile);
case GRINDER_DOUBLE:
return new GuiGrinder.GuiGrinderDouble(player.inventory, tile);
case FURNACE_DOUBLE:
return new GuiFurnaceDouble(player.inventory, tile);
case INPUTTER:
return new GuiInputter(player.inventory, tile, false);
case INPUTTER_ADVANCED:
return new GuiInputter(player.inventory, tile, true);
case REPAIRER:
return new GuiRepairer(player.inventory, tile);
case BREAKER:
return new GuiBreaker(player.inventory, tile);
case DROPPER:
return new GuiDropper(player, tile);
case CANOLA_PRESS:
return new GuiCanolaPress(player.inventory, tile);
case FERMENTING_BARREL:
return new GuiFermentingBarrel(player.inventory, tile);
case COAL_GENERATOR:
return new GuiCoalGenerator(player.inventory, tile);
case OIL_GENERATOR:
return new GuiOilGenerator(player.inventory, tile);
case PHANTOM_PLACER:
return new GuiPhantomPlacer(player.inventory, tile);
case FLUID_COLLECTOR:
return new GuiFluidCollector(player.inventory, tile);
case COFFEE_MACHINE:
return new GuiCoffeeMachine(player.inventory, tile);
case DRILL:
return new GuiDrill(player.inventory);
case FILTER:
return new GuiFilter(player.inventory);
case ENERGIZER:
return new GuiEnergizer(player, tile);
case ENERVATOR:
return new GuiEnervator(player, tile);
case XP_SOLIDIFIER:
return new GuiXPSolidifier(player.inventory, tile);
case CLOUD:
return new GuiSmileyCloud(tile, x, y, z, world);
case BOOK:
if(ItemBooklet.forcedPage != null){
GuiBooklet gui = BookletUtils.createBookletGuiFromPage(null, ItemBooklet.forcedPage);
ItemBooklet.forcedPage = null;
return gui;
}
else{
PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player);
if(data.lastOpenBooklet != null){
return data.lastOpenBooklet;
}
else{
PlayerData.PlayerSave data = PlayerData.getDataFromPlayer(player);
if(data.lastOpenBooklet != null){
return data.lastOpenBooklet;
}
else{
return new GuiMainPage(null);
}
return new GuiMainPage(null);
}
case DIRECTIONAL_BREAKER:
return new GuiDirectionalBreaker(player.inventory, tile);
case RANGED_COLLECTOR:
return new GuiRangedCollector(player.inventory, tile);
case MINER:
return new GuiMiner(player.inventory, tile);
case LASER_RELAY_ITEM_WHITELIST:
return new GuiLaserRelayItemWhitelist(player.inventory, tile);
case BAG:
return new GuiBag(player.getHeldItemMainhand(), player.inventory, false);
case VOID_BAG:
return new GuiBag(player.getHeldItemMainhand(), player.inventory, true);
case BIO_REACTOR:
return new GuiBioReactor(player.inventory, tile);
case FARMER:
return new GuiFarmer(player.inventory, tile);
case FIREWORK_BOX:
return new GuiFireworkBox(tile);
default:
return null;
}
case DIRECTIONAL_BREAKER:
return new GuiDirectionalBreaker(player.inventory, tile);
case RANGED_COLLECTOR:
return new GuiRangedCollector(player.inventory, tile);
case MINER:
return new GuiMiner(player.inventory, tile);
case LASER_RELAY_ITEM_WHITELIST:
return new GuiLaserRelayItemWhitelist(player.inventory, tile);
case BAG:
return new GuiBag(player.getHeldItemMainhand(), player.inventory, false);
case VOID_BAG:
return new GuiBag(player.getHeldItemMainhand(), player.inventory, true);
case BIO_REACTOR:
return new GuiBioReactor(player.inventory, tile);
case FARMER:
return new GuiFarmer(player.inventory, tile);
case FIREWORK_BOX:
return new GuiFireworkBox(tile);
default:
return null;
}
}

View file

@ -82,7 +82,7 @@ public class EnergyDisplay extends Gui{
if(this.isMouseOver(mouseX, mouseY)){
Minecraft mc = Minecraft.getMinecraft();
List<String> text = new ArrayList<String>();
List<String> text = new ArrayList<>();
text.add(this.getOverlayText());
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.nbtButton.displayString = (this.theSettings.respectNBT ? TextFormatting.DARK_GREEN : TextFormatting.RED)+"NB";
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){
Minecraft mc = Minecraft.getMinecraft();
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.addAll(mc.fontRenderer.listFormattedStringToWidth(StringUtil.localizeFormatted("info."+ActuallyAdditions.MODID+".gui.whitelistInfo"), 200));
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);
}
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.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);
}
else if(this.oredictButton.isMouseOver()){
List<String> list = new ArrayList<String>();
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<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")));
String type = null;
if(this.theSettings.respectOredict == 1){

View file

@ -90,7 +90,7 @@ public class FluidDisplay extends Gui{
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
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.enableAlpha();
GlStateManager.popMatrix();

View file

@ -103,7 +103,7 @@ public class GuiBag extends GuiWtfMojang{
this.filter.drawHover(mouseX, mouseY);
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.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));

View file

@ -41,7 +41,7 @@ public class GuiFeeder extends GuiWtfMojang{
public void drawScreen(int x, int y, float 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){
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);
}
}

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, "<"));
}
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, ">"));
}
}

View file

@ -79,7 +79,7 @@ public class GuiLaserRelayItemWhitelist extends GuiWtfMojang{
super.drawScreen(x, y, f);
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.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localize("info."+ActuallyAdditions.MODID+".gui.smartInfo"), 200));
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);
GlStateManager.pushMatrix();
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);
GlStateManager.popMatrix();
}

View file

@ -67,7 +67,7 @@ public class GuiPhantomPlacer extends GuiWtfMojang{
if(!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()){
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.addAll(this.fontRenderer.listFormattedStringToWidth(StringUtil.localize(loc+".2"), 200));
this.drawHoveringText(textList, mouseX, mouseY);

View file

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

View file

@ -28,7 +28,7 @@ public class SlotItemHandlerUnconditioned extends SlotItemHandler {
@Override
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());
this.inv.setStackInSlot(this.getSlotIndex(), ItemStack.EMPTY);

View file

@ -78,16 +78,16 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
@Override
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){
String name = block.getRegistryName().toString();
for(String list : ConfigStringListValues.PAXEL_EXTRA_MINING_WHITELIST.getValue()){
if(list.equals(name)){
return true;
}
for(String list : ConfigStringListValues.PAXEL_EXTRA_MINING_WHITELIST.getValue()){
if(list.equals(name)){
return true;
}
}
return false;
}
@ -110,16 +110,11 @@ public class ItemAllToolAA extends ItemToolAA implements IColorProvidingItem{
@SideOnly(Side.CLIENT)
@Override
public IItemColor getItemColor(){
return new IItemColor(){
@Override
public int colorMultiplier(ItemStack stack, int pass){
return pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF;
}
};
return (stack, pass) -> pass > 0 ? ItemAllToolAA.this.color : 0xFFFFFF;
}
@Override
public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) {
return super.canApplyAtEnchantingTable(stack, enchantment) || enchantment.type.canEnchantItem(Items.DIAMOND_SWORD);
}
@Override
public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) {
return super.canApplyAtEnchantingTable(stack, enchantment) || enchantment.type.canEnchantItem(Items.DIAMOND_SWORD);
}
}

View file

@ -75,7 +75,7 @@ public class ItemBattery extends ItemEnergy{
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand){
if(!worldIn.isRemote && player.isSneaking()){
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);
}

View file

@ -80,7 +80,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay{
//TheAchievements.OPEN_BOOKLET.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

View file

@ -44,7 +44,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{
ItemStack heldStack = player.getHeldItem(hand);
if(player.isSneaking()){
TileEntity tileHit = world.getTileEntity(pos);
if(tileHit != null && start.isInstance(tileHit)){
if(tileHit != null && this.start.isInstance(tileHit)){
if(!world.isRemote){
//Copy Slots
@ -60,7 +60,7 @@ public class ItemChestToCrateUpgrade extends ItemBase{
ItemStack[] stacks = new ItemStack[chest.getSlots()];
for(int i = 0; i < stacks.length; i++){
ItemStack aStack = chest.getStackInSlot(i);
stacks[i] = aStack.copy();
stacks[i] = aStack.copy();
}
//Set New Block

View file

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

View file

@ -34,7 +34,7 @@ public class ItemCrafterOnAStick extends ItemBase{
if(!world.isRemote){
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));
}

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