mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-21 20:52:15 +00:00
IntelliJ IDEA Cleanup (#81)
This commit is contained in:
1 parent
a8efb58b69
commit
a2778f034d
34 files changed
+123
-260
No files matched your search
@@ -60,9 +60,7 @@ public class Avaritia {
|
||||
LudicrousBlocks.voxelize();
|
||||
Compat.census();
|
||||
if (Config.craftingOnly) return;
|
||||
|
||||
LudicrousEntities.letLooseTheDogsOfWar();
|
||||
proxy.prepareForPretty();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -2,10 +2,6 @@ package fox.spiteful.avaritia;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
public void prepareForPretty() {
|
||||
|
||||
}
|
||||
|
||||
public void makeThingsPretty() {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package fox.spiteful.avaritia;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
public class FieldHelper {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T get(Field field, Object instance) {
|
||||
try {
|
||||
return (T) field.get(instance);
|
||||
} catch (Exception e) {
|
||||
Lumberjack.log(Level.ERROR, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> void set(Field field, Object instance, T value) {
|
||||
try {
|
||||
field.set(instance, value);
|
||||
} catch (Exception e) {
|
||||
Lumberjack.log(Level.ERROR, e);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T> T invoke(Method method, Object instance, Object... params) {
|
||||
try {
|
||||
return (T) method.invoke(instance, params);
|
||||
} catch (Exception e) {
|
||||
Lumberjack.log(Level.ERROR, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -18,18 +18,18 @@ public class AchievementTrigger {
|
||||
|
||||
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);
|
||||
|
||||
@@ -77,9 +77,7 @@ public class Achievements {
|
||||
|
||||
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();
|
||||
|
||||
@@ -77,8 +77,7 @@ public class BlockCompressor extends BlockContainer {
|
||||
@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);
|
||||
|
||||
@@ -77,8 +77,7 @@ public class BlockNeutronCollector extends BlockContainer {
|
||||
@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);
|
||||
|
||||
@@ -14,10 +14,6 @@ import fox.spiteful.avaritia.render.FancyHaloRenderer;
|
||||
|
||||
public class CompatClient {
|
||||
|
||||
public static void earlyComprettify() {
|
||||
|
||||
}
|
||||
|
||||
public static void comprettify() {
|
||||
if (Compat.botan) {
|
||||
RenderingRegistry.registerBlockHandler(new RenderInfinitato(RenderingRegistry.getNextAvailableRenderId()));
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ItemOrbArmok extends Item implements IBloodOrb, IBindable {
|
||||
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());
|
||||
|
||||
@@ -48,18 +48,15 @@ public class Allele implements IAllele {
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -63,7 +63,7 @@ public enum BeeBranch implements IClassification {
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies[] getMemberSpecies() {
|
||||
return this.species.toArray(new IAlleleSpecies[this.species.size()]);
|
||||
return this.species.toArray(new IAlleleSpecies[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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;
|
||||
@@ -15,11 +15,10 @@ import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
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;
|
||||
@@ -88,7 +87,7 @@ public class ExpensiveMutation implements IBeeMutation {
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return secret;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,7 +103,7 @@ public class ExpensiveMutation implements IBeeMutation {
|
||||
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions() {
|
||||
return new ArrayList<String>();
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -243,7 +243,7 @@ public enum GreedyBeeSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
return own + (highest < 0 ? 0 : highest);
|
||||
return own + highest;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -291,7 +291,7 @@ public enum GreedyBeeSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
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)]));
|
||||
@@ -312,7 +312,7 @@ public enum GreedyBeeSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
}
|
||||
}
|
||||
|
||||
return bounty.toArray(new ItemStack[bounty.size()]);
|
||||
return bounty.toArray(new ItemStack[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,6 @@ public class Compressor {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
|
||||
CompressorManager.getRecipes().add(recipe);
|
||||
}
|
||||
|
||||
@@ -88,15 +87,11 @@ public class Compressor {
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,7 +127,7 @@ public class Compressor {
|
||||
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;
|
||||
@@ -140,6 +135,6 @@ public class Compressor {
|
||||
}
|
||||
|
||||
private static String toString(IOreDictEntry entry) {
|
||||
return ((IOreDictEntry) entry).getName();
|
||||
return entry.getName();
|
||||
}
|
||||
}
|
||||
@@ -100,14 +100,11 @@ public class ExtremeCrafting {
|
||||
@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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,7 +140,7 @@ public class ExtremeCrafting {
|
||||
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;
|
||||
@@ -182,7 +179,7 @@ public class ExtremeCrafting {
|
||||
}
|
||||
|
||||
private static String toString(IOreDictEntry entry) {
|
||||
return ((IOreDictEntry) entry).getName();
|
||||
return entry.getName();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,8 +5,6 @@ import java.util.ArrayList;
|
||||
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;
|
||||
@@ -14,8 +12,6 @@ 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;
|
||||
@@ -23,20 +19,11 @@ 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());
|
||||
@@ -64,10 +51,6 @@ public class CompressionHandler extends TemplateRecipeHandler {
|
||||
this.ingred.generatePermutations();
|
||||
}
|
||||
|
||||
public int getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -87,7 +87,7 @@ public class ExtremeShapedRecipeHandler extends ShapedRecipeHandler {
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals("extreme") && getClass() == ExtremeShapedRecipeHandler.class) {
|
||||
for (IRecipe irecipe : (List<IRecipe>) ExtremeCraftingManager.getInstance().getRecipeList()) {
|
||||
for (IRecipe irecipe : ExtremeCraftingManager.getInstance().getRecipeList()) {
|
||||
CachedExtremeRecipe recipe = null;
|
||||
if (irecipe instanceof ExtremeShapedRecipe)
|
||||
recipe = new CachedExtremeRecipe((ExtremeShapedRecipe) irecipe);
|
||||
@@ -106,7 +106,7 @@ public class ExtremeShapedRecipeHandler extends ShapedRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (IRecipe irecipe : (List<IRecipe>) ExtremeCraftingManager.getInstance().getRecipeList()) {
|
||||
for (IRecipe irecipe : ExtremeCraftingManager.getInstance().getRecipeList()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(irecipe.getRecipeOutput(), result)) {
|
||||
CachedExtremeRecipe recipe = null;
|
||||
if (irecipe instanceof ExtremeShapedRecipe)
|
||||
@@ -124,7 +124,7 @@ public class ExtremeShapedRecipeHandler extends ShapedRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (IRecipe irecipe : (List<IRecipe>) ExtremeCraftingManager.getInstance().getRecipeList()) {
|
||||
for (IRecipe irecipe : ExtremeCraftingManager.getInstance().getRecipeList()) {
|
||||
CachedExtremeRecipe recipe = null;
|
||||
if (irecipe instanceof ExtremeShapedRecipe) recipe = new CachedExtremeRecipe((ExtremeShapedRecipe) irecipe);
|
||||
else if (irecipe instanceof ExtremeShapedOreRecipe)
|
||||
|
||||
@@ -158,9 +158,9 @@ public class Lucrum {
|
||||
5,
|
||||
new ItemStack(LudicrousItems.bigPearl)))
|
||||
.setPages(
|
||||
new ResearchPage[] { new ResearchPage("avaritia.research_page.BIG_PEARL.1"),
|
||||
new ResearchPage(pearl_recipe) })
|
||||
.setParents(new String[] { "PRIMPEARL" }).setConcealed().setSecondary().registerResearchItem();
|
||||
new ResearchPage("avaritia.research_page.BIG_PEARL.1"),
|
||||
new ResearchPage(pearl_recipe))
|
||||
.setParents("PRIMPEARL").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
InfusionRecipe akashic_recipe = ThaumcraftApi.addInfusionCraftingRecipe(
|
||||
"AKASHIC",
|
||||
@@ -180,9 +180,9 @@ public class Lucrum {
|
||||
5,
|
||||
new ItemStack(LudicrousItems.akashic_record)))
|
||||
.setPages(
|
||||
new ResearchPage[] { new ResearchPage("avaritia.research_page.AKASHIC.1"),
|
||||
new ResearchPage(akashic_recipe) })
|
||||
.setParents(new String[] { "BIG_PEARL" }).setConcealed().setSecondary().registerResearchItem();
|
||||
new ResearchPage("avaritia.research_page.AKASHIC.1"),
|
||||
new ResearchPage(akashic_recipe))
|
||||
.setParents("BIG_PEARL").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,7 @@ public class TonkersEvents {
|
||||
if (event.harvester == null) return;
|
||||
if (event.harvester.getHeldItem() == null) return;
|
||||
ItemStack held = event.harvester.getHeldItem();
|
||||
if (held != null && held.hasTagCompound() && held.getItem() instanceof ToolCore) {
|
||||
ToolCore tool = (ToolCore) held.getItem();
|
||||
if (held != null && held.hasTagCompound() && held.getItem() instanceof ToolCore tool) {
|
||||
NBTTagCompound toolTag = held.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
if (toolTag.getInteger("Head") == Tonkers.infinityMetalId) {
|
||||
@@ -80,13 +79,9 @@ public class TonkersEvents {
|
||||
public void onHurt(LivingHurtEvent event) {
|
||||
Entity damaged = event.entity;
|
||||
Entity damager = event.source.getSourceOfDamage();
|
||||
if (damager != null && damager instanceof EntityLivingBase && damaged instanceof EntityLivingBase) {
|
||||
EntityLivingBase attacker = (EntityLivingBase) damager;
|
||||
EntityLivingBase attacked = (EntityLivingBase) damaged;
|
||||
|
||||
if (damager instanceof EntityLivingBase attacker && damaged instanceof EntityLivingBase attacked) {
|
||||
ItemStack held = attacker.getHeldItem();
|
||||
if (held != null && held.hasTagCompound() && held.getItem() instanceof ToolCore) {
|
||||
ToolCore tool = (ToolCore) held.getItem();
|
||||
if (held != null && held.hasTagCompound() && held.getItem() instanceof ToolCore tool) {
|
||||
NBTTagCompound toolTag = held.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
float puntpower = 0.0f;
|
||||
@@ -130,11 +125,10 @@ public class TonkersEvents {
|
||||
ItemStack held = event.entityPlayer.getHeldItem();
|
||||
if (block.getBlockHardness(event.entityPlayer.worldObj, event.x, event.y, event.z) <= -1
|
||||
&& held.hasTagCompound()
|
||||
&& held.getItem() instanceof ToolCore
|
||||
&& held.getItem() instanceof ToolCore tool
|
||||
&& (block.getMaterial() == Material.rock || block.getMaterial() == Material.iron)) {
|
||||
|
||||
NBTTagCompound toolTag = held.getTagCompound().getCompoundTag("InfiTool");
|
||||
ToolCore tool = (ToolCore) held.getItem();
|
||||
|
||||
if (toolTag != null && toolTag.getInteger("Head") == Tonkers.infinityMetalId
|
||||
&& tool.canHarvestBlock(Blocks.stone, held)) {
|
||||
|
||||
@@ -133,11 +133,10 @@ public class ExtremeCraftingManager {
|
||||
|
||||
public ExtremeShapelessRecipe addShapelessRecipe(ItemStack result, Object... ingredients) {
|
||||
List<ItemStack> arraylist = new ArrayList<>();
|
||||
Object[] aobject = ingredients;
|
||||
int i = ingredients.length;
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
Object object1 = aobject[j];
|
||||
Object object1 = ingredients[j];
|
||||
|
||||
if (object1 instanceof ItemStack stack) {
|
||||
arraylist.add(stack.copy());
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ExtremeShapedOreRecipe implements IRecipe {
|
||||
throw new RuntimeException(ret);
|
||||
}
|
||||
|
||||
HashMap<Character, Object> itemMap = new HashMap<Character, Object>();
|
||||
HashMap<Character, Object> itemMap = new HashMap<>();
|
||||
|
||||
for (; idx < recipe.length; idx += 2) {
|
||||
Character chr = (Character) recipe[idx];
|
||||
@@ -241,7 +241,7 @@ public class ExtremeShapedOreRecipe implements IRecipe {
|
||||
/**
|
||||
* Returns the input for this recipe, any mod accessing this value should never manipulate the values in this array
|
||||
* as it will effect the recipe itself.
|
||||
*
|
||||
*
|
||||
* @return The recipes input vales.
|
||||
*/
|
||||
public Object[] getInput() {
|
||||
|
||||
@@ -2,7 +2,6 @@ package fox.spiteful.avaritia.crafting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -124,16 +123,12 @@ public class Mincer {
|
||||
// Lumberjack.info("pre-sort: "+cropSortingList);
|
||||
|
||||
// sort into size/alphabetic order first to standardise them
|
||||
Collections.sort(cropSortingList, new Comparator<FoodInfo>() {
|
||||
|
||||
@Override
|
||||
public int compare(FoodInfo a, FoodInfo b) {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
|
||||
return a.orename.compareTo(b.orename);
|
||||
cropSortingList.sort((a, b) -> {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
|
||||
return a.orename.compareTo(b.orename);
|
||||
});
|
||||
|
||||
// Lumberjack.info("first sort: "+cropSortingList);
|
||||
@@ -141,16 +136,12 @@ public class Mincer {
|
||||
// sort into size/random order, should be deterministic because previous sort
|
||||
Collections.shuffle(cropSortingList, randy);
|
||||
|
||||
Collections.sort(cropSortingList, new Comparator<FoodInfo>() {
|
||||
|
||||
@Override
|
||||
public int compare(FoodInfo a, FoodInfo b) {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
cropSortingList.sort((a, b) -> {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
// Lumberjack.info("second sort: "+cropSortingList);
|
||||
@@ -221,14 +212,14 @@ public class Mincer {
|
||||
Item meef = Compat.getItem("TwilightForest", "item.meefRaw");
|
||||
knownMeats.add(new ItemStack(venison));
|
||||
knownMeats.add(new ItemStack(meef));
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
if (Loader.isModLoaded("Natura")) {
|
||||
try {
|
||||
Item imp = Compat.getItem("Natura", "impmeat");
|
||||
knownMeats.add(new ItemStack(imp));
|
||||
} catch (Exception e) {}
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
|
||||
if (Compat.am2) {
|
||||
@@ -244,37 +235,23 @@ public class Mincer {
|
||||
Lumberjack.info("rawMeats: " + rawMeats);
|
||||
Lumberjack.info("knownMeats: " + knownMeats);
|
||||
|
||||
// Lumberjack.info("pre-sort: "+meatSortingList);
|
||||
|
||||
// sort into size/alphabetic order first to standardise them
|
||||
Collections.sort(meatSortingList, new Comparator<FoodInfo>() {
|
||||
|
||||
@Override
|
||||
public int compare(FoodInfo a, FoodInfo b) {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
|
||||
return a.orename.compareTo(b.orename);
|
||||
meatSortingList.sort((a, b) -> {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
});
|
||||
|
||||
// Lumberjack.info("first sort: "+meatSortingList);
|
||||
return a.orename.compareTo(b.orename);
|
||||
});
|
||||
|
||||
// sort into size/random order, should be deterministic because previous sort
|
||||
Collections.sort(meatSortingList, new Comparator<FoodInfo>() {
|
||||
|
||||
@Override
|
||||
public int compare(FoodInfo a, FoodInfo b) {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
|
||||
return randy.nextBoolean() ? 1 : -1;
|
||||
meatSortingList.sort((a, b) -> {
|
||||
if (a.count != b.count) {
|
||||
return b.count > a.count ? 1 : -1;
|
||||
}
|
||||
});
|
||||
|
||||
// Lumberjack.info("second sort: "+meatSortingList);
|
||||
return randy.nextBoolean() ? 1 : -1;
|
||||
});
|
||||
|
||||
// CULL!
|
||||
|
||||
|
||||
@@ -41,10 +41,7 @@ public class EntityImmortalItem extends EntityItem {
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float damage) {
|
||||
if (source.getDamageType().equals("outOfWorld")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return source.getDamageType().equals("outOfWorld");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ContainerCompressor extends Container {
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotNumber);
|
||||
Slot slot = this.inventorySlots.get(slotNumber);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
@@ -71,7 +71,7 @@ public class ContainerCompressor extends Container {
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ContainerExtremeCrafting extends Container {
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotNumber);
|
||||
Slot slot = this.inventorySlots.get(slotNumber);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
@@ -114,7 +114,7 @@ public class ContainerExtremeCrafting extends Container {
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ContainerNeutron extends Container {
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotNumber);
|
||||
Slot slot = this.inventorySlots.get(slotNumber);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
@@ -63,7 +63,7 @@ public class ContainerNeutron extends Container {
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
@@ -12,9 +12,7 @@ public class ItemStackWrapper {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object otherobj) {
|
||||
if (otherobj instanceof ItemStackWrapper) {
|
||||
ItemStackWrapper other = (ItemStackWrapper) otherobj;
|
||||
|
||||
if (otherobj instanceof ItemStackWrapper other) {
|
||||
if (this.stack.getItem().equals(other.stack.getItem())
|
||||
&& this.stack.getItemDamage() == other.stack.getItemDamage()) {
|
||||
|
||||
|
||||
@@ -115,11 +115,6 @@ public class ItemBowInfinity extends Item implements ICosmicRenderItem {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack stack) {
|
||||
return 13;
|
||||
|
||||
@@ -39,8 +39,7 @@ public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem {
|
||||
@Override
|
||||
public boolean hitEntity(ItemStack stack, EntityLivingBase victim, EntityLivingBase player) {
|
||||
if (player.worldObj.isRemote) return true;
|
||||
if (victim instanceof EntityPlayer) {
|
||||
EntityPlayer pvp = (EntityPlayer) victim;
|
||||
if (victim instanceof EntityPlayer pvp) {
|
||||
if (LudicrousItems.isInfinite(pvp)) {
|
||||
if (Belmont.isVampire(pvp)) victim.attackEntityFrom(
|
||||
new DamageSourceInfinitySword(player).setFireDamage().setDamageBypassesArmor(),
|
||||
@@ -64,8 +63,7 @@ public class ItemSwordInfinity extends ItemSword implements ICosmicRenderItem {
|
||||
|
||||
@Override
|
||||
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
|
||||
if (!entity.worldObj.isRemote && entity instanceof EntityPlayer) {
|
||||
EntityPlayer victim = (EntityPlayer) entity;
|
||||
if (!entity.worldObj.isRemote && entity instanceof EntityPlayer victim) {
|
||||
if (victim.capabilities.isCreativeMode && !victim.isDead
|
||||
&& victim.getHealth() > 0
|
||||
&& !LudicrousItems.isInfinite(victim)) {
|
||||
|
||||
@@ -41,8 +41,8 @@ public class ToolHelper {
|
||||
public static Material[] materialsAxe = new Material[] { Material.coral, Material.leaves, Material.plants,
|
||||
Material.wood, Material.vine };
|
||||
|
||||
public static Set<EntityPlayer> hammering = new HashSet<>();
|
||||
public static Map<EntityPlayer, List<ItemStack>> hammerdrops = new WeakHashMap<>();
|
||||
public static final Set<EntityPlayer> hammering = new HashSet<>();
|
||||
public static final Map<EntityPlayer, List<ItemStack>> hammerdrops = new WeakHashMap<>();
|
||||
|
||||
public static void removeBlocksInIteration(EntityPlayer player, ItemStack stack, World world, int x, int y, int z,
|
||||
int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean silk,
|
||||
@@ -195,7 +195,7 @@ public class ToolHelper {
|
||||
ItemStackWrapper wrap = e.getKey();
|
||||
|
||||
int size = wrap.stack.getMaxStackSize();
|
||||
int fullstacks = (int) Math.floor(count / size);
|
||||
int fullstacks = count / size;
|
||||
|
||||
for (int i = 0; i < fullstacks; i++) {
|
||||
count -= size;
|
||||
|
||||
@@ -23,20 +23,13 @@ public class FancyHaloRenderer implements IItemRenderer {
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
Item itype = item.getItem();
|
||||
if (itype instanceof IHaloRenderItem) {
|
||||
IHaloRenderItem ihri = (IHaloRenderItem) itype;
|
||||
|
||||
if (itype instanceof IHaloRenderItem ihri) {
|
||||
if (!(ihri.drawHalo(item) || ihri.drawPulseEffect(item))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case INVENTORY:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return type == ItemRenderType.INVENTORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -296,9 +296,7 @@ public class ModelArmorInfinity extends ModelBiped {
|
||||
this.invulnOverlay.heldItemRight = 0;
|
||||
this.invulnOverlay.aimedBow = false;
|
||||
|
||||
if (entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entityLiving;
|
||||
|
||||
if (entityLiving instanceof EntityPlayer player) {
|
||||
ItemStack held_item = player.getEquipmentInSlot(0);
|
||||
|
||||
if (held_item != null) {
|
||||
@@ -335,7 +333,7 @@ public class ModelArmorInfinity extends ModelBiped {
|
||||
this.invulnOverlay.setRotationAngles(f1, speed, ticks, headYaw, headPitch, f6, entity);
|
||||
|
||||
if (RenderManager.instance.entityRenderMap.containsKey(entity.getClass())) {
|
||||
Render r = (Render) RenderManager.instance.entityRenderMap.get(entity.getClass());
|
||||
Render r = RenderManager.instance.entityRenderMap.get(entity.getClass());
|
||||
|
||||
if (r instanceof RenderBiped) {
|
||||
ModelBiped m = ((RenderBiped) r).modelBipedMain;
|
||||
@@ -352,21 +350,21 @@ public class ModelArmorInfinity extends ModelBiped {
|
||||
this.bipedLeftArm.showModel = false;
|
||||
this.bipedRightLeg.showModel = false;
|
||||
this.bipedLeftLeg.showModel = false;
|
||||
this.bipedHeadwear.showModel = this.showHat ? true : false;
|
||||
this.bipedHeadwear.showModel = this.showHat;
|
||||
}
|
||||
|
||||
public void setGems() {
|
||||
this.bipedHead.showModel = false;
|
||||
this.bipedHeadwear.showModel = false;
|
||||
this.bipedBody.showModel = this.legs ? false : (this.showChest ? true : false);
|
||||
this.bipedRightArm.showModel = this.legs ? false : (this.showChest ? true : false);
|
||||
this.bipedLeftArm.showModel = this.legs ? false : (this.showChest ? true : false);
|
||||
this.bipedRightLeg.showModel = this.legs ? (this.showLeg ? true : false) : false;
|
||||
this.bipedLeftLeg.showModel = this.legs ? (this.showLeg ? true : false) : false;
|
||||
this.bipedBody.showModel = !this.legs && this.showChest;
|
||||
this.bipedRightArm.showModel = !this.legs && this.showChest;
|
||||
this.bipedLeftArm.showModel = !this.legs && this.showChest;
|
||||
this.bipedRightLeg.showModel = this.legs && this.showLeg;
|
||||
this.bipedLeftLeg.showModel = this.legs && this.showLeg;
|
||||
}
|
||||
|
||||
public void setWings() {
|
||||
this.bipedBody.showModel = this.legs ? false : (this.showChest ? true : false);
|
||||
this.bipedBody.showModel = !this.legs && this.showChest;
|
||||
this.bipedLeftWing.showModel = true;
|
||||
this.bipedRightWing.showModel = true;
|
||||
this.bipedHeadwear.showModel = false;
|
||||
@@ -374,10 +372,9 @@ public class ModelArmorInfinity extends ModelBiped {
|
||||
this.bipedLeftArm.showModel = false;
|
||||
this.bipedRightLeg.showModel = false;
|
||||
this.bipedLeftLeg.showModel = false;
|
||||
this.bipedHeadwear.showModel = false;
|
||||
this.bipedHead.showModel = false;
|
||||
|
||||
this.overlay.bipedBody.showModel = this.legs ? false : (this.showChest ? true : false);
|
||||
this.overlay.bipedBody.showModel = !this.legs && this.showChest;
|
||||
this.overlay.bipedLeftWing.showModel = true;
|
||||
this.overlay.bipedRightWing.showModel = true;
|
||||
this.overlay.bipedHead.showModel = false;
|
||||
@@ -408,7 +405,7 @@ public class ModelArmorInfinity extends ModelBiped {
|
||||
copyPartAngles(source.bipedRightLeg, dest.bipedRightLeg);
|
||||
}
|
||||
|
||||
public class Overlay extends ModelBiped {
|
||||
public static class Overlay extends ModelBiped {
|
||||
|
||||
public ModelArmorInfinity parent;
|
||||
public float expand;
|
||||
@@ -500,7 +497,7 @@ public class ModelArmorInfinity extends ModelBiped {
|
||||
super.setRotationAngles(f1, f2, f3, f4, f5, f6, entity);
|
||||
|
||||
if (RenderManager.instance.entityRenderMap.containsKey(entity.getClass())) {
|
||||
Render r = (Render) RenderManager.instance.entityRenderMap.get(entity.getClass());
|
||||
Render r = RenderManager.instance.entityRenderMap.get(entity.getClass());
|
||||
|
||||
if (r instanceof RenderBiped) {
|
||||
ModelBiped m = ((RenderBiped) r).modelBipedMain;
|
||||
|
||||
@@ -61,27 +61,27 @@ public class RenderHeavenArrow extends RenderArrow {
|
||||
GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f9);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f9);
|
||||
tessellator.draw();
|
||||
GL11.glNormal3f(-f10, 0.0F, 0.0F);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double) f6, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double) f7, (double) f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double) f7, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double) f6, (double) f9);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, f6, f8);
|
||||
tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, f7, f8);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, f7, f9);
|
||||
tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, f6, f9);
|
||||
tessellator.draw();
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(0.0F, 0.0F, f10);
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double) f2, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double) f3, (double) f4);
|
||||
tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double) f3, (double) f5);
|
||||
tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double) f2, (double) f5);
|
||||
tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, f2, f4);
|
||||
tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, f3, f4);
|
||||
tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, f3, f5);
|
||||
tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, f2, f5);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user