Teleposers and refractoring
This commit is contained in:
parent
1b9f72b494
commit
a8a0ae6e8b
145 changed files with 594 additions and 162 deletions
|
@ -9,7 +9,6 @@ import net.minecraftforge.fml.common.registry.GameData;
|
|||
@EqualsAndHashCode
|
||||
public class BlockStack
|
||||
{
|
||||
|
||||
private final Block block;
|
||||
private final int meta;
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
|||
|
||||
public class BloodMagicAPI
|
||||
{
|
||||
|
||||
public static final String ORB = "ItemBloodOrb";
|
||||
public static final String SCRIBE = "ItemInscriptionTool";
|
||||
|
||||
|
|
|
@ -6,10 +6,8 @@ import java.util.Locale;
|
|||
|
||||
public class Constants
|
||||
{
|
||||
|
||||
public static class NBT
|
||||
{
|
||||
|
||||
public static final String OWNER_UUID = "ownerUUID";
|
||||
public static final String USES = "uses";
|
||||
public static final String UNUSABLE = "unusable";
|
||||
|
@ -62,11 +60,12 @@ public class Constants
|
|||
public static final String TICKS_REMAINING = "ticksRemaining";
|
||||
public static final String CONTAINED_BLOCK_NAME = "containedBlockName";
|
||||
public static final String CONTAINED_BLOCK_META = "containedBlockMeta";
|
||||
|
||||
public static final String PREVIOUS_INPUT = "previousInput";
|
||||
}
|
||||
|
||||
public static class Mod
|
||||
{
|
||||
|
||||
public static final String MODID = "BloodMagic";
|
||||
public static final String DOMAIN = MODID.toLowerCase(Locale.ENGLISH) + ":";
|
||||
public static final String NAME = "Blood Magic: Alchemical Wizardry";
|
||||
|
@ -74,6 +73,11 @@ public class Constants
|
|||
public static final String DEPEND = "";
|
||||
}
|
||||
|
||||
public static final class Gui
|
||||
{
|
||||
public static final int TELEPOSER_GUI = 0;
|
||||
}
|
||||
|
||||
public static class Compat
|
||||
{
|
||||
public static final String JEI_CATEGORY_ALTAR = Mod.MODID + ":altar";
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraft.util.IChatComponent;
|
|||
|
||||
public class DamageSourceBloodMagic extends DamageSource
|
||||
{
|
||||
|
||||
public DamageSourceBloodMagic()
|
||||
{
|
||||
super("bloodMagic");
|
||||
|
|
|
@ -12,7 +12,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
@EqualsAndHashCode
|
||||
public class ItemStackWrapper
|
||||
{
|
||||
|
||||
public final Item item;
|
||||
public final int stackSize;
|
||||
public final int meta;
|
||||
|
|
|
@ -4,7 +4,5 @@ import net.minecraft.tileentity.TileEntity;
|
|||
|
||||
public abstract class AlchemyArrayEffect
|
||||
{
|
||||
|
||||
public abstract boolean update(TileEntity tile, int ticksActive);
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraft.util.BlockPos;
|
|||
|
||||
public class AlchemyArrayEffectCrafting extends AlchemyArrayEffect
|
||||
{
|
||||
|
||||
@Getter
|
||||
public final ItemStack outputStack;
|
||||
public int tickLimit;
|
||||
|
|
|
@ -11,7 +11,6 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
public class AlchemyCircleRenderer
|
||||
{
|
||||
|
||||
public float offsetFromFace = -0.9f;
|
||||
public final ResourceLocation arrayResource;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.util.BlockPos;
|
|||
@Getter
|
||||
public class AltarComponent
|
||||
{
|
||||
|
||||
private BlockPos offset;
|
||||
private boolean upgradeSlot;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
public class AltarUpgrade
|
||||
{
|
||||
|
||||
private int speedCount;
|
||||
private int efficiencyCount;
|
||||
private int sacrificeCount;
|
||||
|
|
|
@ -2,6 +2,5 @@ package WayofTime.bloodmagic.api.altar;
|
|||
|
||||
public enum EnumAltarComponent
|
||||
{
|
||||
|
||||
GLOWSTONE, BLOODSTONE, BEACON, BLOODRUNE, CRYSTAL, NOTAIR
|
||||
}
|
||||
|
|
|
@ -2,6 +2,5 @@ package WayofTime.bloodmagic.api.altar;
|
|||
|
||||
public interface IAltarComponent
|
||||
{
|
||||
|
||||
EnumAltarComponent getType(int meta);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.bloodmagic.api.altar;
|
|||
|
||||
public interface IBloodAltar
|
||||
{
|
||||
|
||||
int getCapacity();
|
||||
|
||||
int getCurrentBlood();
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.world.World;
|
|||
|
||||
public abstract class CompressionHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* Called to look at the inventory and syphons the required stack. Returns
|
||||
* resultant stack if successful, and null if not.
|
||||
|
|
|
@ -14,7 +14,6 @@ import java.util.Map;
|
|||
*/
|
||||
public class CompressionRegistry
|
||||
{
|
||||
|
||||
public static List<CompressionHandler> compressionRegistry = new ArrayList<CompressionHandler>();
|
||||
public static Map<ItemStack, Integer> thresholdMap = new HashMap<ItemStack, Integer>();
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
|||
|
||||
public class AddToNetworkEvent extends Event
|
||||
{
|
||||
|
||||
public String ownerNetwork;
|
||||
public int addedAmount;
|
||||
public int maximum;
|
||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
|||
|
||||
public class BoundToolEvent extends Event
|
||||
{
|
||||
|
||||
public EntityPlayer player;
|
||||
|
||||
public BoundToolEvent(EntityPlayer player)
|
||||
|
|
|
@ -8,7 +8,6 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
|||
@Cancelable
|
||||
public class ItemBindEvent extends Event
|
||||
{
|
||||
|
||||
public final EntityPlayer player;
|
||||
public String key;
|
||||
public ItemStack itemStack;
|
||||
|
|
|
@ -14,7 +14,6 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
|||
|
||||
public class RitualEvent extends Event
|
||||
{
|
||||
|
||||
public final IMasterRitualStone mrs;
|
||||
public final String ownerName;
|
||||
public final Ritual ritual;
|
||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraftforge.fml.common.eventhandler.Event;
|
|||
|
||||
public class SoulNetworkEvent extends Event
|
||||
{
|
||||
|
||||
public final String ownerName;
|
||||
public int syphon;
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package WayofTime.bloodmagic.api.event;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
||||
/** Fired when a teleposer attempts to transpose two blocks. Use this to perform special cleanup or compensation,
|
||||
or cancel it entirely to prevent the transposition. */
|
||||
@Cancelable
|
||||
public class TeleposeEvent extends Event
|
||||
{
|
||||
public final World initalWorld;
|
||||
public final BlockPos initialBlockPos;
|
||||
|
||||
public final Block initialBlock;
|
||||
public final int initialMetadata;
|
||||
|
||||
public final World finalWorld;
|
||||
public final BlockPos finalBlockPos;
|
||||
|
||||
public final Block finalBlock;
|
||||
public final int finalMetadata;
|
||||
|
||||
public TeleposeEvent(World initialWorld, BlockPos initialBlockPos, Block initialBlock, int initialMetadata, World finalWorld, BlockPos finalBlockPos, Block finalBlock, int finalMetadata)
|
||||
{
|
||||
this.initalWorld = initialWorld;
|
||||
this.initialBlockPos = initialBlockPos;
|
||||
this.initialBlock = initialBlock;
|
||||
this.initialMetadata = initialMetadata;
|
||||
|
||||
this.finalWorld = finalWorld;
|
||||
this.finalBlockPos = finalBlockPos;
|
||||
this.finalBlock = finalBlock;
|
||||
this.finalMetadata = finalMetadata;
|
||||
}
|
||||
|
||||
public TileEntity getInitialTile()
|
||||
{
|
||||
return initalWorld.getTileEntity(initialBlockPos);
|
||||
}
|
||||
|
||||
public TileEntity getFinalTile()
|
||||
{
|
||||
return finalWorld.getTileEntity(finalBlockPos);
|
||||
}
|
||||
}
|
|
@ -8,7 +8,6 @@ import net.minecraft.item.ItemStack;
|
|||
*/
|
||||
public interface IBindable
|
||||
{
|
||||
|
||||
/**
|
||||
* Called when the player attempts to bind the item.
|
||||
*
|
||||
|
|
|
@ -11,7 +11,6 @@ import com.google.common.collect.Multimap;
|
|||
|
||||
public abstract class LivingArmourUpgrade
|
||||
{
|
||||
|
||||
/**
|
||||
* Upgrade level 0 is the first upgrade. Upgrade goes from 0 to getMaxTier()
|
||||
* - 1.
|
||||
|
|
|
@ -7,7 +7,6 @@ import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
|||
|
||||
public abstract class StatTracker
|
||||
{
|
||||
|
||||
private boolean isDirty = false;
|
||||
|
||||
public abstract String getUniqueIdentifier();
|
||||
|
|
|
@ -13,7 +13,6 @@ import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
|||
*/
|
||||
public class BloodOrb
|
||||
{
|
||||
|
||||
private String name;
|
||||
private int tier;
|
||||
private int capacity;
|
||||
|
|
|
@ -2,7 +2,6 @@ package WayofTime.bloodmagic.api.orb;
|
|||
|
||||
public interface IBloodOrb
|
||||
{
|
||||
|
||||
BloodOrb getOrb(int meta);
|
||||
|
||||
int getMaxEssence(int meta);
|
||||
|
|
|
@ -19,7 +19,6 @@ import com.google.common.collect.HashBiMap;
|
|||
|
||||
public class AlchemyArrayRecipeRegistry
|
||||
{
|
||||
|
||||
public static final AlchemyCircleRenderer defaultRenderer = new AlchemyCircleRenderer(new ResourceLocation("bloodmagic", "textures/models/AlchemyArrays/SightSigil.png"));
|
||||
|
||||
@Getter
|
||||
|
|
|
@ -12,7 +12,6 @@ import java.util.Map;
|
|||
|
||||
public class ImperfectRitualRegistry
|
||||
{
|
||||
|
||||
public static final Map<ImperfectRitual, Boolean> enabledRituals = new HashMap<ImperfectRitual, Boolean>();
|
||||
private static final BiMap<String, ImperfectRitual> registry = HashBiMap.create();
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ import java.util.List;
|
|||
*/
|
||||
public class OrbRegistry
|
||||
{
|
||||
|
||||
@Getter
|
||||
private static List<BloodOrb> orbs = new ArrayList<BloodOrb>();
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@ import com.google.common.collect.HashBiMap;
|
|||
|
||||
public class RitualRegistry
|
||||
{
|
||||
|
||||
public static final Map<Ritual, Boolean> enabledRituals = new HashMap<Ritual, Boolean>();
|
||||
private static final BiMap<String, Ritual> registry = HashBiMap.create();
|
||||
/**
|
||||
|
|
|
@ -8,7 +8,6 @@ import java.util.Locale;
|
|||
|
||||
public enum EnumRuneType implements IStringSerializable
|
||||
{
|
||||
|
||||
BLANK, WATER, FIRE, EARTH, AIR, DUSK, DAWN;
|
||||
|
||||
public static EnumRuneType byMetadata(int meta)
|
||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.world.World;
|
|||
*/
|
||||
public interface IMasterRitualStone
|
||||
{
|
||||
|
||||
String getOwner();
|
||||
|
||||
boolean activateRitual(ItemStack activationCrystal, EntityPlayer activator, Ritual ritual);
|
||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraft.world.World;
|
|||
*/
|
||||
public interface IRitualStone
|
||||
{
|
||||
|
||||
boolean isRuneType(World world, BlockPos pos, EnumRuneType runeType);
|
||||
|
||||
interface Tile
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.world.World;
|
|||
@ToString
|
||||
public abstract class Ritual
|
||||
{
|
||||
|
||||
public final ArrayList<RitualComponent> ritualComponents = new ArrayList<RitualComponent>();
|
||||
private final String name;
|
||||
private final int crystalLevel;
|
||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.util.EnumFacing;
|
|||
@RequiredArgsConstructor
|
||||
public class RitualComponent
|
||||
{
|
||||
|
||||
private final BlockPos offset;
|
||||
private final EnumRuneType runeType;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
public abstract class RitualRenderer
|
||||
{
|
||||
|
||||
public abstract void renderAt(IMasterRitualStone masterRitualStone, double x, double y, double z);
|
||||
|
||||
protected void bindTexture(ResourceLocation resourceLocation)
|
||||
|
|
|
@ -12,7 +12,6 @@ import java.util.UUID;
|
|||
|
||||
public class BindableHelper
|
||||
{
|
||||
|
||||
/**
|
||||
* Bind an item to a player. Handles checking if the player was an
|
||||
* instanceof {@link net.minecraftforge.common.util.FakePlayer} or other
|
||||
|
|
|
@ -6,7 +6,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
|
||||
public class IncenseHelper
|
||||
{
|
||||
|
||||
public static float getCurrentIncense(EntityPlayer player)
|
||||
{
|
||||
NBTTagCompound data = player.getEntityData();
|
||||
|
|
|
@ -6,7 +6,6 @@ import org.apache.logging.log4j.Logger;
|
|||
|
||||
public class LogHelper
|
||||
{
|
||||
|
||||
private Logger logger;
|
||||
|
||||
public LogHelper(String logger)
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
|
||||
public class NBTHelper
|
||||
{
|
||||
|
||||
public static ItemStack checkNBT(ItemStack stack)
|
||||
{
|
||||
if (stack.getTagCompound() == null)
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.util.UUID;
|
|||
|
||||
public class NetworkHelper
|
||||
{
|
||||
|
||||
// Get
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,6 @@ import java.util.regex.Pattern;
|
|||
|
||||
public class PlayerHelper
|
||||
{
|
||||
|
||||
private static final Pattern FAKE_PLAYER_PATTERN = Pattern.compile("^(?:\\[.*\\])|(?:ComputerCraft)$");
|
||||
|
||||
public static String getUsernameFromPlayer(EntityPlayer player)
|
||||
|
|
|
@ -21,7 +21,6 @@ import WayofTime.bloodmagic.api.ritual.imperfect.ImperfectRitual;
|
|||
|
||||
public class RitualHelper
|
||||
{
|
||||
|
||||
public static boolean canCrystalActivate(Ritual ritual, int crystalLevel)
|
||||
{
|
||||
return ritual.getCrystalLevel() <= crystalLevel && RitualRegistry.ritualEnabled(ritual);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue