Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main/java/fox/spiteful/avaritia/Avaritia.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ public void earlyGame(FMLPreInitializationEvent event) {
LudicrousBlocks.voxelize();
Compat.census();
if (Config.craftingOnly) return;

LudicrousEntities.letLooseTheDogsOfWar();
proxy.prepareForPretty();
}

@EventHandler
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/fox/spiteful/avaritia/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public class ClientProxy extends CommonProxy {

public static final double toDeg = (1.0 / (Math.PI * 2)) * 360.0;

@Override
public void prepareForPretty() {
CompatClient.earlyComprettify();
}

@Override
public void makeThingsPretty() {
FancyHaloRenderer shiny = new FancyHaloRenderer();
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/fox/spiteful/avaritia/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

public class CommonProxy {

public void prepareForPretty() {

}

public void makeThingsPretty() {

}
Expand Down
37 changes: 0 additions & 37 deletions src/main/java/fox/spiteful/avaritia/FieldHelper.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ public void onItemCrafted(PlayerEvent.ItemCraftedEvent event) {

if (event.crafting.getItem() == LudicrousItems.resource) {
switch (event.crafting.getItemDamage()) {
case 1:
case 1 -> {
event.player.addStat(Achievements.crystal_matrix, 1);
return;
case 4:
}
case 4 -> {
event.player.addStat(Achievements.neutronium, 1);
return;
case 5:
}
case 5 -> {
event.player.addStat(Achievements.catalyst, 1);
return;
case 6:
}
case 6 -> {
event.player.addStat(Achievements.infinity, 1);
return;
}
}
} else if (event.crafting.getItem() == Item.getItemFromBlock(LudicrousBlocks.dire_crafting)) {
event.player.addStat(Achievements.dire_crafting, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ public static void achieve() {

if (Compat.blood) armok = new LudicrousAchievement("armok", 2, -5, LudicrousItems.armok_orb, infinity);

page = new AchievementPage(
"Avaritia",
LudicrousAchievement.achievements.toArray(new Achievement[LudicrousAchievement.achievements.size()]));
page = new AchievementPage("Avaritia", LudicrousAchievement.achievements.toArray(new Achievement[0]));
AchievementPage.registerAchievementPage(page);

AchievementTrigger tigger = new AchievementTrigger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public TileEntity createNewTileEntity(World world, int meta) {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack item) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileEntityCompressor) {
TileEntityCompressor machine = (TileEntityCompressor) tile;
if (tile instanceof TileEntityCompressor machine) {
int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

if (l == 0) machine.setFacing(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public TileEntity createNewTileEntity(World world, int meta) {
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack item) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TileEntityNeutron) {
TileEntityNeutron machine = (TileEntityNeutron) tile;
if (tile instanceof TileEntityNeutron machine) {
int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

if (l == 0) machine.setFacing(2);
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/fox/spiteful/avaritia/compat/CompatClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

public class CompatClient {

public static void earlyComprettify() {

}

public static void comprettify() {
if (Compat.botan) {
RenderingRegistry.registerBlockHandler(new RenderInfinitato(RenderingRegistry.getNextAvailableRenderId()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) {
if (!world.isRemote && entity instanceof EntityPlayer) {
NBTTagCompound itemTag = stack.stackTagCompound;
if (itemTag == null || itemTag.getString("ownerName").equals("")) return;
if (itemTag == null || itemTag.getString("ownerName").isEmpty()) return;

SoulNetworkHandler
.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), Integer.MAX_VALUE, getMaxEssence());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,15 @@ public boolean isDominant() {
}

public static IAlleleBeeSpecies getBaseSpecies(String name) {
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry
.getAllele((new StringBuilder()).append("forestry.species").append(name).toString());
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.species" + name);
}

public static IAlleleBeeSpecies getExtraSpecies(String name) {
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry
.getAllele((new StringBuilder()).append("extrabees.species.").append(name.toLowerCase()).toString());
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("extrabees.species." + name.toLowerCase());
}

public static IAlleleBeeSpecies getMagicSpecies(String name) {
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry
.getAllele((new StringBuilder()).append("magicbees.species").append(name).toString());
return (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("magicbees.species" + name);
}

public static IAllele getBaseAllele(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ public enum BeeBranch implements IClassification {
BALANCED("balanced", "Molestus"),
INFINITE("infinite", "Infinitus");

private String name;
private String latin;
private ArrayList<IAlleleSpecies> species = new ArrayList<IAlleleSpecies>();
private final String name;
private final String latin;
private final ArrayList<IAlleleSpecies> species = new ArrayList<>();
private IClassification parent;
private final EnumClassLevel level = EnumClassLevel.GENUS;

Expand Down Expand Up @@ -63,7 +63,7 @@ public void addMemberGroup(IClassification group) {

@Override
public IAlleleSpecies[] getMemberSpecies() {
return this.species.toArray(new IAlleleSpecies[this.species.size()]);
return this.species.toArray(new IAlleleSpecies[0]);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fox.spiteful.avaritia.compat.forestry;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IAlleleBeeSpecies;
Expand All @@ -15,11 +15,10 @@

public class ExpensiveMutation implements IBeeMutation {

private IAlleleBeeSpecies mom;
private IAlleleBeeSpecies dad;
private IAllele[] template;
private boolean secret = false;
private float baseChance;
private final IAlleleBeeSpecies mom;
private final IAlleleBeeSpecies dad;
private final IAllele[] template;
private final float baseChance;

public ExpensiveMutation(IAlleleBeeSpecies first, IAlleleBeeSpecies second, IAllele[] result, float chance) {
mom = first;
Expand Down Expand Up @@ -88,7 +87,7 @@ public float getBaseChance() {

@Override
public boolean isSecret() {
return secret;
return false;
}

@Override
Expand All @@ -104,7 +103,7 @@ public IAllele getPartner(IAllele allele) {

@Override
public Collection<String> getSpecialConditions() {
return new ArrayList<String>();
return Collections.emptyList();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private int getGeneticAdvancement(IAllele species, ArrayList<IAllele> exclude) {
}
}
}
return own + (highest < 0 ? 0 : highest);
return own + highest;
}

@Override
Expand Down Expand Up @@ -291,7 +291,7 @@ public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndiv
if (world.rand.nextFloat() < ((10f / bountyLevel))) {
Collection<? extends IMutation> resultantMutations = getRoot().getCombinations(this);
if (resultantMutations.size() > 0) {
IMutation[] candidates = resultantMutations.toArray(new IMutation[resultantMutations.size()]);
IMutation[] candidates = resultantMutations.toArray(new IMutation[0]);
bounty.add(
AlleleManager.alleleRegistry
.getMutationNoteStack(researcher, candidates[world.rand.nextInt(candidates.length)]));
Expand All @@ -312,7 +312,7 @@ public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndiv
}
}

return bounty.toArray(new ItemStack[bounty.size()]);
return bounty.toArray(new ItemStack[0]);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public Add(CompressorRecipe add) {

@Override
public void apply() {

CompressorManager.getRecipes().add(recipe);
}

Expand Down Expand Up @@ -88,15 +87,11 @@ public Remove(ItemStack rem) {

@Override
public void apply() {

for (Object obj : CompressorManager.getRecipes()) {
if (obj instanceof CompressorRecipe) {
CompressorRecipe craft = (CompressorRecipe) obj;
if (craft.getOutput().isItemEqual(remove)) {
recipe = craft;
CompressorManager.getRecipes().remove(obj);
break;
}
for (CompressorRecipe obj : CompressorManager.getRecipes()) {
if (obj.getOutput().isItemEqual(remove)) {
recipe = obj;
CompressorManager.getRecipes().remove(obj);
break;
}
}
}
Expand Down Expand Up @@ -132,14 +127,14 @@ private static ItemStack toStack(IItemStack item) {
if (item == null) return null;
else {
Object internal = item.getInternal();
if (internal == null || !(internal instanceof ItemStack)) {
if (!(internal instanceof ItemStack)) {
MineTweakerAPI.getLogger().logError("Not a valid item stack: " + item);
}
return (ItemStack) internal;
}
}

private static String toString(IOreDictEntry entry) {
return ((IOreDictEntry) entry).getName();
return entry.getName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,11 @@ public Remove(ItemStack rem) {
@Override
public void apply() {

for (Object obj : ExtremeCraftingManager.getInstance().getRecipeList()) {
if (obj instanceof IRecipe) {
IRecipe craft = (IRecipe) obj;
if (craft.getRecipeOutput().isItemEqual(remove)) {
recipe = craft;
ExtremeCraftingManager.getInstance().getRecipeList().remove(obj);
break;
}
for (IRecipe craft : ExtremeCraftingManager.getInstance().getRecipeList()) {
if (craft.getRecipeOutput().isItemEqual(remove)) {
recipe = craft;
ExtremeCraftingManager.getInstance().getRecipeList().remove(craft);
break;
}
}
}
Expand Down Expand Up @@ -143,7 +140,7 @@ private static ItemStack toStack(IItemStack item) {
if (item == null) return null;
else {
Object internal = item.getInternal();
if (internal == null || !(internal instanceof ItemStack)) {
if (!(internal instanceof ItemStack)) {
MineTweakerAPI.getLogger().logError("Not a valid item stack: " + item);
}
return (ItemStack) internal;
Expand Down Expand Up @@ -182,7 +179,7 @@ private static Object toActualObject(IIngredient ingredient) {
}

private static String toString(IOreDictEntry entry) {
return ((IOreDictEntry) entry).getName();
return entry.getName();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,25 @@
import java.util.Arrays;
import java.util.List;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;

import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fox.spiteful.avaritia.crafting.CompressOreRecipe;
import fox.spiteful.avaritia.crafting.CompressorManager;
import fox.spiteful.avaritia.crafting.CompressorRecipe;
import fox.spiteful.avaritia.gui.GUICompressor;

public class CompressionHandler extends TemplateRecipeHandler {

@SideOnly(Side.CLIENT)
private FontRenderer fontRender;

@SideOnly(Side.CLIENT)
public CompressionHandler() {
super();
fontRender = Minecraft.getMinecraft().fontRenderer;
}

public class CachedCompression extends CachedRecipe {

private PositionedStack ingred;
private PositionedStack result;
private int cost;
private final PositionedStack ingred;
private final PositionedStack result;
private final int cost;

public CachedCompression(CompressorRecipe recipe) {
this(recipe.getOutput(), recipe.getCost(), recipe.getIngredient());
Expand Down Expand Up @@ -64,10 +51,6 @@ public void computeVisuals() {
this.ingred.generatePermutations();
}

public int getCost() {
return cost;
}

}

@Override
Expand Down
Loading
Loading