A whole lot of formatting cleanup
Also changes NBTHolder to a standard Constants class with subclasses for each category
This commit is contained in:
parent
f9802900db
commit
34dee6447b
74 changed files with 861 additions and 662 deletions
|
@ -1,10 +1,10 @@
|
|||
package WayofTime.bloodmagic.item.sigil;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.NBTHolder;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.iface.ISigil;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import WayofTime.bloodmagic.api.util.helper.NBTHelper;
|
||||
import WayofTime.bloodmagic.item.ItemBindable;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -20,14 +20,14 @@ import java.util.List;
|
|||
@Getter
|
||||
public class ItemSigilBase extends ItemBindable implements ISigil {
|
||||
|
||||
protected final String tooltipBase;
|
||||
private final String name;
|
||||
private boolean toggleable;
|
||||
protected final String tooltipBase;
|
||||
|
||||
public ItemSigilBase(String name, int energyUsed) {
|
||||
super();
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".sigil." + name);
|
||||
setUnlocalizedName(Constants.Mod.MODID + ".sigil." + name);
|
||||
setEnergyUsed(energyUsed);
|
||||
|
||||
this.name = name;
|
||||
|
@ -68,15 +68,15 @@ public class ItemSigilBase extends ItemBindable implements ISigil {
|
|||
}
|
||||
|
||||
public boolean isUnusable(ItemStack stack) {
|
||||
NBTHolder.checkNBT(stack);
|
||||
NBTHelper.checkNBT(stack);
|
||||
|
||||
return stack.getTagCompound().getBoolean(NBTHolder.NBT_UNUSABLE);
|
||||
return stack.getTagCompound().getBoolean(Constants.NBT.UNUSABLE);
|
||||
}
|
||||
|
||||
public ItemStack setUnusable(ItemStack stack, boolean unusable) {
|
||||
NBTHolder.checkNBT(stack);
|
||||
NBTHelper.checkNBT(stack);
|
||||
|
||||
stack.getTagCompound().setBoolean(NBTHolder.NBT_UNUSABLE, unusable);
|
||||
stack.getTagCompound().setBoolean(Constants.NBT.UNUSABLE, unusable);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,7 @@ public class ItemSigilLava extends ItemSigilBase {
|
|||
this.tryPlaceLava(world, blockpos1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
@ -114,11 +113,9 @@ public class ItemSigilLava extends ItemSigilBase {
|
|||
public boolean canPlaceLava(World world, BlockPos blockPos) {
|
||||
if (!world.isAirBlock(blockPos) && world.getBlockState(blockPos).getBlock().getMaterial().isSolid()) {
|
||||
return false;
|
||||
}
|
||||
else if ((world.getBlockState(blockPos).getBlock() == Blocks.lava || world.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0) {
|
||||
} else if ((world.getBlockState(blockPos).getBlock() == Blocks.lava || world.getBlockState(blockPos).getBlock() == Blocks.flowing_lava) && world.getBlockState(blockPos).getBlock().getMetaFromState(world.getBlockState(blockPos)) == 0) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
world.setBlockState(blockPos, Blocks.lava.getBlockState().getBaseState());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -47,8 +47,7 @@ public class ItemSigilVoid extends ItemSigilBase {
|
|||
return stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,8 +51,7 @@ public class ItemSigilWater extends ItemSigilBase {
|
|||
this.tryPlaceWater(world, blockpos1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
@ -123,8 +122,7 @@ public class ItemSigilWater extends ItemSigilBase {
|
|||
|
||||
if (!worldIn.isAirBlock(pos) && !flag) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (worldIn.provider.doesWaterVaporize()) {
|
||||
int i = pos.getX();
|
||||
int j = pos.getY();
|
||||
|
@ -134,8 +132,7 @@ public class ItemSigilWater extends ItemSigilBase {
|
|||
for (int l = 0; l < 8; ++l) {
|
||||
worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double) i + Math.random(), (double) j + Math.random(), (double) k + Math.random(), 0.0D, 0.0D, 0.0D, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (!worldIn.isRemote && flag && !material.isLiquid()) {
|
||||
worldIn.destroyBlock(pos, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue