Some altar cleanup and renaming
This commit is contained in:
parent
fefeaf26af
commit
eada60f436
21 changed files with 253 additions and 254 deletions
|
@ -29,7 +29,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.List;
|
||||
|
||||
public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantProvider {
|
||||
private EnumAltarTier tierToBuild = EnumAltarTier.ONE;
|
||||
private AltarTier tierToBuild = AltarTier.ONE;
|
||||
|
||||
public ItemAltarMaker() {
|
||||
super();
|
||||
|
@ -61,12 +61,12 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
|
|||
stack = NBTHelper.checkNBT(stack);
|
||||
|
||||
if (player.isSneaking()) {
|
||||
if (stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) >= EnumAltarTier.MAXTIERS - 1)
|
||||
if (stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) >= AltarTier.MAXTIERS - 1)
|
||||
stack.getTagCompound().setInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER, 0);
|
||||
else
|
||||
stack.getTagCompound().setInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER, stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) + 1);
|
||||
|
||||
setTierToBuild(EnumAltarTier.values()[stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER)]);
|
||||
setTierToBuild(AltarTier.values()[stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER)]);
|
||||
ChatUtil.sendNoSpam(player, TextHelper.localizeEffect("chat.bloodmagic.altarMaker.setTier", NumeralHelper.toRoman(stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) + 1)));
|
||||
return super.onItemRightClick(world, player, hand);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
|
|||
variants.put(0, "type=altarmaker"); // FIXME
|
||||
}
|
||||
|
||||
public void setTierToBuild(EnumAltarTier tierToBuild) {
|
||||
public void setTierToBuild(AltarTier tierToBuild) {
|
||||
this.tierToBuild = tierToBuild;
|
||||
}
|
||||
|
||||
|
@ -99,12 +99,12 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
|
|||
if (world.isRemote)
|
||||
return;
|
||||
|
||||
if (tierToBuild == EnumAltarTier.ONE)
|
||||
if (tierToBuild == AltarTier.ONE)
|
||||
return;
|
||||
|
||||
for (AltarComponent altarComponent : tierToBuild.getAltarComponents()) {
|
||||
BlockPos componentPos = pos.add(altarComponent.getOffset());
|
||||
if (altarComponent.getComponent() == EnumAltarComponent.NOTAIR) {
|
||||
if (altarComponent.getComponent() == ComponentType.NOTAIR) {
|
||||
world.setBlockState(componentPos, Blocks.STONEBRICK.getDefaultState());
|
||||
continue;
|
||||
}
|
||||
|
@ -123,9 +123,9 @@ public class ItemAltarMaker extends Item implements IAltarManipulator, IVariantP
|
|||
RayTraceResult rayTrace = rayTrace(world, player, false);
|
||||
BlockPos pos = rayTrace.getBlockPos();
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
EnumAltarTier altarTier = BloodAltar.getAltarTier(world, pos);
|
||||
AltarTier altarTier = AltarUtil.getTier(world, pos);
|
||||
|
||||
if (altarTier.equals(EnumAltarTier.ONE))
|
||||
if (altarTier.equals(AltarTier.ONE))
|
||||
return "" + altarTier.toInt();
|
||||
else {
|
||||
for (AltarComponent altarComponent : altarTier.getAltarComponents()) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package WayofTime.bloodmagic.item;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.altar.EnumAltarTier;
|
||||
import WayofTime.bloodmagic.altar.AltarTier;
|
||||
import WayofTime.bloodmagic.altar.IAltarManipulator;
|
||||
import WayofTime.bloodmagic.client.IVariantProvider;
|
||||
import WayofTime.bloodmagic.iface.IDocumentedBlock;
|
||||
|
@ -34,7 +34,7 @@ import javax.annotation.Nonnull;
|
|||
import java.util.List;
|
||||
|
||||
public class ItemSanguineBook extends Item implements IVariantProvider, IAltarManipulator {
|
||||
private EnumAltarTier currentDisplayedTier = EnumAltarTier.ONE;
|
||||
private AltarTier currentDisplayedTier = AltarTier.ONE;
|
||||
|
||||
public ItemSanguineBook() {
|
||||
setUnlocalizedName(BloodMagic.MODID + ".sanguineBook");
|
||||
|
@ -73,12 +73,12 @@ public class ItemSanguineBook extends Item implements IVariantProvider, IAltarMa
|
|||
|
||||
RayTraceResult rayTrace = rayTrace(world, player, false);
|
||||
if (rayTrace == null || rayTrace.typeOfHit == RayTraceResult.Type.MISS || rayTrace.typeOfHit == RayTraceResult.Type.ENTITY) {
|
||||
if (stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) >= EnumAltarTier.MAXTIERS - 1)
|
||||
if (stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) >= AltarTier.MAXTIERS - 1)
|
||||
stack.getTagCompound().setInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER, 0);
|
||||
else
|
||||
stack.getTagCompound().setInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER, stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) + 1);
|
||||
|
||||
currentDisplayedTier = EnumAltarTier.values()[stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER)];
|
||||
currentDisplayedTier = AltarTier.values()[stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER)];
|
||||
ChatUtil.sendNoSpam(player, TextHelper.localizeEffect("chat.bloodmagic.altarMaker.setTier", NumeralHelper.toRoman(stack.getTagCompound().getInteger(Constants.NBT.ALTARMAKER_CURRENT_TIER) + 1)));
|
||||
|
||||
return super.onItemRightClick(world, player, hand);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue