diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java index 9dc68b22..9d8d63d5 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectAttractor.java @@ -28,7 +28,7 @@ import java.util.*; */ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { private FakePlayer target; - private Set tracking = new HashSet(); + private Set tracking = new HashSet<>(); private int counter = 0; private int maxMobsAttracted = 10000; @@ -48,9 +48,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { BlockPos pos = tile.getPos(); counter++; if (counter < 10) { - Iterator itr = tracking.iterator(); - while (itr.hasNext()) { - EntityLiving ent = itr.next(); + for (EntityLiving ent : tracking) { onEntityTick(pos, ent); } @@ -61,7 +59,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { World world = tile.getWorld(); - Set trackingThisTick = new HashSet(); + Set trackingThisTick = new HashSet<>(); List entsInBounds = world.getEntitiesWithinAABB(EntityLiving.class, getBounds(pos)); for (EntityLiving ent : entsInBounds) { @@ -268,7 +266,7 @@ public class AlchemyArrayEffectAttractor extends AlchemyArrayEffect { private void cancelCurrentTasks(EntityLiving ent) { Iterator iterator = ent.tasks.taskEntries.iterator(); - List currentTasks = new ArrayList(); + List currentTasks = new ArrayList<>(); while (iterator.hasNext()) { EntityAITaskEntry entityaitaskentry = iterator.next(); if (entityaitaskentry != null) { diff --git a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java index 6f1fd59d..d297eb60 100644 --- a/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java +++ b/src/main/java/WayofTime/bloodmagic/alchemyArray/AlchemyArrayEffectSkeletonTurret.java @@ -25,12 +25,7 @@ import java.util.List; * Credits for the initial code go to Crazy Pants of EIO. */ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect { - public static Predicate checkSkeleton = new Predicate() { - @Override - public boolean apply(EntityMob input) { - return !(input instanceof EntitySkeleton); - } - }; + public static Predicate checkSkeleton = input -> !(input instanceof EntitySkeleton); private EntitySkeleton turret; public AlchemyArrayEffectSkeletonTurret(String key) { @@ -105,7 +100,7 @@ public class AlchemyArrayEffectSkeletonTurret extends AlchemyArrayEffect { private void cancelCurrentTargetTasks(EntityLiving entity) { Iterator iterator = entity.targetTasks.taskEntries.iterator(); - List currentTasks = new ArrayList(); + List currentTasks = new ArrayList<>(); while (iterator.hasNext()) { EntityAITaskEntry entityaitaskentry = iterator.next(); if (entityaitaskentry != null)// && entityaitaskentry.action instanceof EntityAITarget) diff --git a/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java b/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java index 2da8895d..f55108ca 100644 --- a/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java +++ b/src/main/java/WayofTime/bloodmagic/altar/BloodAltar.java @@ -14,7 +14,6 @@ import WayofTime.bloodmagic.util.helper.NetworkHelper; import WayofTime.bloodmagic.block.BlockLifeEssence; import WayofTime.bloodmagic.tile.TileAltar; import com.google.common.base.Enums; -import com.google.common.base.Strings; import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; diff --git a/src/main/java/WayofTime/bloodmagic/altar/EnumAltarTier.java b/src/main/java/WayofTime/bloodmagic/altar/EnumAltarTier.java index 4eaf1714..0478db4b 100644 --- a/src/main/java/WayofTime/bloodmagic/altar/EnumAltarTier.java +++ b/src/main/java/WayofTime/bloodmagic/altar/EnumAltarTier.java @@ -122,7 +122,7 @@ public enum EnumAltarTier { public static final int MAXTIERS = values().length; - ArrayList altarComponents = new ArrayList(); + ArrayList altarComponents = new ArrayList<>(); public void buildComponents() { diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java index e3b768f0..8d9c9b8f 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockAlchemyTable.java @@ -25,7 +25,7 @@ import javax.annotation.Nullable; public class BlockAlchemyTable extends Block implements IBMBlock { public static final PropertyBool INVISIBLE = PropertyBool.create("invisible"); - public static final PropertyEnum DIRECTION = PropertyEnum.create("direction", EnumFacing.class); + public static final PropertyEnum DIRECTION = PropertyEnum.create("direction", EnumFacing.class); public BlockAlchemyTable() { super(Material.ROCK); diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java b/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java index 7f9d2236..679ae793 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockAltar.java @@ -164,8 +164,8 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } @@ -173,7 +173,7 @@ public class BlockAltar extends Block implements IVariantProvider, IDocumentedBl @Override public List getDocumentation(EntityPlayer player, World world, BlockPos pos, IBlockState state) { - List docs = new ArrayList(); + List docs = new ArrayList<>(); IBloodAltar altar = ((IBloodAltar) world.getTileEntity(pos)); Pair missingBlock = BloodAltar.getAltarMissingBlock(world, pos, altar.getTier().toInt()); if (missingBlock != null) diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java index 0d61ac9e..1bcbbc80 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java @@ -101,8 +101,8 @@ public class BlockDemonCrucible extends Block implements IVariantProvider, IBMBl @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java index ddea0501..fdb13d22 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystal.java @@ -27,8 +27,8 @@ import java.util.Random; public class BlockDemonCrystal extends Block { public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 6); - public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumDemonWillType.class); - public static final PropertyEnum ATTACHED = PropertyEnum.create("attached", EnumFacing.class); + public static final PropertyEnum TYPE = PropertyEnum.create("type", EnumDemonWillType.class); + public static final PropertyEnum ATTACHED = PropertyEnum.create("attached", EnumFacing.class); public BlockDemonCrystal() { super(Material.ROCK); diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java index 0b255c05..8ed12395 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrystallizer.java @@ -69,8 +69,8 @@ public class BlockDemonCrystallizer extends BlockContainer implements IVariantPr @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java index 28abe0f5..a761816b 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonPylon.java @@ -62,8 +62,8 @@ public class BlockDemonPylon extends BlockContainer implements IVariantProvider @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java b/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java index af051063..87048b65 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockIncenseAltar.java @@ -85,8 +85,8 @@ public class BlockIncenseAltar extends Block implements IVariantProvider, IBMBlo @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java index 03040157..e5b3b04d 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillar.java @@ -74,7 +74,7 @@ public class BlockInversionPillar extends BlockEnum { @Override public List> getVariants() { - List> ret = new ArrayList>(); + List> ret = new ArrayList<>(); for (int i = 0; i < this.getTypes().length; i++) ret.add(Pair.of(i, "static=false,type=" + this.getTypes()[i])); return ret; diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java index 9b0e3067..7fb5b5d5 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockInversionPillarEnd.java @@ -55,9 +55,9 @@ public class BlockInversionPillarEnd extends BlockEnum impleme @Override public List> getVariants() { - List> ret = new ArrayList>(); + List> ret = new ArrayList<>(); for (int i = 0; i < this.getTypes().length; i++) - ret.add(new ImmutablePair(i, "type=" + this.getTypes()[i])); + ret.add(new ImmutablePair<>(i, "type=" + this.getTypes()[i])); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java b/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java index b488e046..6744b025 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockPhantom.java @@ -86,8 +86,8 @@ public class BlockPhantom extends Block implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java b/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java index 2824b6f0..a4405cf6 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockRitualController.java @@ -14,7 +14,6 @@ import WayofTime.bloodmagic.core.RegistrarBloodMagicItems; import WayofTime.bloodmagic.tile.TileImperfectRitualStone; import WayofTime.bloodmagic.tile.TileMasterRitualStone; import amerifrance.guideapi.api.IGuideLinked; -import com.google.common.base.Strings; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java b/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java index 7b8cc730..e4a0a271 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockSoulForge.java @@ -99,8 +99,8 @@ public class BlockSoulForge extends Block implements IVariantProvider, IBMBlock @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java b/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java index 6aa45663..2aa70bea 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockSpectral.java @@ -109,8 +109,8 @@ public class BlockSpectral extends Block implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java b/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java index 4df0bbe5..5ac1eaf1 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockTeleposer.java @@ -66,8 +66,8 @@ public class BlockTeleposer extends BlockContainer implements IVariantProvider, @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java index ffba0f12..e879512a 100644 --- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java @@ -25,15 +25,6 @@ import java.io.IOException; @SideOnly(Side.CLIENT) public class GuiItemRoutingNode extends GuiContainer { - private GuiButton downButton; - private GuiButton upButton; - private GuiButton northButton; - private GuiButton southButton; - private GuiButton westButton; - private GuiButton eastButton; - private GuiButton incrementButton; - private GuiButton decrementButton; - private GuiTextField textBox; private TileFilteredRoutingNode inventory; @@ -65,14 +56,14 @@ public class GuiItemRoutingNode extends GuiContainer { top = (this.height - this.ySize) / 2; this.buttonList.clear(); - this.buttonList.add(this.downButton = new GuiButton(0, left + 176, top + 14, 18, 18, "D")); - this.buttonList.add(this.upButton = new GuiButton(1, left + 176, top + 32, 18, 18, "U")); - this.buttonList.add(this.northButton = new GuiButton(2, left + 176, top + 50, 18, 18, "N")); - this.buttonList.add(this.southButton = new GuiButton(3, left + 176, top + 68, 18, 18, "S")); - this.buttonList.add(this.westButton = new GuiButton(4, left + 176, top + 86, 18, 18, "W")); - this.buttonList.add(this.eastButton = new GuiButton(5, left + 176, top + 104, 18, 18, "E")); - this.buttonList.add(this.incrementButton = new GuiButton(6, left + 160, top + 50, 10, 18, ">")); - this.buttonList.add(this.decrementButton = new GuiButton(7, left + 132, top + 50, 10, 18, "<")); + this.buttonList.add(new GuiButton(0, left + 176, top + 14, 18, 18, "D")); + this.buttonList.add(new GuiButton(1, left + 176, top + 32, 18, 18, "U")); + this.buttonList.add(new GuiButton(2, left + 176, top + 50, 18, 18, "N")); + this.buttonList.add(new GuiButton(3, left + 176, top + 68, 18, 18, "S")); + this.buttonList.add(new GuiButton(4, left + 176, top + 86, 18, 18, "W")); + this.buttonList.add(new GuiButton(5, left + 176, top + 104, 18, 18, "E")); + this.buttonList.add(new GuiButton(6, left + 160, top + 50, 10, 18, ">")); + this.buttonList.add(new GuiButton(7, left + 132, top + 50, 10, 18, "<")); disableDirectionalButton(inventory.currentActiveSlot); this.textBox = new GuiTextField(0, this.fontRenderer, left + 94, top + 37, 70, 12); @@ -92,7 +83,7 @@ public class GuiItemRoutingNode extends GuiContainer { try { Integer testVal = Integer.decode(str); if (testVal != null) { - amount = testVal.intValue(); + amount = testVal; } } catch (NumberFormatException d) { } @@ -120,7 +111,7 @@ public class GuiItemRoutingNode extends GuiContainer { if (container.lastGhostSlotClicked != -1) { Slot slot = container.getSlot(container.lastGhostSlotClicked + 1); ItemStack stack = slot.getStack(); - if (stack != null) { + if (!stack.isEmpty()) { int amount = GhostItemHelper.getItemGhostAmount(stack); this.textBox.setText("" + amount); } else { @@ -173,7 +164,7 @@ public class GuiItemRoutingNode extends GuiContainer { String s = ""; if (container.lastGhostSlotClicked != -1) { ItemStack clickedStack = inventorySlots.getSlot(1 + container.lastGhostSlotClicked).getStack(); - if (clickedStack != null) { + if (!clickedStack.isEmpty()) { s = clickedStack.getDisplayName(); } } diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java index 3da9b255..c64d1b21 100644 --- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/client/gui/GuiMasterRoutingNode.java @@ -6,20 +6,17 @@ import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiMasterRoutingNode extends GuiContainer { - private TileEntity inventory; public GuiMasterRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) { super(new ContainerMasterRoutingNode(playerInventory, tileRoutingNode)); this.xSize = 216; this.ySize = 216; - inventory = (TileEntity) tileRoutingNode; } @Override diff --git a/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java b/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java index a268d9f9..950af569 100644 --- a/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java +++ b/src/main/java/WayofTime/bloodmagic/client/helper/ShaderHelper.java @@ -1,13 +1,3 @@ -/** - * This class was created by . It's distributed as - * part of the Botania Mod. Get the Source Code in github: - * https://github.com/Vazkii/Botania - *

- * Botania is Open Source and distributed under the - * Botania License: http://botaniamod.net/license.php - *

- * File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)] - */ package WayofTime.bloodmagic.client.helper; import net.minecraft.client.renderer.OpenGlHelper; @@ -22,6 +12,16 @@ import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + *

+ * Botania is Open Source and distributed under the + * Botania License: http://botaniamod.net/license.php + *

+ * File Created @ [Apr 9, 2014, 11:20:26 PM (GMT)] + */ public final class ShaderHelper { private static final int VERT_ST = ARBVertexShader.GL_VERTEX_SHADER_ARB; private static final int FRAG_ST = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB; diff --git a/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java b/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java index 72f5f05f..20003b61 100644 --- a/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java +++ b/src/main/java/WayofTime/bloodmagic/client/hud/HUDElementDemonWillAura.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; public class HUDElementDemonWillAura extends HUDElement { - protected List barOrder = new ArrayList(); + protected List barOrder = new ArrayList<>(); public HUDElementDemonWillAura() { super(5, 5, RenderGameOverlayEvent.ElementType.HOTBAR); diff --git a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedChicken.java b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedChicken.java index 44db0152..6db0f642 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedChicken.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedChicken.java @@ -16,7 +16,7 @@ public class RenderCorruptedChicken extends RenderLiving public RenderCorruptedChicken(RenderManager renderManagerIn) { super(renderManagerIn, new ModelCorruptedChicken(0), 0.3f); - this.addLayer(new LayerWill(this, new ModelCorruptedChicken(1.1f))); + this.addLayer(new LayerWill<>(this, new ModelCorruptedChicken(1.1f))); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSheep.java b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSheep.java index 11529425..d8024973 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSheep.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSheep.java @@ -19,9 +19,9 @@ public class RenderCorruptedSheep extends RenderLiving { public RenderCorruptedSheep(RenderManager renderManagerIn) { super(renderManagerIn, new ModelCorruptedSheep2(0), 0.7F); this.addLayer(new LayerCorruptedSheepWool(this)); - this.addLayer(new LayerWill(this, new ModelCorruptedSheep(1.1f))); - this.addLayer(new LayerWill(this, new ModelCorruptedSheep2(1.1f))); - this.addLayer(new LayerAlchemyCircle()); + this.addLayer(new LayerWill<>(this, new ModelCorruptedSheep(1.1f))); + this.addLayer(new LayerWill<>(this, new ModelCorruptedSheep2(1.1f))); + this.addLayer(new LayerAlchemyCircle<>()); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSpider.java b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSpider.java index 343a459c..bef6c894 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSpider.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedSpider.java @@ -18,7 +18,7 @@ public class RenderCorruptedSpider extends RenderLiving { public RenderCorruptedSpider(RenderManager renderManagerIn) { super(renderManagerIn, new ModelSpider(), 1.0F); this.addLayer(new LayerCorruptedSpiderEyes(this)); - this.addLayer(new LayerWill(this, new ModelCorruptedSpider(1.1f))); + this.addLayer(new LayerWill<>(this, new ModelCorruptedSpider(1.1f))); } protected float getDeathMaxRotation(EntityCorruptedSpider entityLivingBaseIn) { diff --git a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedZombie.java b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedZombie.java index 57475a5f..f7ffad16 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedZombie.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderCorruptedZombie.java @@ -38,7 +38,7 @@ public class RenderCorruptedZombie extends RenderBiped { } this.layerRenderers.remove(layerbipedarmor); - this.addLayer(new LayerWill(this, new ModelZombie(1.2f, false))); + this.addLayer(new LayerWill<>(this, new ModelZombie(1.2f, false))); } /** diff --git a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntityMeteor.java b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntityMeteor.java index f1cf5f9f..77c9cdbc 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntityMeteor.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntityMeteor.java @@ -10,9 +10,11 @@ import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; public class RenderEntityMeteor extends Render { - private static final ResourceLocation resource = new ResourceLocation(BloodMagic.MODID, "textures/models/Meteor.png"); + + private static final ResourceLocation TEXTURE = new ResourceLocation(BloodMagic.MODID, "textures/models/Meteor.png"); + private static final float SCALE = 1; + public ModelBase model = new ModelMeteor(); - private float scale = 1; public RenderEntityMeteor(RenderManager renderManagerIn) { super(renderManagerIn); @@ -20,24 +22,11 @@ public class RenderEntityMeteor extends Render { @Override public void doRender(EntityMeteor entity, double x, double y, double z, float entityYaw, float partialTicks) { -// GlStateManager.pushMatrix(); -// GlStateManager.translate((float) x, (float) y, (float) z); -// GlStateManager.enableRescaleNormal(); -// GlStateManager.scale(0.5F, 0.5F, 0.5F); -// GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); -// GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); -// this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); -// this.renderItem.renderItem(ItemComponent.getStack(ItemComponent.REAGENT_BLOODLIGHT), ItemCameraTransforms.TransformType.GROUND); -// GlStateManager.disableRescaleNormal(); -// GlStateManager.popMatrix(); - GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y, (float) z); GlStateManager.enableRescaleNormal(); - GlStateManager.scale(scale, scale, scale); - this.bindTexture(this.getEntityTexture(entity)); -// GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * f1, 0.0F, 1.0F, 0.0F); -// GL11.glRotatef(180.0f - entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * f1, 1.0F, 0.0F, 0.0f); + GlStateManager.scale(SCALE, SCALE, SCALE); + this.bindTexture(TEXTURE); model.render(entity, 0, (float) x, (float) y, (float) z, entityYaw, partialTicks); GlStateManager.disableRescaleNormal(); GlStateManager.popMatrix(); @@ -47,6 +36,6 @@ public class RenderEntityMeteor extends Render { @Override protected ResourceLocation getEntityTexture(EntityMeteor entity) { - return resource; + return TEXTURE; } } diff --git a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntitySentientArrow.java b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntitySentientArrow.java index c0a2a618..3e522850 100644 --- a/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntitySentientArrow.java +++ b/src/main/java/WayofTime/bloodmagic/client/render/entity/RenderEntitySentientArrow.java @@ -37,7 +37,7 @@ public class RenderEntitySentientArrow extends Render { int i = 0; float f = 0.0F; float f1 = 0.5F; - float f2 = (float) (0 + i * 10) / 32.0F; + float f2 = (float) (i * 10) / 32.0F; float f3 = (float) (5 + i * 10) / 32.0F; float f4 = 0.0F; float f5 = 0.15625F; diff --git a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java index 7548e3ec..5547ac6d 100644 --- a/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java +++ b/src/main/java/WayofTime/bloodmagic/command/sub/SubCommandBind.java @@ -1,12 +1,9 @@ package WayofTime.bloodmagic.command.sub; import WayofTime.bloodmagic.core.data.Binding; -import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.iface.IBindable; import WayofTime.bloodmagic.util.helper.BindableHelper; -import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.util.helper.TextHelper; -import com.google.common.base.Strings; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/BookUtils.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/BookUtils.java index 80b78c00..c8b7e847 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/BookUtils.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/BookUtils.java @@ -22,7 +22,7 @@ public class BookUtils { AlchemyCircleRenderer renderer = AlchemyArrayRecipeRegistry.getAlchemyCircleRenderer(inputStack, catalystStack); if (renderer instanceof DualAlchemyCircleRenderer) { - List resources = new ArrayList(); + List resources = new ArrayList<>(); resources.add(((DualAlchemyCircleRenderer) renderer).arrayResource); resources.add(((DualAlchemyCircleRenderer) renderer).secondaryArrayResource); return new PageAlchemyArray(resources, inputStack, catalystStack); @@ -43,7 +43,7 @@ public class BookUtils { AlchemyCircleRenderer renderer = AlchemyArrayRecipeRegistry.getAlchemyCircleRenderer(inputStack, catalystStack); if (renderer != null) { if (renderer instanceof DualAlchemyCircleRenderer) { - List resources = new ArrayList(); + List resources = new ArrayList<>(); resources.add(((DualAlchemyCircleRenderer) renderer).arrayResource); resources.add(((DualAlchemyCircleRenderer) renderer).secondaryArrayResource); return new PageAlchemyArray(resources, inputStack, catalystStack, outputStack); diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryAlchemy.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryAlchemy.java index 9eb03a5b..a167ea9b 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryAlchemy.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryAlchemy.java @@ -26,14 +26,14 @@ public class CategoryAlchemy { public static Map buildCategory() { - Map entries = new LinkedHashMap(); + Map entries = new LinkedHashMap<>(); String keyBase = "guide." + BloodMagic.MODID + ".entry.alchemy."; - List introPages = new ArrayList(); + List introPages = new ArrayList<>(); introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), true)); - List ashPages = new ArrayList(); + List ashPages = new ArrayList<>(); TartaricForgeRecipe ashRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES)); if (ashRecipe != null) @@ -43,7 +43,7 @@ public class CategoryAlchemy ashPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ash" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "ash"), new EntryText(ashPages, TextHelper.localize(keyBase + "ash"), true)); - List furnacePages = new ArrayList(); + List furnacePages = new ArrayList<>(); PageAlchemyArray furnaceRecipePage = BookUtils.getAlchemyPage("furnace"); if (furnaceRecipePage != null) @@ -53,7 +53,7 @@ public class CategoryAlchemy furnacePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "furnace" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "furnace"), new EntryText(furnacePages, TextHelper.localize(keyBase + "furnace"), true)); - List speedPages = new ArrayList(); + List speedPages = new ArrayList<>(); PageAlchemyArray speedRecipePage = BookUtils.getAlchemyPage("movement"); if (speedRecipePage != null) @@ -63,7 +63,7 @@ public class CategoryAlchemy speedPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "speed" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "speed"), new EntryText(speedPages, TextHelper.localize(keyBase + "speed"), true)); - List updraftPages = new ArrayList(); + List updraftPages = new ArrayList<>(); PageAlchemyArray updraftRecipePage = BookUtils.getAlchemyPage("updraft"); if (updraftRecipePage != null) @@ -73,7 +73,7 @@ public class CategoryAlchemy updraftPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "updraft" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "updraft"), new EntryText(updraftPages, TextHelper.localize(keyBase + "updraft"), true)); - List turretPages = new ArrayList(); + List turretPages = new ArrayList<>(); PageAlchemyArray turretRecipePage = BookUtils.getAlchemyPage("skeletonTurret"); if (turretRecipePage != null) @@ -83,7 +83,7 @@ public class CategoryAlchemy turretPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "turret" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "turret"), new EntryText(turretPages, TextHelper.localize(keyBase + "turret"), true)); - List bouncePages = new ArrayList(); + List bouncePages = new ArrayList<>(); PageAlchemyArray bounceRecipePage = BookUtils.getAlchemyPage("bounce"); if (bounceRecipePage != null) @@ -93,12 +93,12 @@ public class CategoryAlchemy bouncePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bounce" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "bounce"), new EntryText(bouncePages, TextHelper.localize(keyBase + "bounce"), true)); - List buffPages = new ArrayList(); + List buffPages = new ArrayList<>(); buffPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "buff" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "buff"), new EntryText(buffPages, TextHelper.localize(keyBase + "buff"), true)); - List fastMinerPages = new ArrayList(); + List fastMinerPages = new ArrayList<>(); PageAlchemyArray fastMinerRecipePage = BookUtils.getAlchemyPage("fastMiner"); if (fastMinerRecipePage != null) diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryArchitect.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryArchitect.java index 9648211e..946dd171 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryArchitect.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryArchitect.java @@ -31,15 +31,15 @@ import java.util.Map.Entry; public class CategoryArchitect { public static Map buildCategory() { - Map entries = new LinkedHashMap(); + Map entries = new LinkedHashMap<>(); String keyBase = "guide." + BloodMagic.MODID + ".entry.architect."; - List introPages = new ArrayList(); + List introPages = new ArrayList<>(); introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 370)); // introPages.add(new PageImage(new ResourceLocation("bloodmagicguide", "textures/guide/" + ritual.getName() + ".png"))); entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), true)); - List altarPages = new ArrayList(); + List altarPages = new ArrayList<>(); IRecipe altarRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.ALTAR)); if (altarRecipe != null) { @@ -56,7 +56,7 @@ public class CategoryArchitect { altarPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodaltar" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "bloodaltar"), new EntryText(altarPages, TextHelper.localize(keyBase + "bloodaltar"), true)); - List ashPages = new ArrayList(); + List ashPages = new ArrayList<>(); TartaricForgeRecipe ashRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.ARCANE_ASHES)); if (ashRecipe != null) { @@ -65,7 +65,7 @@ public class CategoryArchitect { ashPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ash" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "ash"), new EntryText(ashPages, TextHelper.localize(keyBase + "ash"), true)); - List divinationPages = new ArrayList(); + List divinationPages = new ArrayList<>(); PageAlchemyArray divinationRecipePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.SIGIL_DIVINATION)); if (divinationRecipePage != null) { @@ -75,12 +75,12 @@ public class CategoryArchitect { divinationPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "divination" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "divination"), new EntryText(divinationPages, TextHelper.localize(keyBase + "divination"), true)); - List soulnetworkPages = new ArrayList(); + List soulnetworkPages = new ArrayList<>(); soulnetworkPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "soulnetwork" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "soulnetwork"), new EntryText(soulnetworkPages, TextHelper.localize(keyBase + "soulnetwork"), true)); - List weakorbPages = new ArrayList(); + List weakorbPages = new ArrayList<>(); weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.1"), 370)); AltarRecipe weakorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_WEAK)); @@ -91,7 +91,7 @@ public class CategoryArchitect { weakorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakorb" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "weakorb"), new EntryText(weakorbPages, TextHelper.localize(keyBase + "weakorb"), true)); - List incensePages = new ArrayList(); + List incensePages = new ArrayList<>(); IRecipe incenseRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.INCENSE_ALTAR)); if (incenseRecipe != null) { @@ -108,7 +108,7 @@ public class CategoryArchitect { incensePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "incense" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "incense"), new EntryText(incensePages, TextHelper.localize(keyBase + "incense"), true)); - List runePages = new ArrayList(); + List runePages = new ArrayList<>(); IRecipe runeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 0)); if (runeRecipe != null) { @@ -118,7 +118,7 @@ public class CategoryArchitect { runePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bloodrune" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "bloodrune"), new EntryText(runePages, TextHelper.localize(keyBase + "bloodrune"), true)); - List inspectPages = new ArrayList(); + List inspectPages = new ArrayList<>(); AltarRecipe inspectRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SANGUINE_BOOK)); if (inspectRecipe != null) { @@ -128,7 +128,7 @@ public class CategoryArchitect { inspectPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "inspectoris" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "inspectoris"), new EntryText(inspectPages, TextHelper.localize(keyBase + "inspectoris"), true)); - List speedRunePages = new ArrayList(); + List speedRunePages = new ArrayList<>(); IRecipe speedRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 1)); if (speedRecipe != null) { @@ -138,7 +138,7 @@ public class CategoryArchitect { speedRunePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeSpeed" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "runeSpeed"), new EntryText(speedRunePages, TextHelper.localize(keyBase + "runeSpeed"), true)); - List waterPages = new ArrayList(); + List waterPages = new ArrayList<>(); TartaricForgeRecipe waterRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_WATER.getStack()); if (waterRecipe != null) { @@ -153,7 +153,7 @@ public class CategoryArchitect { waterPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "water" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "water"), new EntryText(waterPages, TextHelper.localize(keyBase + "water"), true)); - List lavaPages = new ArrayList(); + List lavaPages = new ArrayList<>(); TartaricForgeRecipe lavaRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_LAVA.getStack()); if (lavaRecipe != null) { @@ -168,7 +168,7 @@ public class CategoryArchitect { lavaPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lava" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "lava"), new EntryText(lavaPages, TextHelper.localize(keyBase + "lava"), true)); - List lavaCrystalPages = new ArrayList(); + List lavaCrystalPages = new ArrayList<>(); IRecipe lavaCrystalRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.LAVA_CRYSTAL)); if (lavaCrystalRecipe != null) { @@ -178,7 +178,7 @@ public class CategoryArchitect { lavaCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lavaCrystal" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "lavaCrystal"), new EntryText(lavaCrystalPages, TextHelper.localize(keyBase + "lavaCrystal"), true)); - List apprenticeorbPages = new ArrayList(); + List apprenticeorbPages = new ArrayList<>(); AltarRecipe apprenticeorbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_APPRENTICE)); if (apprenticeorbRecipe != null) { @@ -188,7 +188,7 @@ public class CategoryArchitect { apprenticeorbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "apprenticeorb" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "apprenticeorb"), new EntryText(apprenticeorbPages, TextHelper.localize(keyBase + "apprenticeorb"), true)); - List daggerPages = new ArrayList(); + List daggerPages = new ArrayList<>(); AltarRecipe daggerOfSacrificeRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.DAGGER_OF_SACRIFICE)); if (daggerOfSacrificeRecipe != null) { @@ -198,7 +198,7 @@ public class CategoryArchitect { daggerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "dagger" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "dagger"), new EntryText(daggerPages, TextHelper.localize(keyBase + "dagger"), true)); - List runeSacrificePages = new ArrayList(); + List runeSacrificePages = new ArrayList<>(); IRecipe runeSacrificeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 3)); if (runeSacrificeRecipe != null) { @@ -208,7 +208,7 @@ public class CategoryArchitect { runeSacrificePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeSacrifice" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "runeSacrifice"), new EntryText(runeSacrificePages, TextHelper.localize(keyBase + "runeSacrifice"), true)); - List runeSelfSacrificePages = new ArrayList(); + List runeSelfSacrificePages = new ArrayList<>(); IRecipe runeSelfSacrificeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 4)); if (runeSelfSacrificeRecipe != null) { @@ -218,7 +218,7 @@ public class CategoryArchitect { runeSelfSacrificePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeSelfSacrifice" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "runeSelfSacrifice"), new EntryText(runeSelfSacrificePages, TextHelper.localize(keyBase + "runeSelfSacrifice"), true)); - List holdingPages = new ArrayList(); + List holdingPages = new ArrayList<>(); TartaricForgeRecipe holdingRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_HOLDING.getStack()); if (holdingRecipe != null) { @@ -233,7 +233,7 @@ public class CategoryArchitect { holdingPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "holding" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "holding"), new EntryText(holdingPages, TextHelper.localize(keyBase + "holding"), true)); - List airPages = new ArrayList(); + List airPages = new ArrayList<>(); TartaricForgeRecipe airRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_AIR.getStack()); if (airRecipe != null) { @@ -248,7 +248,7 @@ public class CategoryArchitect { airPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "air" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "air"), new EntryText(airPages, TextHelper.localize(keyBase + "air"), true)); - List voidPages = new ArrayList(); + List voidPages = new ArrayList<>(); TartaricForgeRecipe voidRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_VOID.getStack()); if (voidRecipe != null) { @@ -263,7 +263,7 @@ public class CategoryArchitect { voidPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "void" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "void"), new EntryText(voidPages, TextHelper.localize(keyBase + "void"), true)); - List greenGrovePages = new ArrayList(); + List greenGrovePages = new ArrayList<>(); TartaricForgeRecipe greenGroveRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_GROWTH.getStack()); if (greenGroveRecipe != null) { @@ -278,7 +278,7 @@ public class CategoryArchitect { greenGrovePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "greenGrove" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "greenGrove"), new EntryText(greenGrovePages, TextHelper.localize(keyBase + "greenGrove"), true)); - List fastMinerPages = new ArrayList(); + List fastMinerPages = new ArrayList<>(); TartaricForgeRecipe fastMinerRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_FAST_MINER.getStack()); if (fastMinerRecipe != null) { @@ -293,7 +293,7 @@ public class CategoryArchitect { fastMinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "fastMiner" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "fastMiner"), new EntryText(fastMinerPages, TextHelper.localize(keyBase + "fastMiner"), true)); - List seerPages = new ArrayList(); + List seerPages = new ArrayList<>(); TartaricForgeRecipe seerRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_SIGHT.getStack()); if (seerRecipe != null) { @@ -308,7 +308,7 @@ public class CategoryArchitect { seerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "seer" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "seer"), new EntryText(seerPages, TextHelper.localize(keyBase + "seer"), true)); - List magicianOrbPages = new ArrayList(); + List magicianOrbPages = new ArrayList<>(); AltarRecipe magicianOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MAGICIAN)); if (magicianOrbRecipe != null) { @@ -318,7 +318,7 @@ public class CategoryArchitect { magicianOrbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "magicianOrb" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "magicianOrb"), new EntryText(magicianOrbPages, TextHelper.localize(keyBase + "magicianOrb"), true)); - List capacityPages = new ArrayList(); + List capacityPages = new ArrayList<>(); IRecipe capacityRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 4)); if (capacityRecipe != null) { @@ -328,7 +328,7 @@ public class CategoryArchitect { capacityPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "capacity" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "capacity"), new EntryText(capacityPages, TextHelper.localize(keyBase + "capacity"), true)); - List displacementPages = new ArrayList(); + List displacementPages = new ArrayList<>(); IRecipe displacementRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 4)); if (displacementRecipe != null) { @@ -338,7 +338,7 @@ public class CategoryArchitect { displacementPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "displacement" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "displacement"), new EntryText(displacementPages, TextHelper.localize(keyBase + "displacement"), true)); - List affinityPages = new ArrayList(); + List affinityPages = new ArrayList<>(); TartaricForgeRecipe affinityRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_AFFINITY.getStack()); if (affinityRecipe != null) { @@ -353,7 +353,7 @@ public class CategoryArchitect { affinityPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "affinity" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "affinity"), new EntryText(affinityPages, TextHelper.localize(keyBase + "affinity"), true)); - List lampPages = new ArrayList(); + List lampPages = new ArrayList<>(); TartaricForgeRecipe lampRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_BLOOD_LIGHT.getStack()); if (lampRecipe != null) { @@ -368,7 +368,7 @@ public class CategoryArchitect { lampPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lamp" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "lamp"), new EntryText(lampPages, TextHelper.localize(keyBase + "lamp"), true)); - List magnetismPages = new ArrayList(); + List magnetismPages = new ArrayList<>(); TartaricForgeRecipe magnetismRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_MAGNETISM.getStack()); if (magnetismRecipe != null) { @@ -383,7 +383,7 @@ public class CategoryArchitect { magnetismPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "magnetism" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "magnetism"), new EntryText(magnetismPages, TextHelper.localize(keyBase + "magnetism"), true)); - List peritiaPages = new ArrayList(); + List peritiaPages = new ArrayList<>(); IRecipe peritiaRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.EXPERIENCE_TOME)); if (peritiaRecipe != null) { @@ -393,7 +393,7 @@ public class CategoryArchitect { peritiaPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "peritia" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "peritia"), new EntryText(peritiaPages, TextHelper.localize(keyBase + "peritia"), true)); - List livingArmourPages = new ArrayList(); + List livingArmourPages = new ArrayList<>(); TartaricForgeRecipe bindingRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_BINDING.getStack()); if (bindingRecipe != null) { @@ -423,17 +423,17 @@ public class CategoryArchitect { livingArmourPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "livingArmour" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "livingArmour"), new EntryText(livingArmourPages, TextHelper.localize(keyBase + "livingArmour"), true)); - List upgradePages = new ArrayList(); + List upgradePages = new ArrayList<>(); upgradePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "upgradeTome" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "upgradeTome"), new EntryText(upgradePages, TextHelper.localize(keyBase + "upgradeTome"), true)); - List downgradePages = new ArrayList(); + List downgradePages = new ArrayList<>(); downgradePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "downgrade" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "downgrade"), new EntryText(downgradePages, TextHelper.localize(keyBase + "downgrade"), true)); - List teleposerPages = new ArrayList(); + List teleposerPages = new ArrayList<>(); AltarRecipe teleposerFocusRecipe = RecipeHelper.getAltarRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.TELEPOSITION_FOCUS)); if (teleposerFocusRecipe != null) { @@ -448,7 +448,7 @@ public class CategoryArchitect { teleposerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "teleposer" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "teleposer"), new EntryText(teleposerPages, TextHelper.localize(keyBase + "teleposer"), true)); - List boundBladePages = new ArrayList(); + List boundBladePages = new ArrayList<>(); PageAlchemyArray boundBladePage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_SWORD)); if (boundBladePage != null) { @@ -458,7 +458,7 @@ public class CategoryArchitect { boundBladePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "boundBlade" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "boundBlade"), new EntryText(boundBladePages, TextHelper.localize(keyBase + "boundBlade"), true)); - List boundToolPages = new ArrayList(); + List boundToolPages = new ArrayList<>(); PageAlchemyArray boundToolPage = BookUtils.getAlchemyPage(new ItemStack(RegistrarBloodMagicItems.BOUND_PICKAXE)); if (boundToolPage != null) { @@ -478,12 +478,12 @@ public class CategoryArchitect { boundToolPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "boundTool" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "boundTool"), new EntryText(boundToolPages, TextHelper.localize(keyBase + "boundTool"), true)); - List weakShardPages = new ArrayList(); + List weakShardPages = new ArrayList<>(); weakShardPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "weakShard" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "weakShard"), new EntryText(weakShardPages, TextHelper.localize(keyBase + "weakShard"), true)); - List masterOrbPages = new ArrayList(); + List masterOrbPages = new ArrayList<>(); AltarRecipe masterOrbRecipe = RecipeHelper.getAltarRecipeForOutput(OrbRegistry.getOrbStack(RegistrarBloodMagic.ORB_MASTER)); if (magicianOrbRecipe != null) { @@ -493,7 +493,7 @@ public class CategoryArchitect { masterOrbPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "masterOrb" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "masterOrb"), new EntryText(masterOrbPages, TextHelper.localize(keyBase + "masterOrb"), true)); - List orbRunePages = new ArrayList(); + List orbRunePages = new ArrayList<>(); IRecipe orbRuneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 8)); if (orbRuneRecipe != null) { @@ -503,7 +503,7 @@ public class CategoryArchitect { orbRunePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "runeOrb" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "runeOrb"), new EntryText(orbRunePages, TextHelper.localize(keyBase + "runeOrb"), true)); - List augmentedCapacityPages = new ArrayList(); + List augmentedCapacityPages = new ArrayList<>(); IRecipe augmentedCapacityRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 7)); if (orbRuneRecipe != null) { @@ -513,7 +513,7 @@ public class CategoryArchitect { augmentedCapacityPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "augmentedCapacity" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "augmentedCapacity"), new EntryText(augmentedCapacityPages, TextHelper.localize(keyBase + "augmentedCapacity"), true)); - List chargingPages = new ArrayList(); + List chargingPages = new ArrayList<>(); IRecipe chargingRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 10)); if (orbRuneRecipe != null) { @@ -523,7 +523,7 @@ public class CategoryArchitect { chargingPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "charging" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "charging"), new EntryText(chargingPages, TextHelper.localize(keyBase + "charging"), true)); - List accelerationPages = new ArrayList(); + List accelerationPages = new ArrayList<>(); IRecipe accelerationRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.BLOOD_RUNE, 1, 9)); if (orbRuneRecipe != null) { @@ -533,7 +533,7 @@ public class CategoryArchitect { accelerationPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "acceleration" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "acceleration"), new EntryText(accelerationPages, TextHelper.localize(keyBase + "acceleration"), true)); - List suppressionPages = new ArrayList(); + List suppressionPages = new ArrayList<>(); TartaricForgeRecipe suppressionRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_SUPPRESSION.getStack()); if (suppressionRecipe != null) { @@ -548,7 +548,7 @@ public class CategoryArchitect { suppressionPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "suppression" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "suppression"), new EntryText(suppressionPages, TextHelper.localize(keyBase + "suppression"), true)); - List hastePages = new ArrayList(); + List hastePages = new ArrayList<>(); TartaricForgeRecipe hasteRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_HASTE.getStack()); if (hasteRecipe != null) { @@ -563,7 +563,7 @@ public class CategoryArchitect { hastePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "haste" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "haste"), new EntryText(hastePages, TextHelper.localize(keyBase + "haste"), true)); - List severancePages = new ArrayList(); + List severancePages = new ArrayList<>(); TartaricForgeRecipe severanceRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_SEVERANCE.getStack()); if (severanceRecipe != null) { @@ -578,7 +578,7 @@ public class CategoryArchitect { severancePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "severance" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "severance"), new EntryText(severancePages, TextHelper.localize(keyBase + "severance"), true)); - List telepositionPages = new ArrayList(); + List telepositionPages = new ArrayList<>(); TartaricForgeRecipe telepositionRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_TELEPOSITION.getStack()); if (telepositionRecipe != null) { @@ -593,7 +593,7 @@ public class CategoryArchitect { telepositionPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "teleposition" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "teleposition"), new EntryText(telepositionPages, TextHelper.localize(keyBase + "teleposition"), true)); - List compressionPages = new ArrayList(); + List compressionPages = new ArrayList<>(); TartaricForgeRecipe compressionRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_COMPRESSION.getStack()); if (compressionRecipe != null) { @@ -608,7 +608,7 @@ public class CategoryArchitect { compressionPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "compression" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "compression"), new EntryText(compressionPages, TextHelper.localize(keyBase + "compression"), true)); - List bridgePages = new ArrayList(); + List bridgePages = new ArrayList<>(); TartaricForgeRecipe bridgeRecipe = RecipeHelper.getForgeRecipeForOutput(ComponentTypes.REAGENT_BRIDGE.getStack()); if (bridgeRecipe != null) { @@ -623,7 +623,7 @@ public class CategoryArchitect { bridgePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "bridge" + ".info.1"), 370)); entries.put(new ResourceLocation(keyBase + "bridge"), new EntryText(bridgePages, TextHelper.localize(keyBase + "bridge"), true)); - List mimicPages = new ArrayList(); + List mimicPages = new ArrayList<>(); IRecipe mimicRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.MIMIC, 1, 1)); if (mimicRecipe != null) { diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryDemon.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryDemon.java index 92566ab3..eb26e3a4 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryDemon.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryDemon.java @@ -26,15 +26,15 @@ import java.util.Map.Entry; public class CategoryDemon { //TODO: Add Forge recipe pages public static Map buildCategory() { - Map entries = new LinkedHashMap(); + Map entries = new LinkedHashMap<>(); String keyBase = "guide." + BloodMagic.MODID + ".entry.demon."; - List introPages = new ArrayList(); + List introPages = new ArrayList<>(); introPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "intro" + ".info"), 370)); // introPages.add(new PageImage(new ResourceLocation("bloodmagicguide", "textures/guide/" + ritual.getName() + ".png"))); entries.put(new ResourceLocation(keyBase + "intro"), new EntryText(introPages, TextHelper.localize(keyBase + "intro"), true)); - List snarePages = new ArrayList(); + List snarePages = new ArrayList<>(); snarePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "snare" + ".info.1"), 370)); IRecipe snareRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SOUL_SNARE)); @@ -45,7 +45,7 @@ public class CategoryDemon { snarePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "snare" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "snare"), new EntryText(snarePages, TextHelper.localize(keyBase + "snare"), true)); - List forgePages = new ArrayList(); + List forgePages = new ArrayList<>(); forgePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "forge" + ".info.1"), 370)); IRecipe forgeRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.SOUL_FORGE)); @@ -56,7 +56,7 @@ public class CategoryDemon { forgePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "forge" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "forge"), new EntryText(forgePages, TextHelper.localize(keyBase + "forge"), true)); - List pettyPages = new ArrayList(); + List pettyPages = new ArrayList<>(); pettyPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "petty" + ".info.1"), 370)); TartaricForgeRecipe pettyRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM)); if (pettyRecipe != null) { @@ -65,7 +65,7 @@ public class CategoryDemon { pettyPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "petty" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "petty"), new EntryText(pettyPages, TextHelper.localize(keyBase + "petty"), true)); - List swordPages = new ArrayList(); + List swordPages = new ArrayList<>(); swordPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sword" + ".info.1"), 370)); TartaricForgeRecipe swordRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SENTIENT_SWORD)); if (swordRecipe != null) { @@ -74,7 +74,7 @@ public class CategoryDemon { swordPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sword" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "sword"), new EntryText(swordPages, TextHelper.localize(keyBase + "sword"), true)); - List lesserPages = new ArrayList(); + List lesserPages = new ArrayList<>(); lesserPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lesser" + ".info.1"), 370)); TartaricForgeRecipe lesserRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.SOUL_GEM, 1, 1)); if (lesserRecipe != null) { @@ -83,16 +83,16 @@ public class CategoryDemon { lesserPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "lesser" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "lesser"), new EntryText(lesserPages, TextHelper.localize(keyBase + "lesser"), true)); - List reactionsPages = new ArrayList(); + List reactionsPages = new ArrayList<>(); reactionsPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "reactions" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "reactions"), new EntryText(reactionsPages, TextHelper.localize(keyBase + "reactions"), true)); - List sentientGemPages = new ArrayList(); + List sentientGemPages = new ArrayList<>(); sentientGemPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sentientGem" + ".info.1"), 370)); sentientGemPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "sentientGem" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "sentientGem"), new EntryText(sentientGemPages, TextHelper.localize(keyBase + "sentientGem"), true)); - List routingPages = new ArrayList(); + List routingPages = new ArrayList<>(); TartaricForgeRecipe nodeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.ITEM_ROUTING_NODE)); if (nodeRecipe != null) { routingPages.add(new PageTartaricForgeRecipe(nodeRecipe)); @@ -118,17 +118,17 @@ public class CategoryDemon { routingPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "routing" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "routing"), new EntryText(routingPages, TextHelper.localize(keyBase + "routing"), true)); - List auraPages = new ArrayList(); + List auraPages = new ArrayList<>(); auraPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "aura" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "aura"), new EntryText(auraPages, TextHelper.localize(keyBase + "aura"), true)); - List typesPages = new ArrayList(); + List typesPages = new ArrayList<>(); typesPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "types" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "types"), new EntryText(typesPages, TextHelper.localize(keyBase + "types"), true)); - List cruciblePages = new ArrayList(); + List cruciblePages = new ArrayList<>(); TartaricForgeRecipe crucibleRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRUCIBLE)); if (crucibleRecipe != null) { @@ -138,7 +138,7 @@ public class CategoryDemon { cruciblePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "crucible" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "crucible"), new EntryText(cruciblePages, TextHelper.localize(keyBase + "crucible"), true)); - List crystallizerPages = new ArrayList(); + List crystallizerPages = new ArrayList<>(); TartaricForgeRecipe crystallizerRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTALLIZER)); if (crystallizerRecipe != null) { @@ -148,7 +148,7 @@ public class CategoryDemon { crystallizerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "crystallizer" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "crystallizer"), new EntryText(crystallizerPages, TextHelper.localize(keyBase + "crystallizer"), true)); - List clusterPages = new ArrayList(); + List clusterPages = new ArrayList<>(); TartaricForgeRecipe clusterRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_CRYSTAL)); if (clusterRecipe != null) { @@ -158,7 +158,7 @@ public class CategoryDemon { clusterPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "cluster" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "cluster"), new EntryText(clusterPages, TextHelper.localize(keyBase + "cluster"), true)); - List pylonPages = new ArrayList(); + List pylonPages = new ArrayList<>(); TartaricForgeRecipe pylonRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.DEMON_PYLON)); if (pylonRecipe != null) { @@ -168,7 +168,7 @@ public class CategoryDemon { pylonPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "pylon" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "pylon"), new EntryText(pylonPages, TextHelper.localize(keyBase + "pylon"), true)); - List gaugePages = new ArrayList(); + List gaugePages = new ArrayList<>(); TartaricForgeRecipe gaugeRecipe = RecipeHelper.getForgeRecipeForOutput(new ItemStack(RegistrarBloodMagicItems.DEMON_WILL_GAUGE)); if (gaugeRecipe != null) { diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java index ccc59e49..3d77b52c 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategoryRitual.java @@ -28,12 +28,12 @@ public class CategoryRitual { static String keyBase = "guide." + BloodMagic.MODID + ".entry.ritual."; public static Map buildCategory() { - Map entries = new LinkedHashMap(); + Map entries = new LinkedHashMap<>(); addRitualPagesToEntries("intro", entries); addRitualPagesToEntries("basics", entries); - List ritualStonePages = new ArrayList(); + List ritualStonePages = new ArrayList<>(); IRecipe ritualStoneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_STONE)); if (ritualStoneRecipe != null) { @@ -53,7 +53,7 @@ public class CategoryRitual { ritualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "ritualStone" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "ritualStone"), new EntryText(ritualStonePages, TextHelper.localize(keyBase + "ritualStone"), true)); - List masterRitualStonePages = new ArrayList(); + List masterRitualStonePages = new ArrayList<>(); IRecipe masterRitualStoneRecipe = RecipeHelper.getRecipeForOutput(new ItemStack(RegistrarBloodMagicBlocks.RITUAL_CONTROLLER, 1, 0)); if (masterRitualStoneRecipe != null) { @@ -63,7 +63,7 @@ public class CategoryRitual { masterRitualStonePages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "masterRitualStone" + ".info"), 370)); entries.put(new ResourceLocation(keyBase + "masterRitualStone"), new EntryText(masterRitualStonePages, TextHelper.localize(keyBase + "masterRitualStone"), true)); - List activationCrystalPages = new ArrayList(); + List activationCrystalPages = new ArrayList<>(); activationCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "activationCrystal" + ".info.1"), 370)); @@ -75,7 +75,7 @@ public class CategoryRitual { activationCrystalPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "activationCrystal" + ".info.2"), 370)); entries.put(new ResourceLocation(keyBase + "activationCrystal"), new EntryText(activationCrystalPages, TextHelper.localize(keyBase + "activationCrystal"), true)); - List divinerPages = new ArrayList(); + List divinerPages = new ArrayList<>(); divinerPages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + "diviner" + ".info.1"), 370)); @@ -120,7 +120,7 @@ public class CategoryRitual { } public static void addRitualPagesToEntries(String name, Map entries) { - List pages = new ArrayList(); + List pages = new ArrayList<>(); pages.addAll(PageHelper.pagesForLongText(TextHelper.localize(keyBase + name + ".info"), 370)); entries.put(new ResourceLocation(keyBase + name), new EntryText(pages, TextHelper.localize(keyBase + name), true)); } diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategorySpell.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategorySpell.java index 6c3d17e9..680bffda 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategorySpell.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/book/CategorySpell.java @@ -9,7 +9,7 @@ import java.util.Map; public class CategorySpell { public static Map buildCategory() { - Map entries = new LinkedHashMap(); + Map entries = new LinkedHashMap<>(); String keyBase = Constants.Mod.DOMAIN + "spell_"; return entries; diff --git a/src/main/java/WayofTime/bloodmagic/compat/guideapi/page/PageAlchemyArray.java b/src/main/java/WayofTime/bloodmagic/compat/guideapi/page/PageAlchemyArray.java index 8529425f..caa0df9a 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/guideapi/page/PageAlchemyArray.java +++ b/src/main/java/WayofTime/bloodmagic/compat/guideapi/page/PageAlchemyArray.java @@ -24,7 +24,7 @@ public class PageAlchemyArray extends Page { public final ItemStack inputStack; public final ItemStack catalystStack; public final ItemStack outputStack; - public List arrayResources = new ArrayList(); + public List arrayResources = new ArrayList<>(); public PageAlchemyArray(List arrayResources, ItemStack inputStack, ItemStack catalystStack, ItemStack outputStack) { this.arrayResources = arrayResources; diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java index 715fb008..ba639936 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/alchemyTable/AlchemyTableRecipeJEI.java @@ -45,7 +45,7 @@ public class AlchemyTableRecipeJEI implements IRecipeWrapper { @Override public List getTooltipStrings(int mouseX, int mouseY) { - ArrayList ret = new ArrayList(); + ArrayList ret = new ArrayList<>(); if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34) { ret.add(TextHelper.localize("tooltip.bloodmagic.tier", tier)); ret.add(TextHelper.localize("jei.bloodmagic.recipe.lpDrained", syphon)); diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeMaker.java b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeMaker.java index f7baa13c..90ca286d 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeMaker.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/armourDowngrade/ArmourDowngradeRecipeMaker.java @@ -11,7 +11,7 @@ public class ArmourDowngradeRecipeMaker { @Nonnull public static List getRecipes() { List recipeList = LivingArmourDowngradeRecipeRegistry.getRecipeList(); - ArrayList recipes = new ArrayList(); + ArrayList recipes = new ArrayList<>(); for (LivingArmourDowngradeRecipe recipe : recipeList) recipes.add(new ArmourDowngradeRecipeJEI(recipe)); diff --git a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java index db44651e..d921befc 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java +++ b/src/main/java/WayofTime/bloodmagic/compat/jei/binding/BindingRecipeMaker.java @@ -17,7 +17,7 @@ public class BindingRecipeMaker { public static List getRecipes() { Map, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> alchemyArrayRecipeMap = AlchemyArrayRecipeRegistry.getRecipes(); - ArrayList recipes = new ArrayList(); + ArrayList recipes = new ArrayList<>(); for (Map.Entry, AlchemyArrayRecipeRegistry.AlchemyArrayRecipe> itemStackAlchemyArrayRecipeEntry : alchemyArrayRecipeMap.entrySet()) { List input = itemStackAlchemyArrayRecipeEntry.getValue().getInput(); diff --git a/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java b/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java index f246bc48..f5a4b923 100644 --- a/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java +++ b/src/main/java/WayofTime/bloodmagic/compat/waila/provider/DataProviderRitualController.java @@ -8,7 +8,6 @@ import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.tile.TileMasterRitualStone; import WayofTime.bloodmagic.util.helper.TextHelper; -import joptsimple.internal.Strings; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; diff --git a/src/main/java/WayofTime/bloodmagic/compress/CompressionRegistry.java b/src/main/java/WayofTime/bloodmagic/compress/CompressionRegistry.java index 280bd784..2d975531 100644 --- a/src/main/java/WayofTime/bloodmagic/compress/CompressionRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/compress/CompressionRegistry.java @@ -18,8 +18,8 @@ import java.util.Map; * form. */ public class CompressionRegistry { - public static List compressionRegistry = new ArrayList(); - public static Map thresholdMap = new HashMap(); + public static List compressionRegistry = new ArrayList<>(); + public static Map thresholdMap = new HashMap<>(); public static void registerHandler(CompressionHandler handler) { compressionRegistry.add(handler); diff --git a/src/main/java/WayofTime/bloodmagic/core/data/BMWorldSavedData.java b/src/main/java/WayofTime/bloodmagic/core/data/BMWorldSavedData.java index 0eb2be6a..70338a16 100644 --- a/src/main/java/WayofTime/bloodmagic/core/data/BMWorldSavedData.java +++ b/src/main/java/WayofTime/bloodmagic/core/data/BMWorldSavedData.java @@ -13,7 +13,7 @@ import java.util.UUID; public class BMWorldSavedData extends WorldSavedData { public static final String ID = "BloodMagic-SoulNetworks"; - private Map soulNetworks = new HashMap(); + private Map soulNetworks = new HashMap<>(); public BMWorldSavedData(String id) { super(id); diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyArrayRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyArrayRecipeRegistry.java index 36edf7b1..bc28b170 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyArrayRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyArrayRecipeRegistry.java @@ -20,7 +20,7 @@ public class AlchemyArrayRecipeRegistry { public static final AlchemyCircleRenderer DEFAULT_RENDERER = new AlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/BaseArray.png")); private static BiMap, AlchemyArrayRecipe> recipes = HashBiMap.create(); - private static HashMap effectMap = new HashMap(); + private static HashMap effectMap = new HashMap<>(); /** * General case for creating an AlchemyArrayEffect for a given input. @@ -120,7 +120,7 @@ public class AlchemyArrayRecipeRegistry { } public static void registerCraftingRecipe(String inputOreDict, ItemStack catalystStack, ItemStack outputStack, ResourceLocation arrayResource) { - registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, new AlchemyArrayEffectCrafting(outputStack), arrayResource); + registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, new AlchemyArrayEffectCrafting(outputStack), arrayResource); } public static void registerCraftingRecipe(ItemStack input, ItemStack catalystStack, ItemStack outputStack) { @@ -132,7 +132,7 @@ public class AlchemyArrayRecipeRegistry { } public static void registerCraftingRecipe(String inputOreDict, ItemStack catalystStack, ItemStack outputStack) { - registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, new AlchemyArrayEffectCrafting(outputStack)); + registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, new AlchemyArrayEffectCrafting(outputStack)); } public static void registerRecipe(ItemStack inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) { @@ -151,7 +151,7 @@ public class AlchemyArrayRecipeRegistry { public static void registerRecipe(String inputOreDict, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, ResourceLocation arrayResource) { AlchemyCircleRenderer circleRenderer = arrayResource == null ? DEFAULT_RENDERER : new AlchemyCircleRenderer(arrayResource); - registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, arrayEffect, circleRenderer); + registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, arrayEffect, circleRenderer); } public static void registerRecipe(ItemStack input, ItemStack catalystStack, AlchemyArrayEffect arrayEffect) { @@ -163,7 +163,7 @@ public class AlchemyArrayRecipeRegistry { } public static void registerRecipe(String inputOreDict, ItemStack catalystStack, AlchemyArrayEffect arrayEffect) { - registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, arrayEffect, (AlchemyCircleRenderer) null); + registerRecipe(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, arrayEffect, (AlchemyCircleRenderer) null); } public static void replaceAlchemyCircle(List input, AlchemyCircleRenderer circleRenderer) { @@ -250,7 +250,7 @@ public class AlchemyArrayRecipeRegistry { } public AlchemyArrayRecipe(String inputOreDict, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) { - this(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, arrayEffect, circleRenderer, false); + this(OreDictionary.doesOreNameExist(inputOreDict) && OreDictionary.getOres(inputOreDict).size() > 0 ? OreDictionary.getOres(inputOreDict) : Collections.emptyList(), catalystStack, arrayEffect, circleRenderer, false); } public AlchemyArrayRecipe(List inputStacks, ItemStack catalystStack, AlchemyArrayEffect arrayEffect, AlchemyCircleRenderer circleRenderer) { diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyTableRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyTableRecipeRegistry.java index 901994a7..d27e99c1 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyTableRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/AlchemyTableRecipeRegistry.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; public class AlchemyTableRecipeRegistry { - private static List recipeList = new ArrayList(); + private static List recipeList = new ArrayList<>(); public static void registerRecipe(AlchemyTableRecipe recipe) { recipeList.add(recipe); @@ -34,6 +34,6 @@ public class AlchemyTableRecipeRegistry { } public static List getRecipeList() { - return new ArrayList(recipeList); + return new ArrayList<>(recipeList); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/AltarRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/AltarRecipeRegistry.java index 49ab1e77..e52151a5 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/AltarRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/AltarRecipeRegistry.java @@ -1,6 +1,5 @@ package WayofTime.bloodmagic.core.registry; -import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.util.BMLog; import WayofTime.bloodmagic.util.ItemStackWrapper; import WayofTime.bloodmagic.altar.EnumAltarTier; @@ -119,11 +118,11 @@ public class AltarRecipeRegistry { } public AltarRecipe(String inputEntry, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate, boolean fillable) { - this(OreDictionary.doesOreNameExist(inputEntry) && OreDictionary.getOres(inputEntry).size() > 0 ? OreDictionary.getOres(inputEntry) : Collections.emptyList(), output, minTier, syphon, consumeRate, drainRate, fillable); + this(OreDictionary.doesOreNameExist(inputEntry) && OreDictionary.getOres(inputEntry).size() > 0 ? OreDictionary.getOres(inputEntry) : Collections.emptyList(), output, minTier, syphon, consumeRate, drainRate, fillable); } public AltarRecipe(String inputEntry, ItemStack output, EnumAltarTier minTier, int syphon, int consumeRate, int drainRate) { - this(OreDictionary.doesOreNameExist(inputEntry) && OreDictionary.getOres(inputEntry).size() > 0 ? OreDictionary.getOres(inputEntry) : Collections.emptyList(), output, minTier, syphon, consumeRate, drainRate, false); + this(OreDictionary.doesOreNameExist(inputEntry) && OreDictionary.getOres(inputEntry).size() > 0 ? OreDictionary.getOres(inputEntry) : Collections.emptyList(), output, minTier, syphon, consumeRate, drainRate, false); } public boolean doesRequiredItemMatch(ItemStack comparedStack, EnumAltarTier tierCheck) { diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/HarvestRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/HarvestRegistry.java index ab500fd8..9be7251b 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/HarvestRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/HarvestRegistry.java @@ -8,11 +8,11 @@ import net.minecraft.block.BlockStem; import java.util.*; public class HarvestRegistry { - private static List handlerList = new ArrayList(); - private static Map standardCrops = new HashMap(); - private static Set tallCrops = new HashSet(); - private static Map stemCrops = new HashMap(); - private static Map amplifierMap = new HashMap(); + private static List handlerList = new ArrayList<>(); + private static Map standardCrops = new HashMap<>(); + private static Set tallCrops = new HashSet<>(); + private static Map stemCrops = new HashMap<>(); + private static Map amplifierMap = new HashMap<>(); /** * Registers a handler for the Harvest Ritual to call. @@ -81,22 +81,22 @@ public class HarvestRegistry { } public static List getHandlerList() { - return new ArrayList(handlerList); + return new ArrayList<>(handlerList); } public static Map getStandardCrops() { - return new HashMap(standardCrops); + return new HashMap<>(standardCrops); } public static Set getTallCrops() { - return new HashSet(tallCrops); + return new HashSet<>(tallCrops); } public static Map getStemCrops() { - return new HashMap(stemCrops); + return new HashMap<>(stemCrops); } public static Map getAmplifierMap() { - return new HashMap(amplifierMap); + return new HashMap<>(amplifierMap); } } diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java index c1c0acdf..1cf8922a 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/ImperfectRitualRegistry.java @@ -1,6 +1,5 @@ package WayofTime.bloodmagic.core.registry; -import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.util.BMLog; import WayofTime.bloodmagic.util.BlockStack; import WayofTime.bloodmagic.ritual.data.imperfect.ImperfectRitual; @@ -12,7 +11,7 @@ import java.util.HashMap; import java.util.Map; public class ImperfectRitualRegistry { - public static final Map enabledRituals = new HashMap(); + public static final Map enabledRituals = new HashMap<>(); private static final BiMap registry = HashBiMap.create(); /** @@ -90,10 +89,10 @@ public class ImperfectRitualRegistry { } public static ArrayList getIds() { - return new ArrayList(registry.keySet()); + return new ArrayList<>(registry.keySet()); } public static ArrayList getRituals() { - return new ArrayList(registry.values()); + return new ArrayList<>(registry.values()); } } diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/LivingArmourDowngradeRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/LivingArmourDowngradeRecipeRegistry.java index 8360dbd5..61a28fb5 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/LivingArmourDowngradeRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/LivingArmourDowngradeRecipeRegistry.java @@ -15,8 +15,8 @@ import java.util.Map; import java.util.Map.Entry; public class LivingArmourDowngradeRecipeRegistry { - private static List recipeList = new ArrayList(); - private static Map>> dialogueMap = new HashMap>>(); + private static List recipeList = new ArrayList<>(); + private static Map>> dialogueMap = new HashMap<>(); public static void registerRecipe(LivingArmourDowngradeRecipe recipe) { recipeList.add(recipe); @@ -55,6 +55,6 @@ public class LivingArmourDowngradeRecipeRegistry { } public static List getRecipeList() { - return new ArrayList(recipeList); + return new ArrayList<>(recipeList); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/OrbRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/OrbRegistry.java index 5ddbeb3c..d911c303 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/OrbRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/OrbRegistry.java @@ -21,7 +21,7 @@ public class OrbRegistry { @GameRegistry.ObjectHolder("bloodmagic:blood_orb") private static final Item ORB_ITEM = null; public static ArrayListMultimap tierMap = ArrayListMultimap.create(); - private static List orbs = new ArrayList(); + private static List orbs = new ArrayList<>(); public static List getOrbsForTier(int tier) { if (getTierMap().containsKey(tier)) @@ -31,7 +31,7 @@ public class OrbRegistry { } public static List getOrbsUpToTier(int tier) { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (int i = 1; i <= tier; i++) ret.addAll(getOrbsForTier(i)); @@ -40,7 +40,7 @@ public class OrbRegistry { } public static List getOrbsDownToTier(int tier) { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (int i = EnumAltarTier.MAXTIERS; i >= tier; i--) ret.addAll(getOrbsForTier(i)); diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java index cc3f5dc6..b13b4614 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/RitualRegistry.java @@ -9,14 +9,14 @@ import javax.annotation.Nullable; import java.util.*; public class RitualRegistry { - public static final Map enabledRituals = new HashMap(); + public static final Map enabledRituals = new HashMap<>(); private static final BiMap registry = HashBiMap.create(); - private static final List lookupList = new ArrayList(); + private static final List lookupList = new ArrayList<>(); /** * Ordered list for actions that depend on the order that the rituals were * registered in */ - private static final ArrayList orderedIdList = new ArrayList(); + private static final ArrayList orderedIdList = new ArrayList<>(); private static boolean locked; @@ -92,11 +92,11 @@ public class RitualRegistry { } public static Map getEnabledMap() { - return new HashMap(enabledRituals); + return new HashMap<>(enabledRituals); } public static ArrayList getIds() { - return new ArrayList(lookupList); + return new ArrayList<>(lookupList); } public static ArrayList getOrderedIds() { @@ -104,14 +104,14 @@ public class RitualRegistry { } public static ArrayList getRituals() { - return new ArrayList(registry.values()); + return new ArrayList<>(registry.values()); } public static void orderLookupList() { locked = true; // Lock registry so no no rituals can be registered lookupList.clear(); // Make sure it's empty lookupList.addAll(registry.keySet()); - Collections.sort(lookupList, (o1, o2) -> { + lookupList.sort((o1, o2) -> { Ritual ritual1 = registry.get(o1); Ritual ritual2 = registry.get(o2); return ritual1.getComponents().size() > ritual2.getComponents().size() ? -1 : 0; // Put earlier if bigger diff --git a/src/main/java/WayofTime/bloodmagic/core/registry/TartaricForgeRecipeRegistry.java b/src/main/java/WayofTime/bloodmagic/core/registry/TartaricForgeRecipeRegistry.java index 83b075e0..595310ae 100644 --- a/src/main/java/WayofTime/bloodmagic/core/registry/TartaricForgeRecipeRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/core/registry/TartaricForgeRecipeRegistry.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; public class TartaricForgeRecipeRegistry { - private static List recipeList = new ArrayList(); + private static List recipeList = new ArrayList<>(); public static void registerRecipe(TartaricForgeRecipe recipe) { recipeList.add(recipe); @@ -34,6 +34,6 @@ public class TartaricForgeRecipeRegistry { } public static List getRecipeList() { - return new ArrayList(recipeList); + return new ArrayList<>(recipeList); } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/demonAura/WillWorld.java b/src/main/java/WayofTime/bloodmagic/demonAura/WillWorld.java index bf587940..76bf8a75 100644 --- a/src/main/java/WayofTime/bloodmagic/demonAura/WillWorld.java +++ b/src/main/java/WayofTime/bloodmagic/demonAura/WillWorld.java @@ -4,7 +4,7 @@ import java.util.concurrent.ConcurrentHashMap; public class WillWorld { int dim; - ConcurrentHashMap willChunks = new ConcurrentHashMap(); + ConcurrentHashMap willChunks = new ConcurrentHashMap<>(); // private static ConcurrentHashMap nodeTickets = new ConcurrentHashMap(); diff --git a/src/main/java/WayofTime/bloodmagic/demonAura/WorldDemonWillHandler.java b/src/main/java/WayofTime/bloodmagic/demonAura/WorldDemonWillHandler.java index 0ccf57e0..bd37857a 100644 --- a/src/main/java/WayofTime/bloodmagic/demonAura/WorldDemonWillHandler.java +++ b/src/main/java/WayofTime/bloodmagic/demonAura/WorldDemonWillHandler.java @@ -1,6 +1,5 @@ package WayofTime.bloodmagic.demonAura; -import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.soul.DemonWillHolder; import WayofTime.bloodmagic.soul.EnumDemonWillType; import WayofTime.bloodmagic.util.BMLog; @@ -13,8 +12,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; public class WorldDemonWillHandler { - public static ConcurrentHashMap> dirtyChunks = new ConcurrentHashMap>(); - static ConcurrentHashMap containedWills = new ConcurrentHashMap(); + public static ConcurrentHashMap> dirtyChunks = new ConcurrentHashMap<>(); + static ConcurrentHashMap containedWills = new ConcurrentHashMap<>(); @Nullable public static DemonWillHolder getWillHolder(int dim, int x, int y) { @@ -165,7 +164,7 @@ public class WorldDemonWillHandler { } PosXY pos = new PosXY(chunk.loc.x, chunk.loc.y); if (!dirtyChunks.containsKey(dim)) { - dirtyChunks.put(dim, new CopyOnWriteArrayList()); + dirtyChunks.put(dim, new CopyOnWriteArrayList<>()); } CopyOnWriteArrayList dc = dirtyChunks.get(dim); if (!dc.contains(pos)) { diff --git a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java index 137efffa..a2468fbe 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java +++ b/src/main/java/WayofTime/bloodmagic/entity/ai/EntityAIRetreatToHeal.java @@ -36,7 +36,7 @@ public class EntityAIRetreatToHeal extends EntityAIBase { private Predicate avoidTargetSelector; public EntityAIRetreatToHeal(EntityDemonBase theEntityIn, Class classToAvoidIn, float avoidDistanceIn, double farSpeedIn, double nearSpeedIn) { - this(theEntityIn, classToAvoidIn, Predicates.alwaysTrue(), avoidDistanceIn, farSpeedIn, nearSpeedIn); + this(theEntityIn, classToAvoidIn, Predicates.alwaysTrue(), avoidDistanceIn, farSpeedIn, nearSpeedIn); } public EntityAIRetreatToHeal(EntityDemonBase theEntityIn, Class classToAvoidIn, Predicate avoidTargetSelectorIn, float avoidDistanceIn, double farSpeedIn, double nearSpeedIn) { diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java index cb721ce7..47f9cf1d 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityAspectedDemonBase.java @@ -16,7 +16,7 @@ import net.minecraft.world.World; import java.util.Locale; public abstract class EntityAspectedDemonBase extends EntityDemonBase { - protected static final DataParameter TYPE = EntityDataManager.createKey(EntityAspectedDemonBase.class, Serializers.WILL_TYPE_SERIALIZER); + protected static final DataParameter TYPE = EntityDataManager.createKey(EntityAspectedDemonBase.class, Serializers.WILL_TYPE_SERIALIZER); public EntityAspectedDemonBase(World worldIn) { super(worldIn); diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java index 5044857f..450bb4f9 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedChicken.java @@ -63,8 +63,8 @@ public class EntityCorruptedChicken extends EntityAspectedDemonBase { this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java index b5869354..bd12e3e9 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSheep.java @@ -30,12 +30,13 @@ import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Random; public class EntityCorruptedSheep extends EntityAspectedDemonBase implements IShearable { - private static final DataParameter DYE_COLOR = EntityDataManager.createKey(EntityCorruptedSheep.class, DataSerializers.BYTE); + private static final DataParameter DYE_COLOR = EntityDataManager.createKey(EntityCorruptedSheep.class, DataSerializers.BYTE); private static final Map DYE_TO_RGB = Maps.newEnumMap(EnumDyeColor.class); public static int maxProtectionCooldown = 90 * 20; //90 second cooldown @@ -93,8 +94,8 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); } @Override @@ -180,7 +181,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh @Override protected void entityInit() { super.entityInit(); - this.dataManager.register(DYE_COLOR, Byte.valueOf((byte) 0)); + this.dataManager.register(DYE_COLOR, (byte) 0); } @Override @@ -255,34 +256,34 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh * Gets the wool color of this sheep. */ public EnumDyeColor getFleeceColor() { - return EnumDyeColor.byMetadata(this.dataManager.get(DYE_COLOR).byteValue() & 15); + return EnumDyeColor.byMetadata(this.dataManager.get(DYE_COLOR) & 15); } /** * Sets the wool color of this sheep */ public void setFleeceColor(EnumDyeColor color) { - byte b0 = this.dataManager.get(DYE_COLOR).byteValue(); - this.dataManager.set(DYE_COLOR, Byte.valueOf((byte) (b0 & 240 | color.getMetadata() & 15))); + byte b0 = this.dataManager.get(DYE_COLOR); + this.dataManager.set(DYE_COLOR, (byte) (b0 & 240 | color.getMetadata() & 15)); } /** * returns true if a sheeps wool has been sheared */ public boolean getSheared() { - return (this.dataManager.get(DYE_COLOR).byteValue() & 16) != 0; + return (this.dataManager.get(DYE_COLOR) & 16) != 0; } /** * make a sheep sheared if set to true */ public void setSheared(boolean sheared) { - byte b0 = this.dataManager.get(DYE_COLOR).byteValue(); + byte b0 = this.dataManager.get(DYE_COLOR); if (sheared) { - this.dataManager.set(DYE_COLOR, Byte.valueOf((byte) (b0 | 16))); + this.dataManager.set(DYE_COLOR, (byte) (b0 | 16)); } else { - this.dataManager.set(DYE_COLOR, Byte.valueOf((byte) (b0 & -17))); + this.dataManager.set(DYE_COLOR, (byte) (b0 & -17)); } } @@ -327,7 +328,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh this.setSheared(true); int i = 1 + this.rand.nextInt(3); - java.util.List ret = new java.util.ArrayList(); + List ret = new ArrayList<>(); for (int j = 0; j < i; ++j) ret.add(new ItemStack(Item.getItemFromBlock(Blocks.WOOL), 1, this.getFleeceColor().getMetadata())); diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java index 71290023..589f6e72 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityCorruptedSpider.java @@ -20,7 +20,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class EntityCorruptedSpider extends EntityAspectedDemonBase { - private static final DataParameter CLIMBING = EntityDataManager.createKey(EntityCorruptedSpider.class, DataSerializers.BYTE); + private static final DataParameter CLIMBING = EntityDataManager.createKey(EntityCorruptedSpider.class, DataSerializers.BYTE); public EntityCorruptedSpider(World world) { this(world, EnumDemonWillType.DEFAULT); @@ -43,8 +43,8 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase { this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this))); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java index 2df10d5e..b82cfc8d 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntityDemonBase.java @@ -45,7 +45,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable { protected void entityInit() { super.entityInit(); this.dataManager.register(TAMED, (byte) 0); - this.dataManager.register(OWNER_UNIQUE_ID, Optional.absent()); + this.dataManager.register(OWNER_UNIQUE_ID, Optional.absent()); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java b/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java index 3acc8fed..1b13122c 100644 --- a/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java +++ b/src/main/java/WayofTime/bloodmagic/entity/mob/EntitySentientSpecter.java @@ -57,7 +57,7 @@ public class EntitySentientSpecter extends EntityDemonBase { this.setSize(0.6F, 1.95F); // ((PathNavigateGround) getNavigator()).setCanSwim(false); this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIRetreatToHeal(this, EntityCreature.class, 6.0F, 1.0D, 1.2D)); + this.tasks.addTask(2, new EntityAIRetreatToHeal<>(this, EntityCreature.class, 6.0F, 1.0D, 1.2D)); this.tasks.addTask(attackPriority, aiAttackOnCollide); this.tasks.addTask(4, new EntityAIGrabEffectsFromOwner(this, 2.0D, 1.0F)); this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F)); @@ -67,9 +67,9 @@ public class EntitySentientSpecter extends EntityDemonBase { this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true)); - this.targetTasks.addTask(4, new EntityAIHurtByTargetIgnoreTamed(this, false, new Class[0])); + this.targetTasks.addTask(4, new EntityAIHurtByTargetIgnoreTamed(this, false)); this.setCombatTask(); // this.targetTasks.addTask(8, new EntityAINearestAttackableTarget(this, EntityMob.class, 10, true, false, new TargetPredicate(this))); @@ -138,7 +138,7 @@ public class EntitySentientSpecter extends EntityDemonBase { boolean hasStolenEffect = false; - List removedEffects = new ArrayList(); + List removedEffects = new ArrayList<>(); for (PotionEffect eff : owner.getActivePotionEffects()) { if (canStealEffectFromOwner(owner, eff)) { @@ -157,7 +157,7 @@ public class EntitySentientSpecter extends EntityDemonBase { public boolean applyNegativeEffectsToAttacked(EntityLivingBase attackedEntity, float percentTransmitted) { boolean hasProvidedEffect = false; - List removedEffects = new ArrayList(); + List removedEffects = new ArrayList<>(); for (PotionEffect eff : this.getActivePotionEffects()) { if (eff.getPotion().isBadEffect() && attackedEntity.isPotionApplicable(eff)) { if (!attackedEntity.isPotionActive(eff.getPotion())) { @@ -197,13 +197,13 @@ public class EntitySentientSpecter extends EntityDemonBase { } public List getPotionEffectsForArrowRemovingDuration(float percentTransmitted) { - List arrowEffects = new ArrayList(); + List arrowEffects = new ArrayList<>(); if (type != EnumDemonWillType.CORROSIVE) { return arrowEffects; } - List removedEffects = new ArrayList(); + List removedEffects = new ArrayList<>(); for (PotionEffect eff : this.getActivePotionEffects()) { if (eff.getPotion().isBadEffect()) { removedEffects.add(eff); @@ -310,7 +310,7 @@ public class EntitySentientSpecter extends EntityDemonBase { if (getEntityWorld() instanceof WorldServer) { WorldServer server = (WorldServer) getEntityWorld(); - server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0, new int[0]); + server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0); } } diff --git a/src/main/java/WayofTime/bloodmagic/incense/EnumTranquilityType.java b/src/main/java/WayofTime/bloodmagic/incense/EnumTranquilityType.java index c8f9adb8..d2221dbf 100644 --- a/src/main/java/WayofTime/bloodmagic/incense/EnumTranquilityType.java +++ b/src/main/java/WayofTime/bloodmagic/incense/EnumTranquilityType.java @@ -7,5 +7,6 @@ public enum EnumTranquilityType { EARTHEN(), WATER(), FIRE(), - LAVA(); + LAVA(), + ; } diff --git a/src/main/java/WayofTime/bloodmagic/incense/IncenseAltarHandler.java b/src/main/java/WayofTime/bloodmagic/incense/IncenseAltarHandler.java index 9f01f968..f41928c1 100644 --- a/src/main/java/WayofTime/bloodmagic/incense/IncenseAltarHandler.java +++ b/src/main/java/WayofTime/bloodmagic/incense/IncenseAltarHandler.java @@ -12,7 +12,7 @@ import java.util.Map; import java.util.TreeMap; public class IncenseAltarHandler { - public static Map> incenseComponentMap = new TreeMap>(); + public static Map> incenseComponentMap = new TreeMap<>(); //Incense bonus maximum applied for the tier of blocks. public static double[] incenseBonuses = new double[]{0.2, 0.6, 1.2, 2, 3, 4.5}; public static double[] tranquilityRequired = new double[]{0, 6, 14.14, 28, 44.09, 83.14}; @@ -22,7 +22,7 @@ public class IncenseAltarHandler { if (incenseComponentMap.containsKey(altarLevel)) { incenseComponentMap.get(altarLevel).add(component); } else { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(component); incenseComponentMap.put(altarLevel, list); } diff --git a/src/main/java/WayofTime/bloodmagic/incense/IncenseTranquilityRegistry.java b/src/main/java/WayofTime/bloodmagic/incense/IncenseTranquilityRegistry.java index 79d9c57f..e291bbf9 100644 --- a/src/main/java/WayofTime/bloodmagic/incense/IncenseTranquilityRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/incense/IncenseTranquilityRegistry.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; public class IncenseTranquilityRegistry { - public static List handlerList = new ArrayList(); + public static List handlerList = new ArrayList<>(); public static void registerTranquilityHandler(ITranquilityHandler handler) { handlerList.add(handler); diff --git a/src/main/java/WayofTime/bloodmagic/inversion/CorruptionHandler.java b/src/main/java/WayofTime/bloodmagic/inversion/CorruptionHandler.java index c6019eae..1e916933 100644 --- a/src/main/java/WayofTime/bloodmagic/inversion/CorruptionHandler.java +++ b/src/main/java/WayofTime/bloodmagic/inversion/CorruptionHandler.java @@ -11,7 +11,7 @@ import java.util.HashMap; import java.util.Map; public class CorruptionHandler { - public static Map, Map> corruptBlockMap = new HashMap, Map>(); + public static Map, Map> corruptBlockMap = new HashMap<>(); public static void registerBlockCorruption(EnumDemonWillType type, Block block, int meta, IBlockState corruptedState) { Pair pair = Pair.of(block, meta); @@ -19,7 +19,7 @@ public class CorruptionHandler { Map stateMap = corruptBlockMap.get(pair); stateMap.put(type, corruptedState); } else { - Map stateMap = new HashMap(); + Map stateMap = new HashMap<>(); stateMap.put(type, corruptedState); corruptBlockMap.put(pair, stateMap); } diff --git a/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java b/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java index e988ba1f..34a090ef 100644 --- a/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java +++ b/src/main/java/WayofTime/bloodmagic/inversion/InversionPillarHandler.java @@ -9,8 +9,8 @@ import java.util.*; public class InversionPillarHandler { public static final double farthestDistanceSquared = 16 * 16; - public static Map>> pillarMap = new HashMap>>(); - public static Map>>> nearPillarMap = new HashMap>>>(); + public static Map>> pillarMap = new HashMap<>(); + public static Map>>> nearPillarMap = new HashMap<>(); public static boolean addPillarToMap(World world, EnumDemonWillType type, BlockPos pos) { int dim = world.provider.getDimension(); @@ -25,15 +25,15 @@ public class InversionPillarHandler { return false; } } else { - List posList = new ArrayList(); + List posList = new ArrayList<>(); posList.add(pos); willMap.put(type, posList); onPillarAdded(world, type, pos); return true; } } else { - Map> willMap = new HashMap>(); - List posList = new ArrayList(); + Map> willMap = new HashMap<>(); + List posList = new ArrayList<>(); posList.add(pos); willMap.put(type, posList); @@ -65,7 +65,7 @@ public class InversionPillarHandler { //Assume that it has been added already. private static void onPillarAdded(World world, EnumDemonWillType type, BlockPos pos) { BMLog.DEBUG.info("Adding..."); - List closePosList = new ArrayList(); + List closePosList = new ArrayList<>(); int dim = world.provider.getDimension(); if (pillarMap.containsKey(dim)) { @@ -91,7 +91,7 @@ public class InversionPillarHandler { if (posList != null && !posList.contains(pos)) { posList.add(pos); } else { - posList = new ArrayList(); + posList = new ArrayList<>(); posList.add(pos); posMap.put(closePos, posList); } @@ -99,14 +99,14 @@ public class InversionPillarHandler { posMap.put(pos, closePosList); } else { - Map> posMap = new HashMap>(); + Map> posMap = new HashMap<>(); posMap.put(pos, closePosList); willMap.put(type, posMap); } } else { - Map>> willMap = new HashMap>>(); - Map> posMap = new HashMap>(); + Map>> willMap = new HashMap<>(); + Map> posMap = new HashMap<>(); posMap.put(pos, closePosList); willMap.put(type, posMap); @@ -123,9 +123,7 @@ public class InversionPillarHandler { Map> posMap = willMap.get(type); List posList = posMap.get(pos); if (posList != null) { - Iterator itr = posList.iterator(); - while (itr.hasNext()) { - BlockPos checkPos = itr.next(); + for (BlockPos checkPos : posList) { List checkPosList = posMap.get(checkPos); if (checkPosList != null) { checkPosList.remove(pos); @@ -152,12 +150,12 @@ public class InversionPillarHandler { } } - return new ArrayList(); + return new ArrayList<>(); } public static List getAllConnectedPillars(World world, EnumDemonWillType type, BlockPos pos) { - List checkedPosList = new ArrayList(); - List uncheckedPosList = new ArrayList(); //Positions where we did not check their connections. + List checkedPosList = new ArrayList<>(); + List uncheckedPosList = new ArrayList<>(); //Positions where we did not check their connections. uncheckedPosList.add(pos); @@ -170,7 +168,7 @@ public class InversionPillarHandler { while (!uncheckedPosList.isEmpty()) { //Positions that are new this iteration and need to be dumped into uncheckedPosList next iteration. - List newPosList = new ArrayList(); + List newPosList = new ArrayList<>(); for (BlockPos checkPos : uncheckedPosList) { List posList = posMap.get(checkPos); diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java b/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java index 804104f5..efa445e2 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemAltarMaker.java @@ -89,8 +89,8 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=altarmaker")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=altarmaker")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemArcaneAshes.java b/src/main/java/WayofTime/bloodmagic/item/ItemArcaneAshes.java index 4734f6f9..ff20254d 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemArcaneAshes.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemArcaneAshes.java @@ -62,8 +62,8 @@ public class ItemArcaneAshes extends Item implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=arcaneashes")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=arcaneashes")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java index 751a584a..589e91ee 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundAxe.java @@ -131,7 +131,7 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider { @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("active=true"); ret.add("active=false"); return ret; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java index ee6f3f2f..f54d39a7 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundPickaxe.java @@ -144,7 +144,7 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider { @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("active=true"); ret.add("active=false"); return ret; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java index b1842152..910a4658 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundShovel.java @@ -130,7 +130,7 @@ public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider { @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("active=true"); ret.add("active=false"); return ret; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java index 74bb779e..c7d49cfc 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundSword.java @@ -118,7 +118,7 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable @Override public Multimap getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) { - Multimap multimap = HashMultimap.create(); + Multimap multimap = HashMultimap.create(); if (equipmentSlot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getActivated(stack) ? 8 : 2, 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4, 0)); @@ -140,7 +140,7 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("active=true"); ret.add("active=false"); return ret; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java b/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java index 415e712a..4c39abdd 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemBoundTool.java @@ -46,8 +46,8 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable { public final int chargeTime = 30; protected final String tooltipBase; private final String name; - public Map heldDownMap = new HashMap(); - public Map heldDownCountMap = new HashMap(); + public Map heldDownMap = new HashMap<>(); + public Map heldDownCountMap = new HashMap<>(); public ItemBoundTool(String name, float damage, Set effectiveBlocks) { super(damage, 1, RegistrarBloodMagicItems.BOUND_TOOL_MATERIAL, effectiveBlocks); diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemDemonWillGauge.java b/src/main/java/WayofTime/bloodmagic/item/ItemDemonWillGauge.java index f5d3af13..3a0a86ad 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemDemonWillGauge.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemDemonWillGauge.java @@ -33,8 +33,8 @@ public class ItemDemonWillGauge extends Item implements IVariantProvider, IDemon @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=willgauge")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=willgauge")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java b/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java index 10c4776b..24474e87 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemExperienceBook.java @@ -60,13 +60,13 @@ public class ItemExperienceBook extends Item implements IVariantProvider { giveOneLevelExpToPlayer(stack, player); } - return new ActionResult(EnumActionResult.SUCCESS, stack); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=experiencetome")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=experiencetome")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java b/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java index ddb05494..52a3e3c4 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemLavaCrystal.java @@ -2,11 +2,9 @@ package WayofTime.bloodmagic.item; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.data.Binding; -import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.util.helper.NetworkHelper; import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.client.IVariantProvider; -import com.google.common.base.Strings; import com.google.common.collect.Lists; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemPotionFlask.java b/src/main/java/WayofTime/bloodmagic/item/ItemPotionFlask.java index cb3c7c2c..ef73018c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemPotionFlask.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemPotionFlask.java @@ -95,10 +95,10 @@ public class ItemPotionFlask extends Item implements IMeshProvider { if (remainingUses <= 0) { NBTHelper.checkNBT(stack); stack.getTagCompound().setBoolean("empty", true); - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult<>(EnumActionResult.PASS, stack); } player.setActiveHand(hand); - return new ActionResult(EnumActionResult.SUCCESS, stack); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java index 652021b0..10b2ea3c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemRitualDiviner.java @@ -295,7 +295,7 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { ItemStack stack = player.getHeldItem(hand); RayTraceResult ray = this.rayTrace(world, player, false); if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK) { - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult<>(EnumActionResult.PASS, stack); } if (player.isSneaking()) { @@ -303,10 +303,10 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { cycleRitual(stack, player); } - return new ActionResult(EnumActionResult.SUCCESS, stack); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult<>(EnumActionResult.PASS, stack); } @Override @@ -333,10 +333,10 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=basic")); - ret.add(new ImmutablePair(1, "type=dusk")); - ret.add(new ImmutablePair(2, "type=dawn")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=basic")); + ret.add(new ImmutablePair<>(1, "type=dusk")); + ret.add(new ImmutablePair<>(2, "type=dawn")); return ret; } @@ -549,14 +549,14 @@ public class ItemRitualDiviner extends Item implements IVariantProvider { double d0 = itemRand.nextGaussian() * 0.02D; double d1 = itemRand.nextGaussian() * 0.02D; double d2 = itemRand.nextGaussian() * 0.02D; - worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double) ((float) pos.getX() + itemRand.nextFloat()), (double) pos.getY() + (double) itemRand.nextFloat(), (double) ((float) pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double) ((float) pos.getX() + itemRand.nextFloat()), (double) pos.getY() + (double) itemRand.nextFloat(), (double) ((float) pos.getZ() + itemRand.nextFloat()), d0, d1, d2); } } else { for (int i1 = 0; i1 < amount; ++i1) { double d0 = itemRand.nextGaussian() * 0.02D; double d1 = itemRand.nextGaussian() * 0.02D; double d2 = itemRand.nextGaussian() * 0.02D; - worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double) ((float) pos.getX() + itemRand.nextFloat()), (double) pos.getY() + (double) itemRand.nextFloat() * 1.0f, (double) ((float) pos.getZ() + itemRand.nextFloat()), d0, d1, d2, new int[0]); + worldIn.spawnParticle(EnumParticleTypes.VILLAGER_HAPPY, (double) ((float) pos.getX() + itemRand.nextFloat()), (double) pos.getY() + (double) itemRand.nextFloat() * 1.0f, (double) ((float) pos.getZ() + itemRand.nextFloat()), d0, d1, d2); } } } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java b/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java index 07e6be63..a718ea5b 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemRitualReader.java @@ -67,7 +67,7 @@ public class ItemRitualReader extends Item implements IVariantProvider { ItemStack stack = player.getHeldItem(hand); RayTraceResult ray = this.rayTrace(world, player, false); if (ray != null && ray.typeOfHit == RayTraceResult.Type.BLOCK) { - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult<>(EnumActionResult.PASS, stack); } if (player.isSneaking()) { @@ -75,10 +75,10 @@ public class ItemRitualReader extends Item implements IVariantProvider { cycleReader(stack, player); } - return new ActionResult(EnumActionResult.SUCCESS, stack); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult<>(EnumActionResult.PASS, stack); } @Override @@ -107,7 +107,7 @@ public class ItemRitualReader extends Item implements IVariantProvider { master.provideInformationOfRangeToPlayer(player, range); break; case SET_WILL_TYPES: - List typeList = new ArrayList(); + List typeList = new ArrayList<>(); NonNullList inv = player.inventory.mainInventory; for (int i = 0; i < 9; i++) { ItemStack testStack = inv.get(i); @@ -234,8 +234,8 @@ public class ItemRitualReader extends Item implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=normal")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java index bcfd621b..3ffdf74d 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemSacrificialDagger.java @@ -77,7 +77,7 @@ public class ItemSacrificialDagger extends ItemEnum(EnumActionResult.SUCCESS, stack); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } int lpAdded = ConfigHandler.values.sacrificialDaggerConversion * 2; @@ -166,7 +166,7 @@ public class ItemSacrificialDagger extends ItemEnum getVariants() { - List variants = new ArrayList(); + List variants = new ArrayList<>(); variants.add("type=normal"); variants.add("type=creative"); variants.add("type=ceremonial"); diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTome.java b/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTome.java index 3df9322b..a6bfe3b2 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTome.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTome.java @@ -97,8 +97,8 @@ public class ItemUpgradeTome extends Item implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=upgradetome")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=upgradetome")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTrainer.java b/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTrainer.java index cc7f150b..1f6b9e6d 100644 --- a/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTrainer.java +++ b/src/main/java/WayofTime/bloodmagic/item/ItemUpgradeTrainer.java @@ -61,7 +61,7 @@ public class ItemUpgradeTrainer extends Item implements IUpgradeTrainer, IVarian @Override public List getTrainedUpgrades(ItemStack stack) { - List keyList = new ArrayList(); + List keyList = new ArrayList<>(); String key = LivingUpgrades.getKey(stack); if (!key.isEmpty()) { @@ -83,8 +83,8 @@ public class ItemUpgradeTrainer extends Item implements IUpgradeTrainer, IVarian @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=upgradetrainer")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=upgradetrainer")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java b/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java index 158b1034..8f4a5409 100644 --- a/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java +++ b/src/main/java/WayofTime/bloodmagic/item/armour/ItemLivingArmour.java @@ -51,7 +51,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP public static final boolean useSpecialArmourCalculation = true; public static String[] names = {"helmet", "chest", "legs", "boots"}; //TODO: Save/delete cache periodically. - public static Map armourMap = new HashMap(); + public static Map armourMap = new HashMap<>(); private static Field _FLAGS = ReflectionHelper.findField(Entity.class, "FLAGS", "field_184240_ax"); private static DataParameter FLAGS = null; @@ -283,9 +283,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP if (FLAGS == null) { try { FLAGS = (DataParameter) _FLAGS.get(null); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); } } @@ -337,7 +335,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP return armour.getAttributeModifiers(); } - return HashMultimap.create(); + return HashMultimap.create(); } @Override @@ -367,7 +365,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("armour=head"); ret.add("armour=body"); ret.add("armour=leg"); diff --git a/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java b/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java index 793faa21..b2151097 100644 --- a/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java +++ b/src/main/java/WayofTime/bloodmagic/item/armour/ItemSentientArmour.java @@ -298,7 +298,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (EnumDemonWillType type : EnumDemonWillType.values()) { String additional = "_" + type.getName().toLowerCase(); @@ -313,7 +313,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { - Multimap multimap = HashMultimap.create(); + Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.CHEST) { multimap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(0, 318145), "Armor modifier", this.getHealthBonus(stack), 0)); multimap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(new UUID(0, 8145), "Armor modifier", this.getKnockbackResistance(stack), 0)); diff --git a/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java b/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java deleted file mode 100644 index 895b40c8..00000000 --- a/src/main/java/WayofTime/bloodmagic/item/block/base/ItemBlockString.java +++ /dev/null @@ -1,32 +0,0 @@ -package WayofTime.bloodmagic.item.block.base; - -import WayofTime.bloodmagic.block.base.BlockString; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.MathHelper; - -public class ItemBlockString extends ItemBlock { - - public ItemBlockString(BlockString block) { - super(block); - - if (block.getTypes().length > 1) - setHasSubtypes(true); - } - - @SuppressWarnings("unchecked") - @Override - public BlockString getBlock() { - return (BlockString) super.getBlock(); - } - - @Override - public String getUnlocalizedName(ItemStack stack) { - return getBlock().getUnlocalizedName() + "." + getBlock().getTypes()[MathHelper.clamp(stack.getItemDamage(), 0, 15)]; - } - - @Override - public int getMetadata(int damage) { - return damage; - } -} diff --git a/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSacrifice.java b/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSacrifice.java index cba28176..a726b800 100644 --- a/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSacrifice.java +++ b/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSacrifice.java @@ -77,8 +77,8 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator, I @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java b/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java index 002b469d..492dd868 100644 --- a/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java +++ b/src/main/java/WayofTime/bloodmagic/item/gear/ItemPackSelfSacrifice.java @@ -102,8 +102,8 @@ public class ItemPackSelfSacrifice extends ItemArmor implements IAltarManipulato @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/routing/ItemFluidRouterFilter.java b/src/main/java/WayofTime/bloodmagic/item/routing/ItemFluidRouterFilter.java index 455c44c4..94fbf3ec 100644 --- a/src/main/java/WayofTime/bloodmagic/item/routing/ItemFluidRouterFilter.java +++ b/src/main/java/WayofTime/bloodmagic/item/routing/ItemFluidRouterFilter.java @@ -70,7 +70,7 @@ public class ItemFluidRouterFilter extends Item implements IFluidFilterProvider, testFilter = new RoutingFluidFilter(); } - List filteredList = new ArrayList(); + List filteredList = new ArrayList<>(); ItemInventory inv = new ItemInventory(filterStack, 9, ""); for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); @@ -100,7 +100,7 @@ public class ItemFluidRouterFilter extends Item implements IFluidFilterProvider, testFilter = new RoutingFluidFilter(); } - List filteredList = new ArrayList(); + List filteredList = new ArrayList<>(); ItemInventory inv = new ItemInventory(filterStack, 9, ""); //TODO: Change to grab the filter from the Item later. for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); @@ -122,8 +122,8 @@ public class ItemFluidRouterFilter extends Item implements IFluidFilterProvider, @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=exact")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=exact")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/routing/ItemNodeRouter.java b/src/main/java/WayofTime/bloodmagic/item/routing/ItemNodeRouter.java index b3b3e522..d8fb3a56 100644 --- a/src/main/java/WayofTime/bloodmagic/item/routing/ItemNodeRouter.java +++ b/src/main/java/WayofTime/bloodmagic/item/routing/ItemNodeRouter.java @@ -84,7 +84,7 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi if (!node.isMaster(master)) { if (node.getMasterPos().equals(BlockPos.ORIGIN)) //If the node is not the master and it is receptive { - node.connectMasterToRemainingNode(world, new LinkedList(), master); + node.connectMasterToRemainingNode(world, new LinkedList<>(), master); master.addConnection(pos, containedPos); master.addNodeToList(node); node.addConnection(containedPos); @@ -106,7 +106,7 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi if (!pastNode.isMaster(master)) { if (pastNode.getMasterPos().equals(BlockPos.ORIGIN)) //TODO: This is where the issue is { - pastNode.connectMasterToRemainingNode(world, new LinkedList(), master); + pastNode.connectMasterToRemainingNode(world, new LinkedList<>(), master); master.addConnection(pos, containedPos); pastNode.addConnection(pos); master.addNodeToList(pastNode); @@ -143,7 +143,7 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi IMasterRoutingNode master = (IMasterRoutingNode) tile; master.addConnection(pos, containedPos); master.addNodeToList(pastNode); - pastNode.connectMasterToRemainingNode(world, new LinkedList(), master); + pastNode.connectMasterToRemainingNode(world, new LinkedList<>(), master); } pastNode.addConnection(pos); node.addConnection(containedPos); @@ -157,7 +157,7 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi IMasterRoutingNode master = (IMasterRoutingNode) tile; master.addConnection(pos, containedPos); master.addNodeToList(node); - node.connectMasterToRemainingNode(world, new LinkedList(), master); + node.connectMasterToRemainingNode(world, new LinkedList<>(), master); } pastNode.addConnection(pos); node.addConnection(containedPos); @@ -177,8 +177,8 @@ public class ItemNodeRouter extends Item implements INodeRenderer, IVariantProvi @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=normal")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/routing/ItemRouterFilter.java b/src/main/java/WayofTime/bloodmagic/item/routing/ItemRouterFilter.java index 76cc2b48..a7c1d197 100644 --- a/src/main/java/WayofTime/bloodmagic/item/routing/ItemRouterFilter.java +++ b/src/main/java/WayofTime/bloodmagic/item/routing/ItemRouterFilter.java @@ -78,7 +78,7 @@ public class ItemRouterFilter extends Item implements IItemFilterProvider, IVari testFilter = new DefaultItemFilter(); } - List filteredList = new ArrayList(); + List filteredList = new ArrayList<>(); ItemInventory inv = new ItemInventory(filterStack, 9, ""); for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); @@ -117,7 +117,7 @@ public class ItemRouterFilter extends Item implements IItemFilterProvider, IVari testFilter = new DefaultItemFilter(); } - List filteredList = new ArrayList(); + List filteredList = new ArrayList<>(); ItemInventory inv = new ItemInventory(filterStack, 9, ""); //TODO: Change to grab the filter from the Item later. for (int i = 0; i < inv.getSizeInventory(); i++) { ItemStack stack = inv.getStackInSlot(i); @@ -139,11 +139,11 @@ public class ItemRouterFilter extends Item implements IItemFilterProvider, IVari @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=exact")); - ret.add(new ImmutablePair(1, "type=ignorenbt")); - ret.add(new ImmutablePair(2, "type=moditems")); - ret.add(new ImmutablePair(3, "type=oredict")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=exact")); + ret.add(new ImmutablePair<>(1, "type=ignorenbt")); + ret.add(new ImmutablePair<>(2, "type=moditems")); + ret.add(new ImmutablePair<>(3, "type=oredict")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBase.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBase.java index a3753559..39d5689d 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBase.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilBase.java @@ -3,10 +3,8 @@ package WayofTime.bloodmagic.item.sigil; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.item.ItemSigil; -import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.client.IVariantProvider; import WayofTime.bloodmagic.util.helper.TextHelper; -import com.google.common.base.Strings; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -55,7 +53,7 @@ public class ItemSigilBase extends ItemSigil implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); + List> ret = new ArrayList<>(); ret.add(Pair.of(0, "type=normal")); return ret; } diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilPhantomBridge.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilPhantomBridge.java index ce3b9360..eb2d1431 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilPhantomBridge.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilPhantomBridge.java @@ -12,9 +12,10 @@ import java.util.HashMap; import java.util.Map; public class ItemSigilPhantomBridge extends ItemSigilToggleableBase { - private Map> prevPositionMap = new HashMap>(); - private double expansionFactor = 2; - private int range = 3; + private static final double EXPANSION_FACTOR = 2; + private static final int RANGE = 3; + + private Map> prevPositionMap = new HashMap<>(); public ItemSigilPhantomBridge() { super("phantom_bridge", 100); @@ -57,12 +58,12 @@ public class ItemSigilPhantomBridge extends ItemSigilToggleableBase { int posY = playerPos.getY(); int posZ = playerPos.getZ(); - double offsetPosX = posX + expansionFactor * playerVelX; - double offsetPosZ = posZ + expansionFactor * playerVelZ; + double offsetPosX = posX + EXPANSION_FACTOR * playerVelX; + double offsetPosZ = posZ + EXPANSION_FACTOR * playerVelZ; double avgX = (posX + offsetPosX) / 2; double avgZ = (posZ + offsetPosZ) / 2; - double C = 2 * (range + expansionFactor * totalVel) + 1; + double C = 2 * (RANGE + EXPANSION_FACTOR * totalVel) + 1; int truncC = (int) C; //TODO: Make this for-loop better. diff --git a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilToggleableBase.java b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilToggleableBase.java index f54bc75b..952a8712 100644 --- a/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilToggleableBase.java +++ b/src/main/java/WayofTime/bloodmagic/item/sigil/ItemSigilToggleableBase.java @@ -3,11 +3,9 @@ package WayofTime.bloodmagic.item.sigil; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.item.ItemSigilToggleable; -import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.client.IMeshProvider; import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable; import WayofTime.bloodmagic.util.helper.TextHelper; -import com.google.common.base.Strings; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.item.ItemStack; @@ -64,7 +62,7 @@ public class ItemSigilToggleableBase extends ItemSigilToggleable implements IMes @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); ret.add("active=false"); ret.add("active=true"); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientArmourGem.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientArmourGem.java index 7d0450a9..604826b0 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientArmourGem.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientArmourGem.java @@ -53,7 +53,7 @@ public class ItemSentientArmourGem extends Item implements IMeshProvider { ItemSentientArmour.convertPlayerArmour(type, will, player); } - return new ActionResult(EnumActionResult.PASS, player.getHeldItem(hand)); + return new ActionResult<>(EnumActionResult.PASS, player.getHeldItem(hand)); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java index fbcef7f1..ca4a4558 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientAxe.java @@ -308,7 +308,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (EnumDemonWillType type : EnumDemonWillType.values()) { ret.add("type=" + type.getName().toLowerCase()); } @@ -318,7 +318,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP @Override public List getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) { - List soulList = new ArrayList(); + List soulList = new ArrayList<>(); if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; @@ -343,7 +343,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP //TODO: Change attack speed. @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { - Multimap multimap = HashMultimap.create(); + Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java index 7f70b1e2..a1ffaaac 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientPickaxe.java @@ -307,7 +307,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (EnumDemonWillType type : EnumDemonWillType.values()) { ret.add("type=" + type.getName().toLowerCase()); } @@ -317,7 +317,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon @Override public List getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) { - List soulList = new ArrayList(); + List soulList = new ArrayList<>(); if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; @@ -342,7 +342,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon //TODO: Change attack speed. @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { - Multimap multimap = HashMultimap.create(); + Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java index f391bb4f..deb5056c 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientShovel.java @@ -308,7 +308,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (EnumDemonWillType type : EnumDemonWillType.values()) { ret.add("type=" + type.getName().toLowerCase()); } @@ -318,7 +318,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I @Override public List getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) { - List soulList = new ArrayList(); + List soulList = new ArrayList<>(); if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; @@ -343,7 +343,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I //TODO: Change attack speed. @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { - Multimap multimap = HashMultimap.create(); + Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java index 32f45db7..13206057 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSentientSword.java @@ -283,7 +283,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (EnumDemonWillType type : EnumDemonWillType.values()) { ret.add("type=" + type.getName().toLowerCase()); } @@ -293,7 +293,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM @Override public List getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) { - List soulList = new ArrayList(); + List soulList = new ArrayList<>(); if (killedEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(killedEntity instanceof IMob)) { return soulList; @@ -318,7 +318,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM //TODO: Change attack speed. @Override public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { - Multimap multimap = HashMultimap.create(); + Multimap multimap = HashMultimap.create(); if (slot == EntityEquipmentSlot.MAINHAND) { multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", getDamageOfActivatedSword(stack), 0)); multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", this.getAttackSpeedOfSword(stack), 0)); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulGem.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulGem.java index 139313e3..d55aa834 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulGem.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulGem.java @@ -55,7 +55,7 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IMeshProvider, I double filled = PlayerDemonWillHandler.addDemonWill(type, player, drain, stack); this.drainWill(type, stack, filled, true); - return new ActionResult(EnumActionResult.PASS, stack); + return new ActionResult<>(EnumActionResult.PASS, stack); } @Override @@ -72,7 +72,7 @@ public class ItemSoulGem extends Item implements IDemonWillGem, IMeshProvider, I @Override public List getVariants() { - List ret = new ArrayList(); + List ret = new ArrayList<>(); for (EnumDemonWillType type : EnumDemonWillType.values()) { ret.add("type=petty_" + type.getName().toLowerCase()); ret.add("type=lesser_" + type.getName().toLowerCase()); diff --git a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java index f422be70..15e42172 100644 --- a/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java +++ b/src/main/java/WayofTime/bloodmagic/item/soul/ItemSoulSnare.java @@ -48,7 +48,7 @@ public class ItemSoulSnare extends Item implements IVariantProvider { worldIn.spawnEntity(snare); } - return new ActionResult(EnumActionResult.SUCCESS, stack); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); } @Override @@ -76,8 +76,8 @@ public class ItemSoulSnare extends Item implements IVariantProvider { @Override public List> getVariants() { - List> ret = new ArrayList>(); - ret.add(new ImmutablePair(0, "type=soulsnare")); + List> ret = new ArrayList<>(); + ret.add(new ImmutablePair<>(0, "type=soulsnare")); return ret; } } diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java b/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java index fcd8c555..19f9a7a1 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmour.java @@ -23,8 +23,8 @@ import java.util.Map.Entry; public class LivingArmour implements ILivingArmour { public static String chatBase = "chat.bloodmagic.livingArmour."; - public HashMap trackerMap = new HashMap(); - public HashMap upgradeMap = new HashMap(); + public HashMap trackerMap = new HashMap<>(); + public HashMap upgradeMap = new HashMap<>(); public int maxUpgradePoints = 100; public int totalUpgradePoints = 0; @@ -60,7 +60,7 @@ public class LivingArmour implements ILivingArmour { @Override public Multimap getAttributeModifiers() { - HashMultimap modifierMap = HashMultimap.create(); + HashMultimap modifierMap = HashMultimap.create(); for (Entry entry : upgradeMap.entrySet()) { LivingArmourUpgrade upgrade = entry.getValue(); @@ -165,7 +165,7 @@ public class LivingArmour implements ILivingArmour { return; } - List allowedUpgradesList = new ArrayList(); + List allowedUpgradesList = new ArrayList<>(); for (ItemStack stack : player.inventory.mainInventory) { if (stack != null && stack.getItem() instanceof IUpgradeTrainer) { List keyList = ((IUpgradeTrainer) stack.getItem()).getTrainedUpgrades(stack); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmourHandler.java b/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmourHandler.java index a1a0c46f..c15afafb 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmourHandler.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/LivingArmourHandler.java @@ -1,6 +1,5 @@ package WayofTime.bloodmagic.livingArmour; -import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.util.BMLog; import net.minecraft.nbt.NBTTagCompound; @@ -10,10 +9,10 @@ import java.util.HashMap; import java.util.List; public class LivingArmourHandler { - public static List> trackers = new ArrayList>(); - public static HashMap> upgradeMap = new HashMap>(); - public static HashMap> upgradeConstructorMap = new HashMap>(); - public static HashMap upgradeMaxLevelMap = new HashMap(); + public static List> trackers = new ArrayList<>(); + public static HashMap> upgradeMap = new HashMap<>(); + public static HashMap> upgradeConstructorMap = new HashMap<>(); + public static HashMap upgradeMaxLevelMap = new HashMap<>(); public static void registerStatTracker(Class tracker) { trackers.add(tracker); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeDigSlowdown.java b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeDigSlowdown.java index cf948dac..6c1dece3 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeDigSlowdown.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeDigSlowdown.java @@ -12,7 +12,7 @@ import java.util.HashMap; public class LivingArmourUpgradeDigSlowdown extends LivingArmourUpgrade { public static final int[] costs = new int[]{-10, -17, -28, -42, -60, -80, -100, -125, -160, -200}; public static final double[] digSpeedModifier = new double[]{0.9, 0.8, 0.7, 0.6, 0.55, 0.5, 0.4, 0.35, 0.3, 0.2}; - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public LivingArmourUpgradeDigSlowdown(int level) { super(level); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java index 06aebdc0..a67a5cfb 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeMeleeDecrease.java @@ -29,7 +29,7 @@ public class LivingArmourUpgradeMeleeDecrease extends LivingArmourUpgrade { @Override public Multimap getAttributeModifiers() { - Multimap modifierMap = HashMultimap.create(); + Multimap modifierMap = HashMultimap.create(); String name = getUniqueIdentifier() + "-DamageModifier1"; modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "DamageModifier1", meleeDamage[this.level], 1)); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java index cbdab679..db12a7ac 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/downgrade/LivingArmourUpgradeSlowness.java @@ -24,7 +24,7 @@ public class LivingArmourUpgradeSlowness extends LivingArmourUpgrade { @Override public Multimap getAttributeModifiers() { - Multimap modifierMap = HashMultimap.create(); + Multimap modifierMap = HashMultimap.create(); String name = getUniqueIdentifier() + "-SpeedModifier1"; modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "SpeedModifier1", speedModifier[this.level], 1)); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowProtect.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowProtect.java index b084083f..51671858 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowProtect.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowProtect.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerArrowProtect extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{30, 200, 400, 800, 1500, 2500, 3500, 5000, 7000, 15000}; public int totalDamage = 0; @@ -66,7 +66,7 @@ public class StatTrackerArrowProtect extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalDamage >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowShot.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowShot.java index a89f4588..ed0e225d 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowShot.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerArrowShot.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerArrowShot extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] shotsRequired = new int[]{50, 200, 700, 1500, 3000}; public int totalShots = 0; @@ -66,7 +66,7 @@ public class StatTrackerArrowShot extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (totalShots >= shotsRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerCriticalStrike.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerCriticalStrike.java index f14f0598..fef5ed19 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerCriticalStrike.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerCriticalStrike.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerCriticalStrike extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{200, 800, 1300, 2500, 3800}; public double totalDamageDealt = 0; @@ -66,7 +66,7 @@ public class StatTrackerCriticalStrike extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (totalDamageDealt >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerDigging.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerDigging.java index 0a99d49d..c04c1951 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerDigging.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerDigging.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerDigging extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] blocksRequired = new int[]{128, 512, 1024, 2048, 8192, 16000, 32000, 50000, 80000, 150000}; public int totalBlocksDug = 0; @@ -66,7 +66,7 @@ public class StatTrackerDigging extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalBlocksDug >= blocksRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerExperience.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerExperience.java index 99931891..379d3631 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerExperience.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerExperience.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerExperience extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] experienceRequired = new int[]{100, 400, 1000, 1600, 3200, 5000, 7000, 9200, 11500, 140000}; public double totalExperienceGained = 0; @@ -66,7 +66,7 @@ public class StatTrackerExperience extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalExperienceGained >= experienceRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFallProtect.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFallProtect.java index 561cb733..76f6248d 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFallProtect.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFallProtect.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerFallProtect extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{30, 200, 400, 800, 1500}; public int totalDamage = 0; @@ -66,7 +66,7 @@ public class StatTrackerFallProtect extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (totalDamage >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFireResist.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFireResist.java index c36f87c6..c6e467d1 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFireResist.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFireResist.java @@ -55,7 +55,7 @@ public class StatTrackerFireResist extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (totalFireTicks >= fireTicksRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFood.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFood.java index b5ef43a6..b00fbb71 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFood.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerFood.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Map; public class StatTrackerFood extends StatTracker { - public static Map lastFoodEatenMap = new HashMap(); + public static Map lastFoodEatenMap = new HashMap<>(); public static int[] foodRequired = new int[]{100, 200, 300, 500, 1000}; @@ -74,7 +74,7 @@ public class StatTrackerFood extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < foodRequired.length; i++) { if (foodEaten >= foodRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGraveDigger.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGraveDigger.java index 2b7e5bc5..209a8316 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGraveDigger.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGraveDigger.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerGraveDigger extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{200, 800, 1300, 2500, 3800, 5000, 7000, 9200, 11500, 140000}; public double totalDamageDealt = 0; @@ -66,7 +66,7 @@ public class StatTrackerGraveDigger extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalDamageDealt >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java index 9a3830ad..0234bbf2 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerGrimReaperSprint.java @@ -16,7 +16,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerGrimReaperSprint extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] deathsRequired = new int[]{6, 10, 15, 25, 50, 70, 90, 120, 150, 200}; //TODO: Modify public int totalDeaths = 0; @@ -67,7 +67,7 @@ public class StatTrackerGrimReaperSprint extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalDeaths >= deathsRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerHealthboost.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerHealthboost.java index 73e1b3cc..666cf88f 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerHealthboost.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerHealthboost.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerHealthboost extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] healthedRequired = new int[]{80, 200, 340, 540, 800, 1600, 2800, 5000, 7600, 10000}; public double totalHealthGenned = 0; @@ -66,7 +66,7 @@ public class StatTrackerHealthboost extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalHealthGenned >= healthedRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerJump.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerJump.java index 7adb31fd..d5214fa6 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerJump.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerJump.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerJump extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] jumpsRequired = new int[]{30, 200, 400, 700, 1100, 1500, 2000, 2800, 3600, 5000}; //testing public int totalJumps = 0; @@ -68,7 +68,7 @@ public class StatTrackerJump extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalJumps >= jumpsRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMeleeDamage.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMeleeDamage.java index 78adec51..a7172372 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMeleeDamage.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMeleeDamage.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerMeleeDamage extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{200, 800, 1300, 2500, 3800, 5000, 7000, 9200, 11500, 140000}; public double totalDamageDealt = 0; @@ -66,7 +66,7 @@ public class StatTrackerMeleeDamage extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalDamageDealt >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMovement.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMovement.java index eb44d538..49a598d1 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMovement.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerMovement.java @@ -16,8 +16,8 @@ import java.util.List; import java.util.Map; public class StatTrackerMovement extends StatTracker { - public static Map lastPosX = new HashMap(); - public static Map lastPosZ = new HashMap(); + public static Map lastPosX = new HashMap<>(); + public static Map lastPosZ = new HashMap<>(); public static int[] blocksRequired = new int[]{200, 1000, 2000, 4000, 7000, 15000, 25000, 35000, 50000, 70000}; @@ -82,7 +82,7 @@ public class StatTrackerMovement extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalMovement >= blocksRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerNightSight.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerNightSight.java index 77a1e3db..ca2a181b 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerNightSight.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerNightSight.java @@ -16,7 +16,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerNightSight extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{0, 200, 800, 1300, 2500, 3800, 5000, 7000, 9200, 11500}; public static int neededNightVision = 3 * 60 * 20; public double totalDamageDealt = 0; @@ -81,7 +81,7 @@ public class StatTrackerNightSight extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); if (totalNightVision < neededNightVision) { return upgradeList; diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPhysicalProtect.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPhysicalProtect.java index 4e215caa..7fca6648 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPhysicalProtect.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPhysicalProtect.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerPhysicalProtect extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{30, 50, 80, 140, 200, 300, 400, 500, 650, 800}; public int totalDamage = 0; @@ -66,7 +66,7 @@ public class StatTrackerPhysicalProtect extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalDamage >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPoison.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPoison.java index 16e238bb..fb002e49 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPoison.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerPoison.java @@ -56,7 +56,7 @@ public class StatTrackerPoison extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (totalPoisonTicks >= poisonTicksRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerRepairing.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerRepairing.java index d81b4e62..458b5eb6 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerRepairing.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerRepairing.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerRepairing extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{500}; public double totalDamage = 0; @@ -66,7 +66,7 @@ public class StatTrackerRepairing extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 1; i++) { if (totalDamage >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSelfSacrifice.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSelfSacrifice.java index 4a508d89..631ac1d2 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSelfSacrifice.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSelfSacrifice.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerSelfSacrifice extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] sacrificesRequired = new int[]{30, 200, 400, 700, 1100, 1500, 2000, 2800, 3600, 5000}; //testing public int totalSacrifices = 0; @@ -68,7 +68,7 @@ public class StatTrackerSelfSacrifice extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalSacrifices >= sacrificesRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSolarPowered.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSolarPowered.java index 41abc39a..29d656ac 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSolarPowered.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSolarPowered.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerSolarPowered extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] healthedRequired = new int[]{70, 150, 300, 500, 700, 1400, 2400, 4000, 7000, 9000}; public double totalHealthGenned = 0; @@ -66,7 +66,7 @@ public class StatTrackerSolarPowered extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 10; i++) { if (totalHealthGenned >= healthedRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSprintAttack.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSprintAttack.java index c8743426..09d2f220 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSprintAttack.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerSprintAttack.java @@ -15,7 +15,7 @@ import java.util.HashMap; import java.util.List; public class StatTrackerSprintAttack extends StatTracker { - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public static int[] damageRequired = new int[]{200, 800, 1300, 2500, 3800}; public double totalDamageDealt = 0; @@ -66,7 +66,7 @@ public class StatTrackerSprintAttack extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (totalDamageDealt >= damageRequired[i]) { diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerStepAssist.java b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerStepAssist.java index b5bbec27..77ad3f12 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerStepAssist.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/tracker/StatTrackerStepAssist.java @@ -15,8 +15,8 @@ import java.util.List; import java.util.Map; public class StatTrackerStepAssist extends StatTracker { - public static Map lastPosX = new HashMap(); - public static Map lastPosZ = new HashMap(); + public static Map lastPosX = new HashMap<>(); + public static Map lastPosZ = new HashMap<>(); public static int blocksRequired = 1000; @@ -82,7 +82,7 @@ public class StatTrackerStepAssist extends StatTracker { @Override public List getUpgrades() { - List upgradeList = new ArrayList(); + List upgradeList = new ArrayList<>(); if (totalMovement >= blocksRequired) { upgradeList.add(new LivingArmourUpgradeStepAssist(0)); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeDigging.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeDigging.java index 6dac903b..a88e42c9 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeDigging.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeDigging.java @@ -17,7 +17,7 @@ public class LivingArmourUpgradeDigging extends LivingArmourUpgrade { public static final int[] digSpeedTime = new int[]{0, 50, 60, 100, 100, 100, 100, 150, 150, 150}; public static final int[] digSpeedLevel = new int[]{0, 0, 0, 1, 1, 1, 1, 1, 2, 2}; public static final double[] digSpeedModifier = new double[]{1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.8, 2, 2.2, 2.5}; - public static HashMap changeMap = new HashMap(); + public static HashMap changeMap = new HashMap<>(); public LivingArmourUpgradeDigging(int level) { super(level); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java index 69ce784c..08ecc06c 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeHealthboost.java @@ -29,7 +29,7 @@ public class LivingArmourUpgradeHealthboost extends LivingArmourUpgrade { @Override public Multimap getAttributeModifiers() { - Multimap modifierMap = HashMultimap.create(); + Multimap modifierMap = HashMultimap.create(); String name = getUniqueIdentifier() + "-HealthModifier1"; modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "HealthModifier1", healthModifier[this.level], 0)); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java index 2045b972..8909473e 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeKnockbackResist.java @@ -22,7 +22,7 @@ public class LivingArmourUpgradeKnockbackResist extends LivingArmourUpgrade { @Override public Multimap getAttributeModifiers() { - Multimap modifierMap = HashMultimap.create(); + Multimap modifierMap = HashMultimap.create(); String name = getUniqueIdentifier() + "-KnockbackModifier1"; modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "KnockbackModifier1", kbModifier[this.level], 0)); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java index 5b5abda1..22e206f8 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeMeleeDamage.java @@ -29,7 +29,7 @@ public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade { @Override public Multimap getAttributeModifiers() { - Multimap modifierMap = HashMultimap.create(); + Multimap modifierMap = HashMultimap.create(); String name = getUniqueIdentifier() + "-DamageModifier1"; modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(UUID.nameUUIDFromBytes(StringUtils.getBytesUtf8(name)), "DamageModifier1", meleeDamage[this.level], 0)); diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java index 3fe1f8a0..446decfb 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java @@ -47,7 +47,7 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade { @Override public Multimap getAttributeModifiers() { - Multimap modifierMap = HashMultimap.create(); + Multimap modifierMap = HashMultimap.create(); // modifierMap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Speed modifier" + 1, speedModifier[this.level], 1)); diff --git a/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java b/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java index 5ba2f665..1fad6f4e 100644 --- a/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java +++ b/src/main/java/WayofTime/bloodmagic/potion/BMPotionUtils.java @@ -37,7 +37,7 @@ public class BMPotionUtils { double incurredDamage = 0; - List growList = new ArrayList(); + List growList = new ArrayList<>(); for (int i = 0; i < maxPlantsGrown; i++) { BlockPos blockPos = entity.getPosition().add(rand.nextInt(horizontalRadius * 2 + 1) - horizontalRadius, rand.nextInt(verticalRadius * 2 + 1) - verticalRadius, rand.nextInt(horizontalRadius * 2 + 1) - horizontalRadius); diff --git a/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java b/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java index 3aa2be30..04ace93a 100644 --- a/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java +++ b/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java @@ -6,11 +6,7 @@ import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.soul.DemonWillHolder; import WayofTime.bloodmagic.client.IMeshProvider; import WayofTime.bloodmagic.client.IVariantProvider; -import WayofTime.bloodmagic.client.Sprite; import WayofTime.bloodmagic.client.helper.ShaderHelper; -import WayofTime.bloodmagic.client.hud.HUDElementCornerTile; -import WayofTime.bloodmagic.client.hud.HUDElementDemonWillAura; -import WayofTime.bloodmagic.client.hud.HUDElementHolding; import WayofTime.bloodmagic.client.key.KeyBindings; import WayofTime.bloodmagic.client.render.LayerBloodElytra; import WayofTime.bloodmagic.client.render.block.*; @@ -23,7 +19,6 @@ import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow; import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare; import WayofTime.bloodmagic.tile.*; import WayofTime.bloodmagic.tile.routing.TileRoutingNode; -import WayofTime.bloodmagic.util.helper.NumeralHelper; import com.google.common.collect.ImmutableMap; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; @@ -46,9 +41,7 @@ import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import org.apache.commons.lang3.tuple.Pair; import java.awt.Color; -import java.util.List; import java.util.Map; -import java.util.function.Function; public class ClientProxy extends CommonProxy { public static DemonWillHolder currentAura = new DemonWillHolder(); diff --git a/src/main/java/WayofTime/bloodmagic/recipe/LivingArmourDowngradeRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/LivingArmourDowngradeRecipe.java index 8fa14ad2..2a17628f 100644 --- a/src/main/java/WayofTime/bloodmagic/recipe/LivingArmourDowngradeRecipe.java +++ b/src/main/java/WayofTime/bloodmagic/recipe/LivingArmourDowngradeRecipe.java @@ -17,7 +17,7 @@ import java.util.List; public class LivingArmourDowngradeRecipe { protected LivingArmourUpgrade upgrade = null; protected ItemStack keyStack = ItemStack.EMPTY; - protected List input = new ArrayList(); + protected List input = new ArrayList<>(); public LivingArmourDowngradeRecipe(LivingArmourUpgrade upgrade, ItemStack keyStack, Object... recipe) { this.upgrade = upgrade; @@ -32,12 +32,12 @@ public class LivingArmourDowngradeRecipe { } else if (in instanceof String) { input.add(OreDictionary.getOres((String) in)); } else { - String ret = "Invalid living armour downgrade recipe: "; + StringBuilder ret = new StringBuilder("Invalid living armour downgrade recipe: "); for (Object tmp : recipe) { - ret += tmp + ", "; + ret.append(tmp).append(", "); } - ret += upgrade.toString(); - throw new RuntimeException(ret); + ret.append(upgrade.toString()); + throw new RuntimeException(ret.toString()); } } } @@ -63,7 +63,7 @@ public class LivingArmourDowngradeRecipe { return false; } - ArrayList required = new ArrayList(input); + ArrayList required = new ArrayList<>(input); for (ItemStack slot : checkedList) { if (slot != null) { diff --git a/src/main/java/WayofTime/bloodmagic/recipe/TartaricForgeRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/TartaricForgeRecipe.java index db294411..21f5936b 100644 --- a/src/main/java/WayofTime/bloodmagic/recipe/TartaricForgeRecipe.java +++ b/src/main/java/WayofTime/bloodmagic/recipe/TartaricForgeRecipe.java @@ -14,7 +14,7 @@ import java.util.List; public class TartaricForgeRecipe { protected ItemStack output = null; - protected List input = new ArrayList(); + protected List input = new ArrayList<>(); protected double minimumSouls; protected double soulsDrained; @@ -40,12 +40,12 @@ public class TartaricForgeRecipe { } else if (in instanceof String) { input.add(OreDictionary.getOres((String) in)); } else { - String ret = "Invalid soul forge recipe: "; + StringBuilder ret = new StringBuilder("Invalid soul forge recipe: "); for (Object tmp : recipe) { - ret += tmp + ", "; + ret.append(tmp).append(", "); } - ret += output; - throw new RuntimeException(ret); + ret.append(output); + throw new RuntimeException(ret.toString()); } } } @@ -67,24 +67,19 @@ public class TartaricForgeRecipe { */ @SuppressWarnings("unchecked") public boolean matches(List checkedList, World world, BlockPos pos) { - ArrayList required = new ArrayList(input); - - for (int x = 0; x < checkedList.size(); x++) { - ItemStack slot = checkedList.get(x); + ArrayList required = new ArrayList<>(input); + for (ItemStack slot : checkedList) { if (slot != null) { boolean inRecipe = false; - Iterator req = required.iterator(); - while (req.hasNext()) { + for (Object aRequired : required) { boolean match = false; - Object next = req.next(); - - if (next instanceof ItemStack) { - match = OreDictionary.itemMatches((ItemStack) next, slot, false); - } else if (next instanceof List) { - Iterator itr = ((List) next).iterator(); + if (aRequired instanceof ItemStack) { + match = OreDictionary.itemMatches((ItemStack) aRequired, slot, false); + } else if (aRequired instanceof List) { + Iterator itr = ((List) aRequired).iterator(); while (itr.hasNext() && !match) { match = OreDictionary.itemMatches(itr.next(), slot, false); } @@ -92,7 +87,7 @@ public class TartaricForgeRecipe { if (match) { inRecipe = true; - required.remove(next); + required.remove(aRequired); break; } } diff --git a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableDyeableRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableDyeableRecipe.java index 50e83c2b..9182aad7 100644 --- a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableDyeableRecipe.java +++ b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableDyeableRecipe.java @@ -19,11 +19,11 @@ public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe { public AlchemyTableDyeableRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem) { super(inputItem, lpDrained, ticksRequired, tierRequired); - ArrayList validDyes = new ArrayList(); + ArrayList validDyes = new ArrayList<>(); validDyes.add(new ItemStack(Items.NAME_TAG)); validDyes.add(new ItemStack(Items.DYE, 1, OreDictionary.WILDCARD_VALUE)); - ArrayList recipe = new ArrayList(); + ArrayList recipe = new ArrayList<>(); recipe.add(inputItem); recipe.add(validDyes); diff --git a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java index 1c2ccd46..17162a39 100644 --- a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java +++ b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionAugmentRecipe.java @@ -19,10 +19,8 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe { public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, List inputItems, PotionEffect baseEffect, double lengthAugment, int powerAugment) { super(lpDrained, ticksRequired, tierRequired, inputItems, baseEffect); - ArrayList recipe = new ArrayList(); - for (ItemStack stack : inputItems) { - recipe.add(stack); - } + ArrayList recipe = new ArrayList<>(); + recipe.addAll(inputItems); recipe.add(getAugmentedPotionFlask(baseEffect)); this.input = recipe; @@ -55,7 +53,7 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe { if (inputStack.isEmpty()) { ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK); - List effectList = new ArrayList(); + List effectList = new ArrayList<>(); int potionLength = wantedPotion.isInstant() ? 1 : BMPotionUtils.getAugmentedLength(baseEffect.getDuration(), lengthAugment, powerAugment - baseEffect.getAmplifier()); effectList.add(new PotionEffect(wantedPotion, potionLength, powerAugment - baseEffect.getAmplifier())); @@ -67,7 +65,7 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe { ItemStack outputStack = inputStack.copy(); List effectList = PotionUtils.getEffectsFromStack(outputStack); - List newEffectList = new ArrayList(); + List newEffectList = new ArrayList<>(); for (PotionEffect effect : effectList) { if (effect.getPotion() == wantedPotion) { @@ -89,7 +87,7 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe { public static ItemStack getAugmentedPotionFlask(PotionEffect baseEffect) { ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK); - List effectList = new ArrayList(); + List effectList = new ArrayList<>(); effectList.add(baseEffect); BMPotionUtils.setEffects(outputStack, effectList); diff --git a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java index 4a627ede..172af124 100644 --- a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java +++ b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTablePotionRecipe.java @@ -22,10 +22,8 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe { public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, List inputItems, PotionEffect baseEffect) { super(basePotionFlaskStack, lpDrained, ticksRequired, tierRequired); - ArrayList recipe = new ArrayList(); - for (ItemStack stack : inputItems) { - recipe.add(stack); - } + ArrayList recipe = new ArrayList<>(); + recipe.addAll(inputItems); recipe.add(basePotionFlaskStack); this.input = recipe; @@ -60,7 +58,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe { @Override public boolean matches(List checkedList, World world, BlockPos pos) { - ArrayList required = new ArrayList(input); + ArrayList required = new ArrayList<>(input); for (ItemStack slot : checkedList) { if (slot != null) { @@ -121,7 +119,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe { if (inputStack.isEmpty()) { ItemStack outputStack = new ItemStack(RegistrarBloodMagicItems.POTION_FLASK); - List effectList = new ArrayList(); + List effectList = new ArrayList<>(); effectList.add(baseEffect); PotionUtils.appendEffects(outputStack, effectList); diff --git a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableRecipe.java b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableRecipe.java index 8fbd717d..a845963a 100644 --- a/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableRecipe.java +++ b/src/main/java/WayofTime/bloodmagic/recipe/alchemyTable/AlchemyTableRecipe.java @@ -15,7 +15,7 @@ import java.util.List; public class AlchemyTableRecipe { protected ItemStack output = ItemStack.EMPTY; - protected ArrayList input = new ArrayList(); + protected ArrayList input = new ArrayList<>(); protected int lpDrained; protected int ticksRequired; protected int tierRequired; @@ -43,12 +43,12 @@ public class AlchemyTableRecipe { } else if (in instanceof String) { input.add(OreDictionary.getOres((String) in)); } else { - String ret = "Invalid alchemy recipe: "; + StringBuilder ret = new StringBuilder("Invalid alchemy recipe: "); for (Object tmp : recipe) { - ret += tmp + ", "; + ret.append(tmp).append(", "); } - ret += output; - throw new RuntimeException(ret); + ret.append(output); + throw new RuntimeException(ret.toString()); } } } @@ -78,7 +78,7 @@ public class AlchemyTableRecipe { */ @SuppressWarnings("unchecked") public boolean matches(List checkedList, World world, BlockPos pos) { - ArrayList required = new ArrayList(input); + ArrayList required = new ArrayList<>(input); for (ItemStack slot : checkedList) { if (!slot.isEmpty()) { diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java b/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java index 855181d2..4a49327e 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModRecipes.java @@ -148,12 +148,12 @@ public class ModRecipes { AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTablePotionRecipe(lpDrained, 100, tier, inputStack, baseEffect)); - List lengtheningList = new ArrayList(); + List lengtheningList = new ArrayList<>(); lengtheningList.add(inputStack); lengtheningList.add(mundaneLengtheningStack); AlchemyTableRecipeRegistry.registerRecipe(BMPotionUtils.getLengthAugmentRecipe(lpDrained, 100, tier, lengtheningList, baseEffect, 1)); - List powerList = new ArrayList(); + List powerList = new ArrayList<>(); powerList.add(inputStack); powerList.add(mundanePowerStack); AlchemyTableRecipeRegistry.registerRecipe(BMPotionUtils.getPowerAugmentRecipe(lpDrained, 100, tier, powerList, baseEffect, 1)); @@ -173,7 +173,7 @@ public class ModRecipes ItemStack minecartStack = new ItemStack(Items.MINECART); ItemStack stringStack = new ItemStack(Items.STRING); - Map> dialogueMap = new HashMap>(); + Map> dialogueMap = new HashMap<>(); dialogueMap.put(bowStack, Pair.of("bow", new int[] { 1, 100, 300, 500 })); dialogueMap.put(bottleStack, Pair.of("quenched", new int[] { 1, 100, 300, 500 })); dialogueMap.put(swordStack, Pair.of("dulledBlade", new int[] { 1, 100, 300, 500, 700 })); @@ -183,10 +183,10 @@ public class ModRecipes { ItemStack keyStack = entry.getKey(); String str = entry.getValue().getKey(); - Map> textMap = new HashMap>(); + Map> textMap = new HashMap<>(); for (int tick : entry.getValue().getValue()) { - List textList = new ArrayList(); + List textList = new ArrayList<>(); textList.add(new TextComponentTranslation("\u00A74%s", new TextComponentTranslation(messageBase + str + "." + tick))); textMap.put(tick, textList); } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java index 6ce09db4..67a8bf76 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualAltarBuilder.java @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.Iterator; public class RitualAltarBuilder extends Ritual { - private Iterator altarComponentsIterator = new ArrayList(EnumAltarTier.SIX.getAltarComponents()).iterator(); + private Iterator altarComponentsIterator = new ArrayList<>(EnumAltarTier.SIX.getAltarComponents()).iterator(); private boolean cycleDone = false; private AltarComponent currentComponent; @@ -53,7 +53,7 @@ public class RitualAltarBuilder extends Ritual { } if (cycleDone) { - altarComponentsIterator = new ArrayList(EnumAltarTier.SIX.getAltarComponents()).iterator(); + altarComponentsIterator = new ArrayList<>(EnumAltarTier.SIX.getAltarComponents()).iterator(); } if (world.getBlockState(altarPos).getBlock().isReplaceable(world, altarPos) && hasItem(tileEntity, Item.getItemFromBlock(RegistrarBloodMagicBlocks.ALTAR), 0, true)) { @@ -114,7 +114,7 @@ public class RitualAltarBuilder extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); for (int i = -12; i <= -8; i++) { addRune(components, i, -6, 13, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java index 147a3791..596d5c21 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualAnimalGrowth.java @@ -170,7 +170,7 @@ public class RitualAnimalGrowth extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 2, 0, EnumRuneType.DUSK); this.addParallelRunes(components, 1, 0, EnumRuneType.WATER); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java index 9a59ff3a..df617162 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualArmourEvolve.java @@ -66,7 +66,7 @@ public class RitualArmourEvolve extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.DUSK); this.addCornerRunes(components, 2, 0, EnumRuneType.FIRE); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java index a364d484..d20a3643 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualCobblestone.java @@ -84,7 +84,7 @@ public class RitualCobblestone extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 1, EnumRuneType.FIRE); this.addParallelRunes(components, 1, 0, EnumRuneType.WATER); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java index 4f6dc7a6..4691725c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualContainment.java @@ -1,7 +1,6 @@ package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.ritual.data.*; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -32,7 +31,7 @@ public class RitualContainment extends Ritual { AreaDescriptor containmentRange = getBlockRange(CONTAINMENT_RANGE); for (EntityLivingBase entity : world.getEntitiesWithinAABB(EntityLivingBase.class, containmentRange.getAABB(masterRitualStone.getBlockPos()))) { - if (entity instanceof EntityPlayer && (((EntityPlayer) entity).capabilities.isCreativeMode || PlayerHelper.getUUIDFromPlayer((EntityPlayer) entity).toString().equals(masterRitualStone.getOwner()))) + if (entity instanceof EntityPlayer && (((EntityPlayer) entity).capabilities.isCreativeMode || ((EntityPlayer) entity).getGameProfile().getId().equals(masterRitualStone.getOwner()))) continue; double xDif = entity.posX - (masterRitualStone.getBlockPos().getX() + 0.5); @@ -58,7 +57,7 @@ public class RitualContainment extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 1, 0, EnumRuneType.EARTH); this.addCornerRunes(components, 2, 0, EnumRuneType.EARTH); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java index 3909f072..5dea1dbf 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualCrushing.java @@ -36,8 +36,8 @@ public class RitualCrushing extends Ritual { public static double destructiveWillDrain = 0.2; public static double vengefulWillDrain = 0.2; - public static Map cuttingFluidLPMap = new HashMap(); - public static Map cuttingFluidWillMap = new HashMap(); + public static Map cuttingFluidLPMap = new HashMap<>(); + public static Map cuttingFluidWillMap = new HashMap<>(); public static int defaultRefreshTime = 40; public int refreshTime = 40; @@ -120,7 +120,7 @@ public class RitualCrushing extends Ritual { } cuttingStack = cuttingStack.copy(); - List input = new ArrayList(); + List input = new ArrayList<>(); input.add(cuttingStack); input.add(copyStack); @@ -252,7 +252,7 @@ public class RitualCrushing extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 1, 0, EnumRuneType.EARTH); this.addParallelRunes(components, 2, 0, EnumRuneType.FIRE); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java index b6387112..6525cb0d 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualCrystalHarvest.java @@ -68,7 +68,7 @@ public class RitualCrystalHarvest extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); this.addParallelRunes(components, 1, 1, EnumRuneType.DUSK); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java index ba6a2fa7..04ed12f4 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualExpulsion.java @@ -3,7 +3,6 @@ package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.iface.IBindable; -import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.ritual.data.*; import WayofTime.bloodmagic.util.Utils; import com.google.common.collect.Lists; @@ -71,7 +70,7 @@ public class RitualExpulsion extends Ritual { final int teleportDistance = 100; for (EntityPlayer player : world.getEntitiesWithinAABB(EntityPlayer.class, expulsionRange.getAABB(masterRitualStone.getBlockPos()))) { - if (player.capabilities.isCreativeMode || PlayerHelper.getUUIDFromPlayer(player).toString().equals(masterRitualStone.getOwner()) || whitelist.contains(player.getGameProfile().getId())) + if (player.capabilities.isCreativeMode || player.getGameProfile().getId().equals(masterRitualStone.getOwner()) || whitelist.contains(player.getGameProfile().getId())) continue; if (teleportRandomly(player, teleportDistance)) @@ -192,7 +191,7 @@ public class RitualExpulsion extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 2, 0, EnumRuneType.EARTH); this.addRune(components, 2, 0, 1, EnumRuneType.EARTH); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java index f7749ddf..efa144fb 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualFeatheredKnife.java @@ -109,7 +109,7 @@ public class RitualFeatheredKnife extends Ritual { for (EntityPlayer player : entities) { float healthThreshold = steadfastWill >= steadfastWillThreshold ? 0.7f : 0.3f; - if (vengefulWill >= vengefulWillThreshold && !player.getUniqueID().toString().equals(masterRitualStone.getOwner())) { + if (vengefulWill >= vengefulWillThreshold && !player.getGameProfile().getId().equals(masterRitualStone.getOwner())) { healthThreshold = 0.1f; } @@ -186,7 +186,7 @@ public class RitualFeatheredKnife extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 1, 0, EnumRuneType.DUSK); this.addParallelRunes(components, 2, -1, EnumRuneType.WATER); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java index a426c67a..c6e3112c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualFelling.java @@ -35,7 +35,7 @@ public class RitualFelling extends Ritual { setMaximumVolumeAndDistanceOfRange(FELLING_RANGE, 14000, 15, 30); setMaximumVolumeAndDistanceOfRange(CHEST_RANGE, 1, 3, 3); - treePartsCache = new ArrayList(); + treePartsCache = new ArrayList<>(); } @Override @@ -86,7 +86,7 @@ public class RitualFelling extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); addCornerRunes(components, 1, 0, EnumRuneType.EARTH); addCornerRunes(components, 1, 1, EnumRuneType.EARTH); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java index 52048dbf..402a8b40 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualForsakenSoul.java @@ -29,7 +29,7 @@ public class RitualForsakenSoul extends Ritual { public double willBuffer = 0; public double crystalBuffer = 0; - public List keyList = new ArrayList(); + public List keyList = new ArrayList<>(); public RitualForsakenSoul() { super("ritualForsakenSoul", 0, 40000, "ritual." + BloodMagic.MODID + ".forsakenSoulRitual"); @@ -83,7 +83,7 @@ public class RitualForsakenSoul extends Ritual { int maxEffects = 100; int totalEffects = 0; - List crystalList = new ArrayList(); + List crystalList = new ArrayList<>(); AreaDescriptor crystalRange = getBlockRange(CRYSTAL_RANGE); @@ -153,7 +153,7 @@ public class RitualForsakenSoul extends Ritual { keyList.remove(0); } - List uniquenessList = new ArrayList(); + List uniquenessList = new ArrayList<>(); for (int value : keyList) { if (!uniquenessList.contains(value)) { uniquenessList.add(value); @@ -179,7 +179,7 @@ public class RitualForsakenSoul extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); this.addParallelRunes(components, 1, -1, EnumRuneType.DUSK); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java index 7cc66329..7bcd06e7 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualFullStomach.java @@ -3,10 +3,8 @@ package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.ritual.data.*; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.FoodStats; import net.minecraft.util.math.BlockPos; @@ -96,7 +94,7 @@ public class RitualFullStomach extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 3, 0, EnumRuneType.FIRE); this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java index 8a6f9cfb..84089407 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualGreenGrove.java @@ -260,7 +260,7 @@ public class RitualGreenGrove extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.EARTH); this.addParallelRunes(components, 1, 0, EnumRuneType.WATER); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java index b1d4d478..ec6650f1 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualHarvest.java @@ -67,7 +67,7 @@ public class RitualHarvest extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); components.add(new RitualComponent(new BlockPos(1, 0, 1), EnumRuneType.DUSK)); components.add(new RitualComponent(new BlockPos(1, 0, -1), EnumRuneType.DUSK)); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java index 22a26195..26801083 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualInterdiction.java @@ -1,7 +1,6 @@ package WayofTime.bloodmagic.ritual; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.util.helper.PlayerHelper; import WayofTime.bloodmagic.ritual.data.*; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -32,7 +31,7 @@ public class RitualInterdiction extends Ritual { AreaDescriptor interdictionRange = getBlockRange(INTERDICTION_RANGE); for (EntityLivingBase entity : world.getEntitiesWithinAABB(EntityLivingBase.class, interdictionRange.getAABB(masterRitualStone.getBlockPos()))) { - if (entity instanceof EntityPlayer && (((EntityPlayer) entity).capabilities.isCreativeMode || PlayerHelper.getUUIDFromPlayer((EntityPlayer) entity).toString().equals(masterRitualStone.getOwner()))) + if (entity instanceof EntityPlayer && (((EntityPlayer) entity).capabilities.isCreativeMode || ((EntityPlayer) entity).getGameProfile().getId().equals(masterRitualStone.getOwner()))) continue; double xDif = entity.posX - (masterRitualStone.getBlockPos().getX() + 0.5); @@ -62,7 +61,7 @@ public class RitualInterdiction extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.AIR); this.addParallelRunes(components, 1, 0, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java index 84da47b7..62f6f77c 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualJumping.java @@ -70,7 +70,7 @@ public class RitualJumping extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); for (int i = -1; i <= 1; i++) this.addCornerRunes(components, 1, i, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java index d3878ed7..884ddf09 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualLava.java @@ -234,7 +234,7 @@ public class RitualLava extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 1, 0, EnumRuneType.FIRE); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java index 936d7d77..566f9019 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualLivingArmourDowngrade.java @@ -51,7 +51,7 @@ public class RitualLivingArmourDowngrade extends Ritual { boolean isActivatorPresent = false; for (EntityPlayer player : world.getEntitiesWithinAABB(EntityPlayer.class, downgradeRange.getAABB(masterRitualStone.getBlockPos()))) { - if (player.getUniqueID().toString().equals(masterRitualStone.getOwner())) { + if (player.getGameProfile().getId().equals(masterRitualStone.getOwner())) { ItemStack keyStack = getStackFromItemFrame(world, masterPos, masterRitualStone.getDirection()); if (keyStack.isEmpty()) { return; @@ -77,7 +77,7 @@ public class RitualLivingArmourDowngrade extends Ritual { } IItemHandler inv = Utils.getInventory(tile, null); if (inv != null) { - List recipeList = new ArrayList(); + List recipeList = new ArrayList<>(); for (int i = 0; i < inv.getSlots(); i++) { ItemStack invStack = inv.getStackInSlot(i); if (!invStack.isEmpty()) { @@ -163,7 +163,7 @@ public class RitualLivingArmourDowngrade extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addRune(components, 0, 0, -1, EnumRuneType.AIR); this.addRune(components, 0, 0, -2, EnumRuneType.DUSK); @@ -180,25 +180,25 @@ public class RitualLivingArmourDowngrade extends Ritual { this.addRune(components, sgn * 2, 0, 2, EnumRuneType.AIR); this.addRune(components, sgn * 3, 0, 2, EnumRuneType.AIR); this.addRune(components, sgn * 3, 0, 3, EnumRuneType.AIR); - this.addRune(components, sgn * 1, 0, 0, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 0, 1, EnumRuneType.EARTH); + this.addRune(components, sgn, 0, 0, EnumRuneType.EARTH); + this.addRune(components, sgn, 0, 1, EnumRuneType.EARTH); this.addRune(components, sgn * 2, 0, -1, EnumRuneType.FIRE); this.addRune(components, sgn * 2, 0, -2, EnumRuneType.FIRE); this.addRune(components, sgn * 3, 0, -2, EnumRuneType.FIRE); this.addRune(components, sgn * 3, 0, -3, EnumRuneType.FIRE); this.addRune(components, sgn * 3, 0, -4, EnumRuneType.FIRE); - this.addRune(components, sgn * 1, 1, -1, EnumRuneType.AIR); - this.addRune(components, sgn * 1, 1, -2, EnumRuneType.AIR); - this.addRune(components, sgn * 1, 1, -4, EnumRuneType.FIRE); + this.addRune(components, sgn, 1, -1, EnumRuneType.AIR); + this.addRune(components, sgn, 1, -2, EnumRuneType.AIR); + this.addRune(components, sgn, 1, -4, EnumRuneType.FIRE); this.addRune(components, sgn * 2, 1, -4, EnumRuneType.FIRE); - this.addRune(components, sgn * 1, 0, -3, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 0, -4, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 0, -5, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 1, -5, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 2, -5, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 3, -5, EnumRuneType.EARTH); + this.addRune(components, sgn, 0, -3, EnumRuneType.EARTH); + this.addRune(components, sgn, 0, -4, EnumRuneType.EARTH); + this.addRune(components, sgn, 0, -5, EnumRuneType.EARTH); + this.addRune(components, sgn, 1, -5, EnumRuneType.EARTH); + this.addRune(components, sgn, 2, -5, EnumRuneType.EARTH); + this.addRune(components, sgn, 3, -5, EnumRuneType.EARTH); - this.addRune(components, sgn * 1, 3, -4, EnumRuneType.EARTH); + this.addRune(components, sgn, 3, -4, EnumRuneType.EARTH); } return components; diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java index 42d262ed..86e3d325 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualMagnetic.java @@ -73,7 +73,7 @@ public class RitualMagnetic extends Ritual { k = Math.min(radius, Math.max(-radius, lastPos.getZ())); } - while (j + pos.getY() >= 0) { + if (j + pos.getY() >= 0) { while (i <= radius) { while (k <= radius) { BlockPos newPos = pos.add(i, j, k); @@ -136,7 +136,7 @@ public class RitualMagnetic extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.EARTH); this.addParallelRunes(components, 2, 1, EnumRuneType.EARTH); @@ -162,12 +162,7 @@ public class RitualMagnetic extends Ritual { return false; BlockStack type = new BlockStack(block, meta); - Boolean result = oreBlockCache.get(type); - if (result == null) { - result = computeIsItemOre(type); - oreBlockCache.put(type, result); - } - return result; + return oreBlockCache.computeIfAbsent(type, RitualMagnetic::computeIsItemOre); } private static boolean computeIsItemOre(BlockStack type) { diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java index 42052ea9..939fd82a 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualMeteor.java @@ -96,7 +96,7 @@ public class RitualMeteor extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 2, 0, EnumRuneType.FIRE); this.addOffsetRunes(components, 3, 1, 0, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java index 7c4da792..27809a91 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualPlacer.java @@ -81,7 +81,7 @@ public class RitualPlacer extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); addRune(components, 3, 0, 3, EnumRuneType.EARTH); addRune(components, 3, 0, -3, EnumRuneType.EARTH); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java index 2dd00fe1..d62f2f64 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualPortal.java @@ -184,7 +184,7 @@ public class RitualPortal extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); addRune(components, 1, 0, 0, EnumRuneType.AIR); addRune(components, 2, 0, 0, EnumRuneType.WATER); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java index bdb869bc..1cb26be9 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualPump.java @@ -92,7 +92,7 @@ public class RitualPump extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); addRune(components, 1, 0, 1, EnumRuneType.WATER); addRune(components, 1, 0, -1, EnumRuneType.EARTH); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java index b2eb76bb..1da5a885 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualRegeneration.java @@ -154,7 +154,7 @@ public class RitualRegeneration extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); components.add(new RitualComponent(new BlockPos(4, 0, 0), EnumRuneType.AIR)); components.add(new RitualComponent(new BlockPos(5, 0, -1), EnumRuneType.AIR)); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java index 57b51bcf..02d9fd7e 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualSpeed.java @@ -154,7 +154,7 @@ public class RitualSpeed extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addRune(components, 0, 0, -2, EnumRuneType.DUSK); this.addRune(components, 1, 0, -1, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java index 3bb9ed0d..b944c9ec 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualSuppression.java @@ -57,7 +57,7 @@ public class RitualSuppression extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 2, 0, EnumRuneType.WATER); this.addRune(components, -2, 0, -1, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java index fe1a3a07..49ad448b 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualUpgradeRemove.java @@ -104,7 +104,7 @@ public class RitualUpgradeRemove extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.DUSK); this.addCornerRunes(components, 2, 0, EnumRuneType.FIRE); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java index 82e5bc43..0d784546 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualWater.java @@ -58,7 +58,7 @@ public class RitualWater extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.WATER); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java index ba3bc5e0..44604cc5 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualWellOfSuffering.java @@ -119,7 +119,7 @@ public class RitualWellOfSuffering extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addCornerRunes(components, 1, 0, EnumRuneType.FIRE); this.addCornerRunes(components, 2, -1, EnumRuneType.FIRE); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java b/src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java index a397d22e..fc4ea91f 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/RitualZephyr.java @@ -82,7 +82,7 @@ public class RitualZephyr extends Ritual { @Override public ArrayList getComponents() { - ArrayList components = new ArrayList(); + ArrayList components = new ArrayList<>(); this.addParallelRunes(components, 2, 0, EnumRuneType.AIR); this.addCornerRunes(components, 1, 1, EnumRuneType.AIR); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java b/src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java index c898bf3e..59248e7f 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/data/AreaDescriptor.java @@ -14,7 +14,7 @@ import java.util.List; public abstract class AreaDescriptor implements Iterator { public List getContainedPositions(BlockPos pos) { - return new ArrayList(); + return new ArrayList<>(); } public AxisAlignedBB getAABB(BlockPos pos) { @@ -92,7 +92,7 @@ public abstract class AreaDescriptor implements Iterator { @Override public List getContainedPositions(BlockPos pos) { if (!cache || !pos.equals(cachedPosition) || blockPosCache.isEmpty()) { - ArrayList posList = new ArrayList(); + ArrayList posList = new ArrayList<>(); for (int j = minimumOffset.getY(); j < maximumOffset.getY(); j++) { for (int i = minimumOffset.getX(); i < maximumOffset.getX(); i++) { @@ -125,12 +125,12 @@ public abstract class AreaDescriptor implements Iterator { public void setOffsets(BlockPos offset1, BlockPos offset2) { this.minimumOffset = new BlockPos(Math.min(offset1.getX(), offset2.getX()), Math.min(offset1.getY(), offset2.getY()), Math.min(offset1.getZ(), offset2.getZ())); this.maximumOffset = new BlockPos(Math.max(offset1.getX(), offset2.getX()), Math.max(offset1.getY(), offset2.getY()), Math.max(offset1.getZ(), offset2.getZ())); - blockPosCache = new ArrayList(); + blockPosCache = new ArrayList<>(); } @Override public void resetCache() { - this.blockPosCache = new ArrayList(); + this.blockPosCache = new ArrayList<>(); } @Override @@ -267,13 +267,13 @@ public abstract class AreaDescriptor implements Iterator { public void setRadius(BlockPos minimumOffset, int radius) { this.minimumOffset = new BlockPos(Math.min(minimumOffset.getX(), minimumOffset.getX()), Math.min(minimumOffset.getY(), minimumOffset.getY()), Math.min(minimumOffset.getZ(), minimumOffset.getZ())); this.radius = radius; - blockPosCache = new ArrayList(); + blockPosCache = new ArrayList<>(); } @Override public List getContainedPositions(BlockPos pos) { if (!cache || !pos.equals(cachedPosition) || blockPosCache.isEmpty()) { - ArrayList posList = new ArrayList(); + ArrayList posList = new ArrayList<>(); int i = -radius; int j = minimumOffset.getY(); @@ -318,7 +318,7 @@ public abstract class AreaDescriptor implements Iterator { @Override public void resetCache() { - this.blockPosCache = new ArrayList(); + this.blockPosCache = new ArrayList<>(); } @Override @@ -400,7 +400,7 @@ public abstract class AreaDescriptor implements Iterator { public Cross(BlockPos center, int size) { this.centerPos = center; this.size = size; - this.blockPosCache = new ArrayList(); + this.blockPosCache = new ArrayList<>(); } @Override @@ -424,7 +424,7 @@ public abstract class AreaDescriptor implements Iterator { @Override public void resetCache() { - blockPosCache = new ArrayList(); + blockPosCache = new ArrayList<>(); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java b/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java index 0944cbcb..6a3e7bf8 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/data/EnumRitualReaderState.java @@ -3,5 +3,6 @@ package WayofTime.bloodmagic.ritual.data; public enum EnumRitualReaderState { SET_AREA, INFORMATION, - SET_WILL_TYPES; + SET_WILL_TYPES, + ; } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java b/src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java index b2a4d680..fae7e240 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/data/Ritual.java @@ -22,11 +22,11 @@ import java.util.Map.Entry; * {@link RitualRegistry#registerRitual(Ritual, String)} */ public abstract class Ritual { - public final ArrayList ritualComponents = new ArrayList(); - protected final Map modableRangeMap = new HashMap(); - protected final Map volumeRangeMap = new HashMap(); - protected final Map horizontalRangeMap = new HashMap(); - protected final Map verticalRangeMap = new HashMap(); + public final ArrayList ritualComponents = new ArrayList<>(); + protected final Map modableRangeMap = new HashMap<>(); + protected final Map volumeRangeMap = new HashMap<>(); + protected final Map horizontalRangeMap = new HashMap<>(); + protected final Map verticalRangeMap = new HashMap<>(); private final String name; private final int crystalLevel; private final int activationCost; @@ -159,7 +159,7 @@ public abstract class Ritual { } public List getListOfRanges() { - return new ArrayList(modableRangeMap.keySet()); + return new ArrayList<>(modableRangeMap.keySet()); } public String getNextBlockRange(String range) { diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java index 8e5e9a61..e6f600ed 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerPlantable.java @@ -121,9 +121,7 @@ public class HarvestHandlerPlantable implements IHarvestHandler { } } catch (NoSuchMethodException e) { BloodMagic.instance.logger.error("HarvestCraft integration cancelled; unable to find crop name mapper"); - } catch (IllegalAccessException e) { - BloodMagic.instance.logger.error("HarvestCraft integration cancelled; crop name lookup broke"); - } catch (InvocationTargetException e) { + } catch (IllegalAccessException | InvocationTargetException e) { BloodMagic.instance.logger.error("HarvestCraft integration cancelled; crop name lookup broke"); } } diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java index 15f06cdf..79aa7dbd 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerStem.java @@ -32,7 +32,7 @@ public class HarvestHandlerStem implements IHarvestHandler { @Override public boolean harvestAndPlant(World world, BlockPos pos, BlockStack blockStack) { boolean retFlag = false; - List drops = new ArrayList(); + List drops = new ArrayList<>(); BlockPos cropPos = pos; if (HarvestRegistry.getStemCrops().containsKey(blockStack)) { EnumFacing cropDir = blockStack.getBlock().getActualState(blockStack.getState(), world, pos).getValue(BlockStem.FACING); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java index f643015e..a9f11698 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/harvest/HarvestHandlerTall.java @@ -27,7 +27,7 @@ public class HarvestHandlerTall implements IHarvestHandler { public boolean harvestAndPlant(World world, BlockPos pos, BlockStack blockStack) { boolean retFlag = false; - List drops = new ArrayList(); + List drops = new ArrayList<>(); if (HarvestRegistry.getTallCrops().contains(blockStack)) { BlockStack up = BlockStack.getStackFromPos(world, pos.up()); if (up.equals(blockStack)) { diff --git a/src/main/java/WayofTime/bloodmagic/ritual/portal/LocationsHandler.java b/src/main/java/WayofTime/bloodmagic/ritual/portal/LocationsHandler.java index fbf098d3..bdcd9fdd 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/portal/LocationsHandler.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/portal/LocationsHandler.java @@ -17,13 +17,13 @@ public class LocationsHandler implements Serializable { private static LocationsHandler locationsHandler; private LocationsHandler() { - portals = new HashMap>(); + portals = new HashMap<>(); } public boolean addLocation(String name, PortalLocation location) { ArrayList portalLocations = portals.get(name); if (portalLocations == null) { - portals.put(name, new ArrayList()); + portals.put(name, new ArrayList<>()); updateFile(fileName, portals); } if (!portals.get(name).isEmpty() && portals.get(name).size() >= 2) { diff --git a/src/main/java/WayofTime/bloodmagic/routing/RoutingFluidFilter.java b/src/main/java/WayofTime/bloodmagic/routing/RoutingFluidFilter.java index 81c51625..5de7f9cb 100644 --- a/src/main/java/WayofTime/bloodmagic/routing/RoutingFluidFilter.java +++ b/src/main/java/WayofTime/bloodmagic/routing/RoutingFluidFilter.java @@ -25,7 +25,7 @@ public class RoutingFluidFilter implements IFluidFilter { this.fluidHandler = fluidHandler; if (isFilterOutput) { //The requestList contains a list of how much can be extracted. - requestList = new ArrayList(); + requestList = new ArrayList<>(); for (ItemStack filterStack : filteredList) { FluidStack fluidFilterStack = getFluidStackFromItemStack(filterStack); if (fluidFilterStack != null) { @@ -46,7 +46,7 @@ public class RoutingFluidFilter implements IFluidFilter { } } } else { - requestList = new ArrayList(); + requestList = new ArrayList<>(); for (ItemStack filterStack : filteredList) { FluidStack fluidFilterStack = getFluidStackFromItemStack(filterStack); if (fluidFilterStack != null) { diff --git a/src/main/java/WayofTime/bloodmagic/routing/TestItemFilter.java b/src/main/java/WayofTime/bloodmagic/routing/TestItemFilter.java index ecf423d7..2e45865d 100644 --- a/src/main/java/WayofTime/bloodmagic/routing/TestItemFilter.java +++ b/src/main/java/WayofTime/bloodmagic/routing/TestItemFilter.java @@ -86,13 +86,7 @@ public class TestItemFilter implements IItemFilter { } } - Iterator iterator = requestList.iterator(); - while (iterator.hasNext()) { - ItemStack filterStack = iterator.next(); - if (filterStack.isEmpty()) { - iterator.remove(); - } - } + requestList.removeIf(ItemStack::isEmpty); } /** diff --git a/src/main/java/WayofTime/bloodmagic/soul/DemonWillHolder.java b/src/main/java/WayofTime/bloodmagic/soul/DemonWillHolder.java index 91422105..5ac2397d 100644 --- a/src/main/java/WayofTime/bloodmagic/soul/DemonWillHolder.java +++ b/src/main/java/WayofTime/bloodmagic/soul/DemonWillHolder.java @@ -6,7 +6,7 @@ import java.util.HashMap; import java.util.Map.Entry; public class DemonWillHolder { - public HashMap willMap = new HashMap(); + public HashMap willMap = new HashMap<>(); public double addWill(EnumDemonWillType type, double amount, double max) { double current = 0; diff --git a/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java b/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java index c0137c5d..8170946d 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java +++ b/src/main/java/WayofTime/bloodmagic/structures/Dungeon.java @@ -17,9 +17,9 @@ public class Dungeon { public static boolean placeStructureAtPosition(Random rand, WorldServer world, BlockPos pos) { long startTime = System.nanoTime(); - Map> availableDoorMap = new HashMap>(); //Map of doors. The EnumFacing indicates what way this door faces. - List descriptorList = new ArrayList(); - Map> roomMap = new HashMap>(); // Placement positions in terms of actual positions + Map> availableDoorMap = new HashMap<>(); //Map of doors. The EnumFacing indicates what way this door faces. + List descriptorList = new ArrayList<>(); + Map> roomMap = new HashMap<>(); // Placement positions in terms of actual positions PlacementSettings settings = new PlacementSettings(); Mirror mir = Mirror.NONE; @@ -49,7 +49,7 @@ public class Dungeon { //Initial AreaDescriptors and door positions are initialized. Time for fun! for (int i = 0; i < 100; i++) { - List facingList = new ArrayList(); + List facingList = new ArrayList<>(); for (Entry> entry : availableDoorMap.entrySet()) { if (entry.getValue() != null && !entry.getValue().isEmpty()) { facingList.add(entry.getKey()); @@ -62,7 +62,6 @@ public class Dungeon { Pair removedDoor2 = null; BlockPos roomLocation = null; - roomPlacement: for (EnumFacing doorFacing : facingList) { EnumFacing oppositeDoorFacing = doorFacing.getOpposite(); List availableDoorList = availableDoorMap.get(doorFacing); //May need to copy here @@ -97,8 +96,9 @@ public class Dungeon { room = testingRoom; - break roomPlacement; } + + break; } // Collections.shuffle(otherDoorList); diff --git a/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java b/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java index dac62074..de848276 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java +++ b/src/main/java/WayofTime/bloodmagic/structures/DungeonRoom.java @@ -13,10 +13,10 @@ import java.util.Map.Entry; public class DungeonRoom { public int dungeonWeight = 1; - public Map structureMap = new HashMap(); + public Map structureMap = new HashMap<>(); - public Map> doorMap = new HashMap>(); //Map of doors. The EnumFacing indicates what way this door faces. - public List descriptorList = new ArrayList(); + public Map> doorMap = new HashMap<>(); //Map of doors. The EnumFacing indicates what way this door faces. + public List descriptorList = new ArrayList<>(); public DungeonRoom(Map structureMap, Map> doorMap, List descriptorList) { this.structureMap = structureMap; @@ -25,7 +25,7 @@ public class DungeonRoom { } public List getAreaDescriptors(PlacementSettings settings, BlockPos offset) { - List newList = new ArrayList(); + List newList = new ArrayList<>(); for (AreaDescriptor desc : descriptorList) { newList.add(desc.rotateDescriptor(settings).offset(offset)); @@ -35,7 +35,7 @@ public class DungeonRoom { } public List getDoorOffsetsForFacing(PlacementSettings settings, EnumFacing facing, BlockPos offset) { - List offsetList = new ArrayList(); + List offsetList = new ArrayList<>(); EnumFacing originalFacing = DungeonUtil.reverseRotate(settings.getMirror(), settings.getRotation(), facing); if (doorMap.containsKey(originalFacing)) { diff --git a/src/main/java/WayofTime/bloodmagic/structures/DungeonRoomRegistry.java b/src/main/java/WayofTime/bloodmagic/structures/DungeonRoomRegistry.java index 3bd4ab75..5dd80e81 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/DungeonRoomRegistry.java +++ b/src/main/java/WayofTime/bloodmagic/structures/DungeonRoomRegistry.java @@ -6,7 +6,7 @@ import java.util.Map.Entry; import java.util.Random; public class DungeonRoomRegistry { - public static Map dungeonWeightMap = new HashMap(); + public static Map dungeonWeightMap = new HashMap<>(); private static int totalWeight = 0; public static void registerDungeonRoom(DungeonRoom room, int weight) { diff --git a/src/main/java/WayofTime/bloodmagic/structures/DungeonUtil.java b/src/main/java/WayofTime/bloodmagic/structures/DungeonUtil.java index 9534787e..ddf6c518 100644 --- a/src/main/java/WayofTime/bloodmagic/structures/DungeonUtil.java +++ b/src/main/java/WayofTime/bloodmagic/structures/DungeonUtil.java @@ -38,7 +38,7 @@ public class DungeonUtil { if (doorMap.containsKey(facing)) { doorMap.get(facing).add(offsetPos); } else { - List doorList = new ArrayList(); + List doorList = new ArrayList<>(); doorList.add(offsetPos); doorMap.put(facing, doorList); } diff --git a/src/main/java/WayofTime/bloodmagic/teleport/TeleportQueue.java b/src/main/java/WayofTime/bloodmagic/teleport/TeleportQueue.java index 8b3d72e5..1f7463f5 100644 --- a/src/main/java/WayofTime/bloodmagic/teleport/TeleportQueue.java +++ b/src/main/java/WayofTime/bloodmagic/teleport/TeleportQueue.java @@ -11,7 +11,7 @@ public class TeleportQueue { private static List queue; private TeleportQueue() { - queue = new ArrayList(); + queue = new ArrayList<>(); } public void addITeleport(ITeleport iTeleport) { diff --git a/src/main/java/WayofTime/bloodmagic/teleport/TeleporterBloodMagic.java b/src/main/java/WayofTime/bloodmagic/teleport/TeleporterBloodMagic.java index 16e7a6fc..4a02d90a 100644 --- a/src/main/java/WayofTime/bloodmagic/teleport/TeleporterBloodMagic.java +++ b/src/main/java/WayofTime/bloodmagic/teleport/TeleporterBloodMagic.java @@ -17,7 +17,7 @@ public class TeleporterBloodMagic extends Teleporter { @Override public void removeStalePortalLocations(long worldTime) { - ; + } @Override diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java index 4d1b42cf..2ee25431 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyArray.java @@ -17,7 +17,6 @@ public class TileAlchemyArray extends TileInventory implements ITickable, IAlche public boolean isActive = false; public int activeCounter = 0; public EnumFacing rotation = EnumFacing.HORIZONTALS[0]; - ; private String key = "empty"; private AlchemyArrayEffect arrayEffect; diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java index 5693df57..fd911ee6 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileAlchemyTable.java @@ -168,7 +168,7 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, } public List getAccessibleInputSlots(EnumFacing direction) { - List list = new ArrayList(); + List list = new ArrayList<>(); for (int i = 0; i < 6; i++) { if (isInputSlotAccessible(i)) { @@ -185,7 +185,7 @@ public class TileAlchemyTable extends TileInventory implements ISidedInventory, return; } - List inputList = new ArrayList(); + List inputList = new ArrayList<>(); for (int i = 0; i < 6; i++) { if (!getStackInSlot(i).isEmpty()) { diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java index 3d05fe43..7685e0fc 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java @@ -17,7 +17,7 @@ import java.util.Map.Entry; public class TileDemonCrucible extends TileInventory implements ITickable, IDemonWillConduit, ISidedInventory { public final int maxWill = 100; public final double gemDrainRate = 10; - public HashMap willMap = new HashMap(); //TODO: Change to DemonWillHolder + public HashMap willMap = new HashMap<>(); //TODO: Change to DemonWillHolder public int internalCounter = 0; public TileDemonCrucible() { diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java b/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java index 1601a07a..125f8cca 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileIncenseAltar.java @@ -22,7 +22,7 @@ import java.util.Map.Entry; public class TileIncenseAltar extends TileInventory implements ITickable { public static int maxCheckRange = 5; public AreaDescriptor incenseArea = new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11); - public Map tranquilityMap = new HashMap(); + public Map tranquilityMap = new HashMap<>(); public double incenseAddition = 0; //Self-sacrifice is multiplied by 1 plus this value. public double tranquility = 0; @@ -55,7 +55,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable { if (hasPerformed) { if (getWorld().rand.nextInt(4) == 0 && getWorld() instanceof WorldServer) { WorldServer server = (WorldServer) getWorld(); - server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0, new int[0]); + server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0); } } } @@ -80,7 +80,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable { int maxLength = 11; //Max length of the path. The path starts two blocks away from the center block. int yOffset = 0; - Map tranquilityMap = new HashMap(); + Map tranquilityMap = new HashMap<>(); for (int currentDistance = 2; currentDistance < currentDistance + maxLength; currentDistance++) { boolean canFormRoad = false; @@ -116,7 +116,7 @@ public class TileIncenseAltar extends TileInventory implements ITickable { continue; //TODO: Can make this just set j to currentDistance to speed it up. } - for (int y = 0 + yOffset; y <= 2 + yOffset; y++) { + for (int y = yOffset; y <= 2 + yOffset; y++) { BlockPos offsetPos = pos.add(i, y, j); IBlockState state = getWorld().getBlockState(offsetPos); Block block = state.getBlock(); diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java b/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java index 638930a3..a947fda7 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileInversionPillar.java @@ -19,7 +19,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.common.animation.Event; -import net.minecraftforge.common.animation.ITimeValue; import net.minecraftforge.common.animation.TimeValues.VariableValue; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.model.animation.CapabilityAnimation; @@ -64,7 +63,7 @@ public class TileInversionPillar extends TileTicking { public TileInversionPillar(EnumDemonWillType type) { this.type = type; - asm = BloodMagic.proxy.load(new ResourceLocation(BloodMagic.MODID.toLowerCase(), "asms/block/inversion_pillar.json"), ImmutableMap.of("offset", animationOffset, "cycle_length", cycleLength)); + asm = BloodMagic.proxy.load(new ResourceLocation(BloodMagic.MODID.toLowerCase(), "asms/block/inversion_pillar.json"), ImmutableMap.of("offset", animationOffset, "cycle_length", cycleLength)); animationOffsetValue = -1; } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java b/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java index 4e140dea..0bbf0441 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileMasterRitualStone.java @@ -40,7 +40,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS private Ritual currentRitual; private EnumFacing direction = EnumFacing.NORTH; private boolean inverted; - private List currentActiveWillConfig = new ArrayList(); + private List currentActiveWillConfig = new ArrayList<>(); @Override public void onUpdate() { @@ -322,7 +322,7 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS @Override public List getActiveWillConfig() { - return new ArrayList(currentActiveWillConfig); + return new ArrayList<>(currentActiveWillConfig); } @Override @@ -330,17 +330,17 @@ public class TileMasterRitualStone extends TileTicking implements IMasterRitualS //There is probably an easier way to make expanded chat messages if (typeList.size() >= 1) { Object[] translations = new TextComponentTranslation[typeList.size()]; - String constructedString = "%s"; + StringBuilder constructedString = new StringBuilder("%s"); for (int i = 1; i < typeList.size(); i++) { - constructedString = constructedString + ", %s"; + constructedString.append(", %s"); } for (int i = 0; i < typeList.size(); i++) { translations[i] = new TextComponentTranslation("tooltip.bloodmagic.currentBaseType." + typeList.get(i).name.toLowerCase()); } - ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.set", new TextComponentTranslation(constructedString, translations))); + ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.set", new TextComponentTranslation(constructedString.toString(), translations))); } else { ChatUtil.sendNoSpam(player, new TextComponentTranslation("ritual.bloodmagic.willConfig.void")); } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java b/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java index 46ed0004..1076ba17 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileMimic.java @@ -339,9 +339,7 @@ public class TileMimic extends TileInventory implements ITickable { try { _blockMetadata.setInt(tile, replacementMeta); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java b/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java index 3e90cb5d..88ea4e75 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TilePurificationAltar.java @@ -57,7 +57,7 @@ public class TilePurificationAltar extends TileInventory implements ITickable { if (hasPerformed) { if (getWorld().rand.nextInt(4) == 0 && getWorld() instanceof WorldServer) { WorldServer server = (WorldServer) getWorld(); - server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0, new int[0]); + server.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 1, 0.02, 0.03, 0.02, 0); } } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java b/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java index f6909c28..3640b6c7 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/tile/TileSoulForge.java @@ -72,7 +72,7 @@ public class TileSoulForge extends TileInventory implements ITickable, IDemonWil double soulsInGem = getWill(EnumDemonWillType.DEFAULT); - List inputList = new ArrayList(); + List inputList = new ArrayList<>(); for (int i = 0; i < 4; i++) if (!getStackInSlot(i).isEmpty()) diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java index c760c950..250752bd 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileMasterRoutingNode.java @@ -20,10 +20,10 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti public static final int tickRate = 20; private int currentInput; // A list of connections - private TreeMap> connectionMap = new TreeMap>(); - private List generalNodeList = new LinkedList(); - private List outputNodeList = new LinkedList(); - private List inputNodeList = new LinkedList(); + private TreeMap> connectionMap = new TreeMap<>(); + private List generalNodeList = new LinkedList<>(); + private List outputNodeList = new LinkedList<>(); + private List inputNodeList = new LinkedList<>(); public TileMasterRoutingNode() { super(0, "masterRoutingNode"); @@ -43,12 +43,12 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti return; } - Map> outputMap = new TreeMap>(); - Map> outputFluidMap = new TreeMap>(); + Map> outputMap = new TreeMap<>(); + Map> outputFluidMap = new TreeMap<>(); for (BlockPos outputPos : outputNodeList) { TileEntity outputTile = getWorld().getTileEntity(outputPos); - if (this.isConnected(new LinkedList(), outputPos)) { + if (this.isConnected(new LinkedList<>(), outputPos)) { if (outputTile instanceof IOutputItemRoutingNode) { IOutputItemRoutingNode outputNode = (IOutputItemRoutingNode) outputTile; @@ -63,7 +63,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti if (outputMap.containsKey(priority)) { outputMap.get(priority).add(filter); } else { - List filterList = new LinkedList(); + List filterList = new LinkedList<>(); filterList.add(filter); outputMap.put(priority, filterList); } @@ -85,7 +85,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti if (outputMap.containsKey(priority)) { outputFluidMap.get(priority).add(filter); } else { - List filterList = new LinkedList(); + List filterList = new LinkedList<>(); filterList.add(filter); outputFluidMap.put(priority, filterList); } @@ -95,12 +95,12 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti } } - Map> inputMap = new TreeMap>(); - Map> inputFluidMap = new TreeMap>(); + Map> inputMap = new TreeMap<>(); + Map> inputFluidMap = new TreeMap<>(); for (BlockPos inputPos : inputNodeList) { TileEntity inputTile = getWorld().getTileEntity(inputPos); - if (this.isConnected(new LinkedList(), inputPos)) { + if (this.isConnected(new LinkedList<>(), inputPos)) { if (inputTile instanceof IInputItemRoutingNode) { IInputItemRoutingNode inputNode = (IInputItemRoutingNode) inputTile; @@ -115,7 +115,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti if (inputMap.containsKey(priority)) { inputMap.get(priority).add(filter); } else { - List filterList = new LinkedList(); + List filterList = new LinkedList<>(); filterList.add(filter); inputMap.put(priority, filterList); } @@ -137,7 +137,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti if (inputMap.containsKey(priority)) { inputFluidMap.get(priority).add(filter); } else { - List filterList = new LinkedList(); + List filterList = new LinkedList<>(); filterList.add(filter); inputFluidMap.put(priority, filterList); } @@ -315,7 +315,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti if (connectionMap.containsKey(pos1) && !connectionMap.get(pos1).contains(pos2)) { connectionMap.get(pos1).add(pos2); } else { - List list = new LinkedList(); + List list = new LinkedList<>(); list.add(pos2); connectionMap.put(pos1, list); } @@ -323,7 +323,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti if (connectionMap.containsKey(pos2) && !connectionMap.get(pos2).contains(pos1)) { connectionMap.get(pos2).add(pos1); } else { - List list = new LinkedList(); + List list = new LinkedList<>(); list.add(pos1); connectionMap.put(pos2, list); } @@ -360,7 +360,7 @@ public class TileMasterRoutingNode extends TileInventory implements IMasterRouti @Override public List getConnected() { - return new LinkedList(); + return new LinkedList<>(); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java index fbc6c626..66c6b4df 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/routing/TileRoutingNode.java @@ -21,7 +21,7 @@ import java.util.List; public class TileRoutingNode extends TileInventory implements IRoutingNode, IItemRoutingNode, ITickable { private int currentInput; private BlockPos masterPos = BlockPos.ORIGIN; - private List connectionList = new LinkedList(); + private List connectionList = new LinkedList<>(); public TileRoutingNode(int size, String name) { super(size, name); diff --git a/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java b/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java index e11ccb24..b82710f9 100644 --- a/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java +++ b/src/main/java/WayofTime/bloodmagic/util/ChatUtil.java @@ -219,12 +219,7 @@ public class ChatUtil { public static class Handler implements IMessageHandler { @Override public IMessage onMessage(final PacketNoSpamChat message, MessageContext ctx) { - Minecraft.getMinecraft().addScheduledTask(new Runnable() { - @Override - public void run() { - sendNoSpamMessages(message.chatLines); - } - }); + Minecraft.getMinecraft().addScheduledTask(() -> sendNoSpamMessages(message.chatLines)); return null; } } diff --git a/src/main/java/WayofTime/bloodmagic/util/ItemStackWrapper.java b/src/main/java/WayofTime/bloodmagic/util/ItemStackWrapper.java index 0163eea1..d1d648d0 100644 --- a/src/main/java/WayofTime/bloodmagic/util/ItemStackWrapper.java +++ b/src/main/java/WayofTime/bloodmagic/util/ItemStackWrapper.java @@ -96,7 +96,7 @@ public class ItemStackWrapper { } public static List toWrapperList(List itemStackList) { - List wrapperList = new ArrayList(); + List wrapperList = new ArrayList<>(); for (ItemStack stack : itemStackList) wrapperList.add(ItemStackWrapper.getHolder(stack)); @@ -104,7 +104,7 @@ public class ItemStackWrapper { } public static List toStackList(List wrapperList) { - List stackList = new ArrayList(); + List stackList = new ArrayList<>(); for (ItemStackWrapper wrapper : wrapperList) stackList.add(wrapper.toStack()); diff --git a/src/main/java/WayofTime/bloodmagic/util/Utils.java b/src/main/java/WayofTime/bloodmagic/util/Utils.java index 88c989b8..417eddad 100644 --- a/src/main/java/WayofTime/bloodmagic/util/Utils.java +++ b/src/main/java/WayofTime/bloodmagic/util/Utils.java @@ -231,9 +231,7 @@ public class Utils { public static boolean isInteger(String integer) { try { Integer.parseInt(integer); - } catch (NumberFormatException e) { - return false; - } catch (NullPointerException e) { + } catch (NumberFormatException | NullPointerException e) { return false; } // only got here if we didn't return false @@ -365,7 +363,7 @@ public class Utils { public static float applyArmor(EntityLivingBase entity, ItemStack[] inventory, DamageSource source, double damage) { damage *= 25; - ArrayList dmgVals = new ArrayList(); + ArrayList dmgVals = new ArrayList<>(); for (int x = 0; x < inventory.length; x++) { ItemStack stack = inventory[x]; if (stack.isEmpty()) { diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java index f99d4ec6..e1025a32 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/ClientHandler.java @@ -55,7 +55,7 @@ import java.util.*; public class ClientHandler { // Quick toggle for error suppression. Set to false if you wish to hide model errors. public static final boolean SUPPRESS_ASSET_ERRORS = true; - public static final List hudElements = new ArrayList(); + public static final List hudElements = new ArrayList<>(); public static TextureAtlasSprite ritualStoneBlank; public static TextureAtlasSprite ritualStoneWater; public static TextureAtlasSprite ritualStoneFire; @@ -191,13 +191,13 @@ public class ClientHandler { Set missingVariants = ReflectionHelper.getPrivateValue(ModelLoader.class, event.getModelLoader(), "missingVariants"); // Collect all Blood Magic model errors - List errored = new ArrayList(); + List errored = new ArrayList<>(); for (ResourceLocation modelError : modelErrors.keySet()) if (modelError.getResourceDomain().equalsIgnoreCase(BloodMagic.MODID)) errored.add(modelError); // Collect all Blood Magic variant errors - List missing = new ArrayList(); + List missing = new ArrayList<>(); for (ModelResourceLocation missingVariant : missingVariants) if (missingVariant.getResourceDomain().equalsIgnoreCase(BloodMagic.MODID)) missing.add(missingVariant); @@ -228,7 +228,7 @@ public class ClientHandler { String mc = "minecraft"; String format = "textures/%s.png"; - Set toRemove = new HashSet(); + Set toRemove = new HashSet<>(); // Find our missing textures and mark them for removal. Cannot directly remove as it would cause a CME if (missingTextures.containsKey(mc)) { diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/CraftingHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/CraftingHandler.java index a859d993..1eafcbe6 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/CraftingHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/CraftingHandler.java @@ -127,7 +127,7 @@ public class CraftingHandler { if (rightUpgrade != null) { String key = ItemHelper.LivingUpgrades.getKey(event.getRight()); ItemStack outputStack = event.getLeft().copy(); - List keyList = new ArrayList(); + List keyList = new ArrayList<>(); keyList.add(key); if (((IUpgradeTrainer) event.getLeft().getItem()).setTrainedUpgrades(outputStack, keyList)) { event.setCost(1); diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java index cd8bebf3..8ba5b079 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/GenericHandler.java @@ -34,7 +34,6 @@ import WayofTime.bloodmagic.potion.BMPotionUtils; import WayofTime.bloodmagic.util.ChatUtil; import WayofTime.bloodmagic.util.Utils; import WayofTime.bloodmagic.util.helper.*; -import com.google.common.base.Strings; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.enchantment.EnchantmentHelper; @@ -54,7 +53,6 @@ import net.minecraft.init.MobEffects; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumHand; import net.minecraft.util.EnumParticleTypes; @@ -74,7 +72,6 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerPickupXpEvent; import net.minecraftforge.event.world.ExplosionEvent; import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.eventhandler.Event.Result; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -85,10 +82,10 @@ import java.util.*; @Mod.EventBusSubscriber(modid = BloodMagic.MODID) public class GenericHandler { - public static Map bounceMap = new HashMap(); - public static Map filledHandMap = new HashMap(); - private static Map targetTaskMap = new HashMap(); - private static Map attackTaskMap = new HashMap(); + public static Map bounceMap = new HashMap<>(); + public static Map filledHandMap = new HashMap<>(); + private static Map targetTaskMap = new HashMap<>(); + private static Map attackTaskMap = new HashMap<>(); @SubscribeEvent public static void onEntityFall(LivingFallEvent event) { @@ -218,7 +215,7 @@ public class GenericHandler { EntityAnimal animal = (EntityAnimal) event.getEntityLiving(); if (animal.isPotionActive(RegistrarBloodMagic.SACRIFICIAL_LAMB)) { if (!targetTaskMap.containsKey(animal)) { - EntityAITarget task = new EntityAINearestAttackableTarget(animal, EntityMob.class, false); + EntityAITarget task = new EntityAINearestAttackableTarget<>(animal, EntityMob.class, false); EntityAIBase attackTask = new EntityAIAttackMelee(animal, 1.0D, false); animal.targetTasks.addTask(1, task); animal.tasks.addTask(1, attackTask); diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java index ce76a8d0..4b735090 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/event/WillHandler.java @@ -37,7 +37,7 @@ import java.util.concurrent.CopyOnWriteArrayList; @Mod.EventBusSubscriber(modid = BloodMagic.MODID) public class WillHandler { - private static final HashMap SERVER_TICKS = new HashMap(); + private static final HashMap SERVER_TICKS = new HashMap<>(); // Adds Will to player @SubscribeEvent diff --git a/src/main/java/WayofTime/bloodmagic/util/helper/NetworkHelper.java b/src/main/java/WayofTime/bloodmagic/util/helper/NetworkHelper.java index 1b3a4bda..279498e4 100644 --- a/src/main/java/WayofTime/bloodmagic/util/helper/NetworkHelper.java +++ b/src/main/java/WayofTime/bloodmagic/util/helper/NetworkHelper.java @@ -2,14 +2,12 @@ package WayofTime.bloodmagic.util.helper; import WayofTime.bloodmagic.core.data.Binding; import WayofTime.bloodmagic.iface.IBindable; -import WayofTime.bloodmagic.util.Constants; import WayofTime.bloodmagic.event.SoulNetworkEvent; import WayofTime.bloodmagic.orb.BloodOrb; import WayofTime.bloodmagic.orb.IBloodOrb; import WayofTime.bloodmagic.core.registry.OrbRegistry; import WayofTime.bloodmagic.core.data.BMWorldSavedData; import WayofTime.bloodmagic.core.data.SoulNetwork; -import com.google.common.base.Strings; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; diff --git a/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java b/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java index c79afba7..e98cccfb 100644 --- a/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java +++ b/src/main/java/WayofTime/bloodmagic/util/helper/NumeralHelper.java @@ -4,7 +4,7 @@ import java.util.TreeMap; public class NumeralHelper { - private static final TreeMap romanNumerals = new TreeMap(); + private static final TreeMap romanNumerals = new TreeMap<>(); static { romanNumerals.put(1000, "M"); diff --git a/src/main/java/WayofTime/bloodmagic/util/helper/TextHelper.java b/src/main/java/WayofTime/bloodmagic/util/helper/TextHelper.java index 42b3a443..8b9c3e35 100644 --- a/src/main/java/WayofTime/bloodmagic/util/helper/TextHelper.java +++ b/src/main/java/WayofTime/bloodmagic/util/helper/TextHelper.java @@ -36,7 +36,7 @@ public class TextHelper { } public static ArrayList localizeAll(List input) { - ArrayList ret = new ArrayList(input.size()); + ArrayList ret = new ArrayList<>(input.size()); for (int i = 0; i < input.size(); i++) ret.add(i, localize(input.get(i))); @@ -44,7 +44,7 @@ public class TextHelper { } public static ArrayList localizeAllEffect(List input) { - ArrayList ret = new ArrayList(input.size()); + ArrayList ret = new ArrayList<>(input.size()); for (int i = 0; i < input.size(); i++) ret.add(i, localizeEffect(input.get(i)));