Cleaned up a lot of different inspections

This commit is contained in:
Nicholas Ignoffo 2018-03-01 19:27:38 -08:00
parent 0dd0854bd9
commit 70d98455b7
207 changed files with 603 additions and 731 deletions

View file

@ -89,8 +89,8 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=altarmaker"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=altarmaker"));
return ret;
}

View file

@ -62,8 +62,8 @@ public class ItemArcaneAshes extends Item implements IVariantProvider {
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=arcaneashes"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=arcaneashes"));
return ret;
}
}

View file

@ -131,7 +131,7 @@ public class ItemBoundAxe extends ItemBoundTool implements IMeshProvider {
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
ret.add("active=true");
ret.add("active=false");
return ret;

View file

@ -144,7 +144,7 @@ public class ItemBoundPickaxe extends ItemBoundTool implements IMeshProvider {
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
ret.add("active=true");
ret.add("active=false");
return ret;

View file

@ -130,7 +130,7 @@ public class ItemBoundShovel extends ItemBoundTool implements IMeshProvider {
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
ret.add("active=true");
ret.add("active=false");
return ret;

View file

@ -118,7 +118,7 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
@Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot equipmentSlot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
Multimap<String, AttributeModifier> 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<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
ret.add("active=true");
ret.add("active=false");
return ret;

View file

@ -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<ItemStack, Boolean> heldDownMap = new HashMap<ItemStack, Boolean>();
public Map<ItemStack, Integer> heldDownCountMap = new HashMap<ItemStack, Integer>();
public Map<ItemStack, Boolean> heldDownMap = new HashMap<>();
public Map<ItemStack, Integer> heldDownCountMap = new HashMap<>();
public ItemBoundTool(String name, float damage, Set<Block> effectiveBlocks) {
super(damage, 1, RegistrarBloodMagicItems.BOUND_TOOL_MATERIAL, effectiveBlocks);

View file

@ -33,8 +33,8 @@ public class ItemDemonWillGauge extends Item implements IVariantProvider, IDemon
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=willgauge"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=willgauge"));
return ret;
}

View file

@ -60,13 +60,13 @@ public class ItemExperienceBook extends Item implements IVariantProvider {
giveOneLevelExpToPlayer(stack, player);
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=experiencetome"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=experiencetome"));
return ret;
}

View file

@ -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;

View file

@ -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<ItemStack>(EnumActionResult.PASS, stack);
return new ActionResult<>(EnumActionResult.PASS, stack);
}
player.setActiveHand(hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
@Override

View file

@ -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<ItemStack>(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<ItemStack>(EnumActionResult.SUCCESS, stack);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
return new ActionResult<ItemStack>(EnumActionResult.PASS, stack);
return new ActionResult<>(EnumActionResult.PASS, stack);
}
@Override
@ -333,10 +333,10 @@ public class ItemRitualDiviner extends Item implements IVariantProvider {
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=basic"));
ret.add(new ImmutablePair<Integer, String>(1, "type=dusk"));
ret.add(new ImmutablePair<Integer, String>(2, "type=dawn"));
List<Pair<Integer, String>> 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);
}
}
}

View file

@ -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<ItemStack>(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<ItemStack>(EnumActionResult.SUCCESS, stack);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
return new ActionResult<ItemStack>(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<EnumDemonWillType> typeList = new ArrayList<EnumDemonWillType>();
List<EnumDemonWillType> typeList = new ArrayList<>();
NonNullList<ItemStack> 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<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=normal"));
return ret;
}
}

View file

@ -77,7 +77,7 @@ public class ItemSacrificialDagger extends ItemEnum<ItemSacrificialDagger.Dagger
if (this.canUseForSacrifice(stack)) {
player.setActiveHand(hand);
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
int lpAdded = ConfigHandler.values.sacrificialDaggerConversion * 2;
@ -166,7 +166,7 @@ public class ItemSacrificialDagger extends ItemEnum<ItemSacrificialDagger.Dagger
@Override
public List<String> getVariants() {
List<String> variants = new ArrayList<String>();
List<String> variants = new ArrayList<>();
variants.add("type=normal");
variants.add("type=creative");
variants.add("type=ceremonial");

View file

@ -97,8 +97,8 @@ public class ItemUpgradeTome extends Item implements IVariantProvider {
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetome"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=upgradetome"));
return ret;
}

View file

@ -61,7 +61,7 @@ public class ItemUpgradeTrainer extends Item implements IUpgradeTrainer, IVarian
@Override
public List<String> getTrainedUpgrades(ItemStack stack) {
List<String> keyList = new ArrayList<String>();
List<String> 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<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=upgradetrainer"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=upgradetrainer"));
return ret;
}
}

View file

@ -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<UUID, LivingArmour> armourMap = new HashMap<UUID, LivingArmour>();
public static Map<UUID, LivingArmour> armourMap = new HashMap<>();
private static Field _FLAGS = ReflectionHelper.findField(Entity.class, "FLAGS", "field_184240_ax");
private static DataParameter<Byte> FLAGS = null;
@ -283,9 +283,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
if (FLAGS == null) {
try {
FLAGS = (DataParameter<Byte>) _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.<String, AttributeModifier>create();
return HashMultimap.create();
}
@Override
@ -367,7 +365,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
ret.add("armour=head");
ret.add("armour=body");
ret.add("armour=leg");

View file

@ -298,7 +298,7 @@ public class ItemSentientArmour extends ItemArmor implements ISpecialArmor, IMes
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> 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<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
Multimap<String, AttributeModifier> 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));

View file

@ -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;
}
}

View file

@ -77,8 +77,8 @@ public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator, I
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=normal"));
return ret;
}

View file

@ -102,8 +102,8 @@ public class ItemPackSelfSacrifice extends ItemArmor implements IAltarManipulato
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=normal"));
return ret;
}

View file

@ -70,7 +70,7 @@ public class ItemFluidRouterFilter extends Item implements IFluidFilterProvider,
testFilter = new RoutingFluidFilter();
}
List<ItemStack> filteredList = new ArrayList<ItemStack>();
List<ItemStack> 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<ItemStack> filteredList = new ArrayList<ItemStack>();
List<ItemStack> 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<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=exact"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=exact"));
return ret;
}

View file

@ -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<BlockPos>(), 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<BlockPos>(), 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<BlockPos>(), 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<BlockPos>(), 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<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=normal"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=normal"));
return ret;
}

View file

@ -78,7 +78,7 @@ public class ItemRouterFilter extends Item implements IItemFilterProvider, IVari
testFilter = new DefaultItemFilter();
}
List<ItemStack> filteredList = new ArrayList<ItemStack>();
List<ItemStack> 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<ItemStack> filteredList = new ArrayList<ItemStack>();
List<ItemStack> 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<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=exact"));
ret.add(new ImmutablePair<Integer, String>(1, "type=ignorenbt"));
ret.add(new ImmutablePair<Integer, String>(2, "type=moditems"));
ret.add(new ImmutablePair<Integer, String>(3, "type=oredict"));
List<Pair<Integer, String>> 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;
}

View file

@ -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<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(Pair.of(0, "type=normal"));
return ret;
}

View file

@ -12,9 +12,10 @@ import java.util.HashMap;
import java.util.Map;
public class ItemSigilPhantomBridge extends ItemSigilToggleableBase {
private Map<EntityPlayer, Pair<Double, Double>> prevPositionMap = new HashMap<EntityPlayer, Pair<Double, Double>>();
private double expansionFactor = 2;
private int range = 3;
private static final double EXPANSION_FACTOR = 2;
private static final int RANGE = 3;
private Map<EntityPlayer, Pair<Double, Double>> 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.

View file

@ -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<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
ret.add("active=false");
ret.add("active=true");

View file

@ -53,7 +53,7 @@ public class ItemSentientArmourGem extends Item implements IMeshProvider {
ItemSentientArmour.convertPlayerArmour(type, will, player);
}
return new ActionResult<ItemStack>(EnumActionResult.PASS, player.getHeldItem(hand));
return new ActionResult<>(EnumActionResult.PASS, player.getHeldItem(hand));
}
@SideOnly(Side.CLIENT)

View file

@ -308,7 +308,7 @@ public class ItemSentientAxe extends ItemAxe implements IDemonWillWeapon, IMeshP
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> 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<ItemStack> getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) {
List<ItemStack> soulList = new ArrayList<ItemStack>();
List<ItemStack> 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<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
Multimap<String, AttributeModifier> 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));

View file

@ -307,7 +307,7 @@ public class ItemSentientPickaxe extends ItemPickaxe implements IDemonWillWeapon
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> 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<ItemStack> getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) {
List<ItemStack> soulList = new ArrayList<ItemStack>();
List<ItemStack> 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<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
Multimap<String, AttributeModifier> 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));

View file

@ -308,7 +308,7 @@ public class ItemSentientShovel extends ItemSpade implements IDemonWillWeapon, I
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> 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<ItemStack> getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) {
List<ItemStack> soulList = new ArrayList<ItemStack>();
List<ItemStack> 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<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
Multimap<String, AttributeModifier> 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));

View file

@ -283,7 +283,7 @@ public class ItemSentientSword extends ItemSword implements IDemonWillWeapon, IM
@Override
public List<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> 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<ItemStack> getRandomDemonWillDrop(EntityLivingBase killedEntity, EntityLivingBase attackingEntity, ItemStack stack, int looting) {
List<ItemStack> soulList = new ArrayList<ItemStack>();
List<ItemStack> 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<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
Multimap<String, AttributeModifier> 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));

View file

@ -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<ItemStack>(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<String> getVariants() {
List<String> ret = new ArrayList<String>();
List<String> ret = new ArrayList<>();
for (EnumDemonWillType type : EnumDemonWillType.values()) {
ret.add("type=petty_" + type.getName().toLowerCase());
ret.add("type=lesser_" + type.getName().toLowerCase());

View file

@ -48,7 +48,7 @@ public class ItemSoulSnare extends Item implements IVariantProvider {
worldIn.spawnEntity(snare);
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
return new ActionResult<>(EnumActionResult.SUCCESS, stack);
}
@Override
@ -76,8 +76,8 @@ public class ItemSoulSnare extends Item implements IVariantProvider {
@Override
public List<Pair<Integer, String>> getVariants() {
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
ret.add(new ImmutablePair<Integer, String>(0, "type=soulsnare"));
List<Pair<Integer, String>> ret = new ArrayList<>();
ret.add(new ImmutablePair<>(0, "type=soulsnare"));
return ret;
}
}