diff --git a/alfheim/1.7.10-ASJCore-1.5.2.2.jar b/alfheim/1.7.10-ASJCore-1.5.2.2.jar new file mode 100644 index 0000000..69e86ad Binary files /dev/null and b/alfheim/1.7.10-ASJCore-1.5.2.2.jar differ diff --git a/alfheim/Alfheim-63.jar b/alfheim/Alfheim-63.jar new file mode 100644 index 0000000..95ba86b Binary files /dev/null and b/alfheim/Alfheim-63.jar differ diff --git a/build.gradle b/build.gradle index 408732c..6a70631 100644 --- a/build.gradle +++ b/build.gradle @@ -33,16 +33,10 @@ minecraft { replace "@VERSION@", project.version } - dependencies { - compile name: 'Baubles-1.7.10-1.0.1.10-dev' - compile name: 'Thaumcraft-deobf-1.7.10-4.2.3.5' - compile name: 'Forbidden+Magic-1.7.10-0.575' - compile name: 'ThaumicTinkerer-2.5-1.7.10-164' - compile name: 'CraftTweaker-1.7.10-3.0.13-deobf' - compile name: 'witchery-1.7.10-0.24.1' - compile name: '1.7.10_AM2-1.4.0.009' - compile name: 'Botania r1.8-249' + compile fileTree(dir: 'deps', include: '*.jar') + compileOnly files('alfheim/Alfheim-63.jar') + compileOnly files('alfheim/1.7.10-ASJCore-1.5.2.2.jar') } processResources { @@ -74,6 +68,7 @@ task sourcesJar(type: Jar) { from sourceSets.main.allSource } + artifacts { archives devJar archives sourcesJar @@ -85,3 +80,9 @@ jar { attributes 'FMLCorePlugin': 'com.ilya3point999k.thaumicconcilium.core.ThaumicConciliumCore' } } + +gradle.taskGraph.whenReady { graph -> + if (graph.hasTask(":runClient")) { + runClient.args "--username", "Ilya3000" + } +} diff --git a/deps/Baubles-1.7.10-1.0.1.10-dev-sources.jar b/deps/Baubles-1.7.10-1.0.1.10-dev-sources.jar deleted file mode 100644 index 63f2dad..0000000 Binary files a/deps/Baubles-1.7.10-1.0.1.10-dev-sources.jar and /dev/null differ diff --git a/deps/DummyCore1.13.jar b/deps/DummyCore1.13.jar deleted file mode 100644 index 4730f1a..0000000 Binary files a/deps/DummyCore1.13.jar and /dev/null differ diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java deleted file mode 100644 index ddcc3b0..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/AddToNetworkEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; - -@Cancelable -public class AddToNetworkEvent extends Event -{ - public String ownerNetwork; - public int addedAmount; - public int maximum; - - /** - * This event is called whenever the network is added to. If cancelled, no LP will be drained from the source. If result is set to Result.DENY, - * the LP will still be drained but the soul network will not be added to. - * - * @param ownerNetwork Key used for the soul network - * @param addedAmount Amount added - * @param maximum Ceiling that the network can add to - */ - public AddToNetworkEvent(String ownerNetwork, int addedAmount, int maximum) - { - super(); - this.ownerNetwork = ownerNetwork; - this.addedAmount = addedAmount; - this.maximum = maximum; - } - - public String getOwnerNetwork() - { - return this.ownerNetwork; - } - - public int getAddedAmount() - { - return this.addedAmount; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java deleted file mode 100644 index 95e15da..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemBindEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import cpw.mods.fml.common.eventhandler.Cancelable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.eventhandler.Event; - -@Cancelable -public class ItemBindEvent extends Event -{ - public final EntityPlayer player; - public String key; - public ItemStack itemStack; - - public ItemBindEvent(EntityPlayer player, String key, ItemStack itemStack) - { - super(); - this.player = player; - this.key = key; - this.itemStack = itemStack; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java deleted file mode 100644 index 5a81c1d..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemDrainInContainerEvent.java +++ /dev/null @@ -1,15 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.eventhandler.Cancelable; - -@Cancelable -public class ItemDrainInContainerEvent extends SoulNetworkEvent -{ - public ItemStack stack; - public ItemDrainInContainerEvent(ItemStack stack, String ownerNetwork, int drainAmount) - { - super(ownerNetwork, drainAmount); - this.stack = stack; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java deleted file mode 100644 index d75fd7d..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/ItemDrainNetworkEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.eventhandler.Cancelable; - -@Cancelable -public class ItemDrainNetworkEvent extends PlayerDrainNetworkEvent -{ - public final ItemStack itemStack; - public boolean shouldDamage; //If true, will damage regardless of if the network had enough inside it - public float damageAmount; //Amount of damage that would incur if the network could not drain properly - - /** - * Set result to deny the action i.e. damage/drain anyways. Cancelling event prevents action without penalties - * - * @param player Player using the item - * @param ownerNetwork Network that the item is tied to - * @param itemStack Item used - * @param drainAmount Original drain amount - change to alter cost - */ - public ItemDrainNetworkEvent(EntityPlayer player, String ownerNetwork, ItemStack itemStack, int drainAmount) - { - super(player, ownerNetwork, drainAmount); - this.itemStack = itemStack; - this.shouldDamage = false; - this.damageAmount = (float)(drainAmount) / 100.0f; - } -} \ No newline at end of file diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java deleted file mode 100644 index f752255..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/PlayerAddToNetworkEvent.java +++ /dev/null @@ -1,18 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.eventhandler.Cancelable; - -@Cancelable -public class PlayerAddToNetworkEvent extends AddToNetworkEvent -{ - public final EntityPlayer player; - public ItemStack itemStack; - public PlayerAddToNetworkEvent(EntityPlayer player, ItemStack itemStack, String ownerNetwork, int addedAmount, int maximum) - { - super(ownerNetwork, addedAmount, maximum); - this.player = player; - this.itemStack = itemStack; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java deleted file mode 100644 index dacb26d..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/PlayerDrainNetworkEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.common.eventhandler.Cancelable; - -@Cancelable -public class PlayerDrainNetworkEvent extends SoulNetworkEvent -{ - public final EntityPlayer player; //Player that activated the event - public PlayerDrainNetworkEvent(EntityPlayer player, String ownerNetwork, int drainAmount) - { - super(ownerNetwork, drainAmount); - this.player = player; - } - - public EntityPlayer getPlayer() - { - return player; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java deleted file mode 100644 index 04acf35..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/SacrificeKnifeUsedEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; - -@Cancelable -public class SacrificeKnifeUsedEvent extends Event -{ - public final EntityPlayer player; - public boolean shouldDrainHealth; - public boolean shouldFillAltar; - public final int healthDrained; - - public SacrificeKnifeUsedEvent(EntityPlayer player, boolean shouldDrainHealth, boolean shouldFillAltar, int hp) - { - this.player = player; - this.shouldDrainHealth = shouldDrainHealth; - this.shouldFillAltar = shouldFillAltar; - this.healthDrained = hp; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java deleted file mode 100644 index bf47a13..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/SoulNetworkEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import cpw.mods.fml.common.eventhandler.Event; - -public class SoulNetworkEvent extends Event -{ - public String ownerNetwork; - public int drainAmount; - - public SoulNetworkEvent(String ownerNetwork, int drainAmount) - { - super(); - this.ownerNetwork = ownerNetwork; - this.drainAmount = drainAmount; - } - - public String getOwnerNetwork() - { - return this.ownerNetwork; - } - - public int getDrainAmount() - { - return this.drainAmount; - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java b/src/api/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java deleted file mode 100644 index 40c3170..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/event/TeleposeEvent.java +++ /dev/null @@ -1,56 +0,0 @@ -package WayofTime.alchemicalWizardry.api.event; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.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 initialWorld; - public final int initialX; - public final int initialY; - public final int initialZ; - - public final Block initialBlock; - public final int initialMetadata; - - public final World finalWorld; - public final int finalX; - public final int finalY; - public final int finalZ; - - public final Block finalBlock; - public final int finalMetadata; - - public TeleposeEvent(World wi, int xi, int yi, int zi, Block bi, int mi, World wf, int xf, int yf, int zf, Block bf, int mf) { - initialWorld = wi; - initialX = xi; - initialY = yi; - initialZ = zi; - - initialBlock = bi; - initialMetadata = mi; - - finalWorld = wf; - finalX = xf; - finalY = yf; - finalZ = zf; - - finalBlock = bf; - finalMetadata = mf; - } - - public TileEntity getInitialTile() { - return initialWorld.getTileEntity(initialX, initialY, initialZ); - } - - public TileEntity getFinalTile() { - return finalWorld.getTileEntity(finalX, finalY, finalZ); - } - -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java b/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java deleted file mode 100644 index c9b6931..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/ComplexNetworkHandler.java +++ /dev/null @@ -1,126 +0,0 @@ -package WayofTime.alchemicalWizardry.api.soulNetwork; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; -import java.util.HashMap; -import java.util.Map.Entry; -import java.util.UUID; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.server.MinecraftServer; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.mojang.authlib.GameProfile; - - -/** - * Temporary class to hash-out how to create a network not completely tied to the player. - */ -public class ComplexNetworkHandler -{ - public static String fileName = "config/BloodMagic/soulnetworkKeys"; - static HashMap keyMap = new HashMap(); - public static UUID getUUIDFromPlayer(EntityPlayer player) - { - return player.getPersistentID(); - } - - public static EntityPlayer getPlayerFromUUID(UUID uuid) - { - MinecraftServer server = MinecraftServer.getServer(); - GameProfile gameProfile; - gameProfile = server.func_152358_ax().func_152652_a(uuid); - String str = uuid.toString(); - //TODO ServerConfigurationManager d.createPlayerForUser - UUID.fromString(str); - return null; - } - - public static String getKeyForPlayer(EntityPlayer player) - { - return ""; - } - - public static UUID getUUIDForKey(String key) - { -// if (MinecraftServer.getServer() == null) -// { -// return null; -// } -// -// World world = MinecraftServer.getServer().worldServers[0]; -// UUIDKeyMap data = (UUIDKeyMap) world.loadItemData(UUIDKeyMap.class, key); -// -// if (data == null) -// { -// data = new UUIDKeyMap(key); -// world.setItemData(key, data); -// } - return null; - } - - public static String assignKeyToPlayer(EntityPlayer player) - { - return ""; - } - - public static void save() - { - keyMap.put(new UUID(0, 0), "test"); - - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - String json = gson.toJson(keyMap); - Writer writer; - try - { - writer = new FileWriter(fileName + ".json"); - writer.write(json); - writer.close(); - } catch (IOException e) - { - e.printStackTrace(); - } - } - - public static void load() - { - File save = new File(fileName + ".json"); - - if(save.canRead()) - { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - BufferedReader br; - - try - { - br = new BufferedReader(new FileReader(save)); - HashMap schema = gson.fromJson(br, keyMap.getClass()); - - keyMap = schema; - - if(keyMap != null) - { - for(Entry entry : keyMap.entrySet()) - { - System.out.println("" + entry.getValue() + " gave: "+ entry.getKey()); - } - } - } catch (FileNotFoundException e) - { - e.printStackTrace(); - } - } - - else - { - keyMap = null; - } - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/LifeEssenceNetwork.java b/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/LifeEssenceNetwork.java deleted file mode 100644 index 91bcdaf..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/LifeEssenceNetwork.java +++ /dev/null @@ -1,30 +0,0 @@ -package WayofTime.alchemicalWizardry.api.soulNetwork; - -import net.minecraft.nbt.NBTTagCompound; - -public class LifeEssenceNetwork extends net.minecraft.world.WorldSavedData -{ - public int currentEssence; - public int maxOrb; - - public LifeEssenceNetwork(String par1Str) - { - super(par1Str); - currentEssence = 0; - maxOrb = 0; - } - - @Override - public void readFromNBT(NBTTagCompound nbttagcompound) - { - currentEssence = nbttagcompound.getInteger("currentEssence"); - maxOrb = nbttagcompound.getInteger("maxOrb"); - } - - @Override - public void writeToNBT(NBTTagCompound nbttagcompound) - { - nbttagcompound.setInteger("currentEssence", currentEssence); - nbttagcompound.setInteger("maxOrb", maxOrb); - } -} diff --git a/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java b/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java deleted file mode 100644 index d9f30f4..0000000 --- a/src/api/java/WayofTime/alchemicalWizardry/api/soulNetwork/SoulNetworkHandler.java +++ /dev/null @@ -1,442 +0,0 @@ -package WayofTime.alchemicalWizardry.api.soulNetwork; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import WayofTime.alchemicalWizardry.api.event.AddToNetworkEvent; -import WayofTime.alchemicalWizardry.api.event.ItemBindEvent; -import WayofTime.alchemicalWizardry.api.event.ItemDrainInContainerEvent; -import WayofTime.alchemicalWizardry.api.event.ItemDrainNetworkEvent; - -import cpw.mods.fml.common.eventhandler.Event; -import cpw.mods.fml.common.eventhandler.Event.Result; - -public class SoulNetworkHandler -{ - public static boolean syphonFromNetworkWhileInContainer(ItemStack ist, int damageToBeDone) - { - String ownerName = ""; - if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) - { - ownerName = ist.getTagCompound().getString("ownerName"); - } - - ItemDrainInContainerEvent event = new ItemDrainInContainerEvent(ist, ownerName, damageToBeDone); - - if(MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Result.DENY) - { - return false; - } - - return syphonFromNetwork(event.ownerNetwork, event.drainAmount) >= damageToBeDone; - } - - public static int getCurrentMaxOrb(String ownerName) - { - if (MinecraftServer.getServer() == null) - { - return 0; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); - - if (data == null) - { - data = new LifeEssenceNetwork(ownerName); - world.setItemData(ownerName, data); - } - - return data.maxOrb; - } - - public static void setMaxOrbToMax(String ownerName, int maxOrb) - { - if (MinecraftServer.getServer() == null) - { - return; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); - - if (data == null) - { - data = new LifeEssenceNetwork(ownerName); - world.setItemData(ownerName, data); - } - - data.maxOrb = Math.max(maxOrb, data.maxOrb); - data.markDirty(); - } - - public static int getMaximumForOrbTier(int maxOrb) - { - switch(maxOrb) - { - case 1: - return 5000; - case 2: - return 25000; - case 3: - return 150000; - case 4: - return 1000000; - case 5: - return 10000000; - case 6: - return 30000000; - default: - return 1; - } - } - - public static int syphonFromNetwork(ItemStack ist, int damageToBeDone) - { - if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) - { - String ownerName = ist.getTagCompound().getString("ownerName"); - - return syphonFromNetwork(ownerName, damageToBeDone); - } - return 0; - } - - public static int syphonFromNetwork(String ownerName, int damageToBeDone) - { - if (MinecraftServer.getServer() == null) - { - return 0; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); - - if (data == null) - { - data = new LifeEssenceNetwork(ownerName); - world.setItemData(ownerName, data); - } - - if (data.currentEssence >= damageToBeDone) - { - data.currentEssence -= damageToBeDone; - data.markDirty(); - return damageToBeDone; - } - - return 0; - } - - /** - * Master method used to syphon from the player's network, and will damage them accordingly if they do not have enough LP. - * Does not drain on the client side. - * - * @param ist Owned itemStack - * @param player Player using the item - * @param drain - * @return True if the action should be executed and false if it should not. Always returns false if client-sided. - */ - public static boolean syphonAndDamageFromNetwork(ItemStack ist, EntityPlayer player, int drain) - { - if (player.worldObj.isRemote) - { - return false; - } - - if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) - { - String ownerName = ist.getTagCompound().getString("ownerName"); - - ItemDrainNetworkEvent event = new ItemDrainNetworkEvent(player, ownerName, ist, drain); - - if(MinecraftForge.EVENT_BUS.post(event)) - { - return false; - } - - int drainAmount = syphonFromNetwork(event.ownerNetwork, event.drainAmount); - if(drainAmount == 0 || event.shouldDamage) - { - hurtPlayer(player, event.damageAmount); - } - - return (event.getResult() != Event.Result.DENY); //The event has been told to prevent the action but allow all repercussions of using the item. - } - - int amount = SoulNetworkHandler.syphonFromNetwork(ist, drain); - - hurtPlayer(player, drain - amount); - - return true; - } - - public static boolean syphonAndDamageFromNetwork(String ownerName, EntityPlayer player, int damageToBeDone) - { - if (player.worldObj.isRemote) - { - return false; - } - - World world = player.worldObj; - if (world != null) - { - world.playSoundEffect((double) ((float) player.posX + 0.5F), (double) ((float) player.posY + 0.5F), (double) ((float) player.posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); - } - - int amount = SoulNetworkHandler.syphonFromNetwork(ownerName, damageToBeDone); - - hurtPlayer(player, damageToBeDone - amount); - - return true; - } - - public static boolean canSyphonFromOnlyNetwork(ItemStack ist, int damageToBeDone) - { - if (ist.getTagCompound() != null && !(ist.getTagCompound().getString("ownerName").equals(""))) - { - String ownerName = ist.getTagCompound().getString("ownerName"); - - return canSyphonFromOnlyNetwork(ownerName, damageToBeDone); - } - - return false; - } - - public static boolean canSyphonFromOnlyNetwork(String ownerName, int damageToBeDone) - { - if (MinecraftServer.getServer() == null) - { - return false; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); - - if (data == null) - { - data = new LifeEssenceNetwork(ownerName); - world.setItemData(ownerName, data); - } - - return data.currentEssence >= damageToBeDone; - } - - public static int getCurrentEssence(String ownerName) - { - if (MinecraftServer.getServer() == null) - { - return 0; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); - - if (data == null) - { - data = new LifeEssenceNetwork(ownerName); - world.setItemData(ownerName, data); - } - - return data.currentEssence; - } - - public static void setCurrentEssence(String ownerName, int essence) - { - if (MinecraftServer.getServer() == null) - { - return; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, ownerName); - - if (data == null) - { - data = new LifeEssenceNetwork(ownerName); - world.setItemData(ownerName, data); - } - - data.currentEssence = essence; - data.markDirty(); - } - - /** - * A method to add to an owner's network up to a maximum value. - * - * @param ownerName - * @param addedEssence - * @param maximum - * @return amount added to the network - */ - public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence, int maximum) - { - AddToNetworkEvent event = new AddToNetworkEvent(ownerName, addedEssence, maximum); - - if(MinecraftForge.EVENT_BUS.post(event)) - { - return 0; - } - - if (MinecraftServer.getServer() == null) - { - return 0; - } - - World world = MinecraftServer.getServer().worldServers[0]; - LifeEssenceNetwork data = (LifeEssenceNetwork) world.loadItemData(LifeEssenceNetwork.class, event.ownerNetwork); - - if (data == null) - { - data = new LifeEssenceNetwork(event.ownerNetwork); - world.setItemData(event.ownerNetwork, data); - } - - int currEss = data.currentEssence; - - if (currEss >= event.maximum) - { - return 0; - } - - int newEss = Math.min(event.maximum, currEss + event.addedAmount); - if(event.getResult() != Event.Result.DENY) - { - data.currentEssence = newEss; - } - - return newEss - currEss; - } - - public static void hurtPlayer(EntityPlayer user, int energySyphoned) - { - if (energySyphoned < 100 && energySyphoned > 0) - { - if (!user.capabilities.isCreativeMode) - { - user.setHealth((user.getHealth() - 1)); - - if (user.getHealth() <= 0.0005f) - { - user.onDeath(DamageSource.generic); - } - } - } else if (energySyphoned >= 100) - { - if (!user.capabilities.isCreativeMode) - { - for (int i = 0; i < ((energySyphoned + 99) / 100); i++) - { - user.setHealth((user.getHealth() - 1)); - - if (user.getHealth() <= 0.0005f) - { - user.onDeath(DamageSource.generic); - break; - } - } - } - } - } - - public static void hurtPlayer(EntityPlayer user, float damage) - { - if (!user.capabilities.isCreativeMode) - { - user.setHealth((user.getHealth() - damage)); - - if (user.getHealth() <= 0.0005f) - { - user.onDeath(DamageSource.generic); - } - } - } - - public static void checkAndSetItemOwner(ItemStack item, EntityPlayer player) - { - checkAndSetItemPlayer(item, player); - } - - public static boolean checkAndSetItemPlayer(ItemStack item, EntityPlayer player) - { - if (item.hasTagCompound() && !item.getTagCompound().getString("ownerName").equals("")) return true; - - ItemBindEvent event = new ItemBindEvent(player, SoulNetworkHandler.getUsername(player), item); - - if(!MinecraftForge.EVENT_BUS.post(event)) - { - if (!item.hasTagCompound()) - { - item.setTagCompound(new NBTTagCompound()); - } - item.getTagCompound().setString("ownerName", event.key); - return true; - } - return false; - } - - public static void checkAndSetItemOwner(ItemStack item, String ownerName) - { - if (item.getTagCompound() == null) - { - item.setTagCompound(new NBTTagCompound()); - } - - if (item.getTagCompound().getString("ownerName").equals("")) - { - item.getTagCompound().setString("ownerName", ownerName); - } - } - - public static String getUsername(EntityPlayer player) - { - return player.getCommandSenderName(); - } - - public static EntityPlayer getPlayerForUsername(String str) - { - if (MinecraftServer.getServer() == null) - { - return null; - } - return MinecraftServer.getServer().getConfigurationManager().func_152612_a(str); - } - - public static void causeNauseaToPlayer(ItemStack stack) - { - if (stack.getTagCompound() != null && !(stack.getTagCompound().getString("ownerName").equals(""))) - { - String ownerName = stack.getTagCompound().getString("ownerName"); - - SoulNetworkHandler.causeNauseaToPlayer(ownerName); - } - } - - public static void causeNauseaToPlayer(String ownerName) - { - EntityPlayer entityOwner = SoulNetworkHandler.getPlayerForUsername(ownerName); - - if (entityOwner == null) - { - return; - } - - entityOwner.addPotionEffect(new PotionEffect(Potion.confusion.id, 80)); - } - - public static String getOwnerName(ItemStack item) - { - if (item.getTagCompound() == null) - { - item.setTagCompound(new NBTTagCompound()); - } - - return item.getTagCompound().getString("ownerName"); - } -} diff --git a/src/api/java/am2/api/ArsMagicaApi.java b/src/api/java/am2/api/ArsMagicaApi.java deleted file mode 100644 index 76ee5e5..0000000 --- a/src/api/java/am2/api/ArsMagicaApi.java +++ /dev/null @@ -1,324 +0,0 @@ -package am2.api; - -import am2.api.enchantment.IAMEnchantmentHelper; -import am2.api.entities.IEntityManager; -import am2.api.flickers.IFlickerRegistry; -import am2.api.items.IKeystoneHelper; -import am2.api.items.armor.IImbuementRegistry; -import am2.api.potion.IBuffHelper; -import am2.api.power.IObeliskFuelHelper; -import am2.api.spell.ISkillTreeManager; -import am2.api.spell.ISpellIconManager; -import am2.api.spell.ISpellPartManager; -import am2.api.spell.ISpellUtils; -import am2.api.spell.component.interfaces.ISkillTreeEntry; -import am2.api.spell.enums.SkillPointTypes; -import am2.api.spell.enums.SkillTrees; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.IAttribute; -import net.minecraft.entity.ai.attributes.RangedAttribute; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.util.IIcon; - -public class ArsMagicaApi{ - public static final ArsMagicaApi instance = new ArsMagicaApi(); - - /** - * Easy access to this mod's ID - */ - public static final String AM2ModID = "arsmagica2"; - - private static String extendedPropertiesIdentifier; - private static String affinityDataIdentifier; - private static String skillDataIdentifier; - private static String riftStorageIdentifier; - - /** - * Attributes for AM2's properties - */ - //Bonus to max mana. Applied additively. - public static final IAttribute maxManaBonus = new RangedAttribute("am2.maxManaBonus", 0.0f, 0.0f, Double.MAX_VALUE).setDescription("Mana Bonus").setShouldWatch(true); - //Bonus to max burnout. Applied additively. - public static final IAttribute maxBurnoutBonus = new RangedAttribute("am2.maxBurnoutBonus", 0.0f, 0.0f, Double.MAX_VALUE).setDescription("Burnout Bonus").setShouldWatch(true); - //Bonus to XP gained. Applied multiplicatively. - public static final IAttribute xpGainModifier = new RangedAttribute("am2.xpMultiplier", 1.0f, 0.0f, Double.MAX_VALUE).setDescription("XP Mutiplier").setShouldWatch(true); - //Bonus to mana regen rate. Applied multiplicatively. - public static final IAttribute manaRegenTimeModifier = new RangedAttribute("am2.manaRegenModifier", 1.0f, 0.5f, 2.0f).setDescription("Mana Regen Rate Multiplier").setShouldWatch(true); - //Bonus to burnout reduction rate. Applied multiplicatively. - public static final IAttribute burnoutReductionRate = new RangedAttribute("am2.burnoutReduction", 1.0f, 0.1f, 2.0f).setDescription("Burnout Reduction Rate").setShouldWatch(true); - - private static final float manaBurnoutRatio = 0.38f; - - private ArsMagicaApi(){ - - } - - //================================================================================ - // Getters - //================================================================================ - - /** - * Gets the spell part manager. Used to register new shapes/components/modifiers/talents - */ - public final ISpellPartManager getSpellPartManager(){ - return spellPartManager; - } - - /** - * Gets the enchantment helper. Used to resolve current enchantment IDs. - */ - public final IAMEnchantmentHelper getEnchantHelper(){ - return enchantmentHelper; - } - - /** - * Gets the skill tree manager. Used to register spell parts into the skill trees (accessible via occulus) - */ - public final ISkillTreeManager getSkillTreeManager(){ - return this.skillTreeManager; - } - - /** - * Helper method to calculate the burnout for a spell based on mana cost. - */ - public static final float getBurnoutFromMana(float manaCost){ - return manaCost * manaBurnoutRatio; - } - - /** - * Gets the keystone helper instance. Used to check inventories for keys and check access to blocks lockable by keystone. - */ - public final IKeystoneHelper getKeystoneHelper(){ - return this.keystoneHelper; - } - - /** - * Gets the entity manager. Used to blacklist things from the progeny and butchery flicker operators - */ - public final IEntityManager getEntityManager(){ - return this.entityManager; - } - - /** - * Gets the fuel helper instance. Used to register new fuels for the Obelisk. - */ - public final IObeliskFuelHelper getFuelHelper(){ - return this.obeliskFuelHelper; - } - - /** - * Gets the flicker registry. Used to register new flicker operators into the habitat. - */ - public final IFlickerRegistry getFlickerOperatorRegistry(){ - return flickerOperatorRegistry; - } - - /** - * Gets the armor imbuement registry. Used to register new imbuements and check if imbuements are present on a given item stack. - */ - public final IImbuementRegistry getArmorInfusionRegistry(){ - return this.armorInfusionRegistry; - } - - /** - * Gets the AM recipe manager. Used to register new essence refiner recipes. - */ - public final IAMRecipeManager getEssenceRecipeManager(){ - return this.essenceRecipes; - } - - /** - * Is AM2 running in colourblind mode? - */ - public final boolean getColourblindMode(){ - return this.colourblindMode; - } - - /** - * Returns the extended properties for the passed in entity living - */ - public final IExtendedProperties getExtendedProperties(EntityLivingBase entity){ - return (IExtendedProperties)entity.getExtendedProperties(extendedPropertiesIdentifier); - } - - /** - * Returns the skill data instance (known shapes/modifiers/components/talents) - */ - public final ISkillData getSkillData(EntityPlayer entity){ - return (ISkillData)entity.getExtendedProperties(skillDataIdentifier); - } - - /** - * Returns the affinity data for the passed in entity - */ - public final IAffinityData getAffinityData(EntityLivingBase entity){ - return (IAffinityData)entity.getExtendedProperties(affinityDataIdentifier); - } - - /** - * Returns the rift storage for the passed in player. - */ - public final IInventory getRiftStorage(EntityPlayer entity){ - return (IInventory)entity.getExtendedProperties(riftStorageIdentifier); - } - - /** - * Registers a skill tree entry (Shape, Component, Modifier, or Talent) into the mod - * - * @param entry The skill tree entry to register - * @param name The unlocalized name that is used to identify this entry - * @param tree Which skill tree the entry should be located in - * @param x The x coordinate that the entry should be located at in the tree. Typical increments are of 45 to space the items. - * @param y The y coordinate that the entry should be located at in the tree. Typical increments are of 45 to space the items. - * @param point The type of skill point needed to unlock this entry - * @param prerequs Any skill tree entries that are required as prerequisites for this one. All prerequisites must be registered before the current entry. - */ - public final void registerSkillTreeEntry(ISkillTreeEntry entry, String name, SkillTrees tree, int x, int y, SkillPointTypes point, ISkillTreeEntry... prereqs){ - spellPartManager.registerSkillTreeEntry(entry, name); - skillTreeManager.RegisterPart(entry, x, y, tree, point, prereqs); - } - - /** - * Registers the IIcon to use for the specified skill. This should be called during the API's registerSkillTreeIcons event for each entry that you registered. You get a reference to the ISpellIconManager which has the same method, so this is only here for convenience. - * - * @param name The unlocalized name that was used to register the spell. See {@link #registerSkillTreeEntry(ISkillTreeEntry, String, SkillTrees, int, int, SkillPointTypes, ISkillTreeEntry...) registerSkillTreeEntry} method for more info on the name. - * @param IIcon The IIcon to use. You need to register these IIcons with the game beforehand during your mod's load phase - AM won't do it for you. - */ - @SideOnly(Side.CLIENT) - public final void registerSkillIcon(String name, IIcon IIcon){ - spellIconManager.registerIcon(name, IIcon); - } - - /** - * Returns the IIcon manager. This is used to register spell IIcons. - */ - @SideOnly(Side.CLIENT) - public final ISpellIconManager getSpellIconManager(){ - return spellIconManager; - } - - /** - * Returns the buff helper which can be used to query AM for potion IDs, and add dispel blacklists - */ - public final IBuffHelper getBuffHelper(){ - return this.buffHelper; - } - - /** - * Gets the spell utils class - */ - public final ISpellUtils getSpellUtils(){ - return this.spellUtils; - } - - //================================================================================ - // Setters - for AM use only, do not call these. - //================================================================================ - public final void setSpellPartManager(ISpellPartManager manager){ - if (this.spellPartManager == null){ - this.spellPartManager = manager; - } - } - - public final void setEnchantmentHelper(IAMEnchantmentHelper helper){ - if (this.enchantmentHelper == null){ - this.enchantmentHelper = helper; - } - } - - public final void setSkillTreeManager(ISkillTreeManager manager){ - if (this.skillTreeManager == null) - this.skillTreeManager = manager; - } - - @SideOnly(Side.CLIENT) - public final void setSpellIconManager(ISpellIconManager manager){ - if (this.spellIconManager == null) - this.spellIconManager = manager; - } - - public final void setKeystoneHelper(IKeystoneHelper helper){ - if (this.keystoneHelper == null){ - this.keystoneHelper = helper; - } - } - - public final void setExtendedPropertiesID(String identifier){ - if (extendedPropertiesIdentifier == null) - extendedPropertiesIdentifier = identifier; - } - - public final void setAffinityDataID(String identifier){ - if (affinityDataIdentifier == null) - affinityDataIdentifier = identifier; - } - - public final void setSkillDataID(String identifier){ - if (skillDataIdentifier == null) - skillDataIdentifier = identifier; - } - - public final void setRiftStorageID(String identifier){ - if (riftStorageIdentifier == null) - riftStorageIdentifier = identifier; - } - - public final void setEntityManager(IEntityManager manager){ - if (entityManager == null) - entityManager = manager; - } - - public final void setObeliskFuelHelper(IObeliskFuelHelper manager){ - if (obeliskFuelHelper == null) - obeliskFuelHelper = manager; - } - - public final void setFlickerOperatorRegistry(IFlickerRegistry registry){ - if (flickerOperatorRegistry == null) - flickerOperatorRegistry = registry; - } - - public final void setInfusionRegistry(IImbuementRegistry registry){ - if (this.armorInfusionRegistry == null) - this.armorInfusionRegistry = registry; - } - - public final void setEssenceRecipeHandler(IAMRecipeManager manager){ - if (this.essenceRecipes != null) - this.essenceRecipes = manager; - } - - public final void setColourblindMode(boolean colourblindMode){ - this.colourblindMode = colourblindMode; - } - - public final void setBuffHelper(IBuffHelper helper){ - if (this.buffHelper == null) - this.buffHelper = helper; - } - - public final void setSpellUtils(ISpellUtils utilsHelper){ - if (this.spellUtils == null){ - this.spellUtils = utilsHelper; - } - } - - private ISpellPartManager spellPartManager; - private ISpellUtils spellUtils; - private ISkillTreeManager skillTreeManager; - private IAMEnchantmentHelper enchantmentHelper; - private IEntityManager entityManager; - private IKeystoneHelper keystoneHelper; - private IObeliskFuelHelper obeliskFuelHelper; - private IFlickerRegistry flickerOperatorRegistry; - private IImbuementRegistry armorInfusionRegistry; - private IAMRecipeManager essenceRecipes; - @SideOnly(Side.CLIENT) - private ISpellIconManager spellIconManager; - private IBuffHelper buffHelper; - private boolean colourblindMode; - -} diff --git a/src/api/java/am2/api/IAMRecipeManager.java b/src/api/java/am2/api/IAMRecipeManager.java deleted file mode 100644 index 4ee653c..0000000 --- a/src/api/java/am2/api/IAMRecipeManager.java +++ /dev/null @@ -1,13 +0,0 @@ -package am2.api; - -import net.minecraft.item.ItemStack; - -public interface IAMRecipeManager{ - /** - * Adds a recipe to the essence refiner. - * - * @param output The output created - * @param components The components required. Must be a length of 5. - */ - public void addRefinerRecipe(ItemStack output, ItemStack[] components); -} diff --git a/src/api/java/am2/api/IAffinityData.java b/src/api/java/am2/api/IAffinityData.java deleted file mode 100644 index 8f111b2..0000000 --- a/src/api/java/am2/api/IAffinityData.java +++ /dev/null @@ -1,33 +0,0 @@ -package am2.api; - -import am2.api.spell.enums.Affinity; - -public interface IAffinityData{ - - /** - * Gets the depth of the specified affinity as a percentage. - */ - float getAffinityDepth(Affinity affinity); - - /** - * Gets the factor at which affinity gains are currently reduced. - */ - float getDiminishingReturnsFactor(); - - /** - * Directly sets an affinity. Does not take into account oppositions. Use sparingly. - * - * @param affinity The affinity to set - * @param depth The depth to set - */ - void setAffinityAndDepth(Affinity affinity, float depth); - - /** - * Increments the affinity by the specified amount, and decrements other affinities by an amount related to - * how much in opposition they are to the specified affinity. - * - * @param affinity The affinity to increase - * @param amt The amount to increase the affinity by - */ - void incrementAffinity(Affinity affinity, float amt); -} diff --git a/src/api/java/am2/api/IExtendedProperties.java b/src/api/java/am2/api/IExtendedProperties.java deleted file mode 100644 index 74d2707..0000000 --- a/src/api/java/am2/api/IExtendedProperties.java +++ /dev/null @@ -1,30 +0,0 @@ -package am2.api; - -import am2.api.math.AMVector3; - -/** - * Extended properties on EntityLiving used in Ars Magica. - * - * @author Mithion - */ -public interface IExtendedProperties{ - public float getCurrentMana(); - - public float getMaxMana(); - - public int getMarkDimension(); - - public int getMagicLevel(); - - public int getNumSummons(); - - public AMVector3 getMarkLocation(); - - public boolean getHasUnlockedAugmented(); - - public boolean getMarkSet(); - - public boolean setMagicLevelWithMana(int magicLevel); - - public void setCurrentMana(float currentMana); -} diff --git a/src/api/java/am2/api/ILoreHelper.java b/src/api/java/am2/api/ILoreHelper.java deleted file mode 100644 index b517239..0000000 --- a/src/api/java/am2/api/ILoreHelper.java +++ /dev/null @@ -1,28 +0,0 @@ -package am2.api; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public interface ILoreHelper{ - - /** - * Adds an entry to the compendium. - * - * @param entryItem The item that the compendium entry describes. Can be an item, a block, an entity, or a spell part (incl shape/component/or modifier). - * @param entryKey The key of the entry in the compendium. Must be unique. This depends on what you are describing, and can have conditions. See the following:
-	 *                     For meta specific entries, you can add metadata using the format "key@meta".
-	 *                     For non-AM items/blocks, must be prefixed with mod ID, "am2apidemo:forceRing" for example.
-	 *                     For non-AM mobs, must be prefixed with mod ID dot mobID, for example "arsmagica2.EntityDryad".
-	 *                     For Shapes/Components/Modifiers, they must be registered.  Just give their registered name, no prefix is necessary.  For example, "Explosion" (from am2apidemo).
-	 *                     

- * If you get this wrong, the entry will be blank. - *

- * @param entryName The human-readable name of the entry. - * @param entryDesc The entry's text. You can use Minecraft color codes by prefixing the color number with the '#' key (for example, #9This text would be blue #0 and now back to black) - * @param parent The entry's parent entry. You can set this to the key of the parent entry to make this a sub item. Set to null for none. - * @param allowReplace If an entry already exists with the specified key, can it be replaced? - * @param relatedKeys Related entries are shown at the bottom, and are clickable. - */ - public void AddCompenidumEntry(Object entryItem, String entryKey, String entryName, String entryDesc, String parent, boolean allowReplace, String... relatedKeys); -} diff --git a/src/api/java/am2/api/ISkillData.java b/src/api/java/am2/api/ISkillData.java deleted file mode 100644 index 7b6e855..0000000 --- a/src/api/java/am2/api/ISkillData.java +++ /dev/null @@ -1,80 +0,0 @@ -package am2.api; - -import am2.api.spell.component.interfaces.ISkillTreeEntry; -import am2.api.spell.enums.LearnStates; -import am2.api.spell.enums.SkillPointTypes; -import net.minecraft.entity.player.EntityPlayer; - -public interface ISkillData{ - /** - * Checks if the specified skill tree entry is known - */ - boolean isEntryKnown(SkillTreeEntry entry); - - /** - * Returns the number of skill points of the given type that this skill data has - */ - int getSpellPoints(SkillPointTypes type); - - /** - * Sets the number of skill points of the given type that this skill data has - */ - void setSpellPoints(int spellPoints, SkillPointTypes type); - - /** - * Sets the number of skill points for all types that this skill data has - */ - void setSpellPoints(int spellPoints_blue, int spellPoints_green, int spellPoints_red); - - /** - * Increments the skill points of the specified type. - */ - void incrementSpellPoints(SkillPointTypes type); - - /** - * Decrements the skill points of the specified type. Cannot go below 0. - */ - void decrementSpellPoints(SkillPointTypes type); - - /** - * Learns the specified entry. This will attempt to decrement skill points but is not bounded by it - make sure you check {@link #getLearnState(SkillTreeEntry, EntityPlayer)} first! - * - * @param entry - */ - void learn(ISkillTreeEntry entry); - - /** - * Returns an array of shifted IDs representing the known shapes. - */ - Integer[] getKnownShapes(); - - /** - * Returns an array of shifted IDs representing the known components. - */ - Integer[] getKnownComponents(); - - /** - * Returns an array of shifted IDs representing the known modifiers. - */ - Integer[] getKnownModifiers(); - - /** - * Returns an array of shifted IDs representing the known talents. - */ - Integer[] getKnownTalents(); - - /** - * Forces changes to sync to appropriate clients. Chances are you won't have to call this, as the sync will happen at regular intervals if there are actually changes to sync. This is for when you need the changes clientside immediately. - */ - void forceSync(); - - /** - * Clears all spell knowledge and skill points. Does not do any refunding -- this is NOT a respec! - */ - void clearAllKnowledge(); - - /** - * Gets the learn state for the specified skill. - */ - LearnStates getLearnState(SkillTreeEntry entry, EntityPlayer player); -} diff --git a/src/api/java/am2/api/SkillTreeEntry.java b/src/api/java/am2/api/SkillTreeEntry.java deleted file mode 100644 index 15503b7..0000000 --- a/src/api/java/am2/api/SkillTreeEntry.java +++ /dev/null @@ -1,32 +0,0 @@ -package am2.api; - -import am2.api.spell.component.interfaces.ISkillTreeEntry; -import am2.api.spell.enums.SkillTrees; - -public class SkillTreeEntry{ - public final int x; - public final int y; - public final SkillTrees tree; - public final SkillTreeEntry[] prerequisites; - public final ISkillTreeEntry registeredItem; - public final int tier; - public boolean enabled; - - public SkillTreeEntry(int x, int y, SkillTrees tree, SkillTreeEntry[] prerequisites, ISkillTreeEntry registeredItem, boolean enabled){ - this.x = x; - this.y = y; - this.tree = tree; - this.prerequisites = prerequisites; - this.registeredItem = registeredItem; - this.enabled = enabled; - - int highestTier = 0; - for (SkillTreeEntry entry : prerequisites){ - if (entry.tier >= highestTier){ - highestTier = entry.tier + 1; - } - } - - this.tier = highestTier; - } -} diff --git a/src/api/java/am2/api/blocks/IKeystoneLockable.java b/src/api/java/am2/api/blocks/IKeystoneLockable.java deleted file mode 100644 index 89cf84e..0000000 --- a/src/api/java/am2/api/blocks/IKeystoneLockable.java +++ /dev/null @@ -1,22 +0,0 @@ -package am2.api.blocks; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public interface IKeystoneLockable{ - /** - * Return a three element array of the three runes in the inventory that make up the current keystone combination. - * Elements can be NULL if there is no rune present. - */ - public ItemStack[] getRunesInKey(); - - /** - * Does the keystone need to be the currently held item? Trumps {@link #keystoneMustBeInActionBar()}. - */ - public boolean keystoneMustBeHeld(); - - /** - * Does the keystone need to be in the action bar? Or can it be anywhere in the inventory? - */ - public boolean keystoneMustBeInActionBar(); -} diff --git a/src/api/java/am2/api/blocks/MultiblockStructureDefinition.java b/src/api/java/am2/api/blocks/MultiblockStructureDefinition.java deleted file mode 100644 index 155af17..0000000 --- a/src/api/java/am2/api/blocks/MultiblockStructureDefinition.java +++ /dev/null @@ -1,404 +0,0 @@ -package am2.api.blocks; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - -import java.util.ArrayList; -import java.util.HashMap; - -public class MultiblockStructureDefinition{ - public class BlockDec{ - Block block; - int meta; - - public BlockDec(Block block, int meta){ - this.block = block; - this.meta = meta; - } - - public Block getBlock(){ - return block; - } - - public int getMeta(){ - return meta; - } - - @Override - public String toString(){ - String blockName = ""; - if (block != null){ - blockName = block.getLocalizedName(); - }else{ - blockName = "Unknown"; - } - return String.format("Block: %s, meta: %d", blockName, meta); - } - - @Override - public boolean equals(Object obj){ - if (obj instanceof BlockDec){ - return this.block == ((BlockDec)obj).block && (this.meta == -1 || ((BlockDec)obj).meta == -1 || this.meta == ((BlockDec)obj).meta); - } - return false; - } - - @Override - public int hashCode(){ - return Block.getIdFromBlock(block); - } - } - - public class BlockCoord implements Comparable{ - public int x; - public int y; - public int z; - - public BlockCoord(int offsetX, int offsetY, int offsetZ){ - this.x = offsetX; - this.y = offsetY; - this.z = offsetZ; - } - - @Override - public boolean equals(Object obj){ - if (obj instanceof BlockCoord){ - return this.x == ((BlockCoord)obj).x && this.y == ((BlockCoord)obj).y && this.z == ((BlockCoord)obj).z; - } - return false; - } - - @Override - public int hashCode(){ - return this.x + this.y + this.z; - } - - - public int getX(){ - return this.x; - } - - public int getY(){ - return this.y; - } - - public int getZ(){ - return this.z; - } - - @Override - public String toString(){ - return String.format("BlockCoord: %d, %d, %d", x, y, z); - } - - @Override - public int compareTo(BlockCoord o){ - return this.z > o.z ? 1 : this.z < o.z ? -1 : this.x > o.x ? 1 : this.x < o.x ? -1 : this.y > o.y ? 1 : this.y < o.y ? -1 : 0; - } - } - - public class StructureGroup{ - String name; - int mutex; - HashMap> allowedBlocks; - - public StructureGroup(String name, int mutex){ - this.name = name; - this.mutex = mutex; - allowedBlocks = new HashMap>(); - } - - void addAllowedBlock(int offsetX, int offsetY, int offsetZ, Block block, int meta){ - BlockCoord originOffset = new BlockCoord(offsetX, offsetY, offsetZ); - if (!allowedBlocks.containsKey(originOffset)){ - allowedBlocks.put(originOffset, new ArrayList()); - } - ArrayList positionReplacements = allowedBlocks.get(originOffset); - positionReplacements.add(new BlockDec(block, meta)); - } - - ArrayList getAllowedBlocksAt(BlockCoord coord){ - return allowedBlocks.get(coord); - } - - boolean matchGroup(World world, int originX, int originY, int originZ){ - for (BlockCoord offset : allowedBlocks.keySet()){ - Block block = world.getBlock(originX + offset.x, originY + offset.y, originZ + offset.z); - int meta = world.getBlockMetadata(originX + offset.x, originY + offset.y, originZ + offset.z); - ArrayList positionReplacements = allowedBlocks.get(offset); - boolean valid = false; - for (BlockDec bd : positionReplacements){ - if (bd.block == block && (bd.meta == -1 || bd.meta == meta)){ - valid = true; - } - } - if (!valid) return false; - } - return true; - } - - HashMap> getStructureLayer(int layer){ - HashMap> toReturn = new HashMap>(); - - if (layer > getMaxLayer() || layer < getMinLayer()){ - return toReturn; - } - - for (BlockCoord bc : allowedBlocks.keySet()){ - if (bc.y == layer){ - toReturn.put(bc, allowedBlocks.get(bc)); - } - } - return toReturn; - } - - public void replaceAllBlocksOfType(Block originalBlock, Block newBlock){ - replaceAllBlocksOfType(originalBlock, -1, newBlock, -1); - } - - public void replaceAllBlocksOfType(Block originalBlock, int originalMeta, Block newBlock, int newMeta){ - for (BlockCoord bc : allowedBlocks.keySet()){ - for (BlockDec bd : allowedBlocks.get(bc)){ - if (bd.block == originalBlock){ - if (bd.meta == originalMeta || originalMeta == -1){ - bd.block = newBlock; - if (newMeta != -1){ - bd.meta = newMeta; - } - } - } - } - } - } - - public HashMap> getAllowedBlocks(){ - return (HashMap>)allowedBlocks.clone(); - } - - public void deleteBlocksFromWorld(World world, int x, int y, int z){ - for (BlockCoord offset : allowedBlocks.keySet()){ - world.setBlockToAir(x + offset.x, y + offset.y, z + offset.z); - } - } - } - - private StructureGroup mainGroup; - private ArrayList blockGroups; - private ArrayList mutexCache; - - public static final int MAINGROUP_MUTEX = 1; - - private String id; - - private int maxX = 0; - private int minX = 0; - private int maxY = 0; - private int minY = 0; - private int maxZ = 0; - private int minZ = 0; - - public MultiblockStructureDefinition(String id){ - blockGroups = new ArrayList(); - mutexCache = new ArrayList(); - this.id = id; - - //default group - mainGroup = createGroup("main", MAINGROUP_MUTEX); - } - - public String getID(){ - return this.id; - } - - public ArrayList getMutexList(){ - return mutexCache; - } - - public ArrayList getGroupsForMutex(int mutex){ - ArrayList toReturn = new ArrayList(); - - for (StructureGroup group : blockGroups){ - if (group.mutex == mutex){ - toReturn.add(group); - } - } - - return toReturn; - } - - public ArrayList getAllowedBlocksAt(StructureGroup group, BlockCoord coord){ - return group.getAllowedBlocksAt(coord); - } - - public ArrayList getAllowedBlocksAt(BlockCoord coord){ - return mainGroup.getAllowedBlocksAt(coord); - } - - public void addAllowedBlock(int offsetX, int offsetY, int offsetZ, Block block, int meta){ - - if (offsetY > maxY){ - maxY = offsetY; - }else if (offsetY < minY){ - minY = offsetY; - } - - if (offsetX > maxX){ - maxX = offsetX; - }else if (offsetX < minX){ - minX = offsetX; - } - - if (offsetZ > maxZ){ - maxZ = offsetZ; - }else if (offsetZ < minZ){ - minZ = offsetZ; - } - - mainGroup.addAllowedBlock(offsetX, offsetY, offsetZ, block, meta); - } - - public void addAllowedBlock(int offsetX, int offsetY, int offsetZ, Block block){ - addAllowedBlock(offsetX, offsetY, offsetZ, block, -1); - } - - public void addAllowedBlock(StructureGroup group, int offsetX, int offsetY, int offsetZ, Block block, int meta){ - if (!blockGroups.contains(group)){ - blockGroups.add(group); - } - - if (offsetY > maxY){ - maxY = offsetY; - }else if (offsetY < minY){ - minY = offsetY; - } - - if (offsetX > maxX){ - maxX = offsetX; - }else if (offsetX < minX){ - minX = offsetX; - } - - if (offsetZ > maxZ){ - maxZ = offsetZ; - }else if (offsetZ < minZ){ - minZ = offsetZ; - } - - group.addAllowedBlock(offsetX, offsetY, offsetZ, block, meta); - } - - public void addAllowedBlock(StructureGroup group, int offsetX, int offsetY, int offsetZ, Block block){ - addAllowedBlock(group, offsetX, offsetY, offsetZ, block, -1); - } - - public StructureGroup createGroup(String name, int mutex){ - if (!mutexCache.contains(mutex)){ - mutexCache.add(mutex); - } - StructureGroup group = new StructureGroup(name, mutex); - blockGroups.add(group); - return group; - } - - public StructureGroup copyGroup(String originalName, String destinationName, int newMutex){ - StructureGroup copyGroup = null; - for (StructureGroup group : blockGroups){ - if (group.name.equals(originalName)){ - copyGroup = group; - break; - } - } - - if (copyGroup == null) return null; - - StructureGroup newGroup; - - if (newMutex > -1){ - newGroup = new StructureGroup(destinationName, newMutex); - }else{ - newGroup = new StructureGroup(destinationName, copyGroup.mutex); - } - - for (BlockCoord bc : copyGroup.allowedBlocks.keySet()){ - for (BlockDec bd : copyGroup.allowedBlocks.get(bc)){ - newGroup.addAllowedBlock(bc.x, bc.y, bc.z, bd.block, bd.meta); - } - } - - blockGroups.add(newGroup); - - return newGroup; - } - - public StructureGroup copyGroup(String originalName, String destinationName){ - return copyGroup(originalName, destinationName, -1); - } - - public ArrayList getMatchedGroups(int mutex, World world, int originX, int originY, int originZ){ - ArrayList toReturn = new ArrayList(); - for (StructureGroup group : blockGroups){ - if ((group.mutex & mutex) == group.mutex){ - if (group.matchGroup(world, originX, originY, originZ)){ - toReturn.add(group); - } - } - } - return toReturn; - } - - private boolean matchMutex(int mutex, World world, int originX, int originY, int originZ){ - for (StructureGroup group : blockGroups){ - if ((group.mutex & mutex) == group.mutex){ - if (group.matchGroup(world, originX, originY, originZ)){ - return true; - } - } - } - return false; - } - - public boolean checkStructure(World world, int originX, int originY, int originZ){ - boolean valid = true; - for (int i : mutexCache){ - valid &= matchMutex(i, world, originX, originY, originZ); - if (!valid) break; - } - return valid; - } - - public int getMinLayer(){ - return this.minY; - } - - public int getMaxLayer(){ - return this.maxY; - } - - public int getHeight(){ - return this.maxY - this.minY; - } - - public int getWidth(){ - return this.maxX - this.minX; - } - - public int getLength(){ - return this.maxZ - this.minZ; - } - - public HashMap> getStructureLayer(int layer){ - return mainGroup.getStructureLayer(layer); - } - - public HashMap> getStructureLayer(StructureGroup group, int layer){ - return group.getStructureLayer(layer); - } - - public void removeMutex(int mutex, World world, int x, int y, int z){ - for (StructureGroup group : blockGroups){ - if (group.mutex == mutex){ - group.deleteBlocksFromWorld(world, x, y, z); - } - } - } -} diff --git a/src/api/java/am2/api/enchantment/IAMEnchantmentHelper.java b/src/api/java/am2/api/enchantment/IAMEnchantmentHelper.java deleted file mode 100644 index 40a9dab..0000000 --- a/src/api/java/am2/api/enchantment/IAMEnchantmentHelper.java +++ /dev/null @@ -1,13 +0,0 @@ -package am2.api.enchantment; - -public interface IAMEnchantmentHelper{ - /** - * Gets the current ID for soulbound enchantment - */ - public int getSoulboundID(); - - /** - * Gets the current ID for magic resist enchantment - */ - public int getMagicResistID(); -} diff --git a/src/api/java/am2/api/entities/IEntityManager.java b/src/api/java/am2/api/entities/IEntityManager.java deleted file mode 100644 index a927c5d..0000000 --- a/src/api/java/am2/api/entities/IEntityManager.java +++ /dev/null @@ -1,13 +0,0 @@ -package am2.api.entities; - -public interface IEntityManager{ - /** - * Adds the specified entities to the butchery blacklist (won't be affected by sigil of butchery) - */ - public void addButcheryBlacklist(Class... clazz); - - /** - * Adds the specified entities to the progeny blacklist (won't be affected by sigil of progeny) - */ - public void addProgenyBlacklist(Class... clazz); -} diff --git a/src/api/java/am2/api/events/AffinityChangingEvent.java b/src/api/java/am2/api/events/AffinityChangingEvent.java deleted file mode 100644 index bb80a47..0000000 --- a/src/api/java/am2/api/events/AffinityChangingEvent.java +++ /dev/null @@ -1,19 +0,0 @@ -package am2.api.events; - -import am2.api.spell.enums.Affinity; -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.player.EntityPlayer; - -@Cancelable -public class AffinityChangingEvent extends Event{ - public final EntityPlayer player; - public float amount; - public final Affinity affinity; - - public AffinityChangingEvent(EntityPlayer player, Affinity affinity, float amt){ - this.player = player; - this.amount = amt; - this.affinity = affinity; - } -} diff --git a/src/api/java/am2/api/events/ManaCostEvent.java b/src/api/java/am2/api/events/ManaCostEvent.java deleted file mode 100644 index 6026ec1..0000000 --- a/src/api/java/am2/api/events/ManaCostEvent.java +++ /dev/null @@ -1,24 +0,0 @@ -package am2.api.events; - -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * Fired whenever mana cost of a spell is calculated, after all predefined calculations. - * - * @author Mithion - */ -public class ManaCostEvent extends Event{ - public final ItemStack spell; - public final EntityLivingBase caster; - public float manaCost; - public float burnout; - - public ManaCostEvent(ItemStack spell, EntityLivingBase caster, float manaCost, float burnout){ - this.spell = spell; - this.caster = caster; - this.manaCost = manaCost; - this.burnout = burnout; - } -} diff --git a/src/api/java/am2/api/events/ModifierCalculatedEvent.java b/src/api/java/am2/api/events/ModifierCalculatedEvent.java deleted file mode 100644 index ae7c87a..0000000 --- a/src/api/java/am2/api/events/ModifierCalculatedEvent.java +++ /dev/null @@ -1,41 +0,0 @@ -package am2.api.events; - -import am2.api.spell.enums.SpellModifiers; -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -/** - * Called whenever a spell's modified variable is calculated - * - * @author Mithion - */ -public class ModifierCalculatedEvent extends Event{ - //The attribute being modified - public final SpellModifiers attribute; - //The caster of the spell - public final EntityLivingBase caster; - //The spell being cast. This is a copy of the ItemStack. - public final ItemStack spell; - //the initial value of the variable - public final double initialValue; - //the type of operation being used to modify the value - public final OperationType operation; - - //the final modified value of the variable - public double modifiedValue; - - public enum OperationType{ - ADD, - MULTIPLY - } - - public ModifierCalculatedEvent(ItemStack spell, EntityLivingBase caster, SpellModifiers attribute, double initialValue, double modifiedValue, OperationType operation){ - this.spell = spell; - this.caster = caster; - this.attribute = attribute; - this.initialValue = initialValue; - this.modifiedValue = modifiedValue; - this.operation = operation; - } -} diff --git a/src/api/java/am2/api/events/PlayerMagicLevelChangeEvent.java b/src/api/java/am2/api/events/PlayerMagicLevelChangeEvent.java deleted file mode 100644 index c97a7db..0000000 --- a/src/api/java/am2/api/events/PlayerMagicLevelChangeEvent.java +++ /dev/null @@ -1,19 +0,0 @@ -package am2.api.events; - -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.EntityLivingBase; - -/** - * Raised when a player's magic level changes. - * - * @author Mithion - */ -public class PlayerMagicLevelChangeEvent extends Event{ - public final int level; - public final EntityLivingBase entity; - - public PlayerMagicLevelChangeEvent(EntityLivingBase entity, int level){ - this.entity = entity; - this.level = level; - } -} diff --git a/src/api/java/am2/api/events/ReconstructorRepairEvent.java b/src/api/java/am2/api/events/ReconstructorRepairEvent.java deleted file mode 100644 index c03fcb5..0000000 --- a/src/api/java/am2/api/events/ReconstructorRepairEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -package am2.api.events; - -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.item.ItemStack; - -@Cancelable -public class ReconstructorRepairEvent extends Event{ - - /** - * The item being repaired. - */ - public ItemStack item; - - /** - * Called when the arcane reconstructor ticks on repairing an item. - * - * @param item - */ - public ReconstructorRepairEvent(ItemStack item){ - this.item = item; - } -} diff --git a/src/api/java/am2/api/events/RegisterCompendiumEntries.java b/src/api/java/am2/api/events/RegisterCompendiumEntries.java deleted file mode 100644 index d99ca8d..0000000 --- a/src/api/java/am2/api/events/RegisterCompendiumEntries.java +++ /dev/null @@ -1,12 +0,0 @@ -package am2.api.events; - -import am2.api.ILoreHelper; -import cpw.mods.fml.common.eventhandler.Event; - -public class RegisterCompendiumEntries extends Event{ - public final ILoreHelper loreHelper; - - public RegisterCompendiumEntries(ILoreHelper helper){ - this.loreHelper = helper; - } -} diff --git a/src/api/java/am2/api/events/RegisterSkillTreeIcons.java b/src/api/java/am2/api/events/RegisterSkillTreeIcons.java deleted file mode 100644 index aafb055..0000000 --- a/src/api/java/am2/api/events/RegisterSkillTreeIcons.java +++ /dev/null @@ -1,12 +0,0 @@ -package am2.api.events; - -import am2.api.spell.ISpellIconManager; -import cpw.mods.fml.common.eventhandler.Event; - -public class RegisterSkillTreeIcons extends Event{ - public final ISpellIconManager manager; - - public RegisterSkillTreeIcons(ISpellIconManager manager){ - this.manager = manager; - } -} diff --git a/src/api/java/am2/api/events/SkillLearnedEvent.java b/src/api/java/am2/api/events/SkillLearnedEvent.java deleted file mode 100644 index 5addc78..0000000 --- a/src/api/java/am2/api/events/SkillLearnedEvent.java +++ /dev/null @@ -1,20 +0,0 @@ -package am2.api.events; - -import am2.api.spell.component.interfaces.ISkillTreeEntry; -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.player.EntityPlayer; - -/** - * Raised when a player learns a skill at the Occulus - * - * @author Mithion - */ -public class SkillLearnedEvent extends Event{ - public final EntityPlayer player; - public final ISkillTreeEntry skill; - - public SkillLearnedEvent(EntityPlayer player, ISkillTreeEntry entry){ - this.player = player; - this.skill = entry; - } -} diff --git a/src/api/java/am2/api/events/SpellCastingEvent.java b/src/api/java/am2/api/events/SpellCastingEvent.java deleted file mode 100644 index 585e89c..0000000 --- a/src/api/java/am2/api/events/SpellCastingEvent.java +++ /dev/null @@ -1,93 +0,0 @@ -package am2.api.events; - -import am2.api.spell.ItemSpellBase; -import am2.api.spell.enums.SpellCastResult; -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; - -public class SpellCastingEvent{ - @Cancelable - public class Pre extends Event{ - /** - * The spell being cast - */ - public final ItemSpellBase spell; - /** - * The caster of the spell - */ - public final EntityLivingBase caster; - /** - * The calculated mana cost of the spell - */ - public final float manaCost; - /** - * The calculated burnout of the spell - */ - public final float burnout; - /** - * The itemstack representing the spell - */ - public final ItemStack stack; - /** - * The result to be returned after casting the spell - */ - public SpellCastResult castResult; - /** - * Is the spell channeled (maintained in any way, not the shape, so beam counts too) - */ - public final boolean isChanneled; - - public Pre(ItemStack stack, ItemSpellBase spell, EntityLivingBase caster, float manaCost, float burnout, boolean isChanneled){ - this.caster = caster; - this.spell = spell; - this.manaCost = manaCost; - this.burnout = burnout; - this.stack = stack; - this.isChanneled = isChanneled; - } - } - - @Cancelable - public class Post extends Event{ - /** - * The spell being cast - */ - public final ItemSpellBase spell; - /** - * The caster of the spell - */ - public final EntityLivingBase caster; - /** - * The calculated mana cost of the spell - */ - public final float manaCost; - /** - * The calculated burnout of the spell - */ - public final float burnout; - /** - * The itemstack representing the spell - */ - public final ItemStack stack; - /** - * The result to be returned after casting the spell - */ - public final SpellCastResult castResult; - /** - * Is the spell channeled (maintained in any way, not the shape, so beam counts too) - */ - public final boolean isChanneled; - - public Post(ItemStack stack, ItemSpellBase spell, EntityLivingBase caster, float manaCost, float burnout, boolean isChanneled, SpellCastResult castResult){ - this.caster = caster; - this.spell = spell; - this.manaCost = manaCost; - this.burnout = burnout; - this.stack = stack; - this.isChanneled = isChanneled; - this.castResult = castResult; - } - } -} diff --git a/src/api/java/am2/api/events/SpellRecipeItemsEvent.java b/src/api/java/am2/api/events/SpellRecipeItemsEvent.java deleted file mode 100644 index 83e9bc7..0000000 --- a/src/api/java/am2/api/events/SpellRecipeItemsEvent.java +++ /dev/null @@ -1,33 +0,0 @@ -package am2.api.events; - -import cpw.mods.fml.common.eventhandler.Event; - -public class SpellRecipeItemsEvent extends Event{ - public final String registeredName; //The registered name of the spell part. Used to identify what spell shape/component/modifier we are working with - public final int ID; //The ID of the spell part. Also can be used to identify what we are working with, if you don't like strings. - - /** - * recipe items, in order, that need to be thrown into the crafting altar in order to create the item. - *
- * Use Items for items, Blocks for blocks, Strings for OreDictionary items, and E:[type flag] followed by an integer for essence amounts. - *
- * Use itemstacks for items/blocks/oredict when meta is required. By default it is meta 0. Quantity (stack size) is ignored. - *
- * Integer pairs represent the type (*=any, 1=neutral, 2=light, 4=dark, etc.), and the quantity of essence required. The type can be used as flags, - *
- * For example: - *
-	 *     new Object[]{ "E:1|2", 1500 } //require 1500 of neutral or 1500 of light power.
-	 *     new Object[]{ "E:*", 1500 } //require 1500 of any kind of power
-	 *     etc.
-	 * 
- */ - public Object[] recipeItems; //The actual recipe items. Change or verify them here. - - public SpellRecipeItemsEvent(String name, int ID, Object[] recipeItems){ - registeredName = name; - this.ID = ID; - this.recipeItems = recipeItems; - } - -} diff --git a/src/api/java/am2/api/flickers/IFlickerController.java b/src/api/java/am2/api/flickers/IFlickerController.java deleted file mode 100644 index 16be238..0000000 --- a/src/api/java/am2/api/flickers/IFlickerController.java +++ /dev/null @@ -1,11 +0,0 @@ -package am2.api.flickers; - -import net.minecraft.tileentity.TileEntity; - -public interface IFlickerController{ - public byte[] getMetadata(IFlickerFunctionality operator); - - public void setMetadata(IFlickerFunctionality operator, byte[] meta); - - public void removeMetadata(IFlickerFunctionality operator); -} diff --git a/src/api/java/am2/api/flickers/IFlickerFunctionality.java b/src/api/java/am2/api/flickers/IFlickerFunctionality.java deleted file mode 100644 index 00aa05b..0000000 --- a/src/api/java/am2/api/flickers/IFlickerFunctionality.java +++ /dev/null @@ -1,22 +0,0 @@ -package am2.api.flickers; - -import am2.api.spell.enums.Affinity; -import net.minecraft.world.World; - -public interface IFlickerFunctionality{ - boolean RequiresPower(); - - int PowerPerOperation(); - - boolean DoOperation(World worldObj, IFlickerController controller, boolean powered); - - boolean DoOperation(World worldObj, IFlickerController controller, boolean powered, Affinity[] flickers); - - void RemoveOperator(World worldObj, IFlickerController controller, boolean powered); - - int TimeBetweenOperation(boolean powered, Affinity[] flickers); - - void RemoveOperator(World worldObj, IFlickerController controller, boolean powered, Affinity[] flickers); - - Object[] getRecipe(); -} diff --git a/src/api/java/am2/api/flickers/IFlickerRegistry.java b/src/api/java/am2/api/flickers/IFlickerRegistry.java deleted file mode 100644 index 17bfece..0000000 --- a/src/api/java/am2/api/flickers/IFlickerRegistry.java +++ /dev/null @@ -1,12 +0,0 @@ -package am2.api.flickers; - -public interface IFlickerRegistry{ - /** - * Attempts to register a flicker operator into the flicker network - * - * @param singleton The instance of the class that should be called upon to perform the operations when loaded into a flicker block - * @param mask The bit mask representing the flicker combination. These are ORed affinity masks. @see am2.api.spell.enums.Affinity.getMask for specific mask flags (flickers represent an affinity) - * @return True if registered, false if the mask is already in use. - */ - public boolean registerFlickerOperator(IFlickerFunctionality singleton, int mask); -} diff --git a/src/api/java/am2/api/illeffect/BadThingTypes.java b/src/api/java/am2/api/illeffect/BadThingTypes.java deleted file mode 100644 index 59e96bd..0000000 --- a/src/api/java/am2/api/illeffect/BadThingTypes.java +++ /dev/null @@ -1,6 +0,0 @@ -package am2.api.illeffect; - -public enum BadThingTypes{ - ALL, - DARKNEXUS -} \ No newline at end of file diff --git a/src/api/java/am2/api/illeffect/IIllEffect.java b/src/api/java/am2/api/illeffect/IIllEffect.java deleted file mode 100644 index 9c709fa..0000000 --- a/src/api/java/am2/api/illeffect/IIllEffect.java +++ /dev/null @@ -1,39 +0,0 @@ -package am2.api.illeffect; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -import java.util.Map; - -/** - * Base interface for an ill effect during spell creation.
- * Included for compatibility; do not directly inherit.
- * Use IllEffectBase instead. - * - * @author Mithion - */ -public interface IIllEffect extends Comparable{ - /** - * The severity level of the effect. Controls at what instability level the effect could be applied. - * - * @return One of the values in the IllEffectSeverity enum. - */ - public IllEffectSeverity GetSeverity(); - - /** - * Callback to actually apply the ill effect. - * - * @param world The world the effect is happening in - * @param x The x coordinate of the vinteum crystal - * @param y The y coordinate of the vinteum crystal - * @param z The z coordinate of the vinteum crystal - * @return A map of entity players affected, as well as any metadata relevant to the effect applied on that player. - */ - public Map ApplyIllEffect(World world, int x, int y, int z); - - /** - * Gets the localized description of this ill effect as pertains to the affected entity player. - * This will only be called based on your own class, so you can assume the metadata matches your metadata output from ApplyIllEffect. - */ - public String getDescription(EntityPlayer player, Object metadata); -} diff --git a/src/api/java/am2/api/illeffect/IllEffectBase.java b/src/api/java/am2/api/illeffect/IllEffectBase.java deleted file mode 100644 index 3970b4b..0000000 --- a/src/api/java/am2/api/illeffect/IllEffectBase.java +++ /dev/null @@ -1,40 +0,0 @@ -package am2.api.illeffect; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -import java.util.Map; - -/** - * Base class for all ill effects. - * - * @author Mithion - */ -public abstract class IllEffectBase implements IIllEffect{ - - @Override - public final int compareTo(Object o){ - if (!(o instanceof IIllEffect)) return 0; - IIllEffect right = (IIllEffect)o; - int myOrdinal = this.GetSeverity().ordinal(); - int theirOrdinal = right.GetSeverity().ordinal(); - - if (myOrdinal == theirOrdinal){ - return 0; - }else if (myOrdinal < theirOrdinal){ - return -1; - }else{ - return 1; - } - } - - @Override - public abstract IllEffectSeverity GetSeverity(); - - @Override - public abstract String getDescription(EntityPlayer player, Object metadata); - - @Override - public abstract Map ApplyIllEffect(World world, int x, int y, int z); - -} diff --git a/src/api/java/am2/api/illeffect/IllEffectSeverity.java b/src/api/java/am2/api/illeffect/IllEffectSeverity.java deleted file mode 100644 index 87ce4aa..0000000 --- a/src/api/java/am2/api/illeffect/IllEffectSeverity.java +++ /dev/null @@ -1,14 +0,0 @@ -package am2.api.illeffect; - -/** - * Varying severities for ill effects during spell creation. - * - * @author Mithion - */ -public enum IllEffectSeverity{ - MINOR, - MODERATE, - MAJOR, - SEVERE, - FATAL -} diff --git a/src/api/java/am2/api/items/IKeystoneHelper.java b/src/api/java/am2/api/items/IKeystoneHelper.java deleted file mode 100644 index 5bc98fe..0000000 --- a/src/api/java/am2/api/items/IKeystoneHelper.java +++ /dev/null @@ -1,34 +0,0 @@ -package am2.api.items; - -import am2.api.blocks.IKeystoneLockable; -import am2.api.items.KeystoneAccessType; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -import java.util.ArrayList; - -public interface IKeystoneHelper{ - /** - * Gets all the keys from all keystones in the entity's inventory - */ - public ArrayList GetKeysInInvenory(EntityLivingBase ent); - - /** - * Returns the key combination made by the specified runes - * - * @param runes An array of runes no larger than three elements (anything above will be ignored) - * @return - */ - public long getKeyFromRunes(ItemStack[] runes); - - /** - * Returns true or false based on whether the passed in player meets the keystone requirements needed to access the specified container - * - * @param inventory The inventory the player is trying to access - * @param player The player attempting the access check - * @param accessMode The operation which you're trying to carry out - this determines the error message if you lack the requisite keystone. - * @return True if the conditions are met, otherwise false - */ - public boolean canPlayerAccess(IKeystoneLockable inventory, EntityPlayer player, KeystoneAccessType accessMode); -} diff --git a/src/api/java/am2/api/items/KeystoneAccessType.java b/src/api/java/am2/api/items/KeystoneAccessType.java deleted file mode 100644 index f29795f..0000000 --- a/src/api/java/am2/api/items/KeystoneAccessType.java +++ /dev/null @@ -1,7 +0,0 @@ -package am2.api.items; - -public enum KeystoneAccessType{ - NONE, - USE, - BREAK -} diff --git a/src/api/java/am2/api/items/armor/ArmorTextureEvent.java b/src/api/java/am2/api/items/armor/ArmorTextureEvent.java deleted file mode 100644 index 2701d9b..0000000 --- a/src/api/java/am2/api/items/armor/ArmorTextureEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -package am2.api.items.armor; - -import cpw.mods.fml.common.eventhandler.Event; - - -public class ArmorTextureEvent extends Event{ - public final int slot; - public final int renderIndex; - - public String texture; - - public ArmorTextureEvent(int slot, int renderIndex){ - this.slot = slot; - this.renderIndex = renderIndex; - } -} diff --git a/src/api/java/am2/api/items/armor/IArmorImbuement.java b/src/api/java/am2/api/items/armor/IArmorImbuement.java deleted file mode 100644 index 4aab7e2..0000000 --- a/src/api/java/am2/api/items/armor/IArmorImbuement.java +++ /dev/null @@ -1,65 +0,0 @@ -package am2.api.items.armor; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import java.util.EnumSet; - -public interface IArmorImbuement{ - /** - * Gets the ID of the infusion effect. Must be unique. - */ - String getID(); - - /** - * Gets the IIcon index for the texture in the GUI - */ - int getIconIndex(); - - /** - * Gets the tier for this infusion - */ - ImbuementTiers getTier(); - - /** - * Gets all situations under which this infusion applies - */ - EnumSet getApplicationTypes(); - - /** - * Applies the effect. This will be called when any of the application types is matched in an event. - * - * @param player The player wearing the armor - * @param world The world the player is in - * @param stack The itemstack that was matched - * @param matchedType The application type that was matched. - * @param params Depends on the application type. - *
- * In the case of ON_TICK, it will be a 1-length array with the first element being the LivingEvent event
- * In the case of ON_JUMP, it will be a 1-length array with the first element being the LivingJumpEvent event
- * In the case of ON_HIT, it will be a 1-length array with the first element being the LivingHurtEvent event
- * In the case of ON_MINING_SPEED, it will be a 1-length array with the first element being the BreakSpeed event
- */ - boolean applyEffect(EntityPlayer player, World world, ItemStack stack, ImbuementApplicationTypes matchedType, Object... params); - - /** - * Gets all armor slots that this effect can be applied to - */ - int[] getValidSlots(); - - /** - * If the slot is on cooldown, can the effect still apply? - */ - boolean canApplyOnCooldown(); - - /** - * Get the amount of cooldown to add to the slot once the effect applies - */ - int getCooldown(); - - /** - * How much does the infusion damage the armor? - */ - int getArmorDamage(); -} diff --git a/src/api/java/am2/api/items/armor/IImbuementRegistry.java b/src/api/java/am2/api/items/armor/IImbuementRegistry.java deleted file mode 100644 index 659f74c..0000000 --- a/src/api/java/am2/api/items/armor/IImbuementRegistry.java +++ /dev/null @@ -1,32 +0,0 @@ -package am2.api.items.armor; - -import net.minecraft.item.ItemStack; - - -public interface IImbuementRegistry{ - /** - * Registers a new imbuement instance into the system - */ - void registerImbuement(IArmorImbuement imbuementInstance); - - /** - * Locates the specified imbuement registered to the passed-in ID. - * Returns null if not found. - */ - IArmorImbuement getImbuementByID(String ID); - - /** - * Returns all imbuements registered into the specified tier for the given armor type (slot). - */ - IArmorImbuement[] getImbuementsForTier(ImbuementTiers tier, int armorType); - - /** - * Is the given imbuement instance present on the passed-in item stack? - */ - boolean isImbuementPresent(ItemStack stack, IArmorImbuement imbuement); - - /** - * Is the given imbuement ID present on the passed-in item stack? - */ - boolean isImbuementPresent(ItemStack stack, String id); -} diff --git a/src/api/java/am2/api/items/armor/ImbuementApplicationTypes.java b/src/api/java/am2/api/items/armor/ImbuementApplicationTypes.java deleted file mode 100644 index 81d8364..0000000 --- a/src/api/java/am2/api/items/armor/ImbuementApplicationTypes.java +++ /dev/null @@ -1,10 +0,0 @@ -package am2.api.items.armor; - -public enum ImbuementApplicationTypes{ - NONE, - ON_TICK, - ON_HIT, - ON_JUMP, - ON_MINING_SPEED, - ON_DEATH -} diff --git a/src/api/java/am2/api/items/armor/ImbuementTiers.java b/src/api/java/am2/api/items/armor/ImbuementTiers.java deleted file mode 100644 index 38ebad2..0000000 --- a/src/api/java/am2/api/items/armor/ImbuementTiers.java +++ /dev/null @@ -1,8 +0,0 @@ -package am2.api.items.armor; - -public enum ImbuementTiers{ - FIRST, - SECOND, - THIRD, - FOURTH -} diff --git a/src/api/java/am2/api/math/AMLineSegment.java b/src/api/java/am2/api/math/AMLineSegment.java deleted file mode 100644 index 4107566..0000000 --- a/src/api/java/am2/api/math/AMLineSegment.java +++ /dev/null @@ -1,41 +0,0 @@ -package am2.api.math; - -public class AMLineSegment{ - private AMVector3 a, b; - - public AMLineSegment(AMVector3 a, AMVector3 b){ - this.a = a; - this.b = b; - } - - public AMVector3 closestPointOnLine(AMVector3 vPoint){ - - // Create the vector from end point vA to our point vPoint. - AMVector3 vVector1 = vPoint.copy().sub(a); - - // Create a normalized direction vector from end point vA to end point vB - AMVector3 vVector2 = b.copy().sub(a).normalize(); - - // Use the distance formula to find the distance of the line segment (or magnitude) - float d = (float)a.distanceTo(b); - - // Using the dot product, we project the vVector1 onto the vector vVector2. - // This essentially gives us the distance from our projected vector from vA. - float t = AMVector3.dotProduct(vVector2, vVector1); - - // If our projected distance from vA, "t", is less than or equal to 0, it must - // be closest to the end point vA. We want to return this end point. - if (t <= 0) - return a.copy(); - - // If our projected distance from vA, "t", is greater than or equal to the magnitude - // or distance of the line segment, it must be closest to the end point vB. So, return vB. - if (t >= d) - return b.copy(); - - AMVector3 vVector3 = vVector2.copy().scale(t); - AMVector3 vClosestPoint = a.copy().add(vVector3); - - return vClosestPoint; - } -} diff --git a/src/api/java/am2/api/math/AMMatrix4.java b/src/api/java/am2/api/math/AMMatrix4.java deleted file mode 100644 index b7ba1b3..0000000 --- a/src/api/java/am2/api/math/AMMatrix4.java +++ /dev/null @@ -1,51 +0,0 @@ -package am2.api.math; - - -public class AMMatrix4{ - float[] mat; - - public AMMatrix4(){ - loadIdentity(); - } - - public AMMatrix4 loadIdentity(){ - this.mat = new float[16]; - float tmp35_34 = (this.mat[10] = this.mat[15] = 1.0F); - this.mat[5] = tmp35_34; - this.mat[0] = tmp35_34; - return this; - } - - public AMVector3 translate(AMVector3 vec){ - float x = vec.x * this.mat[0] + vec.y * this.mat[1] + vec.z * this.mat[2] + this.mat[3]; - float y = vec.x * this.mat[4] + vec.y * this.mat[5] + vec.z * this.mat[6] + this.mat[7]; - float z = vec.x * this.mat[8] + vec.y * this.mat[9] + vec.z * this.mat[10] + this.mat[11]; - vec.x = x; - vec.y = y; - vec.z = z; - return vec; - } - - public static AMMatrix4 rotationMat(double angle, AMVector3 axis){ - axis = axis.copy().normalize(); - float x = axis.x; - float y = axis.y; - float z = axis.z; - angle *= 0.0174532925D; - float cos = (float)Math.cos(angle); - float ocos = 1.0F - cos; - float sin = (float)Math.sin(angle); - AMMatrix4 rotmat = new AMMatrix4(); - rotmat.mat[0] = (x * x * ocos + cos); - rotmat.mat[1] = (y * x * ocos + z * sin); - rotmat.mat[2] = (x * z * ocos - y * sin); - rotmat.mat[4] = (x * y * ocos - z * sin); - rotmat.mat[5] = (y * y * ocos + cos); - rotmat.mat[6] = (y * z * ocos + x * sin); - rotmat.mat[8] = (x * z * ocos + y * sin); - rotmat.mat[9] = (y * z * ocos - x * sin); - rotmat.mat[10] = (z * z * ocos + cos); - rotmat.mat[15] = 1.0F; - return rotmat; - } -} diff --git a/src/api/java/am2/api/math/AMPlane.java b/src/api/java/am2/api/math/AMPlane.java deleted file mode 100644 index 543fc0c..0000000 --- a/src/api/java/am2/api/math/AMPlane.java +++ /dev/null @@ -1,47 +0,0 @@ -package am2.api.math; - -public class AMPlane{ - AMVector3 planeDef[]; - - public AMPlane(AMVector3... plane){ - planeDef = plane; - } - - private AMVector3 planeNormal(){ - AMVector3 vVector1 = new AMVector3(planeDef[2], planeDef[0]); - AMVector3 vVector2 = new AMVector3(planeDef[1], planeDef[0]); - - AMVector3 vNormal = AMVector3.crossProduct(vVector1, vVector2); - - vNormal.normalize(); - return vNormal; - } - - private float planeDistance(AMVector3 normal, AMVector3 point){ - float distance = 0; - distance = -((normal.x * point.x) + (normal.y * point.y) + (normal.z * point.z)); - - return distance; - } - - public boolean lineSegmentCrosses(AMVector3 p1, AMVector3 p2){ - float distance1 = 0, distance2 = 0; - - AMVector3 vNormal = planeNormal(); - - float originDistance = planeDistance(vNormal, planeDef[0]); - - distance1 = ((vNormal.x * p1.x) + // Ax + - (vNormal.y * p1.y) + // Bx + - (vNormal.z * p1.z)) + originDistance; // Cz + D - - distance2 = ((vNormal.x * p2.x) + // Ax + - (vNormal.y * p2.y) + // Bx + - (vNormal.z * p2.z)) + originDistance; // Cz + D - - if (distance1 * distance2 >= 0) // Check to see if both point's distances are both negative or both positive - return false; // Return false if each point has the same sign. -1 and 1 would mean each point is on either side of the plane. -1 -2 or 3 4 wouldn't... - - return true; // The line intersected the plane, Return TRUE - } -} diff --git a/src/api/java/am2/api/math/AMVector2.java b/src/api/java/am2/api/math/AMVector2.java deleted file mode 100644 index ac0c35b..0000000 --- a/src/api/java/am2/api/math/AMVector2.java +++ /dev/null @@ -1,32 +0,0 @@ -package am2.api.math; - -public class AMVector2{ - public double x; - public double y; - - public int iX; - public int iY; - - public AMVector2(double x, double y){ - this.x = x; - this.y = y; - this.iX = (int)x; - this.iY = (int)y; - } - - public AMVector2 subtract(AMVector2 vec){ - return new AMVector2(this.x - vec.x, this.y - vec.y); - } - - public AMVector2 add(AMVector2 vec){ - return new AMVector2(this.x + vec.x, this.y + vec.y); - } - - public AMVector2 multiply(AMVector2 vec){ - return new AMVector2(this.x * vec.x, this.y * vec.y); - } - - public AMVector2 divide(AMVector2 vec){ - return new AMVector2(this.x / vec.x, this.y / vec.y); - } -} diff --git a/src/api/java/am2/api/math/AMVector3.java b/src/api/java/am2/api/math/AMVector3.java deleted file mode 100644 index 78c261f..0000000 --- a/src/api/java/am2/api/math/AMVector3.java +++ /dev/null @@ -1,222 +0,0 @@ -package am2.api.math; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; - -public class AMVector3{ - public float x; - public float y; - public float z; - - public AMVector3(double x, double y, double z){ - this.x = (float)x; - this.y = (float)y; - this.z = (float)z; - } - - public AMVector3(TileEntity tile){ - this.x = (tile.xCoord); - this.y = (tile.yCoord); - this.z = (tile.zCoord); - } - - public AMVector3(Vec3 vec){ - this.x = (float)vec.xCoord; - this.y = (float)vec.yCoord; - this.z = (float)vec.zCoord; - } - - public AMVector3(AMVector3 a, AMVector3 b){ - this.x = a.x - b.x; // Get the X value of our new vector - this.y = a.y - b.y; // Get the Y value of our new vector - this.z = a.z - b.z; // Get the Z value of our new vector - } - - public AMVector3(Entity entity){ - this(entity.posX, entity.posY, entity.posZ); - } - - public AMVector3 add(AMVector3 vec){ - this.x += vec.x; - this.y += vec.y; - this.z += vec.z; - return this; - } - - public AMVector3 sub(AMVector3 vec){ - this.x -= vec.x; - this.y -= vec.y; - this.z -= vec.z; - return this; - } - - public AMVector3 scale(float scale){ - this.x *= scale; - this.y *= scale; - this.z *= scale; - return this; - } - - public AMVector3 scale(float scalex, float scaley, float scalez){ - this.x *= scalex; - this.y *= scaley; - this.z *= scalez; - return this; - } - - public AMVector3 modulo(float divisor){ - this.x %= divisor; - this.y %= divisor; - this.z %= divisor; - return this; - } - - public AMVector3 normalize(){ - float length = length(); - this.x /= length; - this.y /= length; - this.z /= length; - return this; - } - - public float length(){ - return (float)Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); - } - - public float lengthPow2(){ - return this.x * this.x + this.y * this.y + this.z * this.z; - } - - public AMVector3 copy(){ - return new AMVector3(this.x, this.y, this.z); - } - - public static AMVector3 crossProduct(AMVector3 vec1, AMVector3 vec2){ - return new AMVector3(vec1.y * vec2.z - vec1.z * vec2.y, vec1.z * vec2.x - vec1.x * vec2.z, vec1.x * vec2.y - vec1.y * vec2.x); - } - - public static AMVector3 xCrossProduct(AMVector3 vec){ - return new AMVector3(0.0D, vec.z, -vec.y); - } - - public static AMVector3 zCrossProduct(AMVector3 vec){ - return new AMVector3(-vec.y, vec.x, 0.0D); - } - - public static float dotProduct(AMVector3 vec1, AMVector3 vec2){ - return (vec1.x * vec2.x) + (vec1.y * vec2.y) + (vec1.z * vec2.z); - } - - public static float angle(AMVector3 vec1, AMVector3 vec2){ - return anglePreNorm(vec1.copy().normalize(), vec2.copy().normalize()); - } - - public static float anglePreNorm(AMVector3 vec1, AMVector3 vec2){ - return (float)Math.acos(dotProduct(vec1, vec2)); - } - - public static AMVector3 zero(){ - return new AMVector3(0, 0, 0); - } - - public AMVector3 rotate(float angle, AMVector3 axis){ - return AMMatrix4.rotationMat(angle, axis).translate(this); - } - - @Override - public String toString(){ - return "[" + this.x + "," + this.y + "," + this.z + "]"; - } - - public Vec3 toVec3D(){ - return Vec3.createVectorHelper(this.x, this.y, this.z); - } - - public static AMVector3 getPerpendicular(AMVector3 vec){ - if (vec.z == 0.0F){ - return zCrossProduct(vec); - } - return xCrossProduct(vec); - } - - public boolean isZero(){ - return (this.x == 0.0F) && (this.y == 0.0F) && (this.z == 0.0F); - } - - public boolean isWithinRange(float min, float max){ - return (this.x >= min && x <= max) && (this.y >= min && this.y <= max) && (this.z >= min && this.z <= max); - } - - public double distanceTo(AMVector3 target){ - double var2 = target.x - this.x; - double var4 = target.y - this.y; - double var6 = target.z - this.z; - return MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6); - } - - public double distanceSqTo(AMVector3 target){ - double var2 = target.x - this.x; - double var4 = target.y - this.y; - double var6 = target.z - this.z; - return var2 * var2 + var4 * var4 + var6 * var6; - } - - - /** - * Rounds all values in this Vector to their integral floors - */ - public void floorToI(){ - this.x = (float)Math.floor(this.x); - this.y = (float)Math.floor(this.y); - this.z = (float)Math.floor(this.z); - } - - /** - * Rounds all values in this Vector to their integral logical roundings - */ - public void roundToI(){ - this.x = Math.round(this.x); - this.y = Math.round(this.y); - this.z = Math.round(this.z); - } - - /** - * Rounds all values in this Vector to their integral ceilings - */ - public void ceilToI(){ - this.x = (float)Math.ceil(this.x); - this.y = (float)Math.ceil(this.y); - this.z = (float)Math.ceil(this.z); - } - - /** - * Writes the vector3 to the specified compound - note that the way this function works, only one vector3 can be written to a compound at a time. - * Use sub-compounds if you need more! - */ - public void writeToNBT(NBTTagCompound compound){ - compound.setFloat("Vec3_x", x); - compound.setFloat("Vec3_y", y); - compound.setFloat("Vec3_z", z); - } - - public static AMVector3 readFromNBT(NBTTagCompound compound){ - return new AMVector3(compound.getFloat("Vec3_x"), compound.getFloat("Vec3_y"), compound.getFloat("Vec3_z")); - } - - @Override - public boolean equals(Object obj){ - if (obj instanceof AMVector3){ - AMVector3 comp = (AMVector3)obj; - return (comp.x == this.x && comp.y == this.y && comp.z == this.z); - } - return false; - } - - @Override - public int hashCode(){ - return (int)(x + y + z); - } -} diff --git a/src/api/java/am2/api/particles/IBeamParticle.java b/src/api/java/am2/api/particles/IBeamParticle.java deleted file mode 100644 index d3359ae..0000000 --- a/src/api/java/am2/api/particles/IBeamParticle.java +++ /dev/null @@ -1,30 +0,0 @@ -package am2.api.particles; - -public interface IBeamParticle{ - /** - * Sets the beam type. Determines the texture of the beam. Valid types are 0-2. - */ - public void setType(int type); - - /** - * Sets the color from a single integer. Good for hex colors. - */ - public void setRGBColor(int color); - - /** - * Sets the beam color from 3 int values (0-255). - */ - public void setRGBColorI(int r, int g, int b); - - /** - * Sets the beam color from 3 floating point values (0.0f - 1.0f) - */ - public void setRGBColorF(float r, float g, float b); - - /** - * Indicates that this beam is being cast by a player that is in first person. Should only be called when creating a beam from the local player, if the player is in first person. - *
- * This will offset the beam to make it look like it is coming from the player's active item and not their face. - */ - public void setFirstPersonPlayerCast(); -} diff --git a/src/api/java/am2/api/potion/IBuffHelper.java b/src/api/java/am2/api/potion/IBuffHelper.java deleted file mode 100644 index c3c9f59..0000000 --- a/src/api/java/am2/api/potion/IBuffHelper.java +++ /dev/null @@ -1,52 +0,0 @@ -package am2.api.potion; - -public interface IBuffHelper{ - /* - * Potion Names: - - waterBreathing - flight - slowfall - haste - trueSight - regeneration - magicShield - charmed - frostSlowed - temporalAnchor - manaRegen - entangled - wateryGrave - spellReflect - silence - swiftSwim - agility - leap - gravityWell - astralDistortion - levitation - clarity - illumination - manaBoost - manaShield - fury - scrambleSynapses - shrink - - */ - - /** - * Returns the ID of an AM buff, or -1 if not found. - * - * @param name The name of the potion to find. Case sensitive. - */ - public int getPotionID(String name); - - /** - * Adds a potion to the dispel blacklist, essentially making it un-dispellable. - * - * @param id The id to cause dispel to ignore. - * @return True on success, otherwise false. - */ - public void addDispelExclusion(int id); -} diff --git a/src/api/java/am2/api/power/IObeliskFuelHelper.java b/src/api/java/am2/api/power/IObeliskFuelHelper.java deleted file mode 100644 index 2edf852..0000000 --- a/src/api/java/am2/api/power/IObeliskFuelHelper.java +++ /dev/null @@ -1,18 +0,0 @@ -package am2.api.power; - -import net.minecraft.item.ItemStack; - -public interface IObeliskFuelHelper{ - /** - * Registers a new fuel type for the obelisk to burn - * - * @param stack The stack to use as a comparator (stackSize is ignored, just use 1) - * @param burnTime How long the obelisk should burn for when given one of these items - */ - public void registerFuelType(ItemStack stack, int burnTime); - - /** - * Retrieves the burn time for the specified stack. Returns 0 if it is not a valid fuel. - */ - public int getFuelBurnTime(ItemStack stack); -} diff --git a/src/api/java/am2/api/power/IPowerNode.java b/src/api/java/am2/api/power/IPowerNode.java deleted file mode 100644 index 4cf9c89..0000000 --- a/src/api/java/am2/api/power/IPowerNode.java +++ /dev/null @@ -1,57 +0,0 @@ -package am2.api.power; - -import net.minecraft.tileentity.TileEntity; - -/** - * @author Mithion - * This will eventually allow you to interface with the AM power network - currently it is not fully working. - */ -public interface IPowerNode{ - - /** - * Gets the current capacity in the power block - */ - public float getCapacity(); - - /** - * Can this block provide power? - * - * @param type The power type we are checking for - */ - public boolean canProvidePower(PowerTypes type); - - /** - * Can this block relay power? - * - * @param type The type of power we are looking for - */ - public boolean canRelayPower(PowerTypes type); - - /** - * Can this block request power? - */ - public boolean canRequestPower(); - - /** - * Is this block a nexus? - */ - public boolean isSource(); - - /** - * How fast does this block charge? - */ - public int getChargeRate(); - - /** - * Gets the current power type of the block. - */ - public PowerTypes[] getValidPowerTypes(); - - /** - * Offset of any particle effects to the origin of the block - * - * @param axis The axis in question. 0=x, 1=y, 2=z - */ - public float particleOffset(int axis); - -} diff --git a/src/api/java/am2/api/power/PowerTypes.java b/src/api/java/am2/api/power/PowerTypes.java deleted file mode 100644 index 739af4a..0000000 --- a/src/api/java/am2/api/power/PowerTypes.java +++ /dev/null @@ -1,69 +0,0 @@ -package am2.api.power; - -import am2.LogHelper; -import am2.api.ArsMagicaApi; - -import java.security.InvalidParameterException; -import java.util.ArrayList; - -public final class PowerTypes{ - - public static final PowerTypes NONE = new PowerTypes(0, "None", "\u00A7f"); - public static final PowerTypes LIGHT = new PowerTypes(1, "Light", "\u00A7b"); - public static final PowerTypes NEUTRAL = new PowerTypes(2, "Neutral", "\u00A71"); - public static final PowerTypes DARK = new PowerTypes(4, "Dark", "\u00A74"); - - private static final ArrayList allPowerTypes = new ArrayList(){{ - add(LIGHT); - add(NEUTRAL); - add(DARK); - }}; - - private int _id; - private String _name; - private String _chatColor; - - private PowerTypes(int ID, String name, String chatColor){ - if ((ID & -ID) != ID){ - throw new InvalidParameterException(String.format("ID must be a bitflag that is a power of 2! (You used %d)", ID)); - } - _id = ID; - _name = name; - _chatColor = chatColor; - } - - public static void RegisterPowerType(int id, String name, String chatColor){ - if (getByID(id) == NONE){ - LogHelper.info("Attempted to register power type %s with ID of %d, but that ID is already taken! The type was NOT registered!", name, id); - }else{ - allPowerTypes.add(new PowerTypes(id, name, chatColor)); - LogHelper.info("Registered new power type %s with ID %d", name, id); - } - } - - public int ID(){ - return _id; - } - - public String name(){ - return _name; - } - - public String chatColor(){ - if (ArsMagicaApi.instance.getColourblindMode()){ - return ""; - } - return _chatColor; - } - - public static PowerTypes[] all(){ - return allPowerTypes.toArray(new PowerTypes[allPowerTypes.size()]); - } - - public static PowerTypes getByID(int id){ - for (PowerTypes type : all()) - if (type.ID() == id) - return type; - return NONE; - } -} diff --git a/src/api/java/am2/api/spell/ISkillTreeManager.java b/src/api/java/am2/api/spell/ISkillTreeManager.java deleted file mode 100644 index 8de8e32..0000000 --- a/src/api/java/am2/api/spell/ISkillTreeManager.java +++ /dev/null @@ -1,20 +0,0 @@ -package am2.api.spell; - -import am2.api.spell.component.interfaces.ISkillTreeEntry; -import am2.api.spell.enums.SkillPointTypes; -import am2.api.spell.enums.SkillTrees; - -public interface ISkillTreeManager{ - /** - * Registers a spell part into the skill tree (where it can be unlocked). - * Pass a null prerequisite for no prerequisite. - * Throws an exception if the prerequisite passed in is not a registered entry in the skill tree, or if it is in a different tree. - * - * @param shape The shape to register - * @param x The x-coordinate in the skill tree to display the shape IIcon - * @param y The y-coordinate in the skill tree to display the shape IIcon - * @param tree The skill tree to register the shape into - * @param prerequisites The prerequisite skills needed for the shape. - */ - public void RegisterPart(ISkillTreeEntry part, int x, int y, SkillTrees tree, SkillPointTypes requiredPoint, ISkillTreeEntry... prerequisites); -} diff --git a/src/api/java/am2/api/spell/ISpellIconManager.java b/src/api/java/am2/api/spell/ISpellIconManager.java deleted file mode 100644 index 2207bd2..0000000 --- a/src/api/java/am2/api/spell/ISpellIconManager.java +++ /dev/null @@ -1,21 +0,0 @@ -package am2.api.spell; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.util.IIcon; - -@SideOnly(Side.CLIENT) -public interface ISpellIconManager{ - /** - * Returns the IIcon registered to the specified spell name. Returns the missing IIcon if one doesn't exist. - */ - public IIcon getIcon(String spellName); - - /** - * Registers an IIcon to be associated with a spell component - * - * @param spellName The unlocalized name of the spell used when it was registered - * @param IIcon The IIcon of the spell - */ - public void registerIcon(String spellName, IIcon IIcon); -} diff --git a/src/api/java/am2/api/spell/ISpellPartManager.java b/src/api/java/am2/api/spell/ISpellPartManager.java deleted file mode 100644 index 28e645b..0000000 --- a/src/api/java/am2/api/spell/ISpellPartManager.java +++ /dev/null @@ -1,26 +0,0 @@ -package am2.api.spell; - -import am2.api.spell.component.interfaces.ISkillTreeEntry; - -public interface ISpellPartManager{ - /** - * Registers the skill tree entry into the skill manager. - * - * @param component The skill tree entry to register - * @param name The unlocalized name you want to register it to. Local translations are am2.spell.unlocalized_name, so register this into the language registry for localization. - * @return The shifted numeric ID that is used, this should be stored somewhere - */ - public int registerSkillTreeEntry(ISkillTreeEntry component, String name); - - /** - * @param ID The shifted ID of the skill. - * @return The skill tree entry or null if not found. - */ - public ISkillTreeEntry getSkill(int ID); - - /** - * @param name The unlocalized name of the skill - * @return The skill tree entry or null if not found. - */ - public ISkillTreeEntry getSkill(String name); -} diff --git a/src/api/java/am2/api/spell/ISpellUtils.java b/src/api/java/am2/api/spell/ISpellUtils.java deleted file mode 100644 index 71ff3b0..0000000 --- a/src/api/java/am2/api/spell/ISpellUtils.java +++ /dev/null @@ -1,31 +0,0 @@ -package am2.api.spell; - -import am2.api.spell.enums.SpellModifiers; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface ISpellUtils{ - - public double getModifiedDouble_Mul(double defaultValue, ItemStack stack, EntityLivingBase caster, Entity target, World world, SpellModifiers check); - - public int getModifiedInt_Mul(int defaultValue, ItemStack stack, EntityLivingBase caster, Entity target, World world, SpellModifiers check); - - public double getModifiedDouble_Mul(SpellModifiers check, ItemStack stack, EntityLivingBase caster, Entity target, World world); - - public int getModifiedInt_Mul(SpellModifiers check, ItemStack stack, EntityLivingBase caster, Entity target, World world); - - public double getModifiedDouble_Add(double defaultValue, ItemStack stack, EntityLivingBase caster, Entity target, World world, SpellModifiers check); - - public int getModifiedInt_Add(int defaultValue, ItemStack stack, EntityLivingBase caster, Entity target, World world, SpellModifiers check); - - public double getModifiedDouble_Add(SpellModifiers check, ItemStack stack, EntityLivingBase caster, Entity target, World world); - - public int getModifiedInt_Add(SpellModifiers check, ItemStack stack, EntityLivingBase caster, Entity target, World world); - - public boolean modifierIsPresent(SpellModifiers check, ItemStack stack); - - public int countModifiers(SpellModifiers check, ItemStack stack); - -} diff --git a/src/api/java/am2/api/spell/ItemSpellBase.java b/src/api/java/am2/api/spell/ItemSpellBase.java deleted file mode 100644 index bc6f43b..0000000 --- a/src/api/java/am2/api/spell/ItemSpellBase.java +++ /dev/null @@ -1,29 +0,0 @@ -package am2.api.spell; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -/** - * This is just here for reference - you shouldn't have any need to inherit from this item. To add new parts to spells, inherit from ISpellShape, ISpellModifier, or ISpellComponent. - * - * @author Mithion - */ -public abstract class ItemSpellBase extends Item{ - public ItemSpellBase(){ - super(); - } - - /** - * Specific version of getMovingObjectPosition that takes into account the targeting types that I need - * - * @param caster The caster of the spell - * @param world The world the spell is being cast in - * @param range The range to raycast - * @param targetEntities Stop at collision with entities - * @param targetWater Stop at collision with any non-solid block - * @return A MovingObjectPosition instance if a collision was found, null otherwise - */ - public abstract MovingObjectPosition getMovingObjectPosition(EntityLivingBase caster, World world, double range, boolean targetEntities, boolean targetWater); -} diff --git a/src/api/java/am2/api/spell/component/interfaces/IRitualInteraction.java b/src/api/java/am2/api/spell/component/interfaces/IRitualInteraction.java deleted file mode 100644 index 2d64500..0000000 --- a/src/api/java/am2/api/spell/component/interfaces/IRitualInteraction.java +++ /dev/null @@ -1,23 +0,0 @@ -package am2.api.spell.component.interfaces; - -import am2.api.blocks.MultiblockStructureDefinition; -import net.minecraft.item.ItemStack; - -public interface IRitualInteraction{ - /** - * Gets a MultiblockStructureDefinition outlining the ritual blocks needed and where they should be relative to a given location. - * This should be instantiated on mod load and cached somewhere, and NOT instantiated upon request. - */ - public MultiblockStructureDefinition getRitualShape(); - - /** - * Gets a list of items that need to be present in {@link #getReagentSearchRadius() getReagentSearchRadius()} for the ritual to match. - * Items on the ground as well as items attached to Wizard's Chalk are included. - */ - public ItemStack[] getReagents(); - - /** - * Gets the radius to search for reagents when checking the ritual. - */ - public int getReagentSearchRadius(); -} diff --git a/src/api/java/am2/api/spell/component/interfaces/ISkillTreeEntry.java b/src/api/java/am2/api/spell/component/interfaces/ISkillTreeEntry.java deleted file mode 100644 index 9d92bf0..0000000 --- a/src/api/java/am2/api/spell/component/interfaces/ISkillTreeEntry.java +++ /dev/null @@ -1,10 +0,0 @@ -package am2.api.spell.component.interfaces; - -public interface ISkillTreeEntry{ - /** - * Gets the ID of the skill. Must be unique among all other skills. - * - * @return The ID of the part. - */ - public int getID(); -} diff --git a/src/api/java/am2/api/spell/component/interfaces/ISpellComponent.java b/src/api/java/am2/api/spell/component/interfaces/ISpellComponent.java deleted file mode 100644 index 462ea5a..0000000 --- a/src/api/java/am2/api/spell/component/interfaces/ISpellComponent.java +++ /dev/null @@ -1,76 +0,0 @@ -package am2.api.spell.component.interfaces; - -import am2.api.spell.enums.Affinity; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import java.util.EnumSet; -import java.util.Random; - -public interface ISpellComponent extends ISpellPart{ - /** - * Apply the effect to a single block - * - * @param stack The item stack that contains the effect data - * @param world The world the effect is in - * @param blockx The x coordinate of the block - * @param blocky The y coordinate of the block - * @param blockz The z coordinate of the block - * @param blockFace The face of the block that was targeted - * @param impactX The x coordinate of the impact - * @param impactY The y coordinate of the impact - * @param impactZ The z coordinate of the impact - * @param caster The caster of the spell - * @return True if the effect was successfully applied to the block - */ - public boolean applyEffectBlock(ItemStack stack, World world, int blockx, int blocky, int blockz, int blockFace, double impactX, double impactY, double impactZ, EntityLivingBase caster); - - /** - * Apply the effect to a single entity - * - * @param stack The stack representing the spell - * @param world The world the spell was cast in - * @param caster The caster of the spell - * @param target The current target of the spell - * @return True if the effect was applied successfully to the entity - */ - public boolean applyEffectEntity(ItemStack stack, World world, EntityLivingBase caster, Entity target); - - /** - * Gets the mana cost of the spell - */ - public float manaCost(EntityLivingBase caster); - - /** - * Gets the burnout of the spell - */ - public float burnout(EntityLivingBase caster); - - /** - * Gets any reagents that must be present in the caster's inventory in order - * to cast the spell. - */ - public ItemStack[] reagents(EntityLivingBase caster); - - /** - * Spawn visual effects for the component - * - * @param colorModifier The color from the color modifier. -1 if missing. - */ - public void spawnParticles(World world, double x, double y, double z, EntityLivingBase caster, Entity target, Random rand, int colorModifier); - - /** - * Gets the affinity of the spell - */ - public EnumSet getAffinity(); - - /** - * Gets the amount (before diminishing returns) that this component, when successfully applied, - * shifts the caster's affinity - * - * @param affinity The affinity being shifted - */ - public float getAffinityShift(Affinity affinity); -} diff --git a/src/api/java/am2/api/spell/component/interfaces/ISpellModifier.java b/src/api/java/am2/api/spell/component/interfaces/ISpellModifier.java deleted file mode 100644 index 51c435d..0000000 --- a/src/api/java/am2/api/spell/component/interfaces/ISpellModifier.java +++ /dev/null @@ -1,47 +0,0 @@ -package am2.api.spell.component.interfaces; - -import am2.api.spell.enums.SpellModifiers; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -import java.util.EnumSet; - -public interface ISpellModifier extends ISpellPart{ - /** - * Returns a list of the aspects of a spell that this modifier can change. - * - * @return - */ - public EnumSet getAspectsModified(); - - /** - * Returns the modified value for the specified type. - * - * @param type The type of value we are modifying - * @param caster The caster - * @param target The target (can be the same as the caster) - * @param world The world in which the spell is being cast. - * @param metadata Any metadata written to the spell for this modifier (obtained from getModifierMetadata) - * @return A factor to multiply the default value by (or add, depending on the component's programming) - */ - public float getModifier(SpellModifiers type, EntityLivingBase caster, Entity target, World world, byte[] metadata); - - /** - * Gets the amount that adding this modifier to the spell alters the mana cost. - * - * @param spellStack The itemstack comprising the spell (in case you want to base it on other modifiers added) - * @param stage The stage in which this modifier has been added (if the modifier is added to multiple stages, this will be called multiple times, once per stage) - * @param quantity The quantity of this multiplier in the specified stage. - */ - public float getManaCostMultiplier(ItemStack spellStack, int stage, int quantity); - - /** - * Gets any metadata needed by this modifier for the current spell. Used, for example, in the color modifier to determine what color was specified. - * - * @param stage The stage this modifier is at - * @param matchedRecipe The items that were added to the crafting altar which resulted in the matching of the recipe. - */ - public byte[] getModifierMetadata(ItemStack[] matchedRecipe); -} diff --git a/src/api/java/am2/api/spell/component/interfaces/ISpellPart.java b/src/api/java/am2/api/spell/component/interfaces/ISpellPart.java deleted file mode 100644 index c7489af..0000000 --- a/src/api/java/am2/api/spell/component/interfaces/ISpellPart.java +++ /dev/null @@ -1,28 +0,0 @@ -package am2.api.spell.component.interfaces; - -/** - * Identifies that this object is either a spell component, a spell modifier, or a spell shape. - * Do not inherit this directly unless you are adding talents and such, rather inherit ISpellComponent, ISpellModifier, or ISpellShape for spell parts. - * - * @author Mithion - */ -public interface ISpellPart extends ISkillTreeEntry{ - - /** - * recipe items, in order, that need to be thrown into the crafting altar in order to create the item. - *
- * Use Items for items, Blocks for blocks, Strings for OreDictionary items, and E:[type flag] followed by an integer for essence amounts. - *
- * Use itemstacks for items/blocks/oredict when meta is required. By default it is meta 0. Quantity (stack size) is ignored. - *
- * Integer pairs represent the type (*=any, 1=neutral, 2=light, 4=dark, etc.), and the quantity of essence required. The type can be used as flags, - *
- * For example: - *
-	 *     new Object[]{ "E:1|2", 1500 } //require 1500 of neutral or 1500 of light power.
-	 *     new Object[]{ "E:*", 1500 } //require 1500 of any kind of power
-	 *     etc.
-	 * 
- */ - public Object[] getRecipeItems(); -} diff --git a/src/api/java/am2/api/spell/component/interfaces/ISpellShape.java b/src/api/java/am2/api/spell/component/interfaces/ISpellShape.java deleted file mode 100644 index 32f6fdc..0000000 --- a/src/api/java/am2/api/spell/component/interfaces/ISpellShape.java +++ /dev/null @@ -1,56 +0,0 @@ -package am2.api.spell.component.interfaces; - -import am2.api.spell.ItemSpellBase; -import am2.api.spell.enums.Affinity; -import am2.api.spell.enums.SpellCastResult; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public interface ISpellShape extends ISpellPart{ - /** - * Creates the target area/entity list and applies the effects to ground/mobs - * - * @param item The spell being cast - * @param stack The itemstack representing the spell - * @param caster The caster of the spell - * @param target The specified target of the spell. If this is not NULL, this is a forced target, and should be included with any other targets of the shape. Otherwise the default spell shape logic should apply. - * @param world The world the spell is being cast in - * @param x The x-coordinate of the spell's effect - * @param y The y-coordinate of the spell's effect - * @param z The z-coordinate of the spell's effect - * @param side The side the spell is applied on - * @param giveXP This is passed along to be given back to the SpellHelper where needed. - * @param useCount The number of ticks the spell item has been in use for - * @return The result of the spell cast. - */ - public SpellCastResult beginStackStage(ItemSpellBase item, ItemStack stack, EntityLivingBase caster, EntityLivingBase target, World world, double x, double y, double z, int side, boolean giveXP, int useCount); - - /** - * Is this shape a valid shape for a channeled/maintained spell? - */ - public boolean isChanneled(); - - /** - * Allows different shapes to vary the mana cost of a spell - * - * @param spellStack the itemstack representing the spell (useful if you want to vary based on added modifiers as well, for example) - * @return - */ - public float manaCostMultiplier(ItemStack spellStack); - - /** - * Is the spell a terminus shape? Return true if this component does not continue the spell chain when proccing. - */ - public boolean isTerminusShape(); - - /** - * Is the shape a principal shape? Return true if this spell requires another shape to proc (like runes and zones) - */ - public boolean isPrincipumShape(); - - /** - * Play the sound for the specified affinity - */ - public String getSoundForAffinity(Affinity affinity, ItemStack stack, World world); -} diff --git a/src/api/java/am2/api/spell/enums/Affinity.java b/src/api/java/am2/api/spell/enums/Affinity.java deleted file mode 100644 index 85ff39b..0000000 --- a/src/api/java/am2/api/spell/enums/Affinity.java +++ /dev/null @@ -1,193 +0,0 @@ -package am2.api.spell.enums; - -import net.minecraft.item.Item; - -public enum Affinity{ - NONE(0, - 0xFFFFFF, - -1, //no direct opposite - new int[]{}, //no major opposites - new int[]{}, //no minor opposites - new int[]{}), - - ARCANE(1, - 0xb935cd, - 9, //nature is direct opposite - new int[]{9, 4, 2, 7}, //Major Opposites: life, earth, water, ice - new int[]{5, 10}, //Minor Opposites: Air, Ender - new int[]{6, 3}), //Adjacent Affinities: Lightning, Fire - - WATER(2, - 0x0b5cef, - 3, //fire is direct opposite - new int[]{7, 4, 1, 10}, //Major Opposites: lightning, earth, arcane, ender - new int[]{5, 7}, //Minor Opposites: Air, Ice - new int[]{9, 8}), //Adjacent Affinities: Life, Nature - - FIRE(3, - 0xef260b, - 2, //water is direct opposite - new int[]{5, 7, 8, 9}, //Major Opposites: air, ice, nature, life - new int[]{4, 6}, //Minor Opposites: Earth, Lightning - new int[]{10, 1}), //Adjacent Affinities: Ender, Arcane - - EARTH(4, - 0x61330b, - 5, //air is direct opposite - new int[]{2, 1, 9, 6}, //Major Opposites: water, arcane, life, lightning - new int[]{8, 3}, //Minor Opposites: Nature, Fire - new int[]{7, 10}), //Adjacent Affinities: Ice, Ender - - AIR(5, - 0x777777, - 4, //earth is direct opposite - new int[]{8, 3, 7, 10}, //Major Opposites: nature, fire, ice, ender - new int[]{2, 1}, //Minor Opposites: Water, Arcane - new int[]{9, 6}), //Adjacent Affinities: Life, Lightning - - LIGHTNING(6, - 0xdece19, - 7, //ice is direct opposite - new int[]{2, 10, 8, 4}, //Major Opposites: water, ender, nature, earth - new int[]{9, 3}, //Minor Opposites: Life, Fire - new int[]{5, 1}), //Adjacent Affinities: Air, Arcane - - ICE(7, - 0xd3e8fc, - 6, //lightning is direct opposite - new int[]{9, 3, 5, 1}, //Major Opposites: life, fire, air, arcane - new int[]{2, 10}, //Minor Opposites: Water, Ender - new int[]{8, 4}), //Adjacent Affinities: Nature, Earth - - NATURE(8, - 0x228718, - 6, //arcane is direct opposite - new int[]{5, 10, 6, 3}, //Major Opposites: air, ender, lightning, fire - new int[]{9, 4}, //Minor Opposites: Life, Earth - new int[]{2, 7}), //Adjacent Affinities: Water, Ice - - LIFE(9, - 0x34e122, - 10, //ender is direct opposite - new int[]{1, 7, 3, 4}, //Major Opposites: arcane, ice, fire, earth - new int[]{8, 6}, //Minor Opposites: Nature, Lightning - new int[]{2, 5}), //Adjacent Affinities: Water, Air - - ENDER(10, - 0x3f043d, - 9, //life is direct opposite - new int[]{8, 6, 2, 5}, //Major Opposites: nature, lightning, water, air - new int[]{1, 7}, //Minor Opposites: Arcane, Ice - new int[]{4, 3}); //Adjacent Affinities: Earth, Fire - - - public int ID; - private int directOpposingAffinity; - private int[] majorOppositions; - private int[] minorOppositions; - private int[] adjacentAffinities; - public Item representItem; - public int representMeta; - public final int color; - - private Affinity(int ID, int color, int directOppositeAffinity, int[] majorOppositions, int[] minorOppositions, int[] adjacentAffinities){ - this.ID = ID; - this.directOpposingAffinity = directOppositeAffinity; - this.majorOppositions = majorOppositions; - this.minorOppositions = minorOppositions; - this.adjacentAffinities = adjacentAffinities; - this.color = color; - } - - public Affinity getOpposingAffinity(){ - if (this.directOpposingAffinity > -1) - return Affinity.values()[this.directOpposingAffinity]; - return Affinity.NONE; - } - - public Affinity[] getMajorOpposingAffinities(){ - Affinity[] opposing = new Affinity[this.majorOppositions.length]; - int count = 0; - for (int i : this.majorOppositions){ - opposing[count++] = Affinity.values()[i]; - } - return opposing; - } - - public Affinity[] getMinorOpposingAffinities(){ - Affinity[] opposing = new Affinity[this.minorOppositions.length]; - int count = 0; - for (int i : this.minorOppositions){ - opposing[count++] = Affinity.values()[i]; - } - return opposing; - } - - public Affinity[] getAdjacentAffinities(){ - Affinity[] adjacent = new Affinity[this.adjacentAffinities.length]; - int count = 0; - for (int i : this.adjacentAffinities){ - adjacent[count++] = Affinity.values()[i]; - } - return adjacent; - } - - public void setRepresentItem(Item representItem, int meta){ - if (this.representItem == null){ - this.representItem = representItem; - this.representMeta = meta; - } - } - - public static Affinity getByID(int ID){ - for (Affinity affinity : Affinity.values()){ - if (affinity.ID == ID){ - return affinity; - } - } - return Affinity.NONE; - } - - public static Affinity[] getOrderedAffinities(){ - return new Affinity[]{ - AIR, - LIGHTNING, - ARCANE, - FIRE, - ENDER, - EARTH, - ICE, - NATURE, - WATER, - LIFE - }; - } - - public int getAffinityMask(){ - switch (this){ - case AIR: - return 0x1; - case ARCANE: - return 0x2; - case EARTH: - return 0x4; - case ENDER: - return 0x8; - case FIRE: - return 0x10; - case ICE: - return 0x20; - case LIFE: - return 0x40; - case LIGHTNING: - return 0x80; - case NATURE: - return 0x100; - case WATER: - return 0x200; - case NONE: - default: - return 0; - } - } -} diff --git a/src/api/java/am2/api/spell/enums/BuffPowerLevel.java b/src/api/java/am2/api/spell/enums/BuffPowerLevel.java deleted file mode 100644 index 331127a..0000000 --- a/src/api/java/am2/api/spell/enums/BuffPowerLevel.java +++ /dev/null @@ -1,7 +0,0 @@ -package am2.api.spell.enums; - -public class BuffPowerLevel{ - public static final int Low = 0; - public static final int Medium = 1; - public static final int High = 2; -} diff --git a/src/api/java/am2/api/spell/enums/ContingencyTypes.java b/src/api/java/am2/api/spell/enums/ContingencyTypes.java deleted file mode 100644 index 47e4c59..0000000 --- a/src/api/java/am2/api/spell/enums/ContingencyTypes.java +++ /dev/null @@ -1,10 +0,0 @@ -package am2.api.spell.enums; - -public enum ContingencyTypes{ - NONE, - FALL, - DAMAGE_TAKEN, - ON_FIRE, - HEALTH_LOW, - DEATH -} diff --git a/src/api/java/am2/api/spell/enums/LearnStates.java b/src/api/java/am2/api/spell/enums/LearnStates.java deleted file mode 100644 index 2685501..0000000 --- a/src/api/java/am2/api/spell/enums/LearnStates.java +++ /dev/null @@ -1,9 +0,0 @@ -package am2.api.spell.enums; - -public enum LearnStates{ - LEARNED, - CAN_LEARN, - CANNOT_LEARN, - LOCKED, - DISABLED -}; \ No newline at end of file diff --git a/src/api/java/am2/api/spell/enums/SkillPointTypes.java b/src/api/java/am2/api/spell/enums/SkillPointTypes.java deleted file mode 100644 index 6174c0d..0000000 --- a/src/api/java/am2/api/spell/enums/SkillPointTypes.java +++ /dev/null @@ -1,8 +0,0 @@ -package am2.api.spell.enums; - -public enum SkillPointTypes{ - BLUE, - GREEN, - RED, - SILVER -} diff --git a/src/api/java/am2/api/spell/enums/SkillTrees.java b/src/api/java/am2/api/spell/enums/SkillTrees.java deleted file mode 100644 index 0585746..0000000 --- a/src/api/java/am2/api/spell/enums/SkillTrees.java +++ /dev/null @@ -1,11 +0,0 @@ -package am2.api.spell.enums; - -public enum SkillTrees{ - None, - Offense, - Defense, - Utility, - Talents, - Familiar, - Affinity -} diff --git a/src/api/java/am2/api/spell/enums/SpellCastResult.java b/src/api/java/am2/api/spell/enums/SpellCastResult.java deleted file mode 100644 index e2138d6..0000000 --- a/src/api/java/am2/api/spell/enums/SpellCastResult.java +++ /dev/null @@ -1,11 +0,0 @@ -package am2.api.spell.enums; - -public enum SpellCastResult{ - SUCCESS, - NOT_ENOUGH_MANA, - REAGENTS_MISSING, - MALFORMED_SPELL_STACK, - EFFECT_FAILED, - SUCCESS_REDUCE_MANA, - SILENCED -} diff --git a/src/api/java/am2/api/spell/enums/SpellModifiers.java b/src/api/java/am2/api/spell/enums/SpellModifiers.java deleted file mode 100644 index 5e11f0a..0000000 --- a/src/api/java/am2/api/spell/enums/SpellModifiers.java +++ /dev/null @@ -1,31 +0,0 @@ -package am2.api.spell.enums; - -public enum SpellModifiers{ - SPEED(1.0D), - GRAVITY(0), - BOUNCE(0), - DAMAGE(4.0D), - HEALING(1.0D), - VELOCITY_ADDED(0.0D), - RADIUS(1.0D), - DURATION(1.0D), - PROCS(1), - RANGE(8.0D), - TARGET_NONSOLID_BLOCKS(0), - PIERCING(2), - COLOR(0xFFFFFF), - MINING_POWER(1), - FORTUNE_LEVEL(1), - SILKTOUCH_LEVEL(1), - DISMEMBERING_LEVEL(1), - BUFF_POWER(1), - HOMING(0); - - public double defaultValue = 0D; - public int defaultValueInt = 0; - - private SpellModifiers(double defaultValue){ - this.defaultValue = defaultValue; - this.defaultValueInt = (int)defaultValue; - } -} diff --git a/src/api/java/makeo/gadomancy/api/AuraEffect.java b/src/api/java/makeo/gadomancy/api/AuraEffect.java deleted file mode 100644 index ff284c7..0000000 --- a/src/api/java/makeo/gadomancy/api/AuraEffect.java +++ /dev/null @@ -1,150 +0,0 @@ -package makeo.gadomancy.api; - -import net.minecraft.entity.Entity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import thaumcraft.api.aspects.Aspect; - -import java.util.Random; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by HellFirePvP @ 17.11.2015 14:36 - */ -public abstract class AuraEffect { - - /** - * Return the EffectType you want to use here. - * - * EffectType.ENTITY_EFFECT selects entities within {@link AuraEffect#getRange()} - * range and fires the Entity-related methods - * - * EffectType.BLOCK_EFFECT selects random locations within {@link #getRange()} - * range and fires {@link #doBlockEffect(net.minecraft.util.ChunkCoordinates, net.minecraft.util.ChunkCoordinates, net.minecraft.world.World)} - * - * Returning null will cause BOTH effects to happen and thus, both should be implemented. - */ - public abstract EffectType getEffectType(); - - /** - * Only fired when {@link #getEffectType()} returns {@link makeo.gadomancy.api.AuraEffect.EffectType#ENTITY_EFFECT} - * - * @param e an entity to check if it should be handled. - * @return if the entity should be handled with {@link #doEntityEffect(net.minecraft.util.ChunkCoordinates, net.minecraft.entity.Entity)} - */ - public abstract boolean isEntityApplicable(Entity e); - - /** - * Only fired when {@link #getEffectType()} returns {@link makeo.gadomancy.api.AuraEffect.EffectType#ENTITY_EFFECT} - * Do the actual effect on the Entity here. - * - * @param originTile where the master tile of the aura pylon is. - * @param e an entity where {@link #isEntityApplicable(net.minecraft.entity.Entity)} returned true - */ - public abstract void doEntityEffect(ChunkCoordinates originTile, Entity e); - - /** - * Only fired when {@link #getEffectType()} returns {@link makeo.gadomancy.api.AuraEffect.EffectType#BLOCK_EFFECT} - * - * @param random a random to evaluate random numbers. convenience reasons - * @return the amount of blocks that should be collected. - */ - public abstract int getBlockCount(Random random); - - /** - * Only fired when {@link #getEffectType()} returns {@link makeo.gadomancy.api.AuraEffect.EffectType#BLOCK_EFFECT} - * Do the actual effect on a block here. - * - * @param originTile where the master tile of the aura pylon is. - * @param selectedBlock a selected block - * @param world world of the tile and the block - */ - public abstract void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world); - - /** - * Returns the tick interval how often the aura effect is called - */ - public int getTickInterval() { - return 8; - } - - /** - * Get the range of the aura pylon's effect - * - * Defines - * - the range where entities are collected around the pylon. - * - the range where blocks are collected around the pylon. - * - how close the player has to be to get the aura's research - */ - public double getRange() { - return 8; - } - - /** - * Registers the AuraEffect to the given Aspect. - * - * @param a to register this to. - * @return the current AuraEffect object - */ - public AuraEffect register(Aspect a) { - GadomancyApi.registerAdditionalAuraEffect(a, this); - return this; - } - - /** - * A EntityEffect AuraEffect class for convenience - */ - public static abstract class EntityAuraEffect extends AuraEffect { - - @Override - public final EffectType getEffectType() { - return EffectType.ENTITY_EFFECT; - } - - @Override - public abstract boolean isEntityApplicable(Entity e); - - @Override - public abstract void doEntityEffect(ChunkCoordinates originTile, Entity e); - - @Override - public final int getBlockCount(Random random) { - return 0; - } - - @Override - public final void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {} - } - - /** - * A BlockEffect AuraEffect class for convenience - */ - public static abstract class BlockAuraEffect extends AuraEffect { - - @Override - public final EffectType getEffectType() { - return EffectType.BLOCK_EFFECT; - } - - @Override - public final boolean isEntityApplicable(Entity e) { - return false; - } - - @Override - public final void doEntityEffect(ChunkCoordinates originTile, Entity e) {} - - } - - public static enum EffectType { - - ENTITY_EFFECT, - BLOCK_EFFECT - - } - -} diff --git a/src/api/java/makeo/gadomancy/api/ClickBehavior.java b/src/api/java/makeo/gadomancy/api/ClickBehavior.java deleted file mode 100644 index ef9b7a3..0000000 --- a/src/api/java/makeo/gadomancy/api/ClickBehavior.java +++ /dev/null @@ -1,57 +0,0 @@ -package makeo.gadomancy.api; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 11.10.2015 12:09 - */ -public abstract class ClickBehavior { - protected World world; - protected Block block; - protected int x, y, z, metadata; - - protected boolean hasVisCost; - - public ClickBehavior(boolean hasVisCost) { - this.hasVisCost = hasVisCost; - } - - public ClickBehavior() { - this(false); - } - - /** - * This method is called by me to init all variables - */ - @Deprecated - public void init(World world, Block block, int x, int y, int z, int metadata) { - this.world = world; - this.block = block; - this.x = x; - this.y = y; - this.z = z; - this.metadata = metadata; - } - - /** - * @return if this class needs to handle the given block - */ - public abstract boolean isValidForBlock(); - - //TODO not handled as expected. - public boolean hasVisCost() { - return hasVisCost; - } - - public int getComparatorOutput() { - return 0; - } - - public void addInstability(int instability) { } -} diff --git a/src/api/java/makeo/gadomancy/api/GadomancyApi.java b/src/api/java/makeo/gadomancy/api/GadomancyApi.java deleted file mode 100644 index fdd6d77..0000000 --- a/src/api/java/makeo/gadomancy/api/GadomancyApi.java +++ /dev/null @@ -1,79 +0,0 @@ -package makeo.gadomancy.api; - -import makeo.gadomancy.api.golems.AdditionalGolemType; -import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; -import makeo.gadomancy.api.internal.IApiHandler; -import net.minecraft.item.ItemStack; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.common.entities.golems.EntityGolemBase; -import thaumcraft.common.entities.golems.EnumGolemType; - -import java.util.List; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 26.07.2015 19:00 - */ -public abstract class GadomancyApi { - private static IApiHandler handler; - public static void setInstance(IApiHandler handler) { - GadomancyApi.handler = handler; - } - - @Deprecated - public static boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType){ - return handler.registerAdditionalGolemType(name, modId, newType); - } - - public static AdditionalGolemType getAdditionalGolemType(String name) { - return handler.getAdditionalGolemType(name); - } - - public static AdditionalGolemType getAdditionalGolemType(EnumGolemType type) { - return getAdditionalGolemType(type.name()); - } - - public static List getAdditionalGolemTypes() { - return handler.getAdditionalGolemTypes(); - } - - public static boolean isAdditionalGolemType(String name) { - return getAdditionalGolemType(name) != null; - } - - public static boolean isAdditionalGolemType(EnumGolemType type) { - return isAdditionalGolemType(type.name()); - } - - public static AdditionalGolemCore getAdditionalGolemCore(EntityGolemBase golem) { - return handler.getAdditionalGolemCore(golem); - } - - public static AdditionalGolemCore getAdditionalGolemCore(ItemStack placer) { - return handler.getAdditionalGolemCore(placer); - } - - public static void setAdditionalGolemCore(EntityGolemBase golem, AdditionalGolemCore core) { - handler.setAdditionalGolemCore(golem, core); - } - - public static boolean registerAdditionalGolemCore(String name, AdditionalGolemCore core) { - return handler.registerAdditionalGolemCore(name, core); - } - - public static void registerAdditionalAuraEffect(Aspect aspect, AuraEffect effect) { - handler.registerAdditionalAuraEffect(aspect, effect); - } - - public static List getAdditionalGolemCores() { - return handler.getAdditionalGolemCores(); - } - - public static void registerClawClickBehavior(ClickBehavior clickBehavior) { - handler.registerClawClickBehavior(clickBehavior); - } -} diff --git a/src/api/java/makeo/gadomancy/api/golems/AdditionalGolemType.java b/src/api/java/makeo/gadomancy/api/golems/AdditionalGolemType.java deleted file mode 100644 index 558fb1d..0000000 --- a/src/api/java/makeo/gadomancy/api/golems/AdditionalGolemType.java +++ /dev/null @@ -1,87 +0,0 @@ -package makeo.gadomancy.api.golems; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import thaumcraft.common.entities.golems.EnumGolemType; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 26.07.2015 20:55 - */ -public abstract class AdditionalGolemType { - private EnumGolemType enumEntry; - private Item placerItem; - private String modId; - - public final int maxHealth; - public final int armor; - public final float movementSpeed; - public final boolean fireResist; - public final int upgradeAmount; - public final int carryLimit; - public final int regenDelay; - public final int strength; - - public AdditionalGolemType(int maxHealth, int armor, float movementSpeed, boolean fireResist, int upgradeAmount, int carryLimit, int regenDelay, int strength) { - this.maxHealth = maxHealth; - this.armor = armor; - this.movementSpeed = movementSpeed; - this.fireResist = fireResist; - this.upgradeAmount = upgradeAmount; - this.carryLimit = carryLimit; - this.regenDelay = regenDelay; - this.strength = strength; - } - - public abstract String getUnlocalizedName(); - - public abstract void registerIcons(IIconRegister ir); - public abstract IIcon getIcon(ItemStack stack, int pass); - - public int getRenderPasses() { return 1; } - - public abstract ResourceLocation getEntityTexture(); - - /** - * @return resource location for the golem inventory slot texture - */ - public abstract ResourceLocation getInvSlotTexture(); - - public EnumGolemType getEnumEntry() { - return enumEntry; - } - - public String getName() { - return enumEntry.name(); - } - - public Item getPlacerItem() { - return placerItem; - } - - public String getModId() { - return modId; - } - - @Deprecated - public final void setEnumEntry(EnumGolemType enumEntry) { - this.enumEntry = enumEntry; - } - - @Deprecated - public void setPlacerItem(Item placerItem) { - this.placerItem = placerItem; - } - - @Deprecated - public void setModId(String modId) { - this.modId = modId; - } -} diff --git a/src/api/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java b/src/api/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java deleted file mode 100644 index 315003d..0000000 --- a/src/api/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java +++ /dev/null @@ -1,81 +0,0 @@ -package makeo.gadomancy.api.golems.cores; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import thaumcraft.common.entities.golems.EntityGolemBase; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 11.08.2015 14:10 - */ -public abstract class AdditionalGolemCore { - private String name; - - /** - * Init your AI stuff here - * @param golem the golem entity - */ - public abstract void setupGolem(EntityGolemBase golem); - - /** - * @return If the golem has a gui - */ - public abstract boolean hasGui(); - - /** - * @return the core that is used to define some basic behaviors of the golem e.g. guard core: mob selection - */ - public byte getBaseCore() { - return 1; - } - - /** - * Open custom a gui here - * Only called if hasGui is true - * @param player player entity - * @param golem golem entity - * @return false -> open default gui true -> no gui - */ - public boolean openGui(EntityPlayer player, EntityGolemBase golem) { - return false; - } - - /** - * @param golem - * @return the held tool item of a golem e.g. fishing rod - */ - public ItemStack getToolItem(EntityGolemBase golem) { - return null; - } - - public String getUnlocalizedGuiText() { - return "gadomancy.golem.core.text.default"; - } - - public abstract String getUnlocalizedName(); - - /** - * @return If you're able to set markers using the golemancers bell - */ - public boolean hasMarkers() { - return true; - } - - /** - * @return the item that is used as a core - */ - public abstract ItemStack getItem(); - - public String getName() { - return name; - } - - @Deprecated - public void setName(String name) { - this.name = name; - } -} diff --git a/src/api/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java b/src/api/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java deleted file mode 100644 index 322c30c..0000000 --- a/src/api/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package makeo.gadomancy.api.golems.events; - -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import thaumcraft.common.entities.golems.EntityGolemBase; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 14.10.2015 14:09 - */ -public class GolemDropPlacerEvent extends Event { - public final EntityPlayer player; - public final EntityItem placer; - public final EntityGolemBase golem; - - public GolemDropPlacerEvent(EntityPlayer player, EntityItem placer, EntityGolemBase golem) { - this.player = player; - this.placer = placer; - this.golem = golem; - } -} diff --git a/src/api/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java b/src/api/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java deleted file mode 100644 index f3d4777..0000000 --- a/src/api/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package makeo.gadomancy.api.golems.events; - -import cpw.mods.fml.common.eventhandler.Event; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import thaumcraft.common.entities.golems.EntityGolemBase; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 14.10.2015 14:09 - */ -public class PlacerCreateGolemEvent extends Event { - public final EntityPlayer player; - public final ItemStack placer; - public final EntityGolemBase golem; - - public PlacerCreateGolemEvent(EntityPlayer player, EntityGolemBase golem, ItemStack placer) { - this.player = player; - this.golem = golem; - this.placer = placer; - } -} diff --git a/src/api/java/makeo/gadomancy/api/internal/IApiHandler.java b/src/api/java/makeo/gadomancy/api/internal/IApiHandler.java deleted file mode 100644 index 1f1a8f4..0000000 --- a/src/api/java/makeo/gadomancy/api/internal/IApiHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -package makeo.gadomancy.api.internal; - -import makeo.gadomancy.api.AuraEffect; -import makeo.gadomancy.api.ClickBehavior; -import makeo.gadomancy.api.golems.AdditionalGolemType; -import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; -import net.minecraft.item.ItemStack; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.common.entities.golems.EntityGolemBase; - -import java.util.List; - -/** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file - * - * Created by makeo @ 14.10.2015 14:28 - */ -public interface IApiHandler { - boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType); - - AdditionalGolemType getAdditionalGolemType(String name); - - List getAdditionalGolemTypes(); - - AdditionalGolemCore getAdditionalGolemCore(EntityGolemBase golem); - - AdditionalGolemCore getAdditionalGolemCore(ItemStack placer); - - boolean registerAdditionalGolemCore(String name, AdditionalGolemCore core); - - void setAdditionalGolemCore(EntityGolemBase golem, AdditionalGolemCore core); - - List getAdditionalGolemCores(); - - void registerClawClickBehavior(ClickBehavior clickBehavior); - - void registerAdditionalAuraEffect(Aspect aspect, AuraEffect effect); -} diff --git a/src/api/java/tb/api/ITobacco.java b/src/api/java/tb/api/ITobacco.java deleted file mode 100644 index 45c6371..0000000 --- a/src/api/java/tb/api/ITobacco.java +++ /dev/null @@ -1,9 +0,0 @@ -package tb.api; - -import net.minecraft.entity.player.EntityPlayer; - -public interface ITobacco { - - public abstract void performTobaccoEffect(EntityPlayer smoker, int metadata, boolean isSilverwood); - -} diff --git a/src/api/java/vazkii/botania/api/BotaniaAPI.java b/src/api/java/vazkii/botania/api/BotaniaAPI.java deleted file mode 100644 index 96acba8..0000000 --- a/src/api/java/vazkii/botania/api/BotaniaAPI.java +++ /dev/null @@ -1,676 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:15:28 PM (GMT)] - */ -package vazkii.botania.api; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.util.EnumHelper; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.api.brew.Brew; -import vazkii.botania.api.internal.DummyMethodHandler; -import vazkii.botania.api.internal.DummySubTile; -import vazkii.botania.api.internal.IInternalMethodHandler; -import vazkii.botania.api.lexicon.KnowledgeType; -import vazkii.botania.api.lexicon.LexiconCategory; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipeMiniFlower; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipePureDaisy; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; -import vazkii.botania.api.subtile.signature.BasicSignature; -import vazkii.botania.api.subtile.signature.SubTileSignature; -import vazkii.botania.api.wiki.IWikiProvider; -import vazkii.botania.api.wiki.SimpleWikiProvider; -import vazkii.botania.api.wiki.WikiHooks; - -import com.google.common.collect.BiMap; -import com.google.common.collect.HashBiMap; - -import cpw.mods.fml.common.Loader; - -public final class BotaniaAPI { - - private static List categories = new ArrayList(); - private static List allEntries = new ArrayList(); - - public static Map knowledgeTypes = new HashMap(); - - public static Map brewMap = new LinkedHashMap(); - - public static List disposableBlocks = new ArrayList(); - public static List semiDisposableBlocks = new ArrayList(); - - public static List petalRecipes = new ArrayList(); - public static List pureDaisyRecipes = new ArrayList(); - public static List manaInfusionRecipes = new ArrayList(); - public static List runeAltarRecipes = new ArrayList(); - public static List elvenTradeRecipes = new ArrayList(); - public static List brewRecipes = new ArrayList(); - public static List miniFlowerRecipes = new ArrayList(); - - private static BiMap> subTiles = HashBiMap.> create(); - private static Map, SubTileSignature> subTileSignatures = new HashMap, SubTileSignature>(); - public static Set subtilesForCreativeMenu = new LinkedHashSet(); - public static Map subTileMods = new HashMap(); - public static BiMap miniFlowers = HashBiMap. create(); - - public static Map oreWeights = new HashMap(); - public static Map oreWeightsNether = new HashMap(); - public static Map seeds = new HashMap(); - public static Set looniumBlacklist = new LinkedHashSet(); - public static Set paintableBlocks = new LinkedHashSet(); - public static Set magnetBlacklist = new LinkedHashSet(); - public static Set> gravityRodBlacklist = new LinkedHashSet>(); - - public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20); - - public static ArmorMaterial elementiumArmorMaterial = EnumHelper.addArmorMaterial("B_ELEMENTIUM", 18, new int[] { 2, 6, 5, 2 }, 18); - public static ToolMaterial elementiumToolMaterial = EnumHelper.addToolMaterial("B_ELEMENTIUM", 3, 720, 6.2F, 2F, 20); - - public static ArmorMaterial terrasteelArmorMaterial = EnumHelper.addArmorMaterial("TERRASTEEL", 34, new int[] {3, 8, 6, 3}, 26); - public static ToolMaterial terrasteelToolMaterial = EnumHelper.addToolMaterial("TERRASTEEL", 4, 2300, 9F, 3F, 26); - - public static ArmorMaterial manaweaveArmorMaterial = EnumHelper.addArmorMaterial("MANAWEAVE", 5, new int[] { 1, 2, 2, 1 }, 18); - - public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic"); - - public static KnowledgeType basicKnowledge; - public static KnowledgeType elvenKnowledge; - - // This is here for completeness sake, but you shouldn't use it - public static KnowledgeType relicKnowledge; - - // All of these categories are initialized during botania's PreInit stage. - public static LexiconCategory categoryBasics; - public static LexiconCategory categoryMana; - public static LexiconCategory categoryFunctionalFlowers; - public static LexiconCategory categoryGenerationFlowers; - public static LexiconCategory categoryDevices; - public static LexiconCategory categoryTools; - public static LexiconCategory categoryBaubles; - public static LexiconCategory categoryEnder; - public static LexiconCategory categoryAlfhomancy; - public static LexiconCategory categoryMisc; - - public static Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0); - - static { - registerSubTile("", DummySubTile.class); - - basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true); - elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false); - relicKnowledge = registerKnowledgeType("relic", EnumChatFormatting.DARK_PURPLE, false); - - addOreWeight("oreAluminum", 3940); // Tinkers' Construct - addOreWeight("oreAmber", 2075); // Thaumcraft - addOreWeight("oreApatite", 1595); // Forestry - addOreWeight("oreBlueTopaz", 3195); // Ars Magica - addOreWeight("oreCertusQuartz", 3975); // Applied Energistics - addOreWeight("oreChimerite", 3970); // Ars Magica - addOreWeight("oreCinnabar", 2585); // Thaumcraft - addOreWeight("oreCoal", 46525); // Vanilla - addOreWeight("oreCopper", 8325); // IC2, Thermal Expansion, Tinkers' Construct, etc. - addOreWeight("oreDark", 1350); // EvilCraft - addOreWeight("oreDarkIron", 1700); // Factorization (older versions) - addOreWeight("oreFzDarkIron", 1700); // Factorization (newer versions) - addOreWeight("oreDiamond", 1265); // Vanilla - addOreWeight("oreEmerald", 780); // Vanilla - addOreWeight("oreGalena", 1000); // Factorization - addOreWeight("oreGold", 2970); // Vanilla - addOreWeight("oreInfusedAir", 925); // Thaumcraft - addOreWeight("oreInfusedEarth", 925); // Thaumcraft - addOreWeight("oreInfusedEntropy", 925); // Thaumcraft - addOreWeight("oreInfusedFire", 925); // Thaumcraft - addOreWeight("oreInfusedOrder", 925); // Thaumcraft - addOreWeight("oreInfusedWater", 925); // Thaumcraft - addOreWeight("oreIron", 20665); // Vanilla - addOreWeight("oreLapis", 1285); // Vanilla - addOreWeight("oreLead", 7985); // IC2, Thermal Expansion, Factorization, etc. - addOreWeight("oreMCropsEssence", 3085); // Magical Crops - addOreWeight("oreMithril", 8); // Thermal Expansion - addOreWeight("oreNickel", 2275); // Thermal Expansion - addOreWeight("oreOlivine", 1100); // Project RED - addOreWeight("orePlatinum", 365); // Thermal Expansion - addOreWeight("oreRedstone", 6885); // Vanilla - addOreWeight("oreRuby", 1100); // Project RED - addOreWeight("oreSapphire", 1100); // Project RED - addOreWeight("oreSilver", 6300); // Thermal Expansion, Factorization, etc. - addOreWeight("oreSulfur", 1105); // Railcraft - addOreWeight("oreTin", 9450); // IC2, Thermal Expansion, etc. - addOreWeight("oreUranium", 1337); // IC2 - addOreWeight("oreVinteum", 5925); // Ars Magica - addOreWeight("oreYellorite", 3520); // Big Reactors - addOreWeight("oreZinc", 6485); // Flaxbeard's Steam Power - addOreWeight("oreMythril", 6485); // Simple Ores2 - addOreWeight("oreAdamantium", 2275); // Simple Ores2 - addOreWeight("oreTungsten", 3520); // Simple Tungsten - - addOreWeightNether("oreQuartz", 19600); // Vanilla - addOreWeightNether("oreCobalt", 500); // Tinker's Construct - addOreWeightNether("oreArdite", 500); // Tinker's Construct - addOreWeightNether("oreFirestone", 5); // Railcraft - addOreWeightNether("oreNetherCoal", 17000); // Nether Ores - addOreWeightNether("oreNetherCopper", 4700); // Nether Ores - addOreWeightNether("oreNetherDiamond", 175); // Nether Ores - addOreWeightNether("oreNetherEssence", 2460); // Magical Crops - addOreWeightNether("oreNetherGold", 3635); // Nether Ores - addOreWeightNether("oreNetherIron", 5790); // Nether Ores - addOreWeightNether("oreNetherLapis", 3250); // Nether Ores - addOreWeightNether("oreNetherLead", 2790); // Nether Ores - addOreWeightNether("oreNetherNickel", 1790); // Nether Ores - addOreWeightNether("oreNetherPlatinum", 170); // Nether Ores - addOreWeightNether("oreNetherRedstone", 5600); // Nether Ores - addOreWeightNether("oreNetherSilver", 1550); // Nether Ores - addOreWeightNether("oreNetherSteel", 1690); // Nether Ores - addOreWeightNether("oreNetherTin", 3750); // Nether Ores - addOreWeightNether("oreFyrite", 1000); // Netherrocks - addOreWeightNether("oreAshstone", 1000); // Netherrocks - addOreWeightNether("oreDragonstone", 175); // Netherrocks - addOreWeightNether("oreArgonite", 1000); // Netherrocks - addOreWeightNether("oreOnyx", 500); // SimpleOres 2 - addOreWeightNether("oreHaditeCoal", 500); // Hadite - - addSeed(Items.wheat_seeds, Blocks.wheat); - addSeed(Items.potato, Blocks.potatoes); - addSeed(Items.carrot, Blocks.carrots); - addSeed(Items.nether_wart, Blocks.nether_wart); - addSeed(Items.pumpkin_seeds, Blocks.pumpkin_stem); - addSeed(Items.melon_seeds, Blocks.melon_stem); - - registerModWiki("Minecraft", new SimpleWikiProvider("Minecraft Wiki", "http://minecraft.gamepedia.com/%s")); - - IWikiProvider technicWiki = new SimpleWikiProvider("Technic Wiki", "http://wiki.technicpack.net/%s"); - IWikiProvider mekanismWiki = new SimpleWikiProvider("Mekanism Wiki", "http://wiki.aidancbrady.com/wiki/%s"); - IWikiProvider buildcraftWiki = new SimpleWikiProvider("BuildCraft Wiki", "http://www.mod-buildcraft.com/wiki/doku.php?id=%s"); - - registerModWiki("Mekanism", mekanismWiki); - registerModWiki("MekanismGenerators", mekanismWiki); - registerModWiki("MekanismTools", mekanismWiki); - registerModWiki("EnderIO", new SimpleWikiProvider("EnderIO Wiki", "http://wiki.enderio.com/%s")); - registerModWiki("TropiCraft", new SimpleWikiProvider("Tropicraft Wiki", "http://wiki.tropicraft.net/wiki/%s")); - registerModWiki("RandomThings", new SimpleWikiProvider("Random Things Wiki", "http://randomthingsminecraftmod.wikispaces.com/%s")); - registerModWiki("Witchery", new SimpleWikiProvider("Witchery Wiki", "https://sites.google.com/site/witcherymod/%s", "-", true)); - registerModWiki("AppliedEnergistics2", new SimpleWikiProvider("AE2 Wiki", "http://ae-mod.info/%s")); - registerModWiki("BigReactors", technicWiki); - registerModWiki("BuildCraft|Core", buildcraftWiki); - registerModWiki("BuildCraft|Builders", buildcraftWiki); - registerModWiki("BuildCraft|Energy", buildcraftWiki); - registerModWiki("BuildCraft|Factory", buildcraftWiki); - registerModWiki("BuildCraft|Silicon", buildcraftWiki); - registerModWiki("BuildCraft|Transport", buildcraftWiki); - registerModWiki("ArsMagica2", new SimpleWikiProvider("ArsMagica2 Wiki", "http://wiki.arsmagicamod.com/wiki/%s")); - registerModWiki("PneumaticCraft", new SimpleWikiProvider("PneumaticCraft Wiki", "http://www.minemaarten.com/wikis/pneumaticcraft-wiki/pneumaticcraft-wiki-%s")); - registerModWiki("StevesCarts2", new SimpleWikiProvider("Steve's Carts Wiki", "http://stevescarts2.wikispaces.com/%s")); - registerModWiki("GanysSurface", new SimpleWikiProvider("Gany's Surface Wiki", "http://ganys-surface.wikia.com/wiki/%s")); - registerModWiki("GanysNether", new SimpleWikiProvider("Gany's Nether Wiki", "http://ganys-nether.wikia.com/wiki/%s")); - registerModWiki("GanysEnd", new SimpleWikiProvider("Gany's End Wiki", "http://ganys-end.wikia.com/wiki/%s")); - - registerPaintableBlock(Blocks.stained_glass); - registerPaintableBlock(Blocks.stained_glass_pane); - registerPaintableBlock(Blocks.stained_hardened_clay); - registerPaintableBlock(Blocks.wool); - registerPaintableBlock(Blocks.carpet); - - registerDisposableBlock("dirt"); // Vanilla - registerDisposableBlock("sand"); // Vanilla - registerDisposableBlock("gravel"); // Vanilla - registerDisposableBlock("cobblestone"); // Vanilla - registerDisposableBlock("netherrack"); // Vanilla - registerSemiDisposableBlock("stoneAndesite"); // Botania - registerSemiDisposableBlock("stoneBasalt"); // Botania - registerSemiDisposableBlock("stoneDiorite"); // Botania - registerSemiDisposableBlock("stoneGranite"); // Botania - } - - /** - * The internal method handler in use. - * DO NOT OVERWRITE THIS OR YOU'RE GOING TO FEEL MY WRATH WHEN I UPDATE THE API. - * The fact I have to write that means some moron already tried, don't be that moron. - * @see IInternalMethodHandler - */ - public static IInternalMethodHandler internalHandler = new DummyMethodHandler(); - - /** - * Registers a new Knowledge Type. - * @param id The ID for this knowledge type. - * @param color The color to display this knowledge type as. - */ - public static KnowledgeType registerKnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { - KnowledgeType type = new KnowledgeType(id, color, autoUnlock); - knowledgeTypes.put(id, type); - return type; - } - - /** - * Registers a Brew and returns it. - */ - public static Brew registerBrew(Brew brew) { - brewMap.put(brew.getKey(), brew); - return brew; - } - - /** - * Gets a brew from the key passed in, returns the fallback if - * it's not in the map. - */ - public static Brew getBrewFromKey(String key) { - if(brewMap.containsKey(key)) - return brewMap.get(key); - return fallbackBrew; - } - - /* - * Registers a Block as disposable using its Ore Dictionary Name. - */ - public static void registerDisposableBlock(String oreDictName) { - disposableBlocks.add(oreDictName); - } - - /* - * Registers a Block as semi disposable using its Ore Dictionary Name. - * This means it will not be trashed when sneaking. - */ - public static void registerSemiDisposableBlock(String oreDictName) { - semiDisposableBlocks.add(oreDictName); - } - - /** - * Registers a paintableBlock and returns it. - */ - public static Block registerPaintableBlock(Block paintable){ - paintableBlocks.add(paintable); - return paintable; - } - - /* - * Blacklists an Entity from being affected by the Rod of the Shaded Mesa. - * Pass in the class for the Entity, e.g. EntityCow.class - */ - public static void blacklistEntityFromGravityRod(Class entity) { - gravityRodBlacklist.add(entity); - } - - /* - * Checks if the provided Entity is contained in the Blacklist. - * Pass in the class for the Entity, e.g. entity.getClass() - */ - public static boolean isEntityBlacklistedFromGravityRod(Class entity) { - return gravityRodBlacklist.contains(entity); - } - - /** - * Blacklists an item from being pulled by the Ring of Magnetization. - * Short.MAX_VALUE can be used as the stack's damage for a wildcard. - */ - public static void blacklistItemFromMagnet(ItemStack stack) { - String key = getMagnetKey(stack); - magnetBlacklist.add(key); - } - - /** - * Blacklists a block from having items on top of it being pulled by the Ring of Magnetization. - * Short.MAX_VALUE can be used as meta for a wildcard. - */ - public static void blacklistBlockFromMagnet(Block block, int meta) { - String key = getMagnetKey(block, meta); - magnetBlacklist.add(key); - } - - public static boolean isItemBlacklistedFromMagnet(ItemStack stack) { - return isItemBlacklistedFromMagnet(stack, 0); - } - - public static boolean isItemBlacklistedFromMagnet(ItemStack stack, int recursion) { - if(recursion > 5) - return false; - - if(stack.getItemDamage() != Short.MAX_VALUE) { - ItemStack copy = new ItemStack(stack.getItem(), 0, Short.MAX_VALUE); - boolean general = isItemBlacklistedFromMagnet(copy, recursion + 1); - if(general) - return true; - } - - String key = getMagnetKey(stack); - return magnetBlacklist.contains(key); - } - - public static boolean isBlockBlacklistedFromMagnet(Block block, int meta) { - return isBlockBlacklistedFromMagnet(block, meta, 0); - } - - public static boolean isBlockBlacklistedFromMagnet(Block block, int meta, int recursion) { - if(recursion >= 5) - return false; - - if(meta != Short.MAX_VALUE) { - boolean general = isBlockBlacklistedFromMagnet(block, Short.MAX_VALUE, recursion + 1); - if(general) - return true; - } - - String key = getMagnetKey(block, meta); - return magnetBlacklist.contains(key); - } - - /** - * Registers a Petal Recipe. - * @param output The ItemStack to craft. - * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper - * or String (case for Ore Dictionary). The array can't be larger than 16. - * @return The recipe created. - */ - public static RecipePetals registerPetalRecipe(ItemStack output, Object... inputs) { - RecipePetals recipe = new RecipePetals(output, inputs); - petalRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Pure Daisy Recipe. - * @param input The block that works as an input for the recipe. Can be a Block or an oredict String. - * @param output The block to be placed upon recipe completion. - * @param outputMeta The metadata to be placed upon recipe completion. - * @return The recipe created. - */ - public static RecipePureDaisy registerPureDaisyRecipe(Object input, Block output, int outputMeta) { - RecipePureDaisy recipe = new RecipePureDaisy(input, output, outputMeta); - pureDaisyRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Rune Altar Recipe. - * @param output The ItemStack to craft. - * @param mana The amount of mana required. Don't go over 100000! - * @param inputs The objects for crafting. Can be ItemStack, MappableStackWrapper - * or String (case for Ore Dictionary). The array can't be larger than 16. - * @return The recipe created. - */ - public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) { - RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs); - runeAltarRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Mana Infusion Recipe (throw an item in a mana pool) - * @param output The ItemStack to craft - * @param input The input item, be it an ItemStack or an ore dictionary entry String. - * @param mana The amount of mana required. Don't go over 100000! - * @return The recipe created. - */ - public static RecipeManaInfusion registerManaInfusionRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = new RecipeManaInfusion(output, input, mana); - manaInfusionRecipes.add(recipe); - return recipe; - } - - /** - * Register a Mana Infusion Recipe and flags it as an Alchemy recipe (requires an - * Alchemy Catalyst below the pool). - * @see BotaniaAPI#registerManaInfusionRecipe - */ - public static RecipeManaInfusion registerManaAlchemyRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setAlchemy(true); - return recipe; - } - - /** - * Register a Mana Infusion Recipe and flags it as an Conjuration recipe (requires a - * Conjuration Catalyst below the pool). - * @see BotaniaAPI#registerManaInfusionRecipe - */ - public static RecipeManaInfusion registerManaConjurationRecipe(ItemStack output, Object input, int mana) { - RecipeManaInfusion recipe = registerManaInfusionRecipe(output, input, mana); - recipe.setConjuration(true); - return recipe; - } - - /** - * Registers a Elven Trade recipe (throw an item in an Alfheim Portal). - * @param output The ItemStack to return. - * @param inputs The items required, can be ItemStack or ore dictionary entry string. - * @return The recipe created. - */ - public static RecipeElvenTrade registerElvenTradeRecipe(ItemStack output, Object... inputs) { - RecipeElvenTrade recipe = new RecipeElvenTrade(output, inputs); - elvenTradeRecipes.add(recipe); - return recipe; - } - - /** - * Registers a Brew Recipe (for the Botanical Brewery). - * @param brew The brew in to be set in this recipe. - * @inputs The items used in the recipe, no more than 6. - */ - public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) { - RecipeBrew recipe = new RecipeBrew(brew, inputs); - brewRecipes.add(recipe); - return recipe; - } - - /** - * Registers a SubTileEntity, a new special flower. Look in the subtile package of the API. - * If you call this after PostInit you're a failiure and we are very disappointed in you. - */ - public static void registerSubTile(String key, Class subtileClass) { - subTiles.put(key, subtileClass); - subTileMods.put(key, Loader.instance().activeModContainer().getModId()); - } - - /** - * Register a SubTileEntity and makes it a mini flower. Also adds the recipe and returns it. - * @see BotaniaAPI#registerSubTile - */ - public static RecipeManaInfusion registerMiniSubTile(String key, Class subtileClass, String original) { - registerSubTile(key, subtileClass); - miniFlowers.put(original, key); - - RecipeMiniFlower recipe = new RecipeMiniFlower(key, original, 2500); - manaInfusionRecipes.add(recipe); - miniFlowerRecipes.add(recipe); - return recipe; - } - - /** - * Registers a SubTileEntity's signature. - * @see SubTileSignature - */ - public static void registerSubTileSignature(Class subtileClass, SubTileSignature signature) { - subTileSignatures.put(subtileClass, signature); - } - - /** - * Gets the singleton signature for a SubTileEntity class. Registers a fallback if one wasn't registered - * before the call. - */ - public static SubTileSignature getSignatureForClass(Class subtileClass) { - if(!subTileSignatures.containsKey(subtileClass)) - registerSubTileSignature(subtileClass, new BasicSignature(subTiles.inverse().get(subtileClass))); - - return subTileSignatures.get(subtileClass); - } - - /** - * Gets the singleton signature for a SubTileEntity's name. Registers a fallback if one wasn't registered - * before the call. - */ - public static SubTileSignature getSignatureForName(String name) { - Class subtileClass = subTiles.get(name); - return getSignatureForClass(subtileClass); - } - - /** - * Adds the key for a SubTileEntity into the creative menu. This goes into the - * subtilesForCreativeMenu Set. This does not need to be called for mini flowers, - * those will just use the mini flower map to add themselves next to the source. - */ - public static void addSubTileToCreativeMenu(String key) { - subtilesForCreativeMenu.add(key); - } - - /** - * Adds a category to the list of registered categories to appear in the Lexicon. - */ - public static void addCategory(LexiconCategory category) { - categories.add(category); - } - - /** - * Gets all registered categories. - */ - public static List getAllCategories() { - return categories; - } - - /** - * Gets all registered entries. - */ - public static List getAllEntries() { - return allEntries; - } - - /** - * Registers a Lexicon Entry and adds it to the category passed in. - */ - public static void addEntry(LexiconEntry entry, LexiconCategory category) { - allEntries.add(entry); - category.entries.add(entry); - } - - /** - * Maps an ore (ore dictionary key) to it's weight on the world generation. This - * is used for the Orechid flower. Check the static block in the BotaniaAPI class - * to get the weights for the vanilla blocks.
- * Alternatively get the values with the OreDetector mod:
- * https://gist.github.com/Vazkii/9493322 - */ - public static void addOreWeight(String ore, int weight) { - oreWeights.put(ore, weight); - } - - /** - * Maps an ore (ore dictionary key) to it's weight on the nether world generation. This - * is used for the Orechid Ignem flower. Check the static block in the BotaniaAPI class - * to get the weights for the vanilla blocks.
- * Alternatively get the values with the OreDetector mod:
- * https://gist.github.com/Vazkii/9493322 - */ - public static void addOreWeightNether(String ore, int weight) { - if(ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).size() == 0) - return; - - oreWeightsNether.put(ore, weight); - } - - public static int getOreWeight(String ore) { - return oreWeights.get(ore); - } - - public static int getOreWeightNether(String ore) { - return oreWeightsNether.get(ore); - } - - /** - * Allows an item to be counted as a seed. Any item in this list can be - * dispensed by a dispenser, the block is the block to be placed. - */ - public static void addSeed(Item item, Block block) { - seeds.put(item, block); - } - - /** - * Blacklists an item from the Loonium drop table. - */ - public static void blackListItemFromLoonium(Item item) { - looniumBlacklist.add(item); - } - - /** - * Gets the last recipe to have been added to the recipe list. - */ - public static IRecipe getLatestAddedRecipe() { - List list = CraftingManager.getInstance().getRecipeList(); - return list.get(list.size() - 1); - } - - /** - * Gets the last x recipes added to the recipe list. - */ - public static List getLatestAddedRecipes(int x) { - List list = CraftingManager.getInstance().getRecipeList(); - List newList = new ArrayList(); - for(int i = x - 1; i >= 0; i--) - newList.add(list.get(list.size() - 1 - i)); - - return newList; - } - - /** - * Registers a Wiki provider for a mod so it uses that instead of the fallback - * FTB wiki. Make sure to call this on PostInit only! - */ - public static void registerModWiki(String mod, IWikiProvider provider) { - WikiHooks.registerModWiki(mod, provider); - } - - public static Class getSubTileMapping(String key) { - if(!subTiles.containsKey(key)) - key = ""; - - return subTiles.get(key); - } - - public static String getSubTileStringMapping(Class clazz) { - return subTiles.inverse().get(clazz); - } - - public static Set getAllSubTiles() { - return subTiles.keySet(); - } - - private static String getMagnetKey(ItemStack stack) { - if(stack == null) - return ""; - - return "i_" + stack.getItem().getUnlocalizedName() + "@" + stack.getItemDamage(); - } - - private static String getMagnetKey(Block block, int meta) { - return "bm_" + block.getUnlocalizedName() + "@" + meta; - } - -} diff --git a/src/api/java/vazkii/botania/api/boss/IBotaniaBoss.java b/src/api/java/vazkii/botania/api/boss/IBotaniaBoss.java deleted file mode 100644 index d337e6a..0000000 --- a/src/api/java/vazkii/botania/api/boss/IBotaniaBoss.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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 @ [Oct 29, 2014, 6:09:48 PM (GMT)] - */ -package vazkii.botania.api.boss; - -import java.awt.Rectangle; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.boss.IBossDisplayData; -import net.minecraft.util.ResourceLocation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An extension of IBossDisplayData. This counts as a botania boss and as a normal - * minecraft boss since it has IBossDisplayData. Instead of using the typical - * BossStatus.setBossStatus(entity, true) to set the health bar in the render use - * BotaniaAPI.internalMethodHandler.setBossStatus(entity);

- * Alternatively, you can check if botania is loaded and use the vanilla one - * if that's not the case. - */ -public interface IBotaniaBoss extends IBossDisplayData { - - /** - * The ResourceLocation to bind for this boss's boss bar. - * You can use BotaniaAPI.internalMethodHandler.getDefaultBossBarTexture() to get - * the one used by botania bosses. - */ - @SideOnly(Side.CLIENT) - public ResourceLocation getBossBarTexture(); - - /** - * A Rectangle instance delimiting the uv, width and height of this boss's - * boss bar texture. This is for the background, not the bar that shows - * the HP. - */ - @SideOnly(Side.CLIENT) - public Rectangle getBossBarTextureRect(); - - /** - * A Rectangle instance delimiting the uv, width and height of this boss's - * boss bar HP texture. This is for the foreground that shows how much - * HP the boss has. The width of the rectangle will be multiplied by the - * faction of the boss's current HP by max HP. - */ - @SideOnly(Side.CLIENT) - public Rectangle getBossBarHPTextureRect(); - - /** - * A callback for when this boss's boss bar renders, you can do aditional rendering - * here if needed. - */ - @SideOnly(Side.CLIENT) - public void bossBarRenderCallback(ScaledResolution res, int x, int y); -} diff --git a/src/api/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java b/src/api/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java deleted file mode 100644 index 82221d3..0000000 --- a/src/api/java/vazkii/botania/api/boss/IBotaniaBossWithShader.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 @ [Oct 29, 2014, 6:13:21 PM (GMT)] - */ -package vazkii.botania.api.boss; - -import vazkii.botania.api.internal.ShaderCallback; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Botania boss whose HP bar makes use of shaders. Shaders - * used through this have a few uniforms available: - *
  • int time - The amount of total ticks elapsed.
  • - *
  • int startX - The U coordinate passed in for the render of this bar's texture.
  • - *
  • int startY - The V coordinate passed in for the render of this bar's texture.
  • - */ -public interface IBotaniaBossWithShader extends IBotaniaBoss { - - /** - * The Shader Program to use for this boss bar. Return 0 case - * you don't want a shader to be used. You can use separate shaders - * for the background and foreground. - * @param background True if rendering the background of the boss bar, - * false if rendering the bar itself that shows the HP. - */ - @SideOnly(Side.CLIENT) - public int getBossBarShaderProgram(boolean background); - - /** - * A callback for the shader, used to pass in uniforms. Return null for no callback. - */ - @SideOnly(Side.CLIENT) - public ShaderCallback getBossBarShaderCallback(boolean background, int shader); - -} diff --git a/src/api/java/vazkii/botania/api/brew/Brew.java b/src/api/java/vazkii/botania/api/brew/Brew.java deleted file mode 100644 index d0dd6ba..0000000 --- a/src/api/java/vazkii/botania/api/brew/Brew.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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 @ [Nov 1, 2014, 6:22:54 PM (GMT)] - */ -package vazkii.botania.api.brew; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; - -/** - * The class for a Brew definition, each one is a singleton. - */ -public class Brew { - - String key; - String name; - int color; - int cost; - List effects; - boolean canInfuseBloodPendant = true; - boolean canInfuseIncense = true; - - /** - * @param name The unlocalized name of this potion. - * @param color The color for the potion to be rendered in the bottle, note that it will get - * changed a bit when it renders (for more or less brightness) to give a fancy effect. - * @param cost The cost, in Mana for this brew. - * @param effects A list of effects to apply to the player when they drink it. - */ - public Brew(String key, String name, int color, int cost, PotionEffect... effects) { - this.key = key; - this.name = name; - this.color = color; - this.cost = cost; - this.effects = new ArrayList(Arrays.asList(effects)); - } - - /** - * Sets this brew to not be able to be infused onto the Tainted Blood Pendant. - */ - public Brew setNotBloodPendantInfusable() { - canInfuseBloodPendant = false; - return this; - } - - /** - * Sets this brew to not be able to be infused onto Incense Sticks. - */ - public Brew setNotIncenseInfusable() { - canInfuseIncense = false; - return this; - } - - public boolean canInfuseBloodPendant() { - return canInfuseBloodPendant; - } - - public boolean canInfuseIncense() { - return canInfuseIncense; - } - - /** - * Returns the key for this brew, for it to be found in the map in the API. - * This should ALWAYS return the same result. - */ - public String getKey() { - return key; - } - - /** - * Gets the insensitive unlocalized name. This is used for the lexicon. - */ - public String getUnlocalizedName() { - return name; - } - - /** - * Gets the unlocalized name for the ItemStack passed in. - */ - public String getUnlocalizedName(ItemStack stack) { - return getUnlocalizedName(); - } - - /** - * Gets the display color for the ItemStack passed in. Note that for - * the lexicon, this passes in a botania Managlass Vial or an - * Alfglass Flask at all times. - */ - public int getColor(ItemStack stack) { - return color; - } - - /** - * Gets the insensitive unlocalized mana cost. This is used for the lexicon. - */ - public int getManaCost() { - return cost; - } - - /** - * Gets the mana cost for the ItemStack passed in. - */ - public int getManaCost(ItemStack stack) { - return getManaCost(); - } - - /** - * Gets the list of potion effects for the ItemStack passed in. - * Note that for the lexicon, this passes in a botania Managlass - * Vial or an Alfglass Flask at all times. - */ - public List getPotionEffects(ItemStack stack) { - return effects; - } - -} diff --git a/src/api/java/vazkii/botania/api/brew/IBrewContainer.java b/src/api/java/vazkii/botania/api/brew/IBrewContainer.java deleted file mode 100644 index 0d155ec..0000000 --- a/src/api/java/vazkii/botania/api/brew/IBrewContainer.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 @ [Nov 1, 2014, 6:26:40 PM (GMT)] - */ -package vazkii.botania.api.brew; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this counts as a Brew Container, by which - * it can be used a center item for brew recipes and can contain - * a brew. - */ -public interface IBrewContainer { - - /** - * Returs an ItemStack that should be an item that has the brew - * passed in. - */ - public ItemStack getItemForBrew(Brew brew, ItemStack stack); - - /** - * Gets the cost to add this brew onto this container. Return -1 - * to not allow for the brew to be added. Normally you'd - * use brew.getManaCost(stack); - */ - public int getManaCost(Brew brew, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/brew/IBrewItem.java b/src/api/java/vazkii/botania/api/brew/IBrewItem.java deleted file mode 100644 index d51c9fa..0000000 --- a/src/api/java/vazkii/botania/api/brew/IBrewItem.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 @ [Nov 1, 2014, 9:20:33 PM (GMT)] - */ -package vazkii.botania.api.brew; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this is a Brew item, by which it contains - * a brew. This is only used in vanilla to prevent the brew item - * from going back into the brewery but other mods might use it for whatever. - */ -public interface IBrewItem { - - public Brew getBrew(ItemStack brew); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/CorporeaHelper.java b/src/api/java/vazkii/botania/api/corporea/CorporeaHelper.java deleted file mode 100644 index d4934d7..0000000 --- a/src/api/java/vazkii/botania/api/corporea/CorporeaHelper.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - * 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 @ [Feb 14, 2015, 3:28:54 PM (GMT)] - */ -package vazkii.botania.api.corporea; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; -import java.util.regex.Pattern; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; - -public final class CorporeaHelper { - - private static final List empty = Collections.unmodifiableList(new ArrayList()); - private static final WeakHashMap, List> cachedNetworks = new WeakHashMap(); - private static final List autoCompleteControllers = new ArrayList(); - - private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); - - public static final String[] WILDCARD_STRINGS = new String[] { - "...", "~", "+", "?" , "*" - }; - - /** - * How many items were matched in the last request. If java had "out" params like C# this wouldn't be needed :V - */ - public static int lastRequestMatches = 0; - /** - * How many items were extracted in the last request. - */ - public static int lastRequestExtractions = 0; - - /** - * Gets a list of all the inventories on this spark network. This list is cached for use once every tick, - * and if something changes during that tick it'll still have the first result. - */ - public static List getInventoriesOnNetwork(ICorporeaSpark spark) { - ICorporeaSpark master = spark.getMaster(); - if(master == null) - return empty; - List network = master.getConnections(); - - if(cachedNetworks.containsKey(network)) { - List cache = cachedNetworks.get(network); - if(cache != null) - return cache; - } - - List inventories = new ArrayList(); - if(network != null) - for(ICorporeaSpark otherSpark : network) - if(otherSpark != null) { - IInventory inv = otherSpark.getInventory(); - if(inv != null) - inventories.add(inv); - } - - cachedNetworks.put(network, inventories); - return inventories; - } - - /** - * Gets the amount of available items in the network of the type passed in, checking NBT or not. - * The higher level functions that use a List< IInventory > or a Map< IInventory, Integer > should be - * called instead if the context for those exists to avoid having to get the values again. - */ - public static int getCountInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { - List inventories = getInventoriesOnNetwork(spark); - return getCountInNetwork(stack, inventories, checkNBT); - } - - /** - * Gets the amount of available items in the network of the type passed in, checking NBT or not. - * The higher level function that use a Map< IInventory, Integer > should be - * called instead if the context for this exists to avoid having to get the value again. - */ - public static int getCountInNetwork(ItemStack stack, List inventories, boolean checkNBT) { - Map map = getInventoriesWithItemInNetwork(stack, inventories, checkNBT); - return getCountInNetwork(stack, map, checkNBT); - } - - /** - * Gets the amount of available items in the network of the type passed in, checking NBT or not. - */ - public static int getCountInNetwork(ItemStack stack, Map inventories, boolean checkNBT) { - int count = 0; - - for(IInventory inv : inventories.keySet()) - count += inventories.get(inv); - - return count; - } - - /** - * Gets a Map mapping IInventories to the amount of items of the type passed in that exist - * The higher level function that use a List< IInventory > should be - * called instead if the context for this exists to avoid having to get the value again. - */ - public static Map getInventoriesWithItemInNetwork(ItemStack stack, ICorporeaSpark spark, boolean checkNBT) { - List inventories = getInventoriesOnNetwork(spark); - return getInventoriesWithItemInNetwork(stack, inventories, checkNBT); - } - - /** - * Gets a Map mapping IInventories to the amount of items of the type passed in that exist - * The deeper level function that use a List< IInventory > should be - * called instead if the context for this exists to avoid having to get the value again. - */ - public static Map getInventoriesWithItemInNetwork(ItemStack stack,List inventories, boolean checkNBT) { - Map countMap = new HashMap(); - List wrappedInventories = BotaniaAPI.internalHandler.wrapInventory(inventories); - for (IWrappedInventory inv : wrappedInventories) { - CorporeaRequest request = new CorporeaRequest(stack, checkNBT, -1); - inv.countItems(request); - if (request.foundItems > 0) { - countMap.put(inv.getWrappedObject(), request.foundItems); - } - } - - return countMap; - } - - /** - * Bridge for requestItem() using an ItemStack. - */ - public static List requestItem(ItemStack stack, ICorporeaSpark spark, boolean checkNBT, boolean doit) { - return requestItem(stack, stack.stackSize, spark, checkNBT, doit); - } - - /** - * Bridge for requestItem() using a String and an item count. - */ - public static List requestItem(String name, int count, ICorporeaSpark spark, boolean doit) { - return requestItem(name, count, spark, false, doit); - } - - /** - * Requests list of ItemStacks of the type passed in from the network, or tries to, checking NBT or not. - * This will remove the items from the adequate inventories unless the "doit" parameter is false. - * Returns a new list of ItemStacks of the items acquired or an empty list if none was found. - * Case itemCount is -1 it'll find EVERY item it can. - *

    - * The "matcher" parameter has to be an ItemStack or a String, if the first it'll check if the - * two stacks are similar using the "checkNBT" parameter, else it'll check if the name of the item - * equals or matches (case a regex is passed in) the matcher string. - *

    - * When requesting counting of items, individual stacks may exceed maxStackSize for - * purposes of counting huge amounts. - */ - public static List requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) { - List stacks = new ArrayList(); - CorporeaRequestEvent event = new CorporeaRequestEvent(matcher, itemCount, spark, checkNBT, doit); - if(MinecraftForge.EVENT_BUS.post(event)) - return stacks; - - List inventories = getInventoriesOnNetwork(spark); - List inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories); - Map interceptors = new HashMap(); - - CorporeaRequest request = new CorporeaRequest(matcher, checkNBT, itemCount); - for(IWrappedInventory inv : inventoriesW) { - ICorporeaSpark invSpark = inv.getSpark(); - - Object originalInventory = inv.getWrappedObject(); - if(originalInventory instanceof ICorporeaInterceptor) { - ICorporeaInterceptor interceptor = (ICorporeaInterceptor) originalInventory; - interceptor.interceptRequest(matcher, itemCount, invSpark, spark, stacks, inventories, doit); - interceptors.put(interceptor, invSpark); - } - - if(doit) { - stacks.addAll(inv.extractItems(request)); - } else { - stacks.addAll(inv.countItems(request)); - } - } - - lastRequestMatches = request.foundItems; - lastRequestExtractions = request.extractedItems; - - for(ICorporeaInterceptor interceptor : interceptors.keySet()) - interceptor.interceptRequestLast(matcher, itemCount, interceptors.get(interceptor), spark, stacks, inventories, doit); - - return stacks; - } - - /** - * Gets the spark attached to the inventory passed case it's a TileEntity. - */ - public static ICorporeaSpark getSparkForInventory(IInventory inv) { - if(!(inv instanceof TileEntity)) - return null; - - TileEntity tile = (TileEntity) inv; - return getSparkForBlock(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord); - } - - /** - * Gets the spark attached to the block in the coords passed in. Note that the coords passed - * in are for the block that the spark will be on, not the coords of the spark itself. - */ - public static ICorporeaSpark getSparkForBlock(World world, int x, int y, int z) { - List sparks = world.getEntitiesWithinAABB(ICorporeaSpark.class, AxisAlignedBB.getBoundingBox(x, y + 1, z, x + 1, y + 2, z + 1)); - return sparks.isEmpty() ? null : sparks.get(0); - } - - /** - * Gets if the block in the coords passed in has a spark attached. Note that the coords passed - * in are for the block that the spark will be on, not the coords of the spark itself. - */ - public static boolean doesBlockHaveSpark(World world, int x, int y, int z) { - return getSparkForBlock(world, x, y, z) != null; - } - - /** - * Gets if the slot passed in can be extracted from by a spark. - */ - public static boolean isValidSlot(IInventory inv, int slot) { - return !(inv instanceof ISidedInventory) || arrayHas(((ISidedInventory) inv).getAccessibleSlotsFromSide(ForgeDirection.UP.ordinal()), slot) && ((ISidedInventory) inv).canExtractItem(slot, inv.getStackInSlot(slot), ForgeDirection.UP.ordinal()); - } - - /** - * Gets if two stacks match. - */ - public static boolean stacksMatch(ItemStack stack1, ItemStack stack2, boolean checkNBT) { - return stack1 != null && stack2 != null && stack1.isItemEqual(stack2) && (!checkNBT || ItemStack.areItemStackTagsEqual(stack1, stack2)); - } - - /** - * Gets if the name of a stack matches the string passed in. - */ - public static boolean stacksMatch(ItemStack stack, String s) { - if(stack == null) - return false; - - boolean contains = false; - for(String wc : WILDCARD_STRINGS) { - if(s.endsWith(wc)) { - contains = true; - s = s.substring(0, s.length() - wc.length()); - } - else if(s.startsWith(wc)) { - contains = true; - s = s.substring(wc.length()); - } - - if(contains) - break; - } - - - String name = stripControlCodes(stack.getDisplayName().toLowerCase().trim()); - return equalOrContain(name, s, contains) || equalOrContain(name + "s", s, contains) || equalOrContain(name + "es", s, contains) || name.endsWith("y") && equalOrContain(name.substring(0, name.length() - 1) + "ies", s, contains); - } - - /** - * Clears the cached networks, called once per tick, should not be called outside - * of the botania code. - */ - public static void clearCache() { - cachedNetworks.clear(); - } - - /** - * Helper method to check if an int array contains an int. - */ - public static boolean arrayHas(int[] arr, int val) { - for (int element : arr) - if(element == val) - return true; - - return false; - } - - /** - * Helper method to make stacksMatch() less messy. - */ - public static boolean equalOrContain(String s1, String s2, boolean contain) { - return contain ? s1.contains(s2) : s1.equals(s2); - } - - /** - * Registers a ICorporeaAutoCompleteController - */ - public static void registerAutoCompleteController(ICorporeaAutoCompleteController controller) { - autoCompleteControllers.add(controller); - } - - /** - * Returns if the auto complete helper should run - */ - public static boolean shouldAutoComplete() { - for(ICorporeaAutoCompleteController controller : autoCompleteControllers) - if(controller.shouldAutoComplete()) - return true; - return false; - } - - // Copy from StringUtils - public static String stripControlCodes(String str) { - return patternControlCode.matcher(str).replaceAll(""); - } -} diff --git a/src/api/java/vazkii/botania/api/corporea/CorporeaRequest.java b/src/api/java/vazkii/botania/api/corporea/CorporeaRequest.java deleted file mode 100644 index b3e0bd9..0000000 --- a/src/api/java/vazkii/botania/api/corporea/CorporeaRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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 - * - */ -package vazkii.botania.api.corporea; - -public class CorporeaRequest { - public Object matcher; - public boolean checkNBT; - public int count; - public int foundItems = 0; - public int extractedItems = 0; - - public CorporeaRequest(Object matcher, boolean checkNBT, int count) { - super(); - this.matcher = matcher; - this.checkNBT = checkNBT; - this.count = count; - } - -} diff --git a/src/api/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java b/src/api/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java deleted file mode 100644 index a55ef7b..0000000 --- a/src/api/java/vazkii/botania/api/corporea/CorporeaRequestEvent.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 30, 2015, 2:55:57 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import cpw.mods.fml.common.eventhandler.Cancelable; -import cpw.mods.fml.common.eventhandler.Event; - -/** - * Fired when a corporea request is initiated. Can be cancelled. - */ -@Cancelable -public class CorporeaRequestEvent extends Event { - - public final Object request; - public final int count; - public final ICorporeaSpark spark; - public final boolean checkNBT; - /** - * If false then items won't be pulled. - */ - public final boolean realRequest; - - public CorporeaRequestEvent(Object request, int count, ICorporeaSpark spark, boolean nbt, boolean real) { - this.request = request; - this.count = count; - this.spark = spark; - checkNBT = nbt; - realRequest = real; - } - - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java deleted file mode 100644 index fc0a3e9..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaAutoCompleteController.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 @ [June 8, 2015, 1:04:05 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An interface for systems which may control if the item auto complete system should be active - */ -public interface ICorporeaAutoCompleteController { - - /** - * Return true if auto completion should be enabled. - */ - @SideOnly(Side.CLIENT) - public boolean shouldAutoComplete(); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java deleted file mode 100644 index eeea16a..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaInterceptor.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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 19, 2015, 6:23:31 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * A TileEntity that implements this will be able to intercept corporea - * requests case there is a Corporea Spark on top. - */ -public interface ICorporeaInterceptor { - - /** - * Intercepts a request as it goes. The list of inventories has all the inventories - * at this point, but the list of stacks is not complete. The request parameter can - * be either a String or ItemStack. - */ - public void interceptRequest(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); - - /** - * Intercepts a request after all the stacks have been found and processed. Both the - * list of inventories and stacks is complete at this point. The request parameter can - * be either a String or ItemStack. - */ - public void interceptRequestLast(Object request, int count, ICorporeaSpark spark, ICorporeaSpark source, List stacks, List inventories, boolean doit); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaRequestor.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaRequestor.java deleted file mode 100644 index 66881b5..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaRequestor.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Sep 28, 2015, 11:25:48 AM (GMT)] - */ -package vazkii.botania.api.corporea; - -/** - * A TileEntity that implements this be called by other TileEntities - * to allow for it to do any request at any time. This is used by the - * Corporea Retainer for example. - */ -public interface ICorporeaRequestor { - - /* - * Executes the passed in request. - */ - public void doCorporeaRequest(Object request, int count, ICorporeaSpark spark); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/ICorporeaSpark.java b/src/api/java/vazkii/botania/api/corporea/ICorporeaSpark.java deleted file mode 100644 index 943e29e..0000000 --- a/src/api/java/vazkii/botania/api/corporea/ICorporeaSpark.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * 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 @ [Feb 13, 2015, 10:53:05 PM (GMT)] - */ -package vazkii.botania.api.corporea; - -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * An interface for a Corporea Spark. Includes functions for handling - * connections. - */ -public interface ICorporeaSpark { - - /** - * Called to register the connections for the spark network passed in. Parameters include the master spark, - * which is the one that initiated the chain call, the referrer which passed the call to this instance - * and the List of sparks connected. Normal behavior should be to find any sparks around that are not - * already present in the list of connections and add them to it, passing the function call to them. - *

    - * The connections List and the master Spark should be kept in this instance as pointers for use in - * getConnections() and getMaster() and passed in to any subsequent registerConnections calls on sparks - * found nearby. This is only called whenever a new spark is added or removed from and to the network, - * at that point the connection list in the master spark would be cleared out, also clearing out the one - * in this instance, as it should be a pointer. - */ - public void registerConnections(ICorporeaSpark master, ICorporeaSpark referrer, List connections); - - /** - * Gets the inventory this spark is bound to, generally the one right below it. - */ - public IInventory getInventory(); - - /** - * Gets the list of sparks this spark is connected to, see registerConnections(). This list - * should also include itself. This list must be checked against on a regular basis to verify - * that the spark is still in the network, if that's not the case, the pointer should be - * eliminated. - */ - public List getConnections(); - - /** - * Gets the list of sparks that this spark added to the list of connections during registerConnections(), this - * is mainly used to create a non messy chain of particles to display the network when a spark is right - * clicked with a wand. - */ - public List getRelatives(); - - /** - * Gets the master spark in this network, see registerConnections(). The value this returns - * should be null and the pointer should be eliminated if the spark is no longer present - * in the network. - */ - public ICorporeaSpark getMaster(); - - /** - * Called when an item is extracted from the inventory this spark is attached to through this - * spark. - */ - public void onItemExtracted(ItemStack stack); - - /** - * Called when this spark requests items, passes in the result of the request and not the actual requested stack(s). - */ - public void onItemsRequested(List stacks); - - /** - * Gets if this spark is considered a master spark. - */ - public boolean isMaster(); - - /** - * Gets the network that this spark is on, or the color it's displaying. Sparks may only connect to others - * of the same network, and on changing network should trigger a re-cache of the previous network. - */ - public int getNetwork(); - -} diff --git a/src/api/java/vazkii/botania/api/corporea/IWrappedInventory.java b/src/api/java/vazkii/botania/api/corporea/IWrappedInventory.java deleted file mode 100644 index 1faf366..0000000 --- a/src/api/java/vazkii/botania/api/corporea/IWrappedInventory.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 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 - * - */ -package vazkii.botania.api.corporea; - -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * This interface wraps IInventory corporea works with in order to provide - * compatibility with different storage mods. - * - */ -public interface IWrappedInventory { - - /** - * Break encapsulation and exposes original inventory. - */ - IInventory getWrappedObject(); - - /** - * Counts items in the inventory matching the request - * - * @param request - * - specifies what should be found - * @return List of ItemStack, individual stacks may exceed maxStackSize for - * purposes of counting huge amounts. To get final count requestor - * should sum stackSize of all stacks. - */ - List countItems(CorporeaRequest request); - - /** - * Convenience method for accessing spark over inventory - */ - ICorporeaSpark getSpark(); - - /** - * Extracts items matching request from the inventory.
    - * {@link CorporeaRequest#count} is updated to reflect how many items are - * yet to be extracted.
    - * {@link CorporeaRequest#foundItems} and - * {@link CorporeaRequest#extractedItems} are updated to reflect how many - * items were found and extracted. - * - * @param request - * @return List of ItemStacks to be delivered to the destination. - */ - List extractItems(CorporeaRequest request); -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java b/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java deleted file mode 100644 index f74d0ca..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummyManaNetwork.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * 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 @ [Mar 7, 2014, 3:47:43 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.mana.TileSignature; - -public class DummyManaNetwork implements IManaNetwork { - - public static final DummyManaNetwork instance = new DummyManaNetwork(); - - @Override - public void clear() { - // NO-OP - } - - @Override - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit) { - return null; - } - - @Override - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit) { - return null; - } - - @Override - public List getAllCollectorsInWorld(World world) { - return new ArrayList(); - } - - @Override - public List getAllPoolsInWorld(World world) { - return new ArrayList(); - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java b/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java deleted file mode 100644 index 88ddf47..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummyMethodHandler.java +++ /dev/null @@ -1,235 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:43:03 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; -import vazkii.botania.api.corporea.IWrappedInventory; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.api.lexicon.multiblock.MultiblockSet; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; - -public class DummyMethodHandler implements IInternalMethodHandler { - - @Override - public LexiconPage textPage(String key) { - return dummyPage(key); - } - - @Override - public LexiconPage elfPaperTextPage(String key) { - return dummyPage(key); - } - - @Override - public LexiconPage imagePage(String key, String resource) { - return dummyPage(key); - } - - @Override - public LexiconPage craftingRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage craftingRecipePage(String key, IRecipe recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage petalRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage petalRecipePage(String key, RecipePetals recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage runeRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage manaInfusionRecipesPage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage elvenTradePage(String key, List recipes) { - return dummyPage(key); - } - - @Override - public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage brewPage(String key, String bottomText, RecipeBrew recipe) { - return dummyPage(key); - } - - @Override - public LexiconPage multiblockPage(String key, MultiblockSet mb) { - return dummyPage(key); - } - - private LexiconPage dummyPage(String key) { - return new DummyPage(key); - } - - @Override - public ItemStack getSubTileAsStack(String subTile) { - return new ItemStack(Blocks.stone, 0, 0); - } - - @Override - public ItemStack getSubTileAsFloatingFlowerStack(String subTile) { - return getSubTileAsStack(subTile); - } - - @Override - public String getStackSubTileKey(ItemStack stack) { - return null; - } - - @Override - public IIcon getSubTileIconForName(String name) { - return Blocks.red_flower.getIcon(0, 0); - } - - @Override - public void registerBasicSignatureIcons(String name, IIconRegister register) { - // NO-OP - } - - @Override - public IManaNetwork getManaNetworkInstance() { - return DummyManaNetwork.instance; - } - - @Override - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) { - // NO-OP - } - - @Override - public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound) { - // NO-OP - } - - @Override - public ItemStack getBindDisplayForFlowerType(SubTileEntity e) { - return new ItemStack(Blocks.stone, 0, 0); - } - - @Override - public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) { - // NO-OP - } - - @Override - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m) { - // NO-OP - } - - @Override - public IInventory getBaublesInventory(EntityPlayer player) { - return null; - } - - @Override - public boolean shouldForceCheck() { - return true; - } - - @Override - public int getPassiveFlowerDecay() { - return 0; - } - - @Override - public ResourceLocation getDefaultBossBarTexture() { - return null; - } - - @Override - public void setBossStatus(IBotaniaBoss status) { - // NO-OP - } - - @Override - public boolean isBuildcraftPipe(TileEntity tile) { - return false; - } - - @Override - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) { - // NO-OP - } - - @Override - public boolean hasSolegnoliaAround(Entity e) { - return false; - } - - @Override - public long getWorldElapsedTicks() { - return 0; - } - - @Override - public boolean isBotaniaFlower(World world, int x, int y, int z) { - return false; - } - - @Override - public void sendBaubleUpdatePacket(EntityPlayer player, int slot) { - // NO-OP - } - - @Override - public List wrapInventory(List inventories) { - return null; - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummyPage.java b/src/api/java/vazkii/botania/api/internal/DummyPage.java deleted file mode 100644 index 843198c..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummyPage.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:41:23 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.lexicon.LexiconPage; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A dummy page. It does absolutely nothing and is only - * existant to make sure everything goes right even if - * Botania isn't loaded. - */ -public class DummyPage extends LexiconPage { - - public DummyPage(String unlocalizedName) { - super(unlocalizedName); - } - - @Override - @SideOnly(Side.CLIENT) - public void renderScreen(IGuiLexiconEntry gui, int x, int y) { - // NO-OP - } - -} diff --git a/src/api/java/vazkii/botania/api/internal/DummySubTile.java b/src/api/java/vazkii/botania/api/internal/DummySubTile.java deleted file mode 100644 index d8ac6ab..0000000 --- a/src/api/java/vazkii/botania/api/internal/DummySubTile.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - * 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 @ [Jan 24, 2014, 4:17:33 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import vazkii.botania.api.subtile.SubTileEntity; - -public class DummySubTile extends SubTileEntity { - -} diff --git a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java b/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java deleted file mode 100644 index b0d4d6e..0000000 --- a/src/api/java/vazkii/botania/api/internal/IGuiLexiconEntry.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:48:41 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.GuiButton; -import vazkii.botania.api.lexicon.LexiconEntry; - -/** - * Internal interface for the Lexicon Entry GUI. This contains - * everything that can be accessed from it. It's safe to cast - * this type to GuiScreen. - */ -public interface IGuiLexiconEntry { - - /** - * Gets the entry currently portrayed in this gui. - */ - public LexiconEntry getEntry(); - - /** - * Gets the current page the lexicon GUI is browsing. - */ - public int getPageOn(); - - /** - * Gets the leftmost part of the GUI. - */ - public int getLeft(); - - /** - * Gets the topmost part of the GUI. - */ - public int getTop(); - - /** - * Gets the GUI's width. - */ - public int getWidth(); - - /** - * Gets the GUI's height - */ - public int getHeight(); - - /** - * Gets the GUI's Z level for rendering. - */ - public float getZLevel(); - - /** - * Gets the list of buttons in this gui. - */ - public List getButtonList(); - - /** - * Gets the total amount of ticks (+ partial ticks) the player - * has been in this gui. - */ - public float getElapsedTicks(); - - /** - * Gets the current partial ticks. - */ - public float getPartialTicks(); - - /** - * Gets the delta (1F = 1 tick) between this render call - * and the last one. - */ - public float getTickDelta(); -} diff --git a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java b/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java deleted file mode 100644 index b0e3d10..0000000 --- a/src/api/java/vazkii/botania/api/internal/IInternalMethodHandler.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:34:34 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.IRecipe; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import vazkii.botania.api.boss.IBotaniaBoss; -import vazkii.botania.api.corporea.IWrappedInventory; -import vazkii.botania.api.lexicon.LexiconPage; -import vazkii.botania.api.lexicon.multiblock.MultiblockSet; -import vazkii.botania.api.recipe.RecipeBrew; -import vazkii.botania.api.recipe.RecipeElvenTrade; -import vazkii.botania.api.recipe.RecipeManaInfusion; -import vazkii.botania.api.recipe.RecipePetals; -import vazkii.botania.api.recipe.RecipeRuneAltar; -import vazkii.botania.api.subtile.SubTileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Any methods that refer to internal methods in Botania are here. - * This is defaulted to a dummy handler, whose methods do nothing. - * This handler is set to a proper one on PreInit. Make sure to - * make your mod load after Botania if you have any intention of - * doing anythign with this on PreInit. - */ -public interface IInternalMethodHandler { - - public LexiconPage textPage(String key); - - public LexiconPage elfPaperTextPage(String key); - - public LexiconPage imagePage(String key, String resource); - - public LexiconPage craftingRecipesPage(String key, List recipes); - - public LexiconPage craftingRecipePage(String key, IRecipe recipe); - - public LexiconPage petalRecipesPage(String key, List recipes); - - public LexiconPage petalRecipePage(String key, RecipePetals recipe); - - public LexiconPage runeRecipesPage(String key, List recipes); - - public LexiconPage runeRecipePage(String key, RecipeRuneAltar recipe); - - public LexiconPage manaInfusionRecipesPage(String key, List recipes); - - public LexiconPage manaInfusionRecipePage(String key, RecipeManaInfusion recipe); - - public LexiconPage elvenTradePage(String key, List recipes); - - public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe); - - public LexiconPage brewPage(String key, String bottomText, RecipeBrew recipe); - - public LexiconPage multiblockPage(String key, MultiblockSet mb); - - public IManaNetwork getManaNetworkInstance(); - - public ItemStack getSubTileAsStack(String subTile); - - public ItemStack getSubTileAsFloatingFlowerStack(String subTile); - - public String getStackSubTileKey(ItemStack stack); - - public IIcon getSubTileIconForName(String name); - - public void registerBasicSignatureIcons(String name, IIconRegister register); - - public boolean shouldForceCheck(); - - public int getPassiveFlowerDecay(); - - public IInventory getBaublesInventory(EntityPlayer player); - - public void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side); - - public boolean hasSolegnoliaAround(Entity e); - - @SideOnly(Side.CLIENT) - public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res); - - @SideOnly(Side.CLIENT) - public void drawComplexManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res, ItemStack bindDisplay, boolean properlyBound); - - @SideOnly(Side.CLIENT) - public ItemStack getBindDisplayForFlowerType(SubTileEntity e); - - @SideOnly(Side.CLIENT) - public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText); - - @SideOnly(Side.CLIENT) - public ResourceLocation getDefaultBossBarTexture(); - - @SideOnly(Side.CLIENT) - public void setBossStatus(IBotaniaBoss status); - - public boolean isBuildcraftPipe(TileEntity tile); - - public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m); - - public long getWorldElapsedTicks(); - - public boolean isBotaniaFlower(World world, int x, int y, int z); - - public void sendBaubleUpdatePacket(EntityPlayer player, int slot); - - /** - * Wrap inventories in the network into wrappers providing compatibility for storage mods. - */ - List wrapInventory(List inventories); - -} diff --git a/src/api/java/vazkii/botania/api/internal/IManaBurst.java b/src/api/java/vazkii/botania/api/internal/IManaBurst.java deleted file mode 100644 index 945aa99..0000000 --- a/src/api/java/vazkii/botania/api/internal/IManaBurst.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * 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 @ [Jan 31, 2014, 4:36:13 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.UUID; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; - -/** - * Interface for the Mana Burst entity. This can safely be casted to EntityThrowable. - */ -public interface IManaBurst { - - public boolean isFake(); - - public void setMotion(double x, double y, double z); - - public int getColor(); - - public void setColor(int color); - - public int getMana(); - - public void setMana(int mana); - - public int getStartingMana(); - - public void setStartingMana(int mana); - - public int getMinManaLoss(); - - public void setMinManaLoss(int minManaLoss); - - public float getManaLossPerTick(); - - public void setManaLossPerTick(float mana); - - public float getGravity(); - - public void setGravity(float gravity); - - public ChunkCoordinates getBurstSourceChunkCoordinates(); - - public void setBurstSourceCoords(int x, int y, int z); - - public ItemStack getSourceLens(); - - public void setSourceLens(ItemStack lens); - - public boolean hasAlreadyCollidedAt(int x, int y, int z); - - public void setCollidedAt(int x, int y, int z); - - public int getTicksExisted(); - - public void setFake(boolean fake); - - public void setShooterUUID(UUID uuid); - - public UUID getShooterUIID(); - - public void ping(); - -} diff --git a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java b/src/api/java/vazkii/botania/api/internal/IManaNetwork.java deleted file mode 100644 index fc4553e..0000000 --- a/src/api/java/vazkii/botania/api/internal/IManaNetwork.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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 @ [Mar 7, 2014, 3:39:48 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.mana.TileSignature; - -/** - * A basic interface for a world's Mana Network. - * @see IInternalMethodHandler#getManaNetworkInstance() - */ -public interface IManaNetwork { - - /** - * Clears the entire Mana Network of all it's contents, you probably - * don't want to call this unless you have a very good reason. - */ - public void clear(); - - /** - * Gets the closest Mana Collector (eg. Mana Spreader) in the network to the Chunk - * Coordinates passed in, in the given dimension.
    - * A way of getting the dimension is via worldObj.provider.dimensionId
    - * Note that this function *can* get performance intensive, it's reccomended you - * call it sparingly and take cache of the value returned. - * @param limit The maximum distance the closest block can be, if the closest block - * is farther away than that, null will be returned instead. - */ - public TileEntity getClosestCollector(ChunkCoordinates pos, World world, int limit); - - /** - * Gets the closest Mana Pool in the network to the Chunk Coordinates passed in, - * in the given dimension.
    - * A way of getting the dimension is via worldObj.provider.dimensionId
    - * Note that this function *can* get performance intensive, it's reccomended you - * call it sparingly and take cache of the value returned. - * @param limit The maximum distance the closest block can be, if the closest block - * is farther away than that, null will be returned instead. - */ - public TileEntity getClosestPool(ChunkCoordinates pos, World world, int limit); - - /** - * Gets the list of all Mana Collectors (eg. Mana Spreader) in the dimension - * passed in. Note that this is the actual list and not a copy, make sure to - * clone the list if you intend to change it in any way. - */ - public List getAllCollectorsInWorld(World world); - - /** - * Gets the list of all Mana Pools in the dimension passed in. Note that this - * is the actual list and not a copy, make sure to clone the list if you intend - * to change it in any way. - */ - public List getAllPoolsInWorld(World world); -} diff --git a/src/api/java/vazkii/botania/api/internal/ShaderCallback.java b/src/api/java/vazkii/botania/api/internal/ShaderCallback.java deleted file mode 100644 index 12186a2..0000000 --- a/src/api/java/vazkii/botania/api/internal/ShaderCallback.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 @ [Oct 29, 2014, 6:31:35 PM (GMT)] - */ -package vazkii.botania.api.internal; - -/** - * A Callback for when a shader is called. Used to define shader uniforms. - */ -public abstract class ShaderCallback { - - public abstract void call(int shader); - -} diff --git a/src/api/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java b/src/api/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java deleted file mode 100644 index dff8b96..0000000 --- a/src/api/java/vazkii/botania/api/internal/VanillaPacketDispatcher.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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, 2015, 9:38:44 PM (GMT)] - */ -package vazkii.botania.api.internal; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public final class VanillaPacketDispatcher { - - public static void dispatchTEToNearbyPlayers(TileEntity tile) { - World world = tile.getWorldObj(); - List players = world.playerEntities; - for(Object player : players) - if(player instanceof EntityPlayerMP) { - EntityPlayerMP mp = (EntityPlayerMP) player; - if(pointDistancePlane(mp.posX, mp.posZ, tile.xCoord + 0.5, tile.zCoord + 0.5) < 64) - ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(tile.getDescriptionPacket()); - } - } - - public static void dispatchTEToNearbyPlayers(World world, int x, int y, int z) { - TileEntity tile = world.getTileEntity(x, y, z); - if(tile != null) - dispatchTEToNearbyPlayers(tile); - } - - public static float pointDistancePlane(double x1, double y1, double x2, double y2) { - return (float) Math.hypot(x1 - x2, y1 - y2); - } - -} diff --git a/src/api/java/vazkii/botania/api/item/IAncientWillContainer.java b/src/api/java/vazkii/botania/api/item/IAncientWillContainer.java deleted file mode 100644 index 2d2abe2..0000000 --- a/src/api/java/vazkii/botania/api/item/IAncientWillContainer.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Jan 30, 2015, 11:24:54 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * An item that implements this can have Ancient Wills - * crafted onto it. - */ -public interface IAncientWillContainer { - - public void addAncientWill(ItemStack stack, int will); - - public boolean hasAncientWill(ItemStack stack, int will); - -} diff --git a/src/api/java/vazkii/botania/api/item/IAvatarTile.java b/src/api/java/vazkii/botania/api/item/IAvatarTile.java deleted file mode 100644 index c89f903..0000000 --- a/src/api/java/vazkii/botania/api/item/IAvatarTile.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 @ [Oct 24, 2015, 7:00:21 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.inventory.IInventory; -import vazkii.botania.api.mana.IManaReceiver; - -/** - * A TileEntity that implements this is considered an Avatar. - */ -public interface IAvatarTile extends IInventory, IManaReceiver { - - /** - * Gets the amount of ticks that have elapsed on this avatar while it's functional - * (has redstone signal). - */ - public int getElapsedFunctionalTicks(); - - /** - * Gets if this avatar is enabled (isn't powered by a redstone signal). - */ - public boolean isEnabled(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IAvatarWieldable.java b/src/api/java/vazkii/botania/api/item/IAvatarWieldable.java deleted file mode 100644 index 9691009..0000000 --- a/src/api/java/vazkii/botania/api/item/IAvatarWieldable.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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 @ [Oct 24, 2015, 6:45:50 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -/** - * An Item that implements this can be wielded by an Avatar. - */ -public interface IAvatarWieldable { - - /** - * Called on update of the avatar tile. - */ - public void onAvatarUpdate(IAvatarTile tile, ItemStack stack); - - /** - * Gets the overlay resource to render on top of the avatar tile. - */ - public ResourceLocation getOverlayResource(IAvatarTile tile, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/IBaubleRender.java b/src/api/java/vazkii/botania/api/item/IBaubleRender.java deleted file mode 100644 index d98a294..0000000 --- a/src/api/java/vazkii/botania/api/item/IBaubleRender.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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 @ [Dec 4, 2014, 3:28:43 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.event.RenderPlayerEvent; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Bauble Item that implements this will be have hooks to render something on - * the player while its equipped. - * This class doesn't extend IBauble to make the API not depend on the Baubles - * API, but the item in question still needs to implement IBauble. - */ -public interface IBaubleRender { - - /** - * Called for the rendering of the bauble on the player. The player instance can be - * acquired through the event parameter. Transformations are already applied for - * the RenderType passed in. Make sure to check against the type parameter for - * rendering. Will not be called if the item is a ICosmeticAttachable and - * has a cosmetic bauble attached to it. - */ - @SideOnly(Side.CLIENT) - public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type); - - /** - * A few helper methods for the render. - */ - public static class Helper { - - public static void rotateIfSneaking(EntityPlayer player) { - if(player.isSneaking()) - applySneakingRotation(); - } - - public static void applySneakingRotation() { - GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F); - } - - public static void translateToHeadLevel(EntityPlayer player) { - GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.68F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0); - } - - } - - public static enum RenderType { - /** - * Render Type for the player's body, translations apply on the player's rotation. - * Sneaking is not handled and should be done during the render. - * @see IBaubleRender.Helper - */ - BODY, - - /** - * Render Type for the player's body, translations apply on the player's head rotations. - * Sneaking is not handled and should be done during the render.~ - * @see IBaubleRender.Helper - */ - HEAD; - } - -} diff --git a/src/api/java/vazkii/botania/api/item/IBlockProvider.java b/src/api/java/vazkii/botania/api/item/IBlockProvider.java deleted file mode 100644 index 42f2e3f..0000000 --- a/src/api/java/vazkii/botania/api/item/IBlockProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 @ [Aug 20, 2015, 10:31:54 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this can provide blocks to other items that use them. - * For example, the Black Hole Talisman implements this in order to allow for - * the Rod of the Shifting Crust to pull blocks from it. - */ -public interface IBlockProvider { - - /** - * Provides the requested item. The doit paremeter specifies whether this is - * just a test (false) or if the item should actually be removed (true). - * If you need to use calls to ManaItemHandler.requestMana[Exact], use - * the requestor as the ItemStack passed in. - */ - public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit); - - /** - * Gets the amount of blocks of the type passed stored in this item. You must - * check for the block passed in to not give the counter for a wrong block. Returning - * -1 states that the item can provide infinite of the item passed in (for example, - * the Rod of the Lands would return -1 if the block is dirt). - */ - public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta); - -} diff --git a/src/api/java/vazkii/botania/api/item/IBurstViewerBauble.java b/src/api/java/vazkii/botania/api/item/IBurstViewerBauble.java deleted file mode 100644 index 4402a71..0000000 --- a/src/api/java/vazkii/botania/api/item/IBurstViewerBauble.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 @ [Jan 24, 2015, 3:08:40 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * Base Interface for the Manaseer Monocle and items of the sort. - * Having a IBauble of this type equipped on the 0th slot (amulet) - * will draw bursts without depth testing and to see sub tile radiuses. - */ -public interface IBurstViewerBauble { - -} diff --git a/src/api/java/vazkii/botania/api/item/ICosmeticAttachable.java b/src/api/java/vazkii/botania/api/item/ICosmeticAttachable.java deleted file mode 100644 index 4fbee0e..0000000 --- a/src/api/java/vazkii/botania/api/item/ICosmeticAttachable.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 @ [Feb 22, 2015, 8:31:39 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this interface can have cosmetic items attached to it. - * The item does not have to be a bauble, but it is the render is automatically - * handled by botania internally. Recipes to add and remove the cosmetic items will be - * handled internally, but the cosmetic item has to be set as a container item. - */ -public interface ICosmeticAttachable { - - /** - * Gets the cosmetic item stored in the stack passed in. - */ - public ItemStack getCosmeticItem(ItemStack stack); - - /** - * Sets the stack's cosmetic item to the one passed in. - */ - public void setCosmeticItem(ItemStack stack, ItemStack cosmetic); - -} diff --git a/src/api/java/vazkii/botania/api/item/ICosmeticBauble.java b/src/api/java/vazkii/botania/api/item/ICosmeticBauble.java deleted file mode 100644 index d488ad4..0000000 --- a/src/api/java/vazkii/botania/api/item/ICosmeticBauble.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 @ [Feb 22, 2015, 2:02:02 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * A bauble that counts as a cosmetic only item. These can be added to - * other baubles to add the render to them. Other cosmetic baubles - * can't be stacked on this. - */ -public interface ICosmeticBauble extends IBaubleRender { - -} diff --git a/src/api/java/vazkii/botania/api/item/IDyablePool.java b/src/api/java/vazkii/botania/api/item/IDyablePool.java deleted file mode 100644 index 8bb8e94..0000000 --- a/src/api/java/vazkii/botania/api/item/IDyablePool.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 @ [Jan 18, 2015, 12:20:44 AM (GMT)] - */ -package vazkii.botania.api.item; - - -/** - * Used to define a Mana Pool that can be dyed through floral powder. - */ -public interface IDyablePool { - - public int getColor(); - - public void setColor(int color); - - -} diff --git a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java b/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java deleted file mode 100644 index bd00734..0000000 --- a/src/api/java/vazkii/botania/api/item/IExoflameHeatable.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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 @ [Aug 30, 2014, 4:28:29 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * A TileEntity that implements this can be heated by an Exoflame flower. - */ -public interface IExoflameHeatable { - - /** - * Can this TileEntity smelt its contents. If true, the Exoflame is allowed - * to fuel it. - */ - public boolean canSmelt(); - - /** - * Gets the amount of ticks left for the fuel. If below 2, the exoflame - * will call boostBurnTime. - */ - public int getBurnTime(); - - /** - * Called to increase the amount of time this furnace should be burning - * the fuel for. Even if it doesn't have any fuel. - */ - public void boostBurnTime(); - - /** - * Called once every two ticks to increase the speed of the furnace. Feel - * free to not do anything if all you want is to allow the exoflame to feed - * it, not make it faster. - */ - public void boostCookTime(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java b/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java deleted file mode 100644 index e07d076..0000000 --- a/src/api/java/vazkii/botania/api/item/IExtendedPlayerController.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 @ [Aug 6, 2014, 6:02:29 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * An interface that defines an instance of PlayerControllerMP with - * the ability to modify reach. See vazkii.botania.client.core.handler.BotaniaPlayerController - */ -public interface IExtendedPlayerController { - - /** - * Sets the extra reach the player should have. - */ - public void setReachDistanceExtension(float f); - - /** - * Gets the current reach extension. - */ - public float getReachDistanceExtension(); -} diff --git a/src/api/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java b/src/api/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java deleted file mode 100644 index 7713eaa..0000000 --- a/src/api/java/vazkii/botania/api/item/IExtendedWireframeCoordinateListProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 30, 2015, 1:43:17 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; - -/** - * An extension of IWireframeCoordinateListProvider that allows for - * rendering a single thicker wireframe. - */ -public interface IExtendedWireframeCoordinateListProvider extends IWireframeCoordinateListProvider { - - /** - * Gets the source wireframe to draw, this one will be drawn thicker. - */ - public ChunkCoordinates getSourceWireframe(EntityPlayer player, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/IFlowerPlaceable.java b/src/api/java/vazkii/botania/api/item/IFlowerPlaceable.java deleted file mode 100644 index 05f1f1f..0000000 --- a/src/api/java/vazkii/botania/api/item/IFlowerPlaceable.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 @ [17/11/2015, 20:10:53 (GMT)] - */ -package vazkii.botania.api.item; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.subtile.SubTileEntity; - -/** - * An Item that implements this can be placed by a Rannuncarpus. - */ -public interface IFlowerPlaceable { - - /** - * Gets the block to be placed, return null to not place anything. - */ - public Block getBlockToPlaceByFlower(ItemStack stack, SubTileEntity flower, int x, int y, int z); - - public void onBlockPlacedByFlower(ItemStack stack, SubTileEntity flower, int x, int y, int z); -} diff --git a/src/api/java/vazkii/botania/api/item/IFlowerlessBiome.java b/src/api/java/vazkii/botania/api/item/IFlowerlessBiome.java deleted file mode 100644 index 16543e4..0000000 --- a/src/api/java/vazkii/botania/api/item/IFlowerlessBiome.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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 @ [? (GMT)] - */ -package vazkii.botania.api.item; -import net.minecraft.world.World; -/** - * A BiomeGenBase that implements this will not have Botania flowers generated. - */ -public interface IFlowerlessBiome { - /** - * @return Should this world be allowed to generate flowers? - */ - public boolean canGenerateFlowers(World world, int x, int z); -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/item/IFlowerlessWorld.java b/src/api/java/vazkii/botania/api/item/IFlowerlessWorld.java deleted file mode 100644 index 5d25d79..0000000 --- a/src/api/java/vazkii/botania/api/item/IFlowerlessWorld.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 @ [? (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.world.World; - -/** - * A WorldProvider that implements this will not have Botania flowers generated. - */ -public interface IFlowerlessWorld { - - /** - * @return Should this world be allowed to generate flowers? - */ - public boolean generateFlowers(World world); -} diff --git a/src/api/java/vazkii/botania/api/item/IGrassHornExcempt.java b/src/api/java/vazkii/botania/api/item/IGrassHornExcempt.java deleted file mode 100644 index 601ad91..0000000 --- a/src/api/java/vazkii/botania/api/item/IGrassHornExcempt.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Oct 29, 2014, 4:52:04 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.world.World; - -/** - * A BlockBush can implement this to check if it can be broken - * by a Horn/Drum of the Wild or not. - * @Deprecated Use IHornHarvestable instead - */ -@Deprecated -public interface IGrassHornExcempt { - - public boolean canUproot(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/item/IHornHarvestable.java b/src/api/java/vazkii/botania/api/item/IHornHarvestable.java deleted file mode 100644 index a74af38..0000000 --- a/src/api/java/vazkii/botania/api/item/IHornHarvestable.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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 @ [Oct 24, 2015, 11:16:00 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * A Block that implements this can be uprooted by the various horns in Botania. - */ -public interface IHornHarvestable { - - /** - * Returns true if this block can be uprooted. - * Note that the stack param can be null if it's a drum breaking it. - */ - public boolean canHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType); - - /** - * Returns true if harvestByHorn() should be called. If false it just uses the normal - * block breaking method. - * Note that the stack param can be null if it's a drum breaking it. - */ - public boolean hasSpecialHornHarvest(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType); - - /** - * Called to harvest by a horn. - * Note that the stack param can be null if it's a drum breaking it. - */ - public void harvestByHorn(World world, int x, int y, int z, ItemStack stack, EnumHornType hornType); - - public static enum EnumHornType { - - /** - * Horn of the Wild, for grass and crops - */ - WILD, - - /** - * Horn of the Canopy, for leaves - */ - CANOPY, - - /** - * Horn of the Covering, for snow - */ - COVERING; - - public static EnumHornType getTypeForMeta(int meta) { - EnumHornType[] values = EnumHornType.values(); - return values[Math.min(values.length - 1, meta)]; - } - - }; - -} diff --git a/src/api/java/vazkii/botania/api/item/IManaDissolvable.java b/src/api/java/vazkii/botania/api/item/IManaDissolvable.java deleted file mode 100644 index 0d9ad5d..0000000 --- a/src/api/java/vazkii/botania/api/item/IManaDissolvable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [Jan 18, 2015, 12:10:00 AM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaPool; - -/** - * An item that implements this will have a function called when its standing atop - * a mana pool. - */ -public interface IManaDissolvable { - - /** - * Called for every tick the item is on a mana pool. If the stack has stack - * size 0 the item is killed. This is called in both the server and client. - */ - public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item); - -} diff --git a/src/api/java/vazkii/botania/api/item/IManaProficiencyArmor.java b/src/api/java/vazkii/botania/api/item/IManaProficiencyArmor.java deleted file mode 100644 index 595e800..0000000 --- a/src/api/java/vazkii/botania/api/item/IManaProficiencyArmor.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 @ [Aug 28, 2015, 9:04:53 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -/** - * An armor item that implements this gives the player wearing it mana proficiency, by - * which it makes Rods the player use have a stronger effect. This is a boolean, and only - * one armor piece with this returning true is required for the player to be considered - * to be having proficiency, by which it's suggested that this is used alongside an - * armor set, where only one piece implements it. - */ -public interface IManaProficiencyArmor { - - public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player); - - public final static class Helper { - - public static boolean hasProficiency(EntityPlayer player) { - for(int i = 0; i < 4; i++) { - ItemStack armor = player.getCurrentArmor(i); - if(armor != null) { - Item item = armor.getItem(); - if(item instanceof IManaProficiencyArmor && ((IManaProficiencyArmor) item).shouldGiveProficiency(armor, i, player)) - return true; - } - } - return false; - } - - } - -} diff --git a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java b/src/api/java/vazkii/botania/api/item/IPetalApothecary.java deleted file mode 100644 index 15ae69c..0000000 --- a/src/api/java/vazkii/botania/api/item/IPetalApothecary.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [Aug 30, 2014, 4:22:15 PM (GMT)] - */ -package vazkii.botania.api.item; - -/** - * Base Interface for the Petal Apothecary block. Can - * be safely casted to TileEntity. - */ -public interface IPetalApothecary { - - /** - * Sets if the the apothecary has water or not. - */ - public void setWater(boolean water); - - /** - * Does the apothecary have water in it? - */ - public boolean hasWater(); - -} diff --git a/src/api/java/vazkii/botania/api/item/IPhantomInkable.java b/src/api/java/vazkii/botania/api/item/IPhantomInkable.java deleted file mode 100644 index dc2f397..0000000 --- a/src/api/java/vazkii/botania/api/item/IPhantomInkable.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 @ [Mar 17, 2015, 4:57:44 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this can be crafted with Phantom Ink. - */ -public interface IPhantomInkable { - - public boolean hasPhantomInk(ItemStack stack); - - public void setPhantomInk(ItemStack stack, boolean ink); - -} diff --git a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java b/src/api/java/vazkii/botania/api/item/IPixieSpawner.java deleted file mode 100644 index de8c973..0000000 --- a/src/api/java/vazkii/botania/api/item/IPixieSpawner.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [Aug 6, 2014, 6:06:27 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * Any item that implements this allows for pixies to be spawned when the player takes damage when...
    - * - Case the item is armor, having it equipped.
    - * - Case the item is a bauble, having it worn.
    - * - On any other case, having the item being the current held item. - */ -public interface IPixieSpawner { - - /** - * The chance this item adds for pixies to be spawned. From 0.0 to 1.0. All values - * are put together when calculating. - */ - public float getPixieChance(ItemStack stack); - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/item/IRelic.java b/src/api/java/vazkii/botania/api/item/IRelic.java deleted file mode 100644 index aecd1cd..0000000 --- a/src/api/java/vazkii/botania/api/item/IRelic.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 @ [Mar 29, 2015, 7:17:41 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; - -/** - * An item that implements this counts as a Relic item. This is purely for interaction - * and other mod items should not implement this interface. - */ -public interface IRelic { - - /** - * Binds to the player name passed in. - */ - public void bindToUsername(String playerName, ItemStack stack); - - /** - * Gets the username of the person this relic is bound to. - */ - public String getSoulbindUsername(ItemStack stack); - - /** - * Sets the achievement that this relic binds to. - */ - public void setBindAchievement(Achievement achievement); - - /** - * Gets the achievement that this relic binds to. - */ - public Achievement getBindAchievement(); - -} diff --git a/src/api/java/vazkii/botania/api/item/ISequentialBreaker.java b/src/api/java/vazkii/botania/api/item/ISequentialBreaker.java deleted file mode 100644 index 87af2d0..0000000 --- a/src/api/java/vazkii/botania/api/item/ISequentialBreaker.java +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 @ [Mar 30, 2015, 2:46:05 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * An item that implements this can break multiple blocks at once - * with a Ring of Loki. Usage of this interface requires an implementation - * (see ItemTerraPick). - */ -public interface ISequentialBreaker { - - public void breakOtherBlock(EntityPlayer player, ItemStack stack, int x, int y, int z, int originX, int originY, int originZ, int side); - - public boolean disposeOfTrashBlocks(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/ISortableTool.java b/src/api/java/vazkii/botania/api/item/ISortableTool.java deleted file mode 100644 index af450bc..0000000 --- a/src/api/java/vazkii/botania/api/item/ISortableTool.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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 @ [Feb 23, 2015, 7:03:48 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.item.ItemStack; - -/** - * This interface describes a tool that can be sorted by the Ring of - * Correction. - */ -public interface ISortableTool { - - /** - * Gets the type of tool that this is. A pick, axe or shovel. - */ - public ToolType getSortingType(ItemStack stack); - - /** - * Gets the priority that this tool should have when being sorted. The - * tool with the highest priority will be picked. The way this is specified - * should be (tool-level) * 100 + (tool-modifier) * 10 + (efficiency-level). - *

    - * For example, a Manasteel Pickaxe is tool-level 10 and it doesn't have - * modifiers. Assuming Efficiency 4, the priority should be 10 * 100 + 4 = 1004. - * This will rate higher than a similar pickaxe with Efficiency 3.
    - * A Terra Shatterer has a modifier, its rank and is tool-level 20. With Efficiency - * 5 and rank B (2) the priority should be 20 * 100 + 2 * 10 + 5 = 2025. - *

    - * All intermediate tool levels are there for other mod tools that wish to occupy the spots inbetween. - * Of course, you don't have to always adhere to this. Tools like the Vitreous Pickaxe don't, - * that one in particular is priority 0 so it's never picked. - */ - public int getSortingPriority(ItemStack stack); - - public static enum ToolType { - PICK, AXE, SHOVEL - } - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java b/src/api/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java deleted file mode 100644 index ae0863c..0000000 --- a/src/api/java/vazkii/botania/api/item/IWireframeCoordinateListProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 @ [Mar 29, 2015, 11:30:41 PM (GMT)] - */ -package vazkii.botania.api.item; - -import java.util.List; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * An item that implements this will allow for various wireframes to be drawn - * around the player. This will be called while the item is in the inventory, - * armor slot or bauble slots. - */ -public interface IWireframeCoordinateListProvider { - - /** - * Returns a list of ChunkCoordinates for the wireframes to draw. - * Can be null. - */ - @SideOnly(Side.CLIENT) - public List getWireframesToDraw(EntityPlayer player, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java b/src/api/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java deleted file mode 100644 index 8b51c26..0000000 --- a/src/api/java/vazkii/botania/api/item/TinyPotatoRenderEvent.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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 @ [Jul 25, 2015, 8:02:41 PM (GMT)] - */ -package vazkii.botania.api.item; - -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.common.eventhandler.Event; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Why would you ever want this ._. - */ -@SideOnly(Side.CLIENT) -public class TinyPotatoRenderEvent extends Event { - - public final TileEntity tile; - public final String name; - public final double x, y, z; - public final float partTicks; - - public TinyPotatoRenderEvent(TileEntity tile, String name, double x, double y, double z, float partTicks) { - this.tile = tile; - this.name = name; - this.x = x; - this.y = y; - this.z = z; - this.partTicks = partTicks; - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java b/src/api/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java deleted file mode 100644 index c082572..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/BotaniaTutorialStartEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [04/12/2015, 18:29:56 (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.Queue; - -import cpw.mods.fml.common.eventhandler.Event; - -/** - * Fired when the Lexica Botania's tutorial is started. You can add your - * own entries to the tutorial here. Please use this responsibly. - */ -public class BotaniaTutorialStartEvent extends Event { - - public final Queue tutorial; - - public BotaniaTutorialStartEvent(Queue tutorial) { - this.tutorial = tutorial; - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java b/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java deleted file mode 100644 index a92e608..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/IAddonEntry.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 @ [Jun 8, 2014, 7:02:48 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -/** - * Have a LexiconEntry implement this to signify it's an "Addon entry", as - * in, one provided by an Addon. This allows it to draw a subtitle of - * sorts, to prevent the [Mod tag here] nonsense that happened with thaumcraft - * addons. It can also be used for other purposes, such as stating an - * entry is WIP. - */ -public interface IAddonEntry { - - /** - * Returns the unlocalized subtitle to show below the title. Here you'd - * return something like "(This Entry is provided by the Botanic Tinkerer addon)". - */ - public String getSubtitle(); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java b/src/api/java/vazkii/botania/api/lexicon/ILexicon.java deleted file mode 100644 index ee07e17..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/ILexicon.java +++ /dev/null @@ -1,21 +0,0 @@ -package vazkii.botania.api.lexicon; - -import net.minecraft.item.ItemStack; - -/** - * Basic interface for the Lexica Botania. - */ -public interface ILexicon { - - /** - * Gets if a specific knowledge is unlocked. Check the knowledge types in - * BotaniaAPI. - */ - public boolean isKnowledgeUnlocked(ItemStack stack, KnowledgeType knowledge); - - /** - * Unlocks a specfic type of knowledge. - */ - public void unlockKnowledge(ItemStack stack, KnowledgeType knowledge); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java b/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java deleted file mode 100644 index 5baff9f..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/ILexiconable.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 @ [Jan 20, 2014, 7:05:44 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Any block that implements this can be right clicked with - * a Lexica Botania to open a entry page. - */ -public interface ILexiconable { - - /** - * Gets the lexicon entry to open at this location. null works too. - */ - public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java b/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java deleted file mode 100644 index 5b0c063..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/IRecipeKeyProvider.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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 @ [Mar 20, 2014, 6:08:48 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this so that the method used for mapping it into - * the lexicon recipe mappings isn't the typical id:meta key. - */ -public interface IRecipeKeyProvider { - - public String getKey(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/ITwoNamedPage.java b/src/api/java/vazkii/botania/api/lexicon/ITwoNamedPage.java deleted file mode 100644 index 073b870..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/ITwoNamedPage.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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 @ [Nov 3, 2014, 2:59:55 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -/** - * A LexiconPage that implements this has two unlocalized names - * rather than one. (See brew pages) - */ -public interface ITwoNamedPage { - - public void setSecondUnlocalizedName(String name); - - public String getSecondUnlocalizedName(); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java b/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java deleted file mode 100644 index 5a08c9c..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/KnowledgeType.java +++ /dev/null @@ -1,20 +0,0 @@ -package vazkii.botania.api.lexicon; - -import net.minecraft.util.EnumChatFormatting; - -public class KnowledgeType { - - public final String id; - public final EnumChatFormatting color; - public final boolean autoUnlock; - - public KnowledgeType(String id, EnumChatFormatting color, boolean autoUnlock) { - this.id = id; - this.color = color; - this.autoUnlock = autoUnlock; - } - - public String getUnlocalizedName() { - return "botania.knowledge." + id; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java b/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java deleted file mode 100644 index 06f678d..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconCategory.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:23:47 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ResourceLocation; - -public class LexiconCategory implements Comparable { - - private static int count = 0; - - public final String unlocalizedName; - public final List entries = new ArrayList(); - private final int sortingId; - private ResourceLocation icon; - private int priority = 5; - - /** - * @param unlocalizedName The unlocalized name of this category. This will be localized by the client display. - */ - public LexiconCategory(String unlocalizedName) { - this.unlocalizedName = unlocalizedName; - sortingId = count; - count++; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - /** - * Sets the priority for this category for sorting. Higher numbers - * means they'll appear first in the book. The basics category - * is 9, the miscellaneous category is 0, other vanilla botania categories - * are 5. Using 9 and 0 is not recommended, since having your - * categories before basics or after miscellaneous is a bad idea. - * If two categories have the same priority they'll be sorted - * by insertion order. - */ - public LexiconCategory setPriority(int priority) { - this.priority = priority; - return this; - } - - public int getSortingPriority() { - return priority; - } - - public final int getSortingId() { - return sortingId; - } - - public LexiconCategory setIcon(ResourceLocation icon) { - this.icon = icon; - return this; - } - - public ResourceLocation getIcon() { - return icon; - } - - @Override - public int compareTo(LexiconCategory category) { - return priority == category.priority ? sortingId - category.sortingId : category.priority - priority; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java b/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java deleted file mode 100644 index 2bc0250..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconEntry.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:17:06 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LexiconEntry implements Comparable { - - public final String unlocalizedName; - public final LexiconCategory category; - - private KnowledgeType type = BotaniaAPI.basicKnowledge; - - public List pages = new ArrayList(); - private boolean priority = false; - private ItemStack icon = null; - - private List extraDisplayedRecipes = new ArrayList(); - - /** - * @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display. - */ - public LexiconEntry(String unlocalizedName, LexiconCategory category) { - this.unlocalizedName = unlocalizedName; - this.category = category; - } - - /** - * Sets this page as prioritized, as in, will appear before others in the lexicon. - */ - public LexiconEntry setPriority() { - priority = true; - return this; - } - - /** - * Sets the Knowledge type of this entry. - */ - public LexiconEntry setKnowledgeType(KnowledgeType type) { - this.type = type; - return this; - } - - public KnowledgeType getKnowledgeType() { - return type; - } - - /** - * Sets the display icon for this entry. Overriding the one already there. When adding recipe pages to the - * entry, this will be called once for the result of the first found recipe. - */ - public void setIcon(ItemStack stack) { - icon = stack; - } - - public ItemStack getIcon() { - return icon; - } - - public boolean isPriority() { - return priority; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - public String getTagline() { - return null; // Override this if you want a tagline. You probably do - } - - @SideOnly(Side.CLIENT) - public boolean isVisible() { - return true; - } - - /** - * Sets what pages you want this entry to have. - */ - public LexiconEntry setLexiconPages(LexiconPage... pages) { - this.pages.addAll(Arrays.asList(pages)); - - for(int i = 0; i < this.pages.size(); i++) { - LexiconPage page = this.pages.get(i); - if(!page.skipRegistry) - page.onPageAdded(this, i); - } - - return this; - } - - /** - * Returns the web link for this entry. If this isn't null, looking at this entry will - * show a "View Online" button in the book. The String returned should be the URL to - * open when the button is clicked. - */ - public String getWebLink() { - return null; - } - - /** - * Adds a page to the list of pages. - */ - public void addPage(LexiconPage page) { - pages.add(page); - } - - public final String getNameForSorting() { - return (priority ? 0 : 1) + StatCollector.translateToLocal(getUnlocalizedName()); - } - - public List getDisplayedRecipes() { - ArrayList list = new ArrayList(); - for(LexiconPage page : pages) { - List l = page.getDisplayedRecipes(); - - if(l != null) { - ArrayList itemsAddedThisPage = new ArrayList(); - - for(ItemStack s : l) { - addItem: { - for(ItemStack s1 : itemsAddedThisPage) - if(s1.getItem() == s.getItem()) - break addItem; - for(ItemStack s1 : list) - if(s1.isItemEqual(s) && ItemStack.areItemStackTagsEqual(s1, s)) - break addItem; - - itemsAddedThisPage.add(s); - list.add(s); - } - } - } - } - - list.addAll(extraDisplayedRecipes); - - return list; - } - - public void addExtraDisplayedRecipe(ItemStack stack) { - extraDisplayedRecipes.add(stack); - } - - @Override - public int compareTo(LexiconEntry o) { - return getNameForSorting().compareTo(o.getNameForSorting()); - } - -} \ No newline at end of file diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java b/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java deleted file mode 100644 index 9880b9e..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconPage.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * 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 @ [Jan 14, 2014, 6:17:24 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.List; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.internal.IGuiLexiconEntry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class LexiconPage { - - public String unlocalizedName; - public boolean skipRegistry; - - public LexiconPage(String unlocalizedName) { - this.unlocalizedName = unlocalizedName; - } - - /** - * Does the rendering for this page. - * @param gui The active GuiScreen - * @param mx The mouse's relative X position. - * @param my The mouse's relative Y position. - */ - @SideOnly(Side.CLIENT) - public abstract void renderScreen(IGuiLexiconEntry gui, int mx, int my); - - /** - * Called per update tick. Non gui-sensitive version, kept for backwards compatibility only. - */ - @SideOnly(Side.CLIENT) - public void updateScreen() { - // NO-OP - } - - /** - * Called per update tick. Feel free to override fully, the - * call to updateScreen() is for backwards compatibility. - */ - @SideOnly(Side.CLIENT) - public void updateScreen(IGuiLexiconEntry gui) { - updateScreen(); - } - - /** - * Called when this page is opened, be it via initGui() or when the player changes page. - * You can add buttons and whatever you'd do on initGui() here. - */ - @SideOnly(Side.CLIENT) - public void onOpened(IGuiLexiconEntry gui) { - // NO-OP - } - - /** - * Called when this page is opened, be it via closing the gui or when the player changes page. - * Make sure to dispose of anything you don't use any more, such as buttons in the gui's buttonList. - */ - @SideOnly(Side.CLIENT) - public void onClosed(IGuiLexiconEntry gui) { - // NO-OP - } - - /** - * Called when a button is pressed, equivalent to GuiScreen.actionPerformed. - */ - @SideOnly(Side.CLIENT) - public void onActionPerformed(IGuiLexiconEntry gui, GuiButton button) { - // NO-OP - } - - /** - * Called when a key is pressed. - */ - @SideOnly(Side.CLIENT) - public void onKeyPressed(char c, int key) { - // NO-OP - } - - /** - * Called when {@link LexiconEntry#setLexiconPages(LexiconPage...)} is called. - */ - public void onPageAdded(LexiconEntry entry, int index) { - // NO-OP - } - - /** - * Shows the list of recipes present in this page for display in the category - * page. Can return null for an entry with no recipes. - */ - public List getDisplayedRecipes() { - return null; - } - - public String getUnlocalizedName() { - return unlocalizedName; - } - - public LexiconPage setSkipRegistry() { - skipRegistry = true; - return this; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java b/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java deleted file mode 100644 index 8202a40..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/LexiconRecipeMappings.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 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 @ [Mar 6, 2014, 3:54:12 PM (GMT)] - */ -package vazkii.botania.api.lexicon; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaItem; - -/** - * This class contains mappings for which entry and page correspond to each - * craftable ItemStack. Use the map method to map an ItemStack to a page in - * an entry in the lexicon. - */ -public final class LexiconRecipeMappings { - - private static Map mappings = new HashMap(); - - /** - * Maps the given stack to the given page of the entry. - */ - public static void map(ItemStack stack, LexiconEntry entry, int page, boolean force) { - EntryData data = new EntryData(entry, page); - String str = stackToString(stack); - - if(force || !mappings.containsKey(str)) - mappings.put(str, data); - if(entry.getIcon() == null) - entry.setIcon(stack.copy()); - } - - public static void map(ItemStack stack, LexiconEntry entry, int page) { - map(stack, entry, page, false); - } - - public static void remove(ItemStack stack) { - mappings.remove(stackToString(stack)); - } - - public static EntryData getDataForStack(ItemStack stack) { - return mappings.get(stackToString(stack)); - } - - public static String stackToString(ItemStack stack) { - if(stack == null || stack.getItem() == null) - return "NULL"; - - if(stack.hasTagCompound() && stack.getItem() instanceof IRecipeKeyProvider) - return ((IRecipeKeyProvider) stack.getItem()).getKey(stack); - - return stack.getUnlocalizedName() + (ignoreMeta(stack) ? "" : "~" + stack.getItemDamage()); - } - - public static boolean ignoreMeta(ItemStack stack) { - return stack.isItemStackDamageable() || stack.getItem() instanceof IManaItem; - } - - public static class EntryData { - - public final LexiconEntry entry; - public final int page; - - public EntryData(LexiconEntry entry, int page) { - this.entry = entry; - this.page = page; - } - - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java deleted file mode 100644 index 9d05c40..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/IMultiblockRenderHook.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 @ [Jun 27, 2015, 7:48:47 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; -import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; - -/** - * A hook for rendering blocks in the multiblock display. - */ -public interface IMultiblockRenderHook { - - public static Map renderHooks = new HashMap(); - - public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks, MultiblockComponent comp, float alpha); - - public boolean needsTranslate(Block block); - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java deleted file mode 100644 index 4cf34b8..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/Multiblock.java +++ /dev/null @@ -1,188 +0,0 @@ -/** - * 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 @ [Jun 27, 2015, 2:37:22 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent; - -/** - * This class describes a Mutiblock object. It's used to display a - * multiblock in the lexicon and to show the player in a ghost-like - * look in the world. - */ -public class Multiblock { - - public List components = new ArrayList(); - public List materials = new ArrayList(); - - public int minX, minY, minZ, maxX, maxY, maxZ, offX, offY, offZ; - - public HashMap, MultiblockComponent> locationCache = new HashMap, MultiblockComponent>(); - - /** - * Adds a multiblock component to this multiblock. The component's x y z - * coords should be pivoted to the center of the structure. - */ - public void addComponent(MultiblockComponent component) { - if(getComponentForLocation(component.relPos.posX, component.relPos.posY, component.relPos.posZ) != null) - throw new IllegalArgumentException("Location in multiblock already occupied"); - components.add(component); - changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ); - calculateCostForNewComponent(component); - addComponentToLocationCache(component); - } - - /** - * Constructs and adds a multiblock component to this multiblock. The x y z - * coords should be pivoted to the center of the structure. - */ - public void addComponent(int x, int y, int z, Block block, int meta) { - addComponent(new MultiblockComponent(new ChunkCoordinates(x, y, z), block, meta)); - } - - private void changeAxisForNewComponent(int x, int y, int z) { - if(x < minX) - minX = x; - else if(x > maxX) - maxX = x; - - if(y < minY) - minY = y; - else if(y > maxY) - maxY = y; - - if(z < minZ) - minZ = z; - else if(z > maxZ) - maxZ = z; - } - - private void calculateCostForNewComponent(MultiblockComponent comp) { - ItemStack[] materials = comp.getMaterials(); - if(materials != null) - for(ItemStack stack : materials) - addStack(stack); - } - - private void addStack(ItemStack stack) { - if(stack == null) - return; - - for(ItemStack oStack : materials) - if(oStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(oStack, stack)) { - oStack.stackSize += stack.stackSize; - return; - } - - materials.add(stack); - } - - public void setRenderOffset(int x, int y, int z) { - offX = x; - offY = y; - offZ = z; - } - - public List getComponents() { - return components; - } - - /** - * Rotates this multiblock by the angle passed in. For the best results, use - * only multiples of pi/2. - */ - public void rotate(double angle) { - for(MultiblockComponent comp : getComponents()) - comp.rotate(angle); - updateLocationCache(); - } - - public Multiblock copy() { - Multiblock mb = new Multiblock(); - for(MultiblockComponent comp : getComponents()) - mb.addComponent(comp.copy()); - - return mb; - } - - /** - * Creates a length 4 array of all the rotations multiple of pi/2 required - * to render this multiblock in the world relevant to the 4 cardinal - * orientations. - */ - public Multiblock[] createRotations() { - Multiblock[] blocks = new Multiblock[4]; - blocks[0] = this; - blocks[1] = blocks[0].copy(); - blocks[1].rotate(Math.PI / 2); - blocks[2] = blocks[1].copy(); - blocks[2].rotate(Math.PI / 2); - blocks[3] = blocks[2].copy(); - blocks[3].rotate(Math.PI / 2); - - return blocks; - } - - /** - * Makes a MultiblockSet from this Multiblock and its rotations using - * createRotations(). - */ - public MultiblockSet makeSet() { - return new MultiblockSet(this); - } - - public int getXSize() { - return Math.abs(minX) + Math.abs(maxX) + 1; - } - - public int getYSize() { - return Math.abs(minY) + Math.abs(maxY) + 1; - } - - public int getZSize() { - return Math.abs(minZ) + Math.abs(maxZ) + 1; - } - - /** - * Rebuilds the location cache - */ - public void updateLocationCache() { - locationCache.clear(); - for(MultiblockComponent comp : components) - addComponentToLocationCache(comp); - } - - /** - * Adds a single component to the location cache - */ - private void addComponentToLocationCache(MultiblockComponent comp) { - ChunkCoordinates pos = comp.getRelativePosition(); - locationCache.put(Arrays.asList( - pos.posX, - pos.posY, - pos.posZ - ), comp); - } - - /** - * Gets the component for a given location - */ - public MultiblockComponent getComponentForLocation(int x, int y, int z) { - return locationCache.get(Arrays.asList(x, y, z)); - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java deleted file mode 100644 index c0435f8..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/MultiblockSet.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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 @ [Jun 27, 2015, 7:31:58 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock; - -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -/** - * A set of Multiblock objects for various rotations. - */ -public class MultiblockSet { - - private final Multiblock[] mbs; - - public MultiblockSet(Multiblock[] mbs) { - this.mbs = mbs; - } - - public MultiblockSet(Multiblock mb) { - this(mb.createRotations()); - } - - public Multiblock getForEntity(Entity e) { - return getForRotation(e.rotationYaw); - } - - public Multiblock getForRotation(double rotation) { - int facing = MathHelper.floor_double(rotation * 4.0 / 360.0 + 0.5) & 3; - return getForIndex(facing); - } - - public Multiblock getForIndex(int index) { - return mbs[Math.min(mbs.length - 1, index)]; - } -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java deleted file mode 100644 index f7a159b..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/AnyComponent.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 @ [01/11/2015, 19:05:57 (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -/** - * A multiblock component that matches any non air blocks that have a collision box. - */ -public class AnyComponent extends MultiblockComponent { - - public AnyComponent(ChunkCoordinates relPos, Block block, int meta) { - super(relPos, block, meta); - } - - @Override - public boolean matches(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - return !block.isAir(world, x, y, z) && block.getCollisionBoundingBoxFromPool(world, x, y, z) != null; - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java deleted file mode 100644 index 27eb32a..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/ColorSwitchingComponent.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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 @ [Jun 27, 2015, 7:20:09 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.BotaniaAPI; - -/** - * A multiblock component that switches through the 16 colors of the - * minecraft spectrum. This can be used for flowers, for example. - */ -public class ColorSwitchingComponent extends MultiblockComponent { - - public ColorSwitchingComponent(ChunkCoordinates relPos, Block block) { - super(relPos, block, -1); - } - - @Override - public int getMeta() { - return (int) (BotaniaAPI.internalHandler.getWorldElapsedTicks() / 20) % 16; - } - - @Override - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z) == getBlock(); - } - - @Override - public MultiblockComponent copy() { - return new ColorSwitchingComponent(relPos, block); - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java deleted file mode 100644 index 8a4f0ad..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/FlowerComponent.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * 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 @ [Jun 28, 2015, 3:23:15 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import vazkii.botania.api.BotaniaAPI; - -/** - * A multiblock component that matches any botania flower. - */ -public class FlowerComponent extends ColorSwitchingComponent { - - public FlowerComponent(ChunkCoordinates relPos, Block block) { - super(relPos, block); - } - - @Override - public boolean matches(World world, int x, int y, int z) { - return BotaniaAPI.internalHandler.isBotaniaFlower(world, x, y, z); - } - - @Override - public MultiblockComponent copy() { - return new FlowerComponent(relPos, block); - } - -} diff --git a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java b/src/api/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java deleted file mode 100644 index b1a7d89..0000000 --- a/src/api/java/vazkii/botania/api/lexicon/multiblock/component/MultiblockComponent.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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 @ [Jun 27, 2015, 2:42:32 PM (GMT)] - */ -package vazkii.botania.api.lexicon.multiblock.component; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A component of a multiblock, the normal one - * is just a block. - */ -public class MultiblockComponent { - - public ChunkCoordinates relPos; - public final Block block; - public final int meta; - public final TileEntity tileEntity; - public boolean doFancyRender; - - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta) { - this(relPos, block, meta, null); - } - - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, boolean doFancyRender) { - this(relPos, block, meta, doFancyRender, null); - } - - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, TileEntity tileEntity) { - this(relPos, block, meta, block.hasTileEntity() == (tileEntity != null), tileEntity); - } - - public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, boolean doFancyRender, TileEntity tileEntity) { - this.relPos = relPos; - this.block = block; - this.meta = meta; - this.tileEntity = tileEntity; - this.doFancyRender = doFancyRender; - } - - public ChunkCoordinates getRelativePosition() { - return relPos; - } - - public Block getBlock() { - return block; - } - - public int getMeta() { - return meta; - } - - public boolean matches(World world, int x, int y, int z) { - return world.getBlock(x, y, z) == getBlock() && (meta == -1 || world.getBlockMetadata(x, y, z) == meta); - } - - public ItemStack[] getMaterials() { - return new ItemStack[] { new ItemStack(block, 1, meta) }; - } - - public void rotate(double angle) { - double x = relPos.posX; - double z = relPos.posZ; - double sin = Math.sin(angle); - double cos = Math.cos(angle); - - double xn = x * cos - z * sin; - double zn = x * sin + z * cos; - relPos = new ChunkCoordinates((int) Math.round(xn), relPos.posY, (int) Math.round(zn)); - } - - public MultiblockComponent copy() { - return new MultiblockComponent(relPos, block, meta, tileEntity); - } - - public TileEntity getTileEntity() { - return tileEntity; - } - - @SideOnly(Side.CLIENT) - public boolean shouldDoFancyRender() { - return doFancyRender; - } -} diff --git a/src/api/java/vazkii/botania/api/mana/BurstProperties.java b/src/api/java/vazkii/botania/api/mana/BurstProperties.java deleted file mode 100644 index 75ff0f8..0000000 --- a/src/api/java/vazkii/botania/api/mana/BurstProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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 @ [Jan 31, 2014, 3:49:30 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * The properties of a mana burst, when shot. This is passed to the lens - * currently on the mana spreader to apply changes. - */ -public final class BurstProperties { - - public int maxMana; - public int ticksBeforeManaLoss; - public float manaLossPerTick; - public float gravity; - public float motionModifier; - - public int color; - - public BurstProperties(int maxMana, int ticksBeforeManaLoss, float manaLossPerTick, float gravity, float motionModifier, int color) { - this.maxMana = maxMana; - this.ticksBeforeManaLoss = ticksBeforeManaLoss; - this.manaLossPerTick = manaLossPerTick; - this.gravity = gravity; - this.motionModifier = motionModifier; - this.color = color; - } - -} diff --git a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java b/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java deleted file mode 100644 index aea14b9..0000000 --- a/src/api/java/vazkii/botania/api/mana/IClientManaHandler.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 @ [Jul 2, 2014, 5:26:02 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this will get it's recieveMana call - * called on both client and server. If this is not implemented - * the call will only occur on the server. - */ -public interface IClientManaHandler extends IManaReceiver { - -} diff --git a/src/api/java/vazkii/botania/api/mana/ICompositableLens.java b/src/api/java/vazkii/botania/api/mana/ICompositableLens.java deleted file mode 100644 index 775719d..0000000 --- a/src/api/java/vazkii/botania/api/mana/ICompositableLens.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 @ [Nov 23, 2015, 10:30:34 AM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this to be counted as a lens that can be combined with an ItemLens. - */ -public interface ICompositableLens extends ILens { - - /** - * Returns the properties of the itemstack, used to check if two lenses can combine. - */ - public int getProps(ItemStack stack); - - /** - * Checks if the lens is combinable. - */ - public boolean isCombinable(ItemStack stack); - -} - - diff --git a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java b/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java deleted file mode 100644 index 2556663..0000000 --- a/src/api/java/vazkii/botania/api/mana/ICreativeManaProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [May 25, 2014, 7:34:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Have an item implement this to flag it as an infinite - * mana source for the purposes of the HUD rendered when - * an IManaUserItem implementing item is present. - */ -public interface ICreativeManaProvider { - - public boolean isCreative(ItemStack stack); - -} - diff --git a/src/api/java/vazkii/botania/api/mana/IDirectioned.java b/src/api/java/vazkii/botania/api/mana/IDirectioned.java deleted file mode 100644 index ff856f7..0000000 --- a/src/api/java/vazkii/botania/api/mana/IDirectioned.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 @ [15/11/2015, 19:27:07 (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this is defined as having a direction, - * and has two rotations (X and Y). - * An example of this is the Mana Spreader. - */ -public interface IDirectioned { - - public float getRotationX(); - - public float getRotationY(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IIdentifiable.java b/src/api/java/vazkii/botania/api/mana/IIdentifiable.java deleted file mode 100644 index 65f2edc..0000000 --- a/src/api/java/vazkii/botania/api/mana/IIdentifiable.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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 @ [Jun 19, 2015, 10:05:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import java.util.UUID; - -/** - * This interface marks a TileEntity that can be identified through - * an UUID. This UUID must presist between sessions. - */ -public interface IIdentifiable { - - public UUID getIdentifier(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java b/src/api/java/vazkii/botania/api/mana/IKeyLocked.java deleted file mode 100644 index ce71694..0000000 --- a/src/api/java/vazkii/botania/api/mana/IKeyLocked.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [Jul 11, 2014, 4:29:32 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this interface has an IO key lock. This - * interface defines an input and output key.

    - * - * A Spreader can only shoot mana into a IKeyLocked interfaced TE if the Input - * key of the TE is equal to the Output key of the Spreader.

    - * - * A Spreader can only pull mana from a IKeyLocked interfaced IManaPool TE if the - * Output key of the IManaPool is equal to the Input key of the Spreader. - */ -public interface IKeyLocked { - - public String getInputKey(); - - public String getOutputKey(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java b/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java deleted file mode 100644 index dfa2945..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILaputaImmobile.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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 @ [Jul 26, 2014, 9:51:58 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.world.World; - -/** - * A block that implements this has a flag for whether it can be moved by the Shard of Laputa. - */ -public interface ILaputaImmobile { - - public boolean canMove(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILens.java b/src/api/java/vazkii/botania/api/mana/ILens.java deleted file mode 100644 index d125e57..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILens.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 @ [Jan 31, 2014, 3:03:04 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Have an Item implement this to be counted as a lens for the mana spreader. - */ -public interface ILens extends ILensEffect { - - @SideOnly(Side.CLIENT) - public int getLensColor(ItemStack stack); - - /** - * Can the source lens be combined with the composite lens? This is called - * for both the ILens instance of ItemStack.getItem() of sourceLens and compositeLens. - */ - public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens); - - /** - * Gets the composite lens in the stack passed in, return null for none. - */ - public ItemStack getCompositeLens(ItemStack stack); - - /** - * Sets the composite lens for the sourceLens as the compositeLens, returns - * the ItemStack with the combination. - */ - public ItemStack setCompositeLens(ItemStack sourceLens, ItemStack compositeLens); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILensControl.java b/src/api/java/vazkii/botania/api/mana/ILensControl.java deleted file mode 100644 index ad0cc6c..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILensControl.java +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 @ [15/11/2015, 21:00:32 (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * An extension of ILens that allows for the lens item to control the - * spreader's behaviour. - */ -public interface ILensControl extends ILens { - - public boolean isControlLens(ItemStack stack); - - public boolean allowBurstShooting(ItemStack stack, IManaSpreader spreader, boolean redstone); - - /** - * Used for the tick of a non-redstone spreader. - */ - public void onControlledSpreaderTick(ItemStack stack, IManaSpreader spreader, boolean redstone); - - /** - * Used for when a redstone spreader gets a pulse. - */ - public void onControlledSpreaderPulse(ItemStack stack, IManaSpreader spreader, boolean redstone); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ILensEffect.java b/src/api/java/vazkii/botania/api/mana/ILensEffect.java deleted file mode 100644 index 4c88f55..0000000 --- a/src/api/java/vazkii/botania/api/mana/ILensEffect.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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 14, 2014, 7:30:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import vazkii.botania.api.internal.IManaBurst; - -/** - * Have an item implement this for it to count as a lens effect and - * be able to change the properties of Mana Bursts. - */ -public interface ILensEffect { - - /** - * Called when a mana spreader that has this focus shoots a burst. This is where - * you change the properties of the burst. - */ - public void apply(ItemStack stack, BurstProperties props); - - /** - * Called when a mana burst fired from a mana spreader with this focus collides against - * any block. This is called after the collision is handled. - * @return True to kill the burst. False to keep it alive. - */ - public boolean collideBurst(IManaBurst burst, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack); - - /** - * Called when a mana burst fired from a mana spreader with this focus is updated. - * This is called before the update is handled. - */ - public void updateBurst(IManaBurst burst, ItemStack stack); - - /** - * Called when the mana burst should do it's particles. Return false to not - * do any particles. - */ - public boolean doParticles(IManaBurst burst, ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaBlock.java b/src/api/java/vazkii/botania/api/mana/IManaBlock.java deleted file mode 100644 index 56aa037..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaBlock.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 4:59:05 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that implements this is considered a Mana Block. - * Just being a Mana Block doesn't mean much, look at the other IMana - * interfaces. - */ -public interface IManaBlock { - - /** - * Gets the amount of mana currently in this block. - */ - public int getCurrentMana(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollector.java b/src/api/java/vazkii/botania/api/mana/IManaCollector.java deleted file mode 100644 index 280e460..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaCollector.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 5:01:19 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import vazkii.botania.api.internal.IManaBurst; - -/** - * Any TileEntity that implements this is considered a mana collector, by - * which nearby generating flowers will pump mana into it.

    - * - * Implementation Instructions:
    - * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removeCollector(this); on both.
    - * - On the first tick of onUpdate(), call ManaNetworkEvent.addCollector(this); - */ -public interface IManaCollector extends IManaReceiver { - - /** - * Called every tick on the client case the player is holding a Wand of the Forest. - */ - public void onClientDisplayTick(); - - /** - * Get the multiplier of mana to input into the block, 1.0 is the original amount of mana - * in the burst. 0.9, for example, is 90%, so 10% of the mana in the burst will get - * dissipated. - */ - public float getManaYieldMultiplier(IManaBurst burst); - - /** - * Gets the maximum amount of mana this collector can have. - */ - public int getMaxMana(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java b/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java deleted file mode 100644 index 76b537e..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaCollisionGhost.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * 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 @ [Mar 10, 2014, 7:49:19 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this can be counted as a "ghost" block of - * sorts, that won't call the collision code for the mana bursts. - */ -public interface IManaCollisionGhost { - - public boolean isGhost(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaDiscountArmor.java b/src/api/java/vazkii/botania/api/mana/IManaDiscountArmor.java deleted file mode 100644 index 56a9683..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaDiscountArmor.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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 @ [Jan 28, 2015, 9:22:53 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * An armor item that implements this can provide a mana discount for mana tools. - * Mana tools are the ones on the main toolset (Pick, Shovel, Axe, Sword and Shovel) - * as well as Rods. - */ -public interface IManaDiscountArmor { - - /** - * Gets the mana discount that this piece of armor provides. This is added - * together to create the full discount. - * Value is to be from 0.0 to 1.0. 0.1 is 10% discount, as an example. - * You can also return negative values to make tools cost more. - */ - public float getDiscount(ItemStack stack, int slot, EntityPlayer player); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaGivingItem.java b/src/api/java/vazkii/botania/api/mana/IManaGivingItem.java deleted file mode 100644 index a1d7f04..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaGivingItem.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 @ [08/12/2015, 18:10:29 (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * An item that implements this is an item that can give mana to other items. - * This is used in botania for the terra shatterer to not be constantly - * receiving mana from these items.. - */ -public interface IManaGivingItem { - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaItem.java b/src/api/java/vazkii/botania/api/mana/IManaItem.java deleted file mode 100644 index f4463fb..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaItem.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * 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 @ [Mar 6, 2014, 9:07:40 AM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -/** - * An item that implements this can be counted as an item that can - * contain mana. - */ -public interface IManaItem { - - /** - * Gets the amount of mana this item contains - */ - public int getMana(ItemStack stack); - - /** - * Gets the max amount of mana this item can hold. - */ - public int getMaxMana(ItemStack stack); - - /** - * Adds mana to this item. - */ - public void addMana(ItemStack stack, int mana); - - /** - * Can this item receive mana from a mana Pool? - * @param pool The pool it's receiving mana from, can be casted to IManaPool. - * @see IManaPool#isOutputtingPower() - */ - public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool); - - /** - * Can this item recieve mana from another item? - */ - public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack); - - /** - * Can this item export mana to a mana Pool? - * @param pool The pool it's exporting mana to, can be casted to IManaPool. - * @see IManaPool#isOutputtingPower() - */ - public boolean canExportManaToPool(ItemStack stack,TileEntity pool); - - /** - * Can this item export mana to another item? - */ - public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack); - - /** - * If this item simply does not export mana at all, set this to true. This is - * used to skip items that contain mana but can't export it when drawing the - * mana bar above the XP bar. - */ - public boolean isNoExport(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaPool.java b/src/api/java/vazkii/botania/api/mana/IManaPool.java deleted file mode 100644 index df523a6..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaPool.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 5:03:09 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this is considered a Mana Pool, - * by which nearby functional flowers will pull mana from it.
    - * Mana Distributors will also accept it as valid output.

    - * - * Implementation Instructions:
    - * - Override invalidate() and onChunkUnload(), calling ManaNetworkEvent.removePool(this); on both.
    - * - On the first tick of onUpdate(), call ManaNetworkEvent.addPool(this); - */ -public interface IManaPool extends IManaReceiver { - - /** - * Returns false if the mana pool is accepting power from other power items, - * true if it's sending power into them. - */ - public boolean isOutputtingPower(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java b/src/api/java/vazkii/botania/api/mana/IManaReceiver.java deleted file mode 100644 index 178856f..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaReceiver.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 4:55:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * Any TileEntity that implements this can receive mana from mana bursts. - */ -public interface IManaReceiver extends IManaBlock { - - /** - * Is this Mana Receiver is full? Being full means no mana bursts will be sent. - */ - public boolean isFull(); - - /** - * Called when this receiver receives mana. - */ - public void recieveMana(int mana); - - /** - * Can this tile receive mana from bursts? Generally set to false for - * implementations of IManaCollector. - */ - public boolean canRecieveManaFromBursts(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaSpreader.java b/src/api/java/vazkii/botania/api/mana/IManaSpreader.java deleted file mode 100644 index 61b9f8e..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaSpreader.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 18, 2015, 7:30:00 PM (GMT)] - */ -package vazkii.botania.api.mana; - - -/** - * Any TileEntity that implements this is considered a Mana Spreader, - * by which can fire mana bursts as a spreader. - */ -public interface IManaSpreader extends IManaBlock, IPingable, IDirectioned { - - public void setCanShoot(boolean canShoot); - - public int getBurstParticleTick(); - - public void setBurstParticleTick(int i); - - public int getLastBurstDeathTick(); - - public void setLastBurstDeathTick(int ticksExisted); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaTooltipDisplay.java b/src/api/java/vazkii/botania/api/mana/IManaTooltipDisplay.java deleted file mode 100644 index 21de474..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaTooltipDisplay.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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 @ [Oct 23, 2015, 3:54:03 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * An Item that implements this has a mana tooltip display (like how the Mana Tablet - * and Mana Mirror) do. - */ -public interface IManaTooltipDisplay { - - /** - * Returns the fraction of mana in this item for display. From 0 to 1 (exclusive). - */ - public float getManaFractionForDisplay(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java b/src/api/java/vazkii/botania/api/mana/IManaTrigger.java deleted file mode 100644 index 61aadfc..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaTrigger.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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 @ [May 16, 2014, 7:52:53 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.world.World; -import vazkii.botania.api.internal.IManaBurst; - -/** - * Have a block implement this class to make it do something when a mana burst collides with it. - */ -public interface IManaTrigger { - - public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java b/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java deleted file mode 100644 index 9fe55fc..0000000 --- a/src/api/java/vazkii/botania/api/mana/IManaUsingItem.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [May 25, 2014, 7:32:10 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Any item that implements this interface is an item that would use mana - * from the player's inventory. If there's any items in the inventory or - * equipped in either the baubles or armor inventories that implement - * this interface, a mana bar will be rendered. - */ -public interface IManaUsingItem { - - public boolean usesMana(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IPingable.java b/src/api/java/vazkii/botania/api/mana/IPingable.java deleted file mode 100644 index 1605b42..0000000 --- a/src/api/java/vazkii/botania/api/mana/IPingable.java +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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 @ [Jun 19, 2015, 9:52:05 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import java.util.UUID; - -import vazkii.botania.api.internal.IManaBurst; - -/** - * This describes an interface of a Mana Sender block that should be able to pingbackable - * by a burst to tell it that the burst is still alive. - */ -public interface IPingable extends IIdentifiable { - - /** - * Pings this object back, telling it that the burst passed in is still alive - * in the world. The UUID parameter should be the UUID with which the burst - * was created, this is used to let the object handle the check for if it's the - * correct ID internally. IManaBurst implementations should do this every tick. - */ - public void pingback(IManaBurst burst, UUID expectedIdentity); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java b/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java deleted file mode 100644 index e443e2c..0000000 --- a/src/api/java/vazkii/botania/api/mana/IPoolOverlayProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Jul 2, 2014, 6:36:54 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -/** - * A block that implements this can provide an IIcon (block icons only) - * to be used as an overlay for the mana pool, similarly to the mana void - * and catalysts. - */ -public interface IPoolOverlayProvider { - - public IIcon getIcon(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/mana/IRedirectable.java b/src/api/java/vazkii/botania/api/mana/IRedirectable.java deleted file mode 100644 index 00a1b6a..0000000 --- a/src/api/java/vazkii/botania/api/mana/IRedirectable.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [15/11/2015, 19:28:18 (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * This is an extension of IDirectioned for TileEntities - * that allow for their rotation to be public and modifiable outside. - * This is used in botania for the Redirective mana lens. - */ -public interface IRedirectable extends IDirectioned { - - public void setRotationX(float rot); - - public void setRotationY(float rot); - - /** - * This should be called after rotation setting is done to allow - * for the block to re-calculate. - */ - public void commitRedirection(); -} diff --git a/src/api/java/vazkii/botania/api/mana/IThrottledPacket.java b/src/api/java/vazkii/botania/api/mana/IThrottledPacket.java deleted file mode 100644 index ff760be..0000000 --- a/src/api/java/vazkii/botania/api/mana/IThrottledPacket.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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 12, 2015, 3:08:09 PM (GMT)] - */ -package vazkii.botania.api.mana; - -/** - * A TileEntity that will only send a few packets rather than one per every entity collision. - * markDispatchable marks that this TE needs to send a packet. Further handling is to be done - * in the TE itself. - */ -public interface IThrottledPacket { - - public void markDispatchable(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java b/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java deleted file mode 100644 index a82114c..0000000 --- a/src/api/java/vazkii/botania/api/mana/ITinyPlanetExcempt.java +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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 @ [Jul 22, 2014, 2:26:14 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.item.ItemStack; - -/** - * Any Item that implements ILensEffect and this will have - * a check before being pulled by the Tiny Planet. - */ -public interface ITinyPlanetExcempt { - - public boolean shouldPull(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java b/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java deleted file mode 100644 index d261d55..0000000 --- a/src/api/java/vazkii/botania/api/mana/ManaItemHandler.java +++ /dev/null @@ -1,255 +0,0 @@ -/** - * 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 @ [Mar 13, 2014, 5:32:24 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import vazkii.botania.api.BotaniaAPI; - -public final class ManaItemHandler { - - /** - * Requests mana from items in a given player's inventory. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return The amount of mana received from the request. - */ - public static int requestMana(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if(stack == null) - return 0; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItem = (IManaItem) stackInSlot.getItem(); - if(manaItem.canExportManaToItem(stackInSlot, stack) && manaItem.getMana(stackInSlot) > 0) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) - continue; - - int mana = Math.min(manaToGet, manaItem.getMana(stackInSlot)); - - if(remove) - manaItem.addMana(stackInSlot, -mana); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return mana; - } - } - } - - return 0; - } - - /** - * Requests an exact amount of mana from items in a given player's inventory. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * false will be returned instead, and nothing will happen. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return If the request was succesful. - */ - public static boolean requestManaExact(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - if(stack == null) - return false; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - if(manaItemSlot.canExportManaToItem(stackInSlot, stack) && manaItemSlot.getMana(stackInSlot) > manaToGet) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canReceiveManaFromItem(stack, stackInSlot)) - continue; - - if(remove) - manaItemSlot.addMana(stackInSlot, -manaToGet); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return true; - } - } - } - - return false; - } - - /** - * Dispatches mana to items in a given player's inventory. Note that this method - * does not automatically remove mana from the item which is exporting. - * @param manaToSend How much mana is to be sent. - * @param remove If true, the mana will be added from the target item. Set to false to just check. - * @return The amount of mana actually sent. - */ - public static int dispatchMana(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { - if(stack == null) - return 0; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - - if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) - continue; - - int received = 0; - if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot)) - received = manaToSend; - else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot)); - - - if(add) - manaItemSlot.addMana(stackInSlot, manaToSend); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return received; - } - } - } - - return 0; - } - - /** - * Dispatches an exact amount of mana to items in a given player's inventory. Note that this method - * does not automatically remove mana from the item which is exporting. - * @param manaToSend How much mana is to be sent. - * @param remove If true, the mana will be added from the target item. Set to false to just check. - * @return If an item received the mana sent. - */ - public static boolean dispatchManaExact(ItemStack stack, EntityPlayer player, int manaToSend, boolean add) { - if(stack == null) - return false; - - IInventory mainInv = player.inventory; - IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player); - - int invSize = mainInv.getSizeInventory(); - int size = invSize; - if(baublesInv != null) - size += baublesInv.getSizeInventory(); - - for(int i = 0; i < size; i++) { - boolean useBaubles = i >= invSize; - IInventory inv = useBaubles ? baublesInv : mainInv; - int slot = i - (useBaubles ? invSize : 0); - ItemStack stackInSlot = inv.getStackInSlot(slot); - if(stackInSlot == stack) - continue; - - if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) { - IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem(); - if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot) && manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) { - if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot)) - continue; - - if(add) - manaItemSlot.addMana(stackInSlot, manaToSend); - if(useBaubles) - BotaniaAPI.internalHandler.sendBaubleUpdatePacket(player, slot); - - return true; - } - } - } - - return false; - } - - /** - * Requests mana from items in a given player's inventory. This version also - * checks for IManaDiscountArmor items equipped to lower the cost. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * the amount of mana existent will be returned instead, if you want exact values use requestManaExact. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return The amount of mana received from the request. - */ - public static int requestManaForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player)); - int cost = (int) (manaToGet * multiplier); - return (int) (requestMana(stack, player, cost, remove) / multiplier); - } - - /** - * Requests an exact amount of mana from items in a given player's inventory. This version also - * checks for IManaDiscountArmor items equipped to lower the cost. - * @param manaToGet How much mana is to be requested, if less mana exists than this amount, - * false will be returned instead, and nothing will happen. - * @param remove If true, the mana will be removed from the target item. Set to false to just check. - * @return If the request was succesful. - */ - public static boolean requestManaExactForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) { - float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player)); - int cost = (int) (manaToGet * multiplier); - return requestManaExact(stack, player, cost, remove); - } - - /** - * Gets the sum of all the discounts on IManaDiscountArmor items equipped - * on the player passed in. - */ - public static float getFullDiscountForTools(EntityPlayer player) { - float discount = 0F; - for(int i = 0; i < player.inventory.armorInventory.length; i++) { - ItemStack armor = player.inventory.armorInventory[i]; - if(armor != null && armor.getItem() instanceof IManaDiscountArmor) - discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player); - } - - return discount; - } -} diff --git a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java b/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java deleted file mode 100644 index 9116602..0000000 --- a/src/api/java/vazkii/botania/api/mana/ManaNetworkEvent.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 5:04:30 PM (GMT)] - */ -package vazkii.botania.api.mana; - -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.MinecraftForge; -import cpw.mods.fml.common.eventhandler.Event; - -public class ManaNetworkEvent extends Event { - - public final TileEntity tile; - public final ManaBlockType type; - public final Action action; - - public ManaNetworkEvent(TileEntity tile, ManaBlockType type, Action action) { - this.tile = tile; - this.type = type; - this.action = action; - } - - public static void addCollector(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.ADD); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void removeCollector(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.COLLECTOR, Action.REMOVE); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void addPool(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.ADD); - MinecraftForge.EVENT_BUS.post(event); - } - - public static void removePool(TileEntity tile) { - ManaNetworkEvent event = new ManaNetworkEvent(tile, ManaBlockType.POOL, Action.REMOVE); - MinecraftForge.EVENT_BUS.post(event); - } - - public enum ManaBlockType { - POOL, COLLECTOR - } - - public enum Action { - REMOVE, ADD - } -} diff --git a/src/api/java/vazkii/botania/api/mana/TileSignature.java b/src/api/java/vazkii/botania/api/mana/TileSignature.java deleted file mode 100644 index 5573670..0000000 --- a/src/api/java/vazkii/botania/api/mana/TileSignature.java +++ /dev/null @@ -1,15 +0,0 @@ -package vazkii.botania.api.mana; - -import net.minecraft.tileentity.TileEntity; - -public class TileSignature { - - public final TileEntity tile; - public final boolean remoteWorld; - - public TileSignature(TileEntity tile, boolean remoteWorld) { - this.tile = tile; - this.remoteWorld = remoteWorld; - } - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java deleted file mode 100644 index 880e169..0000000 --- a/src/api/java/vazkii/botania/api/mana/spark/ISparkAttachable.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * 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 @ [Aug 21, 2014, 5:44:13 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import net.minecraft.item.ItemStack; -import vazkii.botania.api.mana.IManaReceiver; - -/** - * A TileEntity that implements this can have a Spark attached to it. - * For the Spark to be allowed to have upgrades, it needs to be an IManaPool. - */ -public interface ISparkAttachable extends IManaReceiver { - - /** - * Can this block have a Spark attached to it. Note that this will not - * unattach the Spark if it's changed later. - */ - public boolean canAttachSpark(ItemStack stack); - - /** - * Called when the Spark is attached. - */ - public void attachSpark(ISparkEntity entity); - - /** - * Returns how much space for mana is available in this block, normally the total - the current. - * Should NEVER return negative values. Make sure to check against that. - */ - public int getAvailableSpaceForMana(); - - /** - * Gets the Spark that is attached to this block. A common implementation is - * to check for Spark entities above: - * - List sparks = worldObj.getEntitiesWithinAABB(ISparkEntity.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1, zCoord, xCoord + 1, yCoord + 2, zCoord + 1)); - if(sparks.size() == 1) { - Entity e = (Entity) sparks.get(0); - return (ISparkEntity) e; - } - - return null; - */ - public ISparkEntity getAttachedSpark(); - - /** - * Return true if this Tile no longer requires mana and all Sparks - * transferring mana to it should cancel their transfer. - */ - public boolean areIncomingTranfersDone(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java b/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java deleted file mode 100644 index e35076c..0000000 --- a/src/api/java/vazkii/botania/api/mana/spark/ISparkEntity.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * 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 @ [Aug 21, 2014, 5:44:07 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import java.util.Collection; - -/** - * An Entity that implements this is considered a Spark. - */ -public interface ISparkEntity { - - /** - * Which TileEntity is this Spark attached to? A common implementation is checking the block below. - * - int x = MathHelper.floor_double(posX); - int y = MathHelper.floor_double(posY) - 1; - int z = MathHelper.floor_double(posZ); - TileEntity tile = worldObj.getTileEntity(x, y, z); - if(tile != null && tile instanceof ISparkAttachable) - return (ISparkAttachable) tile; - - return null; - */ - public ISparkAttachable getAttachedTile(); - - /** - * Gets a collection of all Sparks this is tranfering to. - */ - public Collection getTransfers(); - - /** - * Registers the Spark passed in as a Spark meant for mana to be transfered towards. - */ - public void registerTransfer(ISparkEntity entity); - - /** - * Gets which upgrade is in this Spark.
    - * 0: None
    - * 1: Dispersive
    - * 2: Dominant
    - * 3: Recessive
    - * 4: Isolated - */ - public int getUpgrade(); - - /** - * Sets the upgrade on this Spark. See {@link ISparkEntity#getUpgrade} - */ - public void setUpgrade(int upgrade); - - /** - * See {@link ISparkAttachable#areIncomingTranfersDone()} - */ - public boolean areIncomingTransfersDone(); - -} diff --git a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java b/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java deleted file mode 100644 index 7351036..0000000 --- a/src/api/java/vazkii/botania/api/mana/spark/SparkHelper.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 @ [Aug 21, 2014, 7:16:11 PM (GMT)] - */ -package vazkii.botania.api.mana.spark; - -import java.util.List; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public final class SparkHelper { - - public static final int SPARK_SCAN_RANGE = 12; - - public static List getSparksAround(World world, double x, double y, double z) { - return SparkHelper.getEntitiesAround(ISparkEntity.class, world, x, y, z); - } - - public static List getEntitiesAround(Class clazz, World world, double x, double y, double z) { - int r = SPARK_SCAN_RANGE; - List entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r)); - return entities; - } - -} diff --git a/src/api/java/vazkii/botania/api/package-info.java b/src/api/java/vazkii/botania/api/package-info.java deleted file mode 100644 index f5ba9c0..0000000 --- a/src/api/java/vazkii/botania/api/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@API(owner = "Botania", apiVersion = "76", provides = "BotaniaAPI") -package vazkii.botania.api; -import cpw.mods.fml.common.API; - diff --git a/src/api/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java b/src/api/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java deleted file mode 100644 index 40d9713..0000000 --- a/src/api/java/vazkii/botania/api/recipe/ElvenPortalUpdateEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 17, 2015, 4:58:30 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import cpw.mods.fml.common.eventhandler.Event; - -/** - * An event fired when an Elven Portal TE updates. The portal's - * relevant AABB and other stuff is passed in for convenience. This - * is fired in MinecraftForge.EVENT_BUS. - */ -public class ElvenPortalUpdateEvent extends Event { - - /** - * May be casted to TileAlfPortal if you have botania code access aside from the API. - */ - public final TileEntity portalTile; - public final AxisAlignedBB aabb; - public boolean open; - public final List stacksInside; - - public ElvenPortalUpdateEvent(TileEntity te, AxisAlignedBB aabb, boolean open, List stacks) { - portalTile = te; - this.aabb = aabb; - this.open = open; - stacksInside = stacks; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java b/src/api/java/vazkii/botania/api/recipe/IElvenItem.java deleted file mode 100644 index e614014..0000000 --- a/src/api/java/vazkii/botania/api/recipe/IElvenItem.java +++ /dev/null @@ -1,14 +0,0 @@ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; - -/** - * Any Item that implements this is classified as an "Elven Item", by which, - * it'll not go through the alfheim portal. Any item that comes out of it - * must implement this or it'll just go back in. - */ -public interface IElvenItem { - - public boolean isElvenItem(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java b/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java deleted file mode 100644 index ca46124..0000000 --- a/src/api/java/vazkii/botania/api/recipe/IFlowerComponent.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Feb 15, 2014, 2:36:35 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; - -/** - * Have an Item implement this to allow it to be used in the Petal Apothecary. - */ -public interface IFlowerComponent { - - public boolean canFit(ItemStack stack, IInventory apothecary); - - public int getParticleColor(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeBrew.java b/src/api/java/vazkii/botania/api/recipe/RecipeBrew.java deleted file mode 100644 index 9557778..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeBrew.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * 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 @ [Nov 1, 2014, 8:52:00 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.api.brew.Brew; -import vazkii.botania.api.brew.IBrewContainer; - -public class RecipeBrew { - - Brew brew; - List inputs; - - public RecipeBrew(Brew brew, Object... inputs) { - this.brew = brew; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); - - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if(stack == null) - break; - - if(stack.getItem() instanceof IBrewContainer) - continue; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - oredictIndex = j; - found = true; - break; - } - } - - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - else return false; - } - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public Brew getBrew() { - return brew; - } - - public int getManaUsage() { - return brew.getManaCost(); - } - - public ItemStack getOutput(ItemStack stack) { - if(stack == null || !(stack.getItem() instanceof IBrewContainer)) - return new ItemStack(Items.glass_bottle); // Fallback... - IBrewContainer container = (IBrewContainer) stack.getItem(); - - return container.getItemForBrew(brew, stack); - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java b/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java deleted file mode 100644 index dbea13e..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeElvenTrade.java +++ /dev/null @@ -1,94 +0,0 @@ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeElvenTrade { - - ItemStack output; - List inputs; - - public RecipeElvenTrade(ItemStack output, Object... inputs) { - this.output = output; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(List stacks, boolean remove) { - List inputsMissing = new ArrayList(inputs); - List stacksToRemove = new ArrayList(); - - for(ItemStack stack : stacks) { - if(stack == null) { - continue; - } - if(inputsMissing.isEmpty()) - break; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - if(!stacksToRemove.contains(stack)) - stacksToRemove.add(stack); - oredictIndex = j; - found = true; - break; - } - } - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - if(!stacksToRemove.contains(stack)) - stacksToRemove.add(stack); - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - } - - if(remove) - for(ItemStack r : stacksToRemove) - stacks.remove(r); - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public ItemStack getOutput() { - return output; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java b/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java deleted file mode 100644 index 368c8d4..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeManaInfusion.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * 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 @ [Jan 30, 2014, 5:57:07 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.List; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipeManaInfusion { - - ItemStack output; - Object input; - int mana; - boolean isAlchemy = false; - boolean isConjuration = false; - - public RecipeManaInfusion(ItemStack output, Object input, int mana) { - this.output = output; - this.input = input; - this.mana = mana; - } - - public boolean matches(ItemStack stack) { - if(input instanceof ItemStack) { - ItemStack inputCopy = ((ItemStack) input).copy(); - if(inputCopy.getItemDamage() == Short.MAX_VALUE) - inputCopy.setItemDamage(stack.getItemDamage()); - - return stack.isItemEqual(inputCopy); - } - - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) - return true; - } - } - - return false; - } - - public void setAlchemy(boolean alchemy) { - isAlchemy = alchemy; - } - - public boolean isAlchemy() { - return isAlchemy; - } - - public void setConjuration(boolean conjuration) { - isConjuration = conjuration; - } - - public boolean isConjuration() { - return isConjuration; - } - - public Object getInput() { - return input; - } - - public ItemStack getOutput() { - return output; - } - - public int getManaToConsume() { - return mana; - } -} - diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeMiniFlower.java b/src/api/java/vazkii/botania/api/recipe/RecipeMiniFlower.java deleted file mode 100644 index 92908c0..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeMiniFlower.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 22, 2015, 5:57:59 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; -import vazkii.botania.api.BotaniaAPI; - -public class RecipeMiniFlower extends RecipeManaInfusion { - - public RecipeMiniFlower(String flower, String mini, int mana) { - super(BotaniaAPI.internalHandler.getSubTileAsStack(flower), BotaniaAPI.internalHandler.getSubTileAsStack(mini), mana); - setAlchemy(true); - } - - @Override - public boolean matches(ItemStack stack) { - String key = BotaniaAPI.internalHandler.getStackSubTileKey(stack); - String input = this.input instanceof String ? (String) this.input : BotaniaAPI.internalHandler.getStackSubTileKey((ItemStack) this.input); - return key != null && key.equals(input); - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java b/src/api/java/vazkii/botania/api/recipe/RecipePetals.java deleted file mode 100644 index 60e4635..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipePetals.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 2:02:44 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class RecipePetals { - - ItemStack output; - List inputs; - - public RecipePetals(ItemStack output, Object... inputs) { - this.output = output; - - List inputsToSet = new ArrayList(); - for(Object obj : inputs) { - if(obj instanceof String || obj instanceof ItemStack) - inputsToSet.add(obj); - else throw new IllegalArgumentException("Invalid input"); - } - - this.inputs = inputsToSet; - } - - public boolean matches(IInventory inv) { - List inputsMissing = new ArrayList(inputs); - - for(int i = 0; i < inv.getSizeInventory(); i++) { - ItemStack stack = inv.getStackInSlot(i); - if(stack == null) - break; - - int stackIndex = -1, oredictIndex = -1; - - for(int j = 0; j < inputsMissing.size(); j++) { - Object input = inputsMissing.get(j); - if(input instanceof String) { - List validStacks = OreDictionary.getOres((String) input); - boolean found = false; - for(ItemStack ostack : validStacks) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) { - oredictIndex = j; - found = true; - break; - } - } - - - if(found) - break; - } else if(input instanceof ItemStack && simpleAreStacksEqual((ItemStack) input, stack)) { - stackIndex = j; - break; - } - } - - if(stackIndex != -1) - inputsMissing.remove(stackIndex); - else if(oredictIndex != -1) - inputsMissing.remove(oredictIndex); - else return false; - } - - return inputsMissing.isEmpty(); - } - - boolean simpleAreStacksEqual(ItemStack stack, ItemStack stack2) { - return stack.getItem() == stack2.getItem() && stack.getItemDamage() == stack2.getItemDamage(); - } - - public List getInputs() { - return new ArrayList(inputs); - } - - public ItemStack getOutput() { - return output; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipePureDaisy.java b/src/api/java/vazkii/botania/api/recipe/RecipePureDaisy.java deleted file mode 100644 index 19248e6..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipePureDaisy.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * 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 17, 2015, 5:07:25 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; -import vazkii.botania.api.subtile.SubTileEntity; - -public class RecipePureDaisy { - - private static final Map> oreMap = new HashMap(); - - Object input; - Block output; - int outputMeta; - - public RecipePureDaisy(Object input, Block output, int outputMeta) { - this.input = input; - this.output = output; - this.outputMeta = outputMeta; - - if(input != null && !(input instanceof String || input instanceof Block)) - throw new IllegalArgumentException("input must be an oredict String or a Block."); - } - - /** - * This gets called every tick, please be careful with your checks. - */ - public boolean matches(World world, int x, int y, int z, SubTileEntity pureDaisy, Block block, int meta) { - if(input instanceof Block) - return block == input; - - ItemStack stack = new ItemStack(block, 1, meta); - String oredict = (String) input; - return isOreDict(stack, oredict); - } - - public boolean isOreDict(ItemStack stack, String entry) { - if(stack == null || stack.getItem() == null) - return false; - - List ores; - if(oreMap.containsKey(entry)) - ores = oreMap.get(entry); - else { - ores = OreDictionary.getOres(entry); - oreMap.put(entry, ores); - } - - for(ItemStack ostack : ores) { - ItemStack cstack = ostack.copy(); - if(cstack.getItemDamage() == Short.MAX_VALUE) - cstack.setItemDamage(stack.getItemDamage()); - - if(stack.isItemEqual(cstack)) - return true; - } - - return false; - } - - /** - * Returns true if the block was placed (and if the Pure Daisy should do particles and stuffs). - * Should only place the block if !world.isRemote, but should return true if it would've placed - * it otherwise. You may return false to cancel the normal particles and do your own. - */ - public boolean set(World world, int x, int y, int z, SubTileEntity pureDaisy) { - if(!world.isRemote) - world.setBlock(x, y, z, output, outputMeta, 1 | 2); - return true; - } - - public Object getInput() { - return input; - } - - public Block getOutput() { - return output; - } - - public int getOutputMeta() { - return outputMeta; - } - -} diff --git a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java b/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java deleted file mode 100644 index f8bb211..0000000 --- a/src/api/java/vazkii/botania/api/recipe/RecipeRuneAltar.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 @ [Feb 5, 2014, 1:41:14 PM (GMT)] - */ -package vazkii.botania.api.recipe; - -import net.minecraft.item.ItemStack; - -public class RecipeRuneAltar extends RecipePetals { - - int mana; - - public RecipeRuneAltar(ItemStack output, int mana, Object... inputs) { - super(output, inputs); - this.mana = mana; - } - - public int getManaUsage() { - return mana; - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java b/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java deleted file mode 100644 index 3bca431..0000000 --- a/src/api/java/vazkii/botania/api/subtile/ISpecialFlower.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 7:12:28 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * The special flowers in botania implement this. Used for cases where - * BlockFlower would be checked against, but isn't convenient for - * the special flowers with effects. For Azanor and Lycaon. - */ -public interface ISpecialFlower { - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java b/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java deleted file mode 100644 index 3a99d6d..0000000 --- a/src/api/java/vazkii/botania/api/subtile/ISubTileContainer.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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 @ [Aug 26, 2014, 5:42:16 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * A TileEntity that implements this contains a SubTileEntity. - */ -public interface ISubTileContainer { - - /** - * Gets the SubTile in this block. Generally shouldn't return null, but in that - * case use the fallback DummySubTile. - */ - public SubTileEntity getSubTile(); - - /** - * Sets the SubTile on this block from it's name. - */ - public void setSubTile(String name); - -} diff --git a/src/api/java/vazkii/botania/api/subtile/ISubTileSlowableContainer.java b/src/api/java/vazkii/botania/api/subtile/ISubTileSlowableContainer.java deleted file mode 100644 index 6092cd6..0000000 --- a/src/api/java/vazkii/botania/api/subtile/ISubTileSlowableContainer.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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 @ [29/12/2015, 23:00:06 (GMT)] - */ -package vazkii.botania.api.subtile; - -/** - * An extension of ISubTileContainer that allows for the SubTile to be "slowed down". - * Slowing down is the action that happens when a flower is planted in Podzol or Mycellium. - * Any flowers that pick up items from the ground should have a delay on the time the item - * needs to be on the floor equal to the value of getSlowDownFactor(). - */ -public interface ISubTileSlowableContainer extends ISubTileContainer { - - public static final int SLOWDOWN_FACTOR_PODZOL = 5; - public static final int SLOWDOWN_FACTOR_MYCEL = 10; - - public int getSlowdownFactor(); - -} diff --git a/src/api/java/vazkii/botania/api/subtile/RadiusDescriptor.java b/src/api/java/vazkii/botania/api/subtile/RadiusDescriptor.java deleted file mode 100644 index f57b6fa..0000000 --- a/src/api/java/vazkii/botania/api/subtile/RadiusDescriptor.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * 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 @ [Mar 31, 2015, 2:59:19 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; - -/** - * This object describes the Radius of a SubTileEntity. It can either be - * a circle or rectangle, it's to note that the - */ -public class RadiusDescriptor { - - final ChunkCoordinates subtileCoords; - - public RadiusDescriptor(ChunkCoordinates subtileCoords) { - this.subtileCoords = subtileCoords; - } - - public ChunkCoordinates getSubtileCoords() { - return subtileCoords; - } - - public boolean isCircle() { - return false; - } - - public double getCircleRadius() { - return 0; - } - - public AxisAlignedBB getAABB() { - return null; - } - - public static class Circle extends RadiusDescriptor { - - final double radius; - - public Circle(ChunkCoordinates subtileCoords, double radius) { - super(subtileCoords); - this.radius = radius; - } - - @Override - public boolean isCircle() { - return true; - } - - @Override - public double getCircleRadius() { - return radius; - } - - } - - public static class Rectangle extends RadiusDescriptor { - - final AxisAlignedBB aabb; - - public Rectangle(ChunkCoordinates subtileCoords, AxisAlignedBB aabb) { - super(subtileCoords); - this.aabb = aabb; - } - - @Override - public AxisAlignedBB getAABB() { - return aabb; - } - - } - - public static class Square extends Rectangle { - - public Square(ChunkCoordinates subtileCoords, int expand) { - super(subtileCoords, AxisAlignedBB.getBoundingBox(subtileCoords.posX - expand, subtileCoords.posY, subtileCoords.posZ - expand, subtileCoords.posX + 1 + expand, subtileCoords.posY, subtileCoords.posZ + 1 + expand)); - } - - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java b/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java deleted file mode 100644 index 2b98121..0000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileEntity.java +++ /dev/null @@ -1,243 +0,0 @@ -/** - * 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 @ [Jan 24, 2014, 3:59:06 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.VanillaPacketDispatcher; -import vazkii.botania.api.lexicon.LexiconEntry; -import vazkii.botania.api.wand.IWandBindable; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * A Sub-TileEntity, this is used for the flower system. Make sure to map subclasses - * of this using BotaniaAPI.mapSubTile(String, Class). Any subclass of this must have - * a no parameter constructor. - */ -public class SubTileEntity { - - protected TileEntity supertile; - - public int ticksExisted = 0; - - /** true if this flower is working on Enchanted Soil **/ - public boolean overgrowth = false; - /** true if this flower is working on Enchanted Soil and this is the second tick **/ - public boolean overgrowthBoost = false; - - /** The Tag items should use to store which sub tile they are. **/ - public static final String TAG_TYPE = "type"; - public static final String TAG_TICKS_EXISTED = "ticksExisted"; - - public void setSupertile(TileEntity tile) { - supertile = tile; - } - - public boolean canUpdate() { - return true; - } - - public void onUpdate() { - ticksExisted++; - } - - public final void writeToPacketNBTInternal(NBTTagCompound cmp) { - cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted); - writeToPacketNBT(cmp); - } - - public final void readFromPacketNBTInternal(NBTTagCompound cmp) { - if(cmp.hasKey(TAG_TICKS_EXISTED)) - ticksExisted = cmp.getInteger(TAG_TICKS_EXISTED); - readFromPacketNBT(cmp); - } - - /** - * Writes some extra data to a network packet. This data is read - * by readFromPacketNBT on the client that receives the packet. - * Note: This method is also used to write to the world NBT. - */ - public void writeToPacketNBT(NBTTagCompound cmp) { } - - /** - * Reads data from a network packet. This data is written by - * writeToPacketNBT in the server. Note: This method is also used - * to read from the world NBT. - */ - public void readFromPacketNBT(NBTTagCompound cmp) { } - - public void sync() { - VanillaPacketDispatcher.dispatchTEToNearbyPlayers(supertile); - } - - public String getUnlocalizedName() { - return BotaniaAPI.getSubTileStringMapping(getClass()); - } - - /** - * Gets the icon for this SubTileEntity, this is a block icon. - */ - @SideOnly(Side.CLIENT) - public IIcon getIcon() { - return BotaniaAPI.internalHandler.getSubTileIconForName(getUnlocalizedName()); - } - - /** - * Called when a Wand of the Forest is used on this sub tile. Note that the - * player parameter can be null if this is called from a dispenser. - */ - public boolean onWanded(EntityPlayer player, ItemStack wand) { - return false; - } - - /** - * Called when this sub tile is placed in the world (by an entity). - */ - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - // NO-OP - } - - /** - * Called when a player right clicks this sub tile. - */ - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { return false; } - - /** - * Called when this sub tile is added to the world. - */ - public void onBlockAdded(World world, int x, int y, int z) { - //NO-OP - } - - /** - * Called when this sub tile is harvested - */ - public void onBlockHarvested(World world, int x, int y, int z, int side, EntityPlayer player) { - //NO-OP - } - - /** - * Allows additional processing of sub tile drops - */ - public ArrayList getDrops(ArrayList list) { - return list; - } - - /** - * Gets which Lexicon Entry to open when this sub tile is right clicked with a lexicon. - */ - public LexiconEntry getEntry() { - return null; - } - - /** - * Gets the block coordinates this is bound to, for use with the wireframe render - * when the sub tile is being hovered with a wand of the forest. - */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding() { - return null; - } - - /** - * Returns a descriptor for the radius of this sub tile. This is called while a player - * is looking at the block with a Manaseer Monocle (IBurstViewerBauble). - */ - @SideOnly(Side.CLIENT) - public RadiusDescriptor getRadius() { - return null; - } - - /** - * Gets a ChunkCoordinates instance with the position of this sub tile. - */ - public ChunkCoordinates toChunkCoordinates() { - return new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - - /** - * @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int) - */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return false; - } - - /** - * @see IWandBindable#bindTo(EntityPlayer, ItemStack, int, int, int, int) - */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return false; - } - - /** - * Called on the client when the block being pointed at is the one with this sub tile. - * Used to render a HUD portraying some data from this sub tile. - */ - @SideOnly(Side.CLIENT) - public void renderHUD(Minecraft mc, ScaledResolution res) { - // NO-OP - } - - /** - * Gets the light value for this SubTileEntity, this is a int (-1 to default to the flower) - */ - public int getLightValue() { - return -1; - } - - /** - * Gets the comparator input value for this SubTileEntity - */ - public int getComparatorInputOverride(int side) { - return 0; - } - - /** - * Gets the redstone power level for this SubTileEntity - */ - public int getPowerLevel(int side) { - return 0; - } - - /** - * Gets if this SubTileEntity is affected by Enchanted Soil's speed boost. - */ - public boolean isOvergrowthAffected() { - return true; - } - - /** - * Gets ths slowdown factor of this SubTile. - * @see ISubTileSlowableContainer - */ - public int getSlowdownFactor() { - if(supertile instanceof ISubTileSlowableContainer) { - ISubTileSlowableContainer slowable = (ISubTileSlowableContainer) supertile; - return slowable.getSlowdownFactor(); - } - - return 0; - } - - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java b/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java deleted file mode 100644 index d6156ea..0000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileFunctional.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * 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 @ [Jan 24, 2014, 8:03:44 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.awt.Color; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaNetwork; -import vazkii.botania.api.mana.IManaPool; - -/** - * The basic class for a Functional Flower. - */ -public class SubTileFunctional extends SubTileEntity { - - public static final int RANGE = 10; - - private static final String TAG_MANA = "mana"; - - private static final String TAG_POOL_X = "poolX"; - private static final String TAG_POOL_Y = "poolY"; - private static final String TAG_POOL_Z = "poolZ"; - - public int mana; - - public int redstoneSignal = 0; - - int sizeLastCheck = -1; - TileEntity linkedPool = null; - public int knownMana = -1; - - ChunkCoordinates cachedPoolCoordinates = null; - - /** - * If set to true, redstoneSignal will be updated every tick. - */ - public boolean acceptsRedstone() { - return false; - } - - @Override - public void onUpdate() { - super.onUpdate(); - - linkPool(); - - if(linkedPool != null && isValidBinding()) { - IManaPool pool = (IManaPool) linkedPool; - int manaInPool = pool.getCurrentMana(); - int manaMissing = getMaxMana() - mana; - int manaToRemove = Math.min(manaMissing, manaInPool); - pool.recieveMana(-manaToRemove); - addMana(manaToRemove); - } - - if(acceptsRedstone()) { - redstoneSignal = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); - redstoneSignal = Math.max(redstoneSignal, redstoneSide); - } - } - - if(supertile.getWorldObj().isRemote) { - double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; - Color color = new Color(getColor()); - if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); - } - } - - public void linkPool() { - boolean needsNew = false; - if(linkedPool == null) { - needsNew = true; - - if(cachedPoolCoordinates != null) { - needsNew = false; - if(supertile.getWorldObj().blockExists(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ)) { - needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedPoolCoordinates.posX, cachedPoolCoordinates.posY, cachedPoolCoordinates.posZ); - if(tileAt != null && tileAt instanceof IManaPool && !tileAt.isInvalid()) { - linkedPool = tileAt; - needsNew = false; - } - cachedPoolCoordinates = null; - } - } - } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - if(tileAt != null && tileAt instanceof IManaPool) - linkedPool = tileAt; - } - - if(needsNew && ticksExisted == 1) { // Only for new flowers - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllPoolsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedPool = network.getClosestPool(coords, supertile.getWorldObj(), RANGE); - sizeLastCheck = size; - } - } - } - - public void linkToForcefully(TileEntity pool) { - linkedPool = pool; - } - - public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); - } - - @Override - public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) - return false; - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); - } - - public int getMaxMana() { - return 20; - } - - public int getColor() { - return 0xFFFFFF; - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - - int x = cmp.getInteger(TAG_POOL_X); - int y = cmp.getInteger(TAG_POOL_Y); - int z = cmp.getInteger(TAG_POOL_Z); - - cachedPoolCoordinates = y < 0 ? null : new ChunkCoordinates(x, y, z); - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - - if(cachedPoolCoordinates != null) { - cmp.setInteger(TAG_POOL_X, cachedPoolCoordinates.posX); - cmp.setInteger(TAG_POOL_Y, cachedPoolCoordinates.posY); - cmp.setInteger(TAG_POOL_Z, cachedPoolCoordinates.posZ); - } else { - int x = linkedPool == null ? 0 : linkedPool.xCoord; - int y = linkedPool == null ? -1 : linkedPool.yCoord; - int z = linkedPool == null ? 0 : linkedPool.zCoord; - - cmp.setInteger(TAG_POOL_X, x); - cmp.setInteger(TAG_POOL_Y, y); - cmp.setInteger(TAG_POOL_Z, z); - } - } - - @Override - public ChunkCoordinates getBinding() { - if(linkedPool == null) - return null; - return new ChunkCoordinates(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord); - } - - @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 10; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaPool) { - linkedPool = tile; - return true; - } - } - - return false; - } - - public boolean isValidBinding() { - return linkedPool != null && !linkedPool.isInvalid() && supertile.getWorldObj().getTileEntity(linkedPool.xCoord, linkedPool.yCoord, linkedPool.zCoord) == linkedPool; - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = getColor(); - BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding()); - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java b/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java deleted file mode 100644 index 02f7a23..0000000 --- a/src/api/java/vazkii/botania/api/subtile/SubTileGenerating.java +++ /dev/null @@ -1,315 +0,0 @@ -/** - * 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 @ [Jan 24, 2014, 8:03:36 PM (GMT)] - */ -package vazkii.botania.api.subtile; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.internal.IManaNetwork; -import vazkii.botania.api.mana.IManaCollector; - -/** - * The basic class for a Generating Flower. - */ -public class SubTileGenerating extends SubTileEntity { - - public static final int RANGE = 6; - - private static final String TAG_MANA = "mana"; - - private static final String TAG_COLLECTOR_X = "collectorX"; - private static final String TAG_COLLECTOR_Y = "collectorY"; - private static final String TAG_COLLECTOR_Z = "collectorZ"; - private static final String TAG_PASSIVE_DECAY_TICKS = "passiveDecayTicks"; - - protected int mana; - - public int redstoneSignal = 0; - - int sizeLastCheck = -1; - protected TileEntity linkedCollector = null; - public int knownMana = -1; - public int passiveDecayTicks; - - ChunkCoordinates cachedCollectorCoordinates = null; - - /** - * If set to true, redstoneSignal will be updated every tick. - */ - public boolean acceptsRedstone() { - return false; - } - - @Override - public void onUpdate() { - super.onUpdate(); - - linkCollector(); - - if(canGeneratePassively()) { - int delay = getDelayBetweenPassiveGeneration(); - if(delay > 0 && ticksExisted % delay == 0 && !supertile.getWorldObj().isRemote) { - if(shouldSyncPassiveGeneration()) - sync(); - addMana(getValueForPassiveGeneration()); - } - } - emptyManaIntoCollector(); - - if(acceptsRedstone()) { - redstoneSignal = 0; - for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { - int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal()); - redstoneSignal = Math.max(redstoneSignal, redstoneSide); - } - } - - if(supertile.getWorldObj().isRemote) { - double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F; - Color color = new Color(getColor()); - if(Math.random() > particleChance) - BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random() * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5); - } - - boolean passive = isPassiveFlower(); - if(!supertile.getWorldObj().isRemote) { - int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay(); - - if(passive && muhBalance > 0 && passiveDecayTicks > muhBalance) { - supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType())); - if(supertile.getWorldObj().getBlock(supertile.xCoord, supertile.yCoord - 1, supertile.zCoord).isSideSolid(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord - 1, supertile.zCoord, ForgeDirection.UP)) - supertile.getWorldObj().setBlock(supertile.xCoord, supertile.yCoord, supertile.zCoord, Blocks.deadbush); - else supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord); - } - } - - if(!overgrowth && passive) - passiveDecayTicks++; - } - - public void linkCollector() { - boolean needsNew = false; - if(linkedCollector == null) { - needsNew = true; - - if(cachedCollectorCoordinates != null) { - needsNew = false; - if(supertile.getWorldObj().blockExists(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ)) { - needsNew = true; - TileEntity tileAt = supertile.getWorldObj().getTileEntity(cachedCollectorCoordinates.posX, cachedCollectorCoordinates.posY, cachedCollectorCoordinates.posZ); - if(tileAt != null && tileAt instanceof IManaCollector && !tileAt.isInvalid()) { - linkedCollector = tileAt; - needsNew = false; - } - cachedCollectorCoordinates = null; - } - } - } else { - TileEntity tileAt = supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - if(tileAt != null && tileAt instanceof IManaCollector) - linkedCollector = tileAt; - } - - if(needsNew && ticksExisted == 1) { // New flowers only - IManaNetwork network = BotaniaAPI.internalHandler.getManaNetworkInstance(); - int size = network.getAllCollectorsInWorld(supertile.getWorldObj()).size(); - if(BotaniaAPI.internalHandler.shouldForceCheck() || size != sizeLastCheck) { - ChunkCoordinates coords = new ChunkCoordinates(supertile.xCoord, supertile.yCoord, supertile.zCoord); - linkedCollector = network.getClosestCollector(coords, supertile.getWorldObj(), RANGE); - sizeLastCheck = size; - } - } - } - - public void linkToForcefully(TileEntity collector) { - linkedCollector = collector; - } - - public void addMana(int mana) { - this.mana = Math.min(getMaxMana(), this.mana + mana); - } - - public void emptyManaIntoCollector() { - if(linkedCollector != null && isValidBinding()) { - IManaCollector collector = (IManaCollector) linkedCollector; - if(!collector.isFull() && mana > 0) { - int manaval = Math.min(mana, collector.getMaxMana() - collector.getCurrentMana()); - mana -= manaval; - collector.recieveMana(manaval); - } - } - } - - public boolean isPassiveFlower() { - return false; - } - - public boolean shouldSyncPassiveGeneration() { - return false; - } - - public boolean canGeneratePassively() { - return false; - } - - public int getDelayBetweenPassiveGeneration() { - return 20; - } - - public int getValueForPassiveGeneration() { - return 1; - } - - @Override - public ArrayList getDrops(ArrayList list) { - ArrayList drops = super.getDrops(list); - populateDropStackNBTs(drops); - return drops; - } - - public void populateDropStackNBTs(List drops) { - if(isPassiveFlower() && ticksExisted > 0 && BotaniaAPI.internalHandler.getPassiveFlowerDecay() > 0) { - ItemStack drop = drops.get(0); - if(drop != null) { - if(!drop.hasTagCompound()) - drop.setTagCompound(new NBTTagCompound()); - NBTTagCompound cmp = drop.getTagCompound(); - cmp.setInteger(TAG_PASSIVE_DECAY_TICKS, passiveDecayTicks); - } - } - } - - @Override - public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { - super.onBlockPlacedBy(world, x, y, z, entity, stack); - if(isPassiveFlower()) { - NBTTagCompound cmp = stack.getTagCompound(); - passiveDecayTicks = cmp.getInteger(TAG_PASSIVE_DECAY_TICKS); - } - } - - @Override - public boolean onWanded(EntityPlayer player, ItemStack wand) { - if(player == null) - return false; - - if(!player.worldObj.isRemote) - sync(); - - knownMana = mana; - player.worldObj.playSoundAtEntity(player, "botania:ding", 0.1F, 1F); - - return super.onWanded(player, wand); - } - - public int getMaxMana() { - return 20; - } - - public int getColor() { - return 0xFFFFFF; - } - - @Override - public void readFromPacketNBT(NBTTagCompound cmp) { - mana = cmp.getInteger(TAG_MANA); - passiveDecayTicks = cmp.getInteger(TAG_PASSIVE_DECAY_TICKS); - - int x = cmp.getInteger(TAG_COLLECTOR_X); - int y = cmp.getInteger(TAG_COLLECTOR_Y); - int z = cmp.getInteger(TAG_COLLECTOR_Z); - - cachedCollectorCoordinates = y < 0 ? null : new ChunkCoordinates(x, y, z); - } - - @Override - public void writeToPacketNBT(NBTTagCompound cmp) { - cmp.setInteger(TAG_MANA, mana); - cmp.setInteger(TAG_TICKS_EXISTED, ticksExisted); - cmp.setInteger(TAG_PASSIVE_DECAY_TICKS, passiveDecayTicks); - - if(cachedCollectorCoordinates != null) { - cmp.setInteger(TAG_COLLECTOR_X, cachedCollectorCoordinates.posX); - cmp.setInteger(TAG_COLLECTOR_Y, cachedCollectorCoordinates.posY); - cmp.setInteger(TAG_COLLECTOR_Z, cachedCollectorCoordinates.posZ); - } else { - int x = linkedCollector == null ? 0 : linkedCollector.xCoord; - int y = linkedCollector == null ? -1 : linkedCollector.yCoord; - int z = linkedCollector == null ? 0 : linkedCollector.zCoord; - - cmp.setInteger(TAG_COLLECTOR_X, x); - cmp.setInteger(TAG_COLLECTOR_Y, y); - cmp.setInteger(TAG_COLLECTOR_Z, z); - } - } - - @Override - public ChunkCoordinates getBinding() { - if(linkedCollector == null) - return null; - return new ChunkCoordinates(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord); - } - - @Override - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - return true; - } - - @Override - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) { - int range = 6; - range *= range; - - double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord); - if(range >= dist) { - TileEntity tile = player.worldObj.getTileEntity(x, y, z); - if(tile instanceof IManaCollector) { - linkedCollector = tile; - return true; - } - } - - return false; - } - - - public boolean isValidBinding() { - return linkedCollector != null && !linkedCollector.isInvalid() && supertile.getWorldObj().getTileEntity(linkedCollector.xCoord, linkedCollector.yCoord, linkedCollector.zCoord) == linkedCollector; - } - - @Override - public void renderHUD(Minecraft mc, ScaledResolution res) { - String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name"); - int color = getColor(); - BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, res, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding()); - } - - @Override - public boolean isOvergrowthAffected() { - return !isPassiveFlower(); - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/signature/BasicSignature.java b/src/api/java/vazkii/botania/api/subtile/signature/BasicSignature.java deleted file mode 100644 index b3f5e47..0000000 --- a/src/api/java/vazkii/botania/api/subtile/signature/BasicSignature.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * 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 @ [Oct 17, 2014, 5:34:35 PM (GMT)] - */ -package vazkii.botania.api.subtile.signature; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import vazkii.botania.api.BotaniaAPI; -import vazkii.botania.api.subtile.SubTileEntity; -import vazkii.botania.api.subtile.SubTileFunctional; -import vazkii.botania.api.subtile.SubTileGenerating; - -/** - * A basic (and fallback) implementation of SubTileSignature. - */ -public class BasicSignature extends SubTileSignature { - - final String name; - - public BasicSignature(String name) { - this.name = name; - } - - @Override - public void registerIcons(IIconRegister register) { - BotaniaAPI.internalHandler.registerBasicSignatureIcons(name, register); - } - - @Override - public IIcon getIconForStack(ItemStack stack) { - return BotaniaAPI.internalHandler.getSubTileIconForName(name); - } - - @Override - public String getUnlocalizedNameForStack(ItemStack stack) { - return unlocalizedName(""); - } - - @Override - public String getUnlocalizedLoreTextForStack(ItemStack stack) { - return unlocalizedName(".reference"); - } - - public String getName() { - return name; - } - - public String getType() { - Class clazz = BotaniaAPI.getSubTileMapping(name); - - if(clazz == null) - return "uwotm8"; - - if(clazz.getAnnotation(PassiveFlower.class) != null) - return "botania.flowerType.passiveGenerating"; - - if(SubTileGenerating.class.isAssignableFrom(clazz)) - return "botania.flowerType.generating"; - - if(SubTileFunctional.class.isAssignableFrom(clazz)) - return "botania.flowerType.functional"; - - return "botania.flowerType.misc"; - } - - @Override - public void addTooltip(ItemStack stack, EntityPlayer player, List tooltip) { - tooltip.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal(getType())); - } - - private String unlocalizedName(String end) { - return "tile.botania:" + SubTileSignature.SPECIAL_FLOWER_PREFIX + name + end; - } - -} diff --git a/src/api/java/vazkii/botania/api/subtile/signature/PassiveFlower.java b/src/api/java/vazkii/botania/api/subtile/signature/PassiveFlower.java deleted file mode 100644 index 008fa83..0000000 --- a/src/api/java/vazkii/botania/api/subtile/signature/PassiveFlower.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 @ [04/12/2015, 16:47:01 (GMT)] - */ -package vazkii.botania.api.subtile.signature; - -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -/** - * This annotation used for detecting whether a SubTileEntity - * is a passive flower without having to instantiate it. This - * is used for the flowers' tooltips. - */ -@Retention(value = RUNTIME) -@Target(value = TYPE) -public @interface PassiveFlower { - -} diff --git a/src/api/java/vazkii/botania/api/subtile/signature/SubTileSignature.java b/src/api/java/vazkii/botania/api/subtile/signature/SubTileSignature.java deleted file mode 100644 index 65fac22..0000000 --- a/src/api/java/vazkii/botania/api/subtile/signature/SubTileSignature.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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 @ [Oct 17, 2014, 5:29:26 PM (GMT)] - */ -package vazkii.botania.api.subtile.signature; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -/** - * A singleton instance for a SubTileEntity, this is called for a few methods. - */ -public abstract class SubTileSignature { - - public static final String SPECIAL_FLOWER_PREFIX = "flower."; - - /** - * Equivalent to Block.registerBlockIcons. - */ - public abstract void registerIcons(IIconRegister register); - - /** - * Gets the icon to display for the flower item. - */ - public abstract IIcon getIconForStack(ItemStack stack); - - /** - * Gets the display name for the flower item. - */ - public abstract String getUnlocalizedNameForStack(ItemStack stack); - - /** - * Gets the lore text for the flower item, displayed in the item's tooltip. - * If you do not want a reference return a key that does not have localization such - * as "botaniamisc.noloc". - */ - public abstract String getUnlocalizedLoreTextForStack(ItemStack stack); - - /** - * Adds additional text to the tooltip. This text is added after getUnlocalizedLoreTextForStack. - */ - public void addTooltip(ItemStack stack, EntityPlayer player, List tooltip) { - // NO-OP - } - -} diff --git a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java b/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java deleted file mode 100644 index f7c8036..0000000 --- a/src/api/java/vazkii/botania/api/wand/ICoordBoundItem.java +++ /dev/null @@ -1,18 +0,0 @@ -package vazkii.botania.api.wand; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * The item equivalent of ITileBound, renders when the - * item is in hand. - * @see ITileBound - */ -public interface ICoordBoundItem { - - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(ItemStack stack); - -} diff --git a/src/api/java/vazkii/botania/api/wand/ITileBound.java b/src/api/java/vazkii/botania/api/wand/ITileBound.java deleted file mode 100644 index 199390b..0000000 --- a/src/api/java/vazkii/botania/api/wand/ITileBound.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 @ [Mar 24, 2014, 6:47:53 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.util.ChunkCoordinates; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Any TileEntity that implements this is technically bound - * to something, and the binding will be shown when hovering - * over with a Wand of the Forest. - */ -public interface ITileBound { - - /** - * Gets where this block is bound to, can return null. - */ - @SideOnly(Side.CLIENT) - public ChunkCoordinates getBinding(); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandBindable.java b/src/api/java/vazkii/botania/api/wand/IWandBindable.java deleted file mode 100644 index 0c5786c..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWandBindable.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 @ [Oct 9, 2014, 3:01:58 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -/** - * A TileEntity that implements this can be bound to another block - * via the Wand of the Forest. Also see IWireframeAABBProvider to change - * the displayed bounding box. - */ -public interface IWandBindable extends ITileBound { - - /** - * Return true if the Wand can select this tile. - */ - public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); - - /** - * Call to bind the TileEntity to where the player clicked. Return true to deselect - * the TileEntity for another bind or false case the TileEntity should stay selected. - */ - public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandHUD.java b/src/api/java/vazkii/botania/api/wand/IWandHUD.java deleted file mode 100644 index a75e44a..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWandHUD.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 @ [Feb 5, 2014, 1:34:44 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.world.World; - -/** - * Any block that implements this has a HUD rendered when being hovered - * with a Wand of the Forest. - */ -public interface IWandHUD { - - public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWandable.java b/src/api/java/vazkii/botania/api/wand/IWandable.java deleted file mode 100644 index 52349fa..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWandable.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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 @ [Jan 22, 2014, 5:12:53 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Any block that implements this can be used with the Wand for the Forest for some purpose. - */ -public interface IWandable { - - /** - * Called when the block is used by a wand. Note that the player parameter can be null - * if this function is called from a dispenser. - */ - public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side); - -} diff --git a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java b/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java deleted file mode 100644 index 3b6e807..0000000 --- a/src/api/java/vazkii/botania/api/wand/IWireframeAABBProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 19, 2014, 7:23:59 PM (GMT)] - */ -package vazkii.botania.api.wand; - -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -/** - * A block that implements this can provide a custom AABB - * for rendering the wireframe with ITileBound. - */ -public interface IWireframeAABBProvider { - - public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z); - -} diff --git a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java deleted file mode 100644 index 285c154..0000000 --- a/src/api/java/vazkii/botania/api/wiki/IWikiProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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 @ [Sep 2, 2014, 5:57:35 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -/** - * An interface for a Wiki Provider, these are registered to allow a mod to provide a wiki - * for all the blocks in them, used for the world interaction with the Lexica Botania. - * A simple, mostly all-inclusive implementation can be found on SimpleWikiProvider. - */ -public interface IWikiProvider { - - /** - * Gets the name of the block being looked at for display. - */ - public String getBlockName(World world, MovingObjectPosition pos); - - /** - * Gets the URL to open when the block is clicked. - */ - public String getWikiURL(World world, MovingObjectPosition pos); - - /** - * Gets the name of the wiki for display. - */ - public String getWikiName(World world, MovingObjectPosition pos); - -} diff --git a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java b/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java deleted file mode 100644 index f03e07c..0000000 --- a/src/api/java/vazkii/botania/api/wiki/SimpleWikiProvider.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * 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 @ [Sep 2, 2014, 5:58:39 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -import org.apache.commons.lang3.text.WordUtils; - -public class SimpleWikiProvider implements IWikiProvider { - - final String name, urlBase, replacement; - final boolean lowercase; - - public SimpleWikiProvider(String name, String urlBase) { - this(name, urlBase, "%20"); - } - - public SimpleWikiProvider(String name, String urlBase, boolean lowercase) { - this(name, urlBase, "%20", lowercase); - } - - public SimpleWikiProvider(String name, String urlBase, String replacement) { - this.name = name; - this.urlBase = urlBase; - this.replacement = replacement; - lowercase = false; - } - - public SimpleWikiProvider(String name, String urlBase, String replacement, boolean lowercase) { - this.name = name; - this.urlBase = urlBase; - this.replacement = replacement; - this.lowercase = lowercase; - } - - @Override - public String getBlockName(World world, MovingObjectPosition pos) { - int x = pos.blockX; - int y = pos.blockY; - int z = pos.blockZ; - - Block block = world.getBlock(x, y, z); - if(block == null) - return null; - - ItemStack stack = block.getPickBlock(pos, world, x, y, z); - - if(stack == null || stack.getItem() == null) - stack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z)); - - if(stack.getItem() == null) - return null; - - String name = stack.getDisplayName(); - if(name == null || name.isEmpty()) - return null; - - return name; - } - - @Override - public String getWikiURL(World world, MovingObjectPosition pos) { - String name = getBlockName(world, pos); - if(name == null) - return null; - - if(lowercase) { - return String.format(urlBase, name.toLowerCase().replaceAll(" ", replacement)); - } else { - return String.format(urlBase, WordUtils.capitalizeFully(name).replaceAll(" ", replacement)); - } - } - - @Override - public String getWikiName(World world, MovingObjectPosition pos) { - return name; - } - -} diff --git a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java b/src/api/java/vazkii/botania/api/wiki/WikiHooks.java deleted file mode 100644 index ae42fd8..0000000 --- a/src/api/java/vazkii/botania/api/wiki/WikiHooks.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 @ [Sep 2, 2014, 6:05:03 PM (GMT)] - */ -package vazkii.botania.api.wiki; - -import java.util.HashMap; -import java.util.Map; - -import net.minecraft.block.Block; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier; - -public class WikiHooks { - - private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://ftb.gamepedia.com/%s"); - - private static final Map modWikis = new HashMap(); - - public static IWikiProvider getWikiFor(Block block) { - UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block); - return getWikiFor(mod == null ? "" : mod.modId.toLowerCase()); - } - - public static IWikiProvider getWikiFor(String mod) { - if(!modWikis.containsKey(mod)) - modWikis.put(mod, FALLBACK_PROVIDER); - - return modWikis.get(mod); - } - - public static void registerModWiki(String mod, IWikiProvider provider) { - modWikis.put(mod.toLowerCase(), provider); - } - -} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/api/event/WitcheryImpDealEvent.java b/src/main/java/com/ilya3point999k/thaumicconcilium/api/event/WitcheryImpDealEvent.java new file mode 100644 index 0000000..117d171 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/api/event/WitcheryImpDealEvent.java @@ -0,0 +1,25 @@ +package com.ilya3point999k.thaumicconcilium.api.event; + +import cpw.mods.fml.common.eventhandler.Event; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; + +public class WitcheryImpDealEvent extends Event { + + public final EntityPlayer impOwner; + public final ItemStack stack; + public final EntityLivingBase target; + + public WitcheryImpDealEvent(EntityPlayer impOwner, ItemStack stack, EntityLivingBase target) { + super(); + this.impOwner = impOwner; + this.stack = stack; + this.target = target; + } + + public static void fireImpDealEvent(EntityPlayer impOwner, ItemStack stack, EntityLivingBase target) { + MinecraftForge.EVENT_BUS.post(new WitcheryImpDealEvent(impOwner, stack, target)); + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/ClientProxy.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/ClientProxy.java index 3798b2e..a847d78 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/ClientProxy.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/ClientProxy.java @@ -14,8 +14,17 @@ import com.ilya3point999k.thaumicconcilium.client.render.model.VengefulGolemMode import com.ilya3point999k.thaumicconcilium.client.render.projectile.*; import com.ilya3point999k.thaumicconcilium.common.CommonProxy; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.*; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.DistortionEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.UpcomingHoleEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.WrathEffectEntity; import com.ilya3point999k.thaumicconcilium.common.entities.mobs.*; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.BrightestOne; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.CrimsonPontifex; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.NetherExplorer; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.Protolimb; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.WitheredBotanist; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.other.*; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.*; import com.ilya3point999k.thaumicconcilium.common.events.TCGuiEvent; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; @@ -35,6 +44,7 @@ import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelSquid; import net.minecraft.client.particle.EntityFlameFX; +import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -99,7 +109,12 @@ public class ClientProxy extends CommonProxy { MinecraftForgeClient.registerItemRenderer(TCItemRegistry.burdeningAmulet, transparentItemRenderer); MinecraftForgeClient.registerItemRenderer(TCItemRegistry.spotlightFoci, transparentItemRenderer); MinecraftForgeClient.registerItemRenderer(TCItemRegistry.thaumaturgeDrum, new ThaumaturgeDrumRenderer()); - MinecraftForgeClient.registerItemRenderer(TCItemRegistry.pontifexHammer, new PaladinHammerRenderer()); + if (Integration.taintedMagic) { + MinecraftForgeClient.registerItemRenderer(TCItemRegistry.pontifexHammer, new PaladinHammerRenderer()); + if (Integration.horizons) { + MinecraftForgeClient.registerItemRenderer(TCItemRegistry.protobody, new ProtobodyRenderer()); + } + } MinecraftForgeClient.registerItemRenderer(TCItemRegistry.shardMill, new ShardMillRenderer()); MinecraftForgeClient.registerItemRenderer(TCItemRegistry.astralMonitor, new AstralMonitorRenderer()); @@ -124,6 +139,7 @@ public class ClientProxy extends CommonProxy { RenderingRegistry.registerEntityRenderingHandler(CrimsonOrbEntity.class, new CrimsonOrbEntityRenderer()); RenderingRegistry.registerEntityRenderingHandler(EtherealShacklesEntity.class, new EtherealShacklesEntityRenderer()); RenderingRegistry.registerEntityRenderingHandler(MaterialPeeler.class, new MaterialPeelerRenderer()); + RenderingRegistry.registerEntityRenderingHandler(Protolimb.class, new ProtolimbRenderer()); } @@ -137,6 +153,7 @@ public class ClientProxy extends CommonProxy { if(Compat.botan){ RenderingRegistry.registerEntityRenderingHandler(WitheredBotanist.class, new WitheredBotanistRenderer()); } + RenderingRegistry.registerEntityRenderingHandler(NetherExplorer.class, new NetherExplorerRenderer()); if (Integration.horizons) { RenderingRegistry.registerEntityRenderingHandler(Overanimated.class, new ThaumaturgeRenderer(new ModelBiped(), @@ -168,6 +185,34 @@ public class ClientProxy extends CommonProxy { RenderingRegistry.registerEntityRenderingHandler(ShardPowderEntity.class, new ShardPowderEntityRenderer()); RenderingRegistry.registerEntityRenderingHandler(BrightestOne.class, new BrightestOneRenderer()); + if(Integration.witchery){ + try { + Class burnedWitch = Class.forName("com.ilya3point999k.thaumicconcilium.common.entities.mobs.BurnedWitch"); + Class burnedWitchRenderer = Class.forName("com.ilya3point999k.thaumicconcilium.client.render.mob.BurnedWitchRenderer"); + + RenderingRegistry.registerEntityRenderingHandler((Class) burnedWitch, (Render) burnedWitchRenderer.newInstance()); + if (Compat.bm) { + Class sloppyAlchemist = Class.forName("com.ilya3point999k.thaumicconcilium.common.entities.mobs.SloppyAlchemist"); + Class sloppyAlchemistRenderer = Class.forName("com.ilya3point999k.thaumicconcilium.client.render.mob.SloppyAlchemistRenderer"); + + RenderingRegistry.registerEntityRenderingHandler((Class) sloppyAlchemist, (Render) sloppyAlchemistRenderer.newInstance()); + + Class chort = Class.forName("com.ilya3point999k.thaumicconcilium.common.entities.mobs.Chort"); + Class chortRenderer = Class.forName("com.ilya3point999k.thaumicconcilium.client.render.mob.ChortRenderer"); + + RenderingRegistry.registerEntityRenderingHandler((Class) chort, (Render) chortRenderer.newInstance()); + + RenderingRegistry.registerEntityRenderingHandler(ChortSpitEntity.class, new RenderSnowball(Items.slime_ball)); + } + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + if (Integration.automagy){ RenderingRegistry.registerEntityRenderingHandler(RedPoweredMind.class, new RedPoweredMindRender()); } @@ -210,7 +255,9 @@ public class ClientProxy extends CommonProxy { } if(Integration.horizons){ - MinecraftForgeClient.registerItemRenderer(TCItemRegistry.drainageSyringe, new DrainageSyringeRenderer()); + if (Compat.bm && Compat.botan) { + MinecraftForgeClient.registerItemRenderer(TCItemRegistry.drainageSyringe, new DrainageSyringeRenderer()); + } RenderingRegistry.registerEntityRenderingHandler(GolemBydlo.class, new GolemBydloRenderer(new GolemBydloModel(true))); if(Integration.automagy){ ClientRegistry.bindTileEntitySpecialRenderer(RedPoweredMindTile.class, new RedPoweredMindTileRenderer()); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/ThaumaturgeGUI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/ThaumaturgeGUI.java index 6d5731a..3b0a477 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/ThaumaturgeGUI.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/ThaumaturgeGUI.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.client; -import com.ilya3point999k.thaumicconcilium.common.entities.ContainerThaumaturge; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Thaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.ContainerThaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.gui.inventory.GuiContainer; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/events/ClientEvents.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/events/ClientEvents.java index d0a8268..541b056 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/events/ClientEvents.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/events/ClientEvents.java @@ -1,20 +1,16 @@ package com.ilya3point999k.thaumicconcilium.client.events; -import am2.api.ArsMagicaApi; -import am2.api.events.RegisterSkillTreeIcons; import com.ilya3point999k.thaumicconcilium.client.render.ShaderHelper; +import com.ilya3point999k.thaumicconcilium.client.render.block.SolidVoidBlockRenderer; import com.ilya3point999k.thaumicconcilium.client.render.projectile.ShardPowderEntityRenderer; import com.ilya3point999k.thaumicconcilium.common.TCPlayerCapabilities; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; -import com.ilya3point999k.thaumicconcilium.common.items.BottleOfClearWater; -import com.ilya3point999k.thaumicconcilium.common.items.ItemEntityIcon; -import com.ilya3point999k.thaumicconcilium.common.items.ItemSpellIcon; import com.ilya3point999k.thaumicconcilium.common.items.ShardMill; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketChangeActiveShard; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketChangeEtherealRange; -import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; +import com.ilya3point999k.thaumicconcilium.common.registry.TCBlockRegistry; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -34,30 +30,30 @@ import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderPlayer; -import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; -import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.client.event.*; import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; +import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.ARBShaderObjects; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import org.lwjgl.util.glu.Project; +import thaumcraft.api.BlockCoordinates; import thaumcraft.client.lib.UtilsFX; import thaumcraft.common.config.Config; import thaumcraft.common.config.ConfigItems; @@ -66,9 +62,11 @@ import thaumic.tinkerer.client.lib.LibResources; import thaumic.tinkerer.client.model.kami.ModelWings; import java.awt.*; +import java.lang.reflect.Method; import java.text.DecimalFormat; import java.util.HashMap; import java.util.Iterator; +import java.util.Set; import java.util.TreeMap; public class ClientEvents { @@ -124,21 +122,11 @@ public class ClientEvents { if(Compat.am2) { if(Integration.taintedMagic) { try { - Object instance = Class.forName("am2.lore.ArcaneCompendium").getField("instance").get(null); - java.lang.reflect.Method m = Class.forName("am2.lore.ArcaneCompendium").getMethod( - "AddCompenidumEntry", - Object.class, String.class, String.class, String.class, Object.class, boolean.class - ); - m.invoke(instance, - Integration.crimson_raid_component, - "Crimson_Raid", - StatCollector.translateToLocal("am2.spell.crimson_raid"), - StatCollector.translateToLocal("am2.entry.crimson_raid"), - null, - false - ); - } catch (Exception e) { - e.printStackTrace(); + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.AM2Integration"); + Method m = clazz.getMethod("registerClient"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register AM2 client code: " + t); } //ArcaneCompendium.instance.AddCompenidumEntry(Integration.crimson_raid_component, "Crimson_Raid", StatCollector.translateToLocal("am2.spell.crimson_raid"), StatCollector.translateToLocal("am2.entry.crimson_raid"), null, false); //ArcaneCompendium.instance.AddCompenidumEntry(TCItemRegistry.tightBelt, ThaumicConcilium.MODID + ":TightBelt", "Belt", "belt", null, false); @@ -930,8 +918,6 @@ public class ClientEvents { } } - - @SubscribeEvent @SideOnly(Side.CLIENT) public void renderPlayer(RenderPlayerEvent.Specials.Post event){ @@ -1031,3 +1017,5 @@ public class ClientEvents { } } } + + diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/DistortionEffectRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/DistortionEffectRenderer.java index 6b3e5a6..7503ea3 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/DistortionEffectRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/DistortionEffectRenderer.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.client.render; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.DistortionEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.DistortionEffectEntity; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/MaterialPeelerRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/MaterialPeelerRenderer.java index 0148130..4ae87b7 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/MaterialPeelerRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/MaterialPeelerRenderer.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.client.render; -import com.ilya3point999k.thaumicconcilium.common.entities.MaterialPeeler; +import com.ilya3point999k.thaumicconcilium.common.entities.other.MaterialPeeler; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/RiftRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/RiftRenderer.java index 7b0b573..bc0eab4 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/RiftRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/RiftRenderer.java @@ -2,7 +2,7 @@ package com.ilya3point999k.thaumicconcilium.client.render; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.Util; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.sasmaster.glelwjgl.java.CoreGLE; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; @@ -15,7 +15,7 @@ import org.lwjgl.opengl.GL11; public class RiftRenderer extends Render { private final ShaderCallback shaderCallback; - private static final ResourceLocation starsTexture; + public static final ResourceLocation starsTexture; public static final ResourceLocation FLUC_ON = new ResourceLocation(ThaumicConcilium.MODID + ":textures/misc/fluctuation_on.png"); CoreGLE gle; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/UpcomingHoleRender.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/UpcomingHoleRender.java index f69236f..735548e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/UpcomingHoleRender.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/UpcomingHoleRender.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.client.render; -import com.ilya3point999k.thaumicconcilium.common.entities.UpcomingHoleEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.UpcomingHoleEntity; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/WrathEffectRender.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/WrathEffectRender.java index f552110..b54ad31 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/WrathEffectRender.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/WrathEffectRender.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.client.render; -import com.ilya3point999k.thaumicconcilium.common.entities.WrathEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.WrathEffectEntity; import cpw.mods.fml.client.FMLClientHandler; import net.minecraft.client.particle.EntityFlameFX; import net.minecraft.client.particle.EntityLavaFX; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/block/SolidVoidBlockRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/block/SolidVoidBlockRenderer.java index 8c49c89..87dd58c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/block/SolidVoidBlockRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/block/SolidVoidBlockRenderer.java @@ -42,4 +42,4 @@ public class SolidVoidBlockRenderer extends BlockRenderer implements ISimpleBloc public int getRenderId() { return TCBlockRegistry.solidVoidID; } -} +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/LeafFX.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/LeafFX.java index 03245f3..ac2d8ec 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/LeafFX.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/LeafFX.java @@ -4,11 +4,9 @@ import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -import thaumcraft.client.lib.UtilsFX; import thaumcraft.codechicken.lib.vec.Vector3; import thaumic.tinkerer.common.core.helper.MiscHelper; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/RuneFlowFX.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/RuneFlowFX.java index 066b1eb..f78d8e9 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/RuneFlowFX.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/fx/RuneFlowFX.java @@ -1,11 +1,9 @@ package com.ilya3point999k.thaumicconcilium.client.render.fx; import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityDropParticleFX; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityEnderEye; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; import thaumcraft.codechicken.lib.vec.Vector3; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/AstralMonitorRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/AstralMonitorRenderer.java index 27ea813..8de15f0 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/AstralMonitorRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/AstralMonitorRenderer.java @@ -30,7 +30,6 @@ import thaumcraft.client.lib.UtilsFX; import thaumcraft.common.config.Config; import java.nio.FloatBuffer; -import java.nio.IntBuffer; import java.util.Random; public class AstralMonitorRenderer implements IItemRenderer { diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/ProtobodyRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/ProtobodyRenderer.java new file mode 100644 index 0000000..d64d1eb --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/item/ProtobodyRenderer.java @@ -0,0 +1,70 @@ +package com.ilya3point999k.thaumicconcilium.client.render.item; + +import com.ilya3point999k.thaumicconcilium.client.render.RiftRenderer; +import com.ilya3point999k.thaumicconcilium.client.render.ShaderCallback; +import com.ilya3point999k.thaumicconcilium.client.render.ShaderHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.ARBShaderObjects; +import org.lwjgl.opengl.GL11; +import thaumcraft.client.lib.UtilsFX; + +public class ProtobodyRenderer implements IItemRenderer { + ModelBiped corpse; + private final ShaderCallback shaderCallback; + + public ProtobodyRenderer(){ + corpse = new ModelBiped(); + shaderCallback = new ShaderCallback() { + @Override + public void call(int shader) { + Minecraft mc = Minecraft.getMinecraft(); + int x = ARBShaderObjects.glGetUniformLocationARB(shader, "yaw"); + ARBShaderObjects.glUniform1fARB(x, (float) (mc.thePlayer.rotationYaw * 2.0f * 3.141592653589793 / 360.0)); + int z = ARBShaderObjects.glGetUniformLocationARB(shader, "pitch"); + ARBShaderObjects.glUniform1fARB(z, -(float) (mc.thePlayer.rotationPitch * 2.0f * 3.141592653589793 / 360.0)); + } + }; + } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return helper != IItemRenderer.ItemRendererHelper.BLOCK_3D; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + final ItemRenderer ir = RenderManager.instance.itemRenderer; + GL11.glPushMatrix(); + GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f); + GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + if (type != IItemRenderer.ItemRenderType.INVENTORY) { + if (type == IItemRenderer.ItemRenderType.ENTITY) { + GL11.glTranslated(0.0, -3.0, 0.0); + } + else { + GL11.glScalef(0.5f, 0.5f, 0.5f); + GL11.glTranslated(-1.0, -4.0, -1.0); + } + } + else { + GL11.glTranslated(0.0, -0.9, 0.0); + GL11.glScalef(0.5f, 0.5f, 0.5f); + } + UtilsFX.bindTexture(RiftRenderer.starsTexture); + ShaderHelper.useShader(ShaderHelper.endScreenShader, shaderCallback); + this.corpse.render((Entity)null, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.125f); + ShaderHelper.releaseShader(); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BrightestOneRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BrightestOneRenderer.java index 9515ef6..7944942 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BrightestOneRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BrightestOneRenderer.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.client.render.mob; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.BrightestOne; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.BrightestOne; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.Tessellator; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BurnedWitchRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BurnedWitchRenderer.java new file mode 100644 index 0000000..20b5916 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/BurnedWitchRenderer.java @@ -0,0 +1,27 @@ +package com.ilya3point999k.thaumicconcilium.client.render.mob; + +import com.ilya3point999k.thaumicconcilium.client.render.model.BurnedWitchModel; +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import net.minecraft.client.renderer.entity.RenderBiped; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +public class BurnedWitchRenderer extends RenderBiped { + + private static final ResourceLocation texture = new ResourceLocation(ThaumicConcilium.MODID + ":textures/entity/burned_witch.png"); + + public BurnedWitchRenderer() { + super(new BurnedWitchModel(), 0.5F); + } + + @Override + public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) { + super.doRender((EntityLiving)entity, x, y, z, yaw, pitch); + } + + @Override + protected ResourceLocation getEntityTexture(EntityLiving entity) { + return texture; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/ChortRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/ChortRenderer.java new file mode 100644 index 0000000..5509dd3 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/ChortRenderer.java @@ -0,0 +1,28 @@ +package com.ilya3point999k.thaumicconcilium.client.render.mob; + +import com.ilya3point999k.thaumicconcilium.client.render.model.ChortModel; +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +public class ChortRenderer extends RenderLiving { + + private static final ResourceLocation texture = new ResourceLocation(ThaumicConcilium.MODID + ":textures/entity/chort.png"); + + public ChortRenderer() { + super(new ChortModel(), 0.5F); + } + + @Override + public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) { + super.doRender((EntityLiving)entity, x, y, z, yaw, pitch); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + return texture; + } + +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/CrimsonPontifexRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/CrimsonPontifexRenderer.java index 032d475..efbb21c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/CrimsonPontifexRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/CrimsonPontifexRenderer.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.client.render.mob; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonPontifex; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.CrimsonPontifex; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.entity.RenderBiped; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/DopeSquidRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/DopeSquidRenderer.java index c347713..2b7884b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/DopeSquidRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/DopeSquidRenderer.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.client.render.mob; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.DopeSquid; +import com.ilya3point999k.thaumicconcilium.common.entities.other.DopeSquid; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/GolemBydloRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/GolemBydloRenderer.java index ee5391e..2d9b42c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/GolemBydloRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/GolemBydloRenderer.java @@ -1,41 +1,15 @@ package com.ilya3point999k.thaumicconcilium.client.render.mob; import com.ilya3point999k.thaumicconcilium.client.render.model.GolemBydloModel; -import com.ilya3point999k.thaumicconcilium.common.entities.GolemBydlo; -import net.minecraft.block.Block; +import com.ilya3point999k.thaumicconcilium.common.entities.other.GolemBydlo; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.ItemRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderIronGolem; import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import org.lwjgl.opengl.GL11; -import thaumcraft.client.lib.UtilsFX; -import thaumcraft.client.renderers.entity.RenderGolemBase; -import thaumcraft.client.renderers.models.entities.ModelGolem; -import thaumcraft.client.renderers.models.entities.ModelGolemAccessories; -import thaumcraft.common.blocks.ItemJarFilled; -import thaumcraft.common.config.ConfigItems; -import thaumcraft.common.entities.golems.EntityGolemBase; - -import java.awt.*; public class GolemBydloRenderer extends RenderLiving { ModelBase damage; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/LesserPortalRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/LesserPortalRenderer.java index 65a838a..b2f23f2 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/LesserPortalRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/LesserPortalRenderer.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.client.render.mob; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.LesserPortal; +import com.ilya3point999k.thaumicconcilium.common.entities.other.LesserPortal; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.renderer.ActiveRenderInfo; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/NetherExplorerRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/NetherExplorerRenderer.java new file mode 100644 index 0000000..3746317 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/NetherExplorerRenderer.java @@ -0,0 +1,41 @@ +package com.ilya3point999k.thaumicconcilium.client.render.mob; + +import com.ilya3point999k.thaumicconcilium.client.render.model.NetherExplorerModel; +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.NetherExplorer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class NetherExplorerRenderer extends Render { + + public static final ResourceLocation texture = new ResourceLocation(ThaumicConcilium.MODID+":textures/entity/nether_explorer.png"); + public static final NetherExplorerModel model = new NetherExplorerModel(); + public NetherExplorerRenderer() + { + super(); + } + + @Override + public void doRender(Entity e, double x, double y, double z, float par8, float par9) + { + NetherExplorer explorer = (NetherExplorer) e; + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glTranslated(x, y + 0.1, z); + GL11.glRotated(explorer.rotationYaw, 0.0, 1.0, 0.0); + GL11.glRotated(90.0, 1.0, 0.0, 0.0); + Minecraft.getMinecraft().renderEngine.bindTexture(texture); + model.render(e, 0F, 0F, 0F, 0F, 0F, 0.0625F); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + + } + + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return texture; + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/ProtolimbRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/ProtolimbRenderer.java new file mode 100644 index 0000000..8ffd06b --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/ProtolimbRenderer.java @@ -0,0 +1,137 @@ +package com.ilya3point999k.thaumicconcilium.client.render.mob; + +import com.ilya3point999k.thaumicconcilium.client.render.RiftRenderer; +import com.ilya3point999k.thaumicconcilium.client.render.ShaderCallback; +import com.ilya3point999k.thaumicconcilium.client.render.ShaderHelper; +import com.ilya3point999k.thaumicconcilium.client.render.model.GibbedBipedModel; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.Protolimb; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.ARBShaderObjects; +import org.lwjgl.opengl.GL11; + +public class ProtolimbRenderer extends Render +{ + GibbedBipedModel biped = new GibbedBipedModel(); + + private final ShaderCallback shaderCallback; + + public ProtolimbRenderer() + { + super(); + shaderCallback = new ShaderCallback() { + @Override + public void call(int shader) { + Minecraft mc = Minecraft.getMinecraft(); + int x = ARBShaderObjects.glGetUniformLocationARB(shader, "yaw"); + ARBShaderObjects.glUniform1fARB(x, (float)(mc.thePlayer.rotationYaw * 2.0f * 3.141592653589793 / 360.0)); + int z = ARBShaderObjects.glGetUniformLocationARB(shader, "pitch"); + ARBShaderObjects.glUniform1fARB(z, -(float)(mc.thePlayer.rotationPitch * 2.0f * 3.141592653589793 / 360.0)); + } + }; + } + + + + @Override + public void doRender(Entity entity, double x, double y, double z, float yaw, float partialTickTime) { + Protolimb gib = (Protolimb) entity; + byte type = gib.getType(); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x, (float)y, (float)z); + + Minecraft.getMinecraft().renderEngine.bindTexture(RiftRenderer.starsTexture); + ShaderHelper.useShader(ShaderHelper.endShader, shaderCallback); + + GL11.glEnable(GL11.GL_BLEND); + + float rotation = gib.innerRotation + partialTickTime; + float f = 0.0625f; + + for (int q = 0; q <= 3; ++q) { + if (q < 3) GL11.glDepthMask(false); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, (q < 3) ? GL11.GL_ONE : GL11.GL_ONE_MINUS_SRC_ALPHA); + + float scale = (q < 3) ? (float)Math.pow(1.1, q) : 1.0f; + + switch (type) { + case 0: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedHead.rotationPointX * f, biped.bipedHead.rotationPointY * f, biped.bipedHead.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedHead.rotationPointX * f, -biped.bipedHead.rotationPointY * f, -biped.bipedHead.rotationPointZ * f); + biped.bipedHead.render(f); + GL11.glPopMatrix(); + break; + case 1: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedLeftArm.rotationPointX * f, biped.bipedLeftArm.rotationPointY * f, biped.bipedLeftArm.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedLeftArm.rotationPointX * f, -biped.bipedLeftArm.rotationPointY * f, -biped.bipedLeftArm.rotationPointZ * f); + biped.bipedLeftArm.render(f); + GL11.glPopMatrix(); + break; + case 2: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedRightArm.rotationPointX * f, biped.bipedRightArm.rotationPointY * f, biped.bipedRightArm.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedRightArm.rotationPointX * f, -biped.bipedRightArm.rotationPointY * f, -biped.bipedRightArm.rotationPointZ * f); + biped.bipedRightArm.render(f); + GL11.glPopMatrix(); + break; + case 3: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedBody.rotationPointX * f, biped.bipedBody.rotationPointY * f, biped.bipedBody.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedBody.rotationPointX * f, -biped.bipedBody.rotationPointY * f, -biped.bipedBody.rotationPointZ * f); + biped.bipedBody.render(f); + GL11.glPopMatrix(); + break; + case 4: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedLeftLeg.rotationPointX * f, biped.bipedLeftLeg.rotationPointY * f, biped.bipedLeftLeg.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedLeftLeg.rotationPointX * f, -biped.bipedLeftLeg.rotationPointY * f, -biped.bipedLeftLeg.rotationPointZ * f); + biped.bipedLeftLeg.render(f); + GL11.glPopMatrix(); + break; + case 5: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedRightLeg.rotationPointX * f, biped.bipedRightLeg.rotationPointY * f, biped.bipedRightLeg.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedRightLeg.rotationPointX * f, -biped.bipedRightLeg.rotationPointY * f, -biped.bipedRightLeg.rotationPointZ * f); + biped.bipedRightLeg.render(f); + GL11.glPopMatrix(); + break; + default: + GL11.glPushMatrix(); + GL11.glTranslatef(biped.bipedHead.rotationPointX * f, biped.bipedHead.rotationPointY * f, biped.bipedHead.rotationPointZ * f); + GL11.glRotatef(rotation, 0.7071F, 0.0F, 0.7071F); + GL11.glScalef(scale, scale, scale); + GL11.glTranslatef(-biped.bipedHead.rotationPointX * f, -biped.bipedHead.rotationPointY * f, -biped.bipedHead.rotationPointZ * f); + biped.bipedHead.render(f); + GL11.glPopMatrix(); + break; + } + + if (q < 3) GL11.glDepthMask(true); + } + + GL11.glDisable(GL11.GL_BLEND); + ShaderHelper.releaseShader(); + GL11.glPopMatrix(); + } + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) { + return RiftRenderer.starsTexture; + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/SloppyAlchemistRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/SloppyAlchemistRenderer.java new file mode 100644 index 0000000..bd20840 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/SloppyAlchemistRenderer.java @@ -0,0 +1,37 @@ +package com.ilya3point999k.thaumicconcilium.client.render.mob; + +import com.ilya3point999k.thaumicconcilium.client.render.model.SloppyAlchemistModel; +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Chort; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.util.ResourceLocation; + +public class SloppyAlchemistRenderer extends RenderLiving { + + private static final ResourceLocation texture = new ResourceLocation(ThaumicConcilium.MODID + ":textures/entity/excsi.png"); + private static final ModelBiped free = new ModelBiped(0.5F); + private static final SloppyAlchemistModel nonfree = new SloppyAlchemistModel(); + + public SloppyAlchemistRenderer() { + super(free, 0.5F); + } + + + @Override + public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) { + if (entity.riddenByEntity instanceof Chort){ + this.mainModel = nonfree; + } else { + this.mainModel = free; + } + super.doRender((EntityLiving)entity, x, y, z, yaw, pitch); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + return texture; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/WitheredBotanistRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/WitheredBotanistRenderer.java index 47cf5b7..36ae56b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/WitheredBotanistRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/mob/WitheredBotanistRenderer.java @@ -1,8 +1,8 @@ package com.ilya3point999k.thaumicconcilium.client.render.mob; -import com.ilya3point999k.thaumicconcilium.client.render.block.RedPoweredMindTileRenderer; import com.ilya3point999k.thaumicconcilium.client.render.model.WitheredBotanistModel; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.WitheredBotanist; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; @@ -21,10 +21,10 @@ public class WitheredBotanistRenderer extends Render { @Override public void doRender(Entity e, double x, double y, double z, float par8, float par9) { - + WitheredBotanist botanist = (WitheredBotanist) e; GL11.glPushMatrix(); - GL11.glTranslated(x, y + 0.1, z); + GL11.glRotated(botanist.rotationYaw, 0.0, 1.0, 0.0); GL11.glRotated(90.0, 1.0, 0.0, 0.0); Minecraft.getMinecraft().renderEngine.bindTexture(texture); model.render(e, 0F, 0F, 0F, 0F, 0F, 0.0625F); @@ -34,6 +34,6 @@ public class WitheredBotanistRenderer extends Render { @Override protected ResourceLocation getEntityTexture(Entity p_110775_1_) { - return RedPoweredMindTileRenderer.texture; + return texture; } } \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/BurnedWitchModel.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/BurnedWitchModel.java new file mode 100644 index 0000000..79e42ad --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/BurnedWitchModel.java @@ -0,0 +1,133 @@ +package com.ilya3point999k.thaumicconcilium.client.render.model; + +import com.emoniph.witchery.client.model.ModelBroom; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; +import thaumcraft.client.lib.UtilsFX; + +public class BurnedWitchModel extends ModelBiped { + public static final ModelBroom broom = new ModelBroom(); + + @Override + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + GL11.glPushMatrix(); + GL11.glColor3f(ModelBroom.fleeceColorTable[12][0], ModelBroom.fleeceColorTable[12][1], ModelBroom.fleeceColorTable[12][2]); + UtilsFX.bindTexture("witchery", "textures/entities/Broom.png"); + GL11.glTranslatef(0F, 0.2F, 0F); + broom.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + GL11.glPopMatrix(); + } + + @Override + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + broom.setRotationAngles( p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F; + this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.bipedRightLeg.rotateAngleY = 0.0F; + this.bipedLeftLeg.rotateAngleY = 0.0F; + + + this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); + this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); + + + if (this.heldItemLeft != 0) + { + this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; + } + + if (this.heldItemRight != 0) + { + this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; + } + + this.bipedRightArm.rotateAngleY = 0.0F; + this.bipedLeftArm.rotateAngleY = 0.0F; + float f6; + float f7; + + if (this.onGround > -9990.0F) + { + f6 = this.onGround; + this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI * 2.0F) * 0.2F; + this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; + f6 = 1.0F - this.onGround; + f6 *= f6; + f6 *= f6; + f6 = 1.0F - f6; + f7 = MathHelper.sin(f6 * (float)Math.PI); + float f8 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8)); + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; + } + + if (this.isSneak) + { + this.bipedBody.rotateAngleX = 0.5F; + this.bipedRightArm.rotateAngleX += 0.4F; + this.bipedLeftArm.rotateAngleX += 0.4F; + this.bipedRightLeg.rotationPointZ = 4.0F; + this.bipedLeftLeg.rotationPointZ = 4.0F; + this.bipedRightLeg.rotationPointY = 9.0F; + this.bipedLeftLeg.rotationPointY = 9.0F; + this.bipedHead.rotationPointY = 1.0F; + this.bipedHeadwear.rotationPointY = 1.0F; + } + else + { + this.bipedBody.rotateAngleX = 0.0F; + this.bipedRightLeg.rotationPointZ = 0.1F; + this.bipedLeftLeg.rotationPointZ = 0.1F; + this.bipedRightLeg.rotationPointY = 12.0F; + this.bipedLeftLeg.rotationPointY = 12.0F; + this.bipedHead.rotationPointY = 0.0F; + this.bipedHeadwear.rotationPointY = 0.0F; + } + + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + + if (this.aimedBow) + { + f6 = 0.0F; + f7 = 0.0F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F) + this.bipedHead.rotateAngleY; + this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; + this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F; + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } + + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/ChortModel.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/ChortModel.java new file mode 100644 index 0000000..4bd4ab3 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/ChortModel.java @@ -0,0 +1,188 @@ +package com.ilya3point999k.thaumicconcilium.client.render.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ChortModel extends ModelBase +{ + public ModelRenderer bipedHead; + public ModelRenderer bipedHeadwear; + public ModelRenderer bipedBody; + public ModelRenderer bipedRightArm; + public ModelRenderer bipedLeftArm; + public ModelRenderer bipedRightLeg; + public ModelRenderer bipedLeftLeg; + public ModelRenderer tail; + /** Records whether the model should be rendered holding an item in the left hand, and if that item is a block. */ + public int heldItemLeft; + /** Records whether the model should be rendered holding an item in the right hand, and if that item is a block. */ + public int heldItemRight; + public boolean isSneak; + /** Records whether the model should be rendered aiming a bow. */ + public boolean aimedBow; + private static final String __OBFID = "CL_00000840"; + + public ChortModel() + { + this(0.0F); + } + + public ChortModel(float p_i1148_1_) + { + this(p_i1148_1_, 0.0F, 64, 32); + } + + public ChortModel(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_) + { + this.textureWidth = p_i1149_3_; + this.textureHeight = p_i1149_4_; + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedHeadwear = new ModelRenderer(this, 32, 0); + this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_ + 0.5F); + this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedBody = new ModelRenderer(this, 16, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_); + this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + p_i1149_2_, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + p_i1149_2_, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + p_i1149_2_, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, p_i1149_1_); + this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + p_i1149_2_, 0.0F); + tail = new ModelRenderer(this, 56, 18); + tail.addBox(0F, -4F, 8F, 0, 11, 3); + tail.setRotationPoint(0F, 0F, 0F); + tail.setTextureSize(64, 32); + tail.mirror = true; + tail.rotateAngleX = -0.7853982F; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); + + this.bipedHead.render(p_78088_7_); + this.bipedBody.render(p_78088_7_); + this.bipedRightArm.render(p_78088_7_); + this.bipedLeftArm.render(p_78088_7_); + this.bipedRightLeg.render(p_78088_7_); + this.bipedLeftLeg.render(p_78088_7_); + this.bipedHeadwear.render(p_78088_7_); + this.tail.render(p_78088_7_); + + } + + /** + * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms + * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how + * "far" arms and legs can swing at most. + */ + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F; + this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.bipedRightLeg.rotateAngleY = 0.0F; + this.bipedLeftLeg.rotateAngleY = 0.0F; + + if (this.isRiding) + { + this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); + this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); + this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); + this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); + } + + if (this.heldItemLeft != 0) + { + this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; + } + + if (this.heldItemRight != 0) + { + this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; + } + + this.bipedRightArm.rotateAngleY = 0.0F; + this.bipedLeftArm.rotateAngleY = 0.0F; + float f6; + float f7; + + if (this.onGround > -9990.0F) + { + f6 = this.onGround; + this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f6) * (float)Math.PI * 2.0F) * 0.2F; + this.tail.rotateAngleY = this.bipedBody.rotateAngleY; + this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F; + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY; + this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY; + f6 = 1.0F - this.onGround; + f6 *= f6; + f6 *= f6; + f6 = 1.0F - f6; + f7 = MathHelper.sin(f6 * (float)Math.PI); + float f8 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f7 * 1.2D + (double)f8)); + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; + } + + if (this.isSneak) + { + this.bipedBody.rotateAngleX = 0.5F; + this.tail.rotateAngleX += 0.5F; + this.bipedRightArm.rotateAngleX += 0.4F; + this.bipedLeftArm.rotateAngleX += 0.4F; + this.bipedRightLeg.rotationPointZ = 4.0F; + this.bipedLeftLeg.rotationPointZ = 4.0F; + this.bipedRightLeg.rotationPointY = 9.0F; + this.bipedLeftLeg.rotationPointY = 9.0F; + this.bipedHead.rotationPointY = 1.0F; + this.bipedHeadwear.rotationPointY = 1.0F; + } + else + { + this.bipedBody.rotateAngleX = 0.0F; + this.tail.rotateAngleX = -0.7853982F; + this.bipedRightLeg.rotationPointZ = 0.1F; + this.bipedLeftLeg.rotationPointZ = 0.1F; + this.bipedRightLeg.rotationPointY = 12.0F; + this.bipedLeftLeg.rotationPointY = 12.0F; + this.bipedHead.rotationPointY = 0.0F; + this.bipedHeadwear.rotationPointY = 0.0F; + } + + this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F; + this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F; + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/DrumModel.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/DrumModel.java index 71ee638..964886e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/DrumModel.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/DrumModel.java @@ -2,10 +2,6 @@ package com.ilya3point999k.thaumicconcilium.client.render.model; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; import org.lwjgl.opengl.GL11; public class DrumModel extends ModelBase { diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/GolemBydloModel.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/GolemBydloModel.java index d4c3e5e..b32030c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/GolemBydloModel.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/GolemBydloModel.java @@ -1,13 +1,11 @@ package com.ilya3point999k.thaumicconcilium.client.render.model; -import com.ilya3point999k.thaumicconcilium.common.entities.GolemBydlo; +import com.ilya3point999k.thaumicconcilium.common.entities.other.GolemBydlo; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; -import thaumcraft.common.entities.golems.EntityGolemBase; public class GolemBydloModel extends ModelBase { public ModelRenderer golemHead; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/NetherExplorerModel.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/NetherExplorerModel.java new file mode 100644 index 0000000..1bdf36e --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/NetherExplorerModel.java @@ -0,0 +1,60 @@ +package com.ilya3point999k.thaumicconcilium.client.render.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class NetherExplorerModel extends ModelBase { + public ModelRenderer bipedHead; + public ModelRenderer bipedBody; + public ModelRenderer bipedRightArm; + public ModelRenderer bipedLeftArm; + public ModelRenderer bipedRightLeg; + public ModelRenderer bipedLeftLeg; + + public NetherExplorerModel() { + this(0.5F); + } + + public NetherExplorerModel(float p_i1148_1_) { + this(p_i1148_1_, 0.0F, 64, 32); + } + + public NetherExplorerModel(float p_i1149_1_, float p_i1149_2_, int p_i1149_3_, int p_i1149_4_) { + super(); + this.textureWidth = 64; + this.textureHeight = 32; + this.bipedHead = new ModelRenderer(this, 0, 0); + this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, p_i1149_1_); + this.bipedHead.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + this.bipedBody = new ModelRenderer(this, 16, 16); + this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, p_i1149_1_); + this.bipedBody.setRotationPoint(0.0F, 0.0F + p_i1149_2_, 0.0F); + + this.bipedRightArm = new ModelRenderer(this, 40, 16); + this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i1149_1_); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; + this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, p_i1149_1_); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); + this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i1149_1_); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; + this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, p_i1149_1_); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); + } + @Override + public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, + float netHeadYaw, float headPitch, float scale) { + bipedHead.render(scale); + bipedBody.render(scale); + bipedRightArm.render(scale); + bipedLeftArm.render(scale); + bipedRightLeg.render(scale); + bipedLeftLeg.render(scale); + } + +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/SloppyAlchemistModel.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/SloppyAlchemistModel.java new file mode 100644 index 0000000..d34851d --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/model/SloppyAlchemistModel.java @@ -0,0 +1,100 @@ +package com.ilya3point999k.thaumicconcilium.client.render.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class SloppyAlchemistModel extends ModelBase { + ModelRenderer head; + ModelRenderer headwear; + ModelRenderer body; + ModelRenderer rightarm; + ModelRenderer leftarm; + ModelRenderer rightleg; + ModelRenderer leftleg; + + public SloppyAlchemistModel() + { + + textureWidth = 64; + textureHeight = 32; + + head = new ModelRenderer(this, 0, 0); + head.addBox(-4F, -8F, -4F, 8, 8, 8); + head.setRotationPoint(0F, 13F, -9F); + head.setTextureSize(64, 32); + head.mirror = true; + setRotation(head, 0F, 0F, 0F); + + headwear = new ModelRenderer(this, 32, 0); + headwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.5F); + headwear.setRotationPoint(0.0F, 13.0F, -9.0F); + + body = new ModelRenderer(this, 16, 16); + body.addBox(-4F, 0F, -2F, 8, 12, 4); + body.setRotationPoint(0F, 13F, -5F); + body.setTextureSize(64, 32); + body.mirror = true; + setRotation(body, 1.570796F, 0F, 0F); + rightarm = new ModelRenderer(this, 40, 16); + rightarm.addBox(-3F, 0F, -2F, 4, 12, 4); + rightarm.setRotationPoint(-5F, 12F, -5F); + rightarm.setTextureSize(64, 32); + rightarm.mirror = true; + setRotation(rightarm, 0F, 0F, 0F); + leftarm = new ModelRenderer(this, 40, 16); + leftarm.addBox(-1F, 0F, -2F, 4, 12, 4); + leftarm.setRotationPoint(5F, 12F, -5F); + leftarm.setTextureSize(64, 32); + leftarm.mirror = true; + setRotation(leftarm, 0F, 0F, 0F); + rightleg = new ModelRenderer(this, 0, 16); + rightleg.addBox(-2F, 0F, -2F, 4, 12, 4); + rightleg.setRotationPoint(-2F, 12F, 5F); + rightleg.setTextureSize(64, 32); + rightleg.mirror = true; + setRotation(rightleg, 0F, 0F, 0F); + leftleg = new ModelRenderer(this, 0, 16); + leftleg.addBox(-2F, 0F, -2F, 4, 12, 4); + leftleg.setRotationPoint(2F, 12F, 5F); + leftleg.setTextureSize(64, 32); + leftleg.mirror = true; + setRotation(leftleg, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + head.render(f5); + headwear.render(f5); + body.render(f5); + rightarm.render(f5); + leftarm.render(f5); + rightleg.render(f5); + leftleg.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) + { + float f6 = (180F / (float)Math.PI); + this.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + this.headwear.rotateAngleY = this.head.rotateAngleY; + this.headwear.rotateAngleX = this.head.rotateAngleX; + + this.body.rotateAngleX = ((float)Math.PI / 2F); + this.rightarm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + this.leftarm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.rightleg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leftleg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/ChargedWispRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/ChargedWispRenderer.java index af2b986..2a4f4ae 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/ChargedWispRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/ChargedWispRenderer.java @@ -6,7 +6,6 @@ import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/PositiveBurstOrbRenderer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/PositiveBurstOrbRenderer.java index e72c2b1..f13716d 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/PositiveBurstOrbRenderer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/client/render/projectile/PositiveBurstOrbRenderer.java @@ -9,7 +9,6 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; -import org.lwjgl.Sys; import org.lwjgl.opengl.GL11; import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.lib.UtilsFX; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/CommonProxy.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/CommonProxy.java index 6a3e2c1..2426170 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/CommonProxy.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/CommonProxy.java @@ -2,8 +2,8 @@ package com.ilya3point999k.thaumicconcilium.common; import com.ilya3point999k.thaumicconcilium.common.containers.AstralMonitorContainer; import com.ilya3point999k.thaumicconcilium.common.containers.LithographerContainer; -import com.ilya3point999k.thaumicconcilium.common.entities.ContainerThaumaturge; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Thaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.ContainerThaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.events.TCEntityEventHandler; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.TCFociUpgrades; @@ -11,19 +11,22 @@ import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.registry.*; import com.ilya3point999k.thaumicconcilium.common.tiles.LithographerTile; import com.ilya3point999k.thaumicconcilium.common.world.ThaumicConciliumWorldGen; +import com.ilya3point999k.thaumicconcilium.common.world.village.BurningSite; +import com.ilya3point999k.thaumicconcilium.common.world.village.BurningSiteHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.VillagerRegistry; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraftforge.common.MinecraftForge; -import thaumcraft.common.Thaumcraft; import thaumcraft.common.entities.golems.ContainerGolem; import thaumcraft.common.entities.golems.EntityGolemBase; @@ -48,6 +51,11 @@ public class CommonProxy implements IGuiHandler { TCEntityEventHandler entityEventHandler = new TCEntityEventHandler(); MinecraftForge.EVENT_BUS.register(entityEventHandler); FMLCommonHandler.instance().bus().register(entityEventHandler); + + if(Integration.witchery && TCConfig.generateBurningSites) { + VillagerRegistry.instance().registerVillageCreationHandler(new BurningSiteHandler()); + MapGenStructureIO.func_143031_a(BurningSite.class, "BurningSite"); + } } public void postInit(FMLPostInitializationEvent event) { diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCConfig.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCConfig.java index 96f78de..004dfcd 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCConfig.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCConfig.java @@ -42,11 +42,20 @@ public class TCConfig { public static int paranoidWarriorSpawnChance; public static int vengefulGolemSpawnChance; public static int crimsonRangerSpawnChance; + public static int netherExplorerSpawnRate; + public static int witheredBotanistSpawnChance; + public static int sloppyAlchemistSpawnChance; + public static int burnedWitchSpawnChance; public static int madThaumaturgeReplacesBrainyZombieChance; public static int crimsonPaladinReplacesCultistWarriorChance; + + public static boolean generateCrimsonAvanposts; + public static boolean generateBurningSites; public static int crimsonAvanpostGenChance; + public static int burningSitesGenChance; public static int chanceOfRiftOpening; + public static int impPactTime; public static int causalBouillonID; public static int[] thaumaturgeBiomeBlacklist; @@ -57,6 +66,7 @@ public class TCConfig { public static int[] paranoidWarriorBiomeBlacklist; public static int[] vengefulGolemBiomeBlacklist; public static int[] crimsonRangerBiomeBlacklist; + public static int[] witheredBotanistBiomeBlacklist; public static int crimsonRaidID; @@ -87,7 +97,7 @@ public class TCConfig { burnoutUpgradeID = conf.getInt("burnoutUpgradeID", "focus", 120, FocusUpgradeType.types.length+1, Short.MAX_VALUE, ""); primalEssenceUpgradeID = conf.getInt("primalEssenceUpgradeID", "focus", 121, FocusUpgradeType.types.length+1, Short.MAX_VALUE, ""); - thaumaturgeSpawnChance = conf.getInt("thaumaturgeSpawnChance", "mobs", 10, 0, Integer.MAX_VALUE, ""); + thaumaturgeSpawnChance = conf.getInt("thaumaturgeSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); madThaumaturgeSpawnChance = conf.getInt("madThaumaturgeSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); quicksilverElementalSpawnChance = conf.getInt("quicksilverElementalSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); dissolvedSpawnChance = conf.getInt("dissolvedSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); @@ -95,6 +105,10 @@ public class TCConfig { paranoidWarriorSpawnChance = conf.getInt("paranoidWarriorSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); vengefulGolemSpawnChance = conf.getInt("vengefulGolemSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); crimsonRangerSpawnChance = conf.getInt("crimsonRangerSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); + witheredBotanistSpawnChance = conf.getInt("witheredBotanistSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); + netherExplorerSpawnRate = conf.getInt("netherExplorerSpawnRate", "mobs", 300, 0, Integer.MAX_VALUE, "How often game will attempt to spawn Nether Explorers (in ticks)"); + sloppyAlchemistSpawnChance = conf.getInt("sloppyAlchemistSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); + burnedWitchSpawnChance = conf.getInt("burnedWitchSpawnChance", "mobs", 5, 0, Integer.MAX_VALUE, ""); String biomes = conf.getString("thaumaturgeBiomeBlacklist","mobs", "", "Comma separated IDs of biomes where spawn is not allowed"); thaumaturgeBiomeBlacklist = biomes.isEmpty() ? null : Arrays.stream(biomes.split(",")).mapToInt(Integer::parseInt).toArray(); @@ -113,12 +127,19 @@ public class TCConfig { biomes = conf.getString("crimsonRangerBiomeBlacklist","mobs", "", "Comma separated IDs of biomes where spawn is not allowed"); crimsonRangerBiomeBlacklist = biomes.isEmpty() ? null : Arrays.stream(biomes.split(",")).mapToInt(Integer::parseInt).toArray(); + biomes = conf.getString("witheredBotanistBiomeBlacklist","mobs", "", "Comma separated IDs of biomes where spawn is not allowed"); + witheredBotanistBiomeBlacklist = biomes.isEmpty() ? null : Arrays.stream(biomes.split(",")).mapToInt(Integer::parseInt).toArray(); + madThaumaturgeReplacesBrainyZombieChance = conf.getInt("madThaumaturgeReplacesBrainyZombieChance", "mobs", 20, 0, 100, "0 - never, 100 - always."); crimsonPaladinReplacesCultistWarriorChance = conf.getInt("crimsonPaladinReplacesCultistWarriorChance", "mobs", 20, 0, 100, "0 - never, 100 - always."); - crimsonAvanpostGenChance = conf.getInt("crimsonAvanpostGenChance", "world", 5, 0, 100, "Chance to generate Crimson Avanpost in the world"); + generateCrimsonAvanposts = conf.getBoolean("generateCrimsonAvanposts", "world", true, "Generate Crimson Avanposts in the world."); + generateBurningSites = conf.getBoolean("generateBurningSites", "world", true, "Generate Burning Sites in villages."); + crimsonAvanpostGenChance = conf.getInt("crimsonAvanpostGenChance", "world", 300, 0, Integer.MAX_VALUE, "Chance to generate Crimson Avanpost in the world. The number is approximately: \"generate 1 avanpost every N chunks\""); + burningSitesGenChance = conf.getInt("burningSitesGenChance", "world", 10, 0, Integer.MAX_VALUE, "Chance to generate Burning Site in villages. There can be only 1 per village."); chanceOfRiftOpening = conf.getInt("chanceOfRiftOpening", "balance", 100, 0, 100, "0 - never, 100 - always. Never is not recommended, it will lead to softlock of progress in unmodified survival."); + impPactTime = conf.getInt("impPactTime", "balance", 72000, 0, Integer.MAX_VALUE, "Amount of ticks since last deal with Witchery' Flame Imp, during which Chorts wont attack player"); causalBouillonID = conf.get("causalBouillonID", "dim", 33).getInt(); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCPlayerCapabilities.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCPlayerCapabilities.java index 9804aae..e32ad02 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCPlayerCapabilities.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/TCPlayerCapabilities.java @@ -21,6 +21,9 @@ public class TCPlayerCapabilities implements IExtendedEntityProperties { public int chainedTime; public boolean ethereal; public int fleshAmount; + public int impDealTime; + public int protolimbs; + public TCPlayerCapabilities(EntityPlayer player) { if(!(player instanceof FakePlayer) && !(player instanceof FakeThaumcraftPlayer)) @@ -36,6 +39,8 @@ public class TCPlayerCapabilities implements IExtendedEntityProperties { fleshAmount = 0; pontifexRobeToggle = false; monitored = new String[4]; + impDealTime = 0; + protolimbs = 0; } public static final void register(EntityPlayer player) @@ -64,6 +69,8 @@ public class TCPlayerCapabilities implements IExtendedEntityProperties { properties.setBoolean("ethereal", ethereal); properties.setBoolean("pontifexRobeToggle", pontifexRobeToggle); properties.setInteger("fleshAmount", fleshAmount); + properties.setInteger("impDealTime", impDealTime); + properties.setInteger("protolimbs", protolimbs); compound.setTag(EXT_PROP_NAME, properties); } @@ -79,6 +86,8 @@ public class TCPlayerCapabilities implements IExtendedEntityProperties { ethereal = properties.getBoolean("ethereal"); pontifexRobeToggle = properties.getBoolean("pontifexRobeToggle"); fleshAmount = properties.getInteger("fleshAmount"); + impDealTime = properties.getInteger("impDealTime"); + protolimbs = properties.getInteger("protolimbs"); } @Override diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/ThaumicConcilium.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/ThaumicConcilium.java index b5f193e..c5011ac 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/ThaumicConcilium.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/ThaumicConcilium.java @@ -13,7 +13,7 @@ import net.minecraft.creativetab.CreativeTabs; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@Mod(modid = ThaumicConcilium.MODID, name = ThaumicConcilium.NAME, version = ThaumicConcilium.VERSION, dependencies = "after:Thaumcraft;after:ForbiddenMagic;after:ThaumicTinkerer;after:gadomancy;after:thaumicbases;after:Automagy;after:TaintedMagic;after:ThaumicHorizons;after:witchery;after:arsmagica2") +@Mod(modid = ThaumicConcilium.MODID, name = ThaumicConcilium.NAME, version = ThaumicConcilium.VERSION, dependencies = "after:Thaumcraft;after:ForbiddenMagic;after:ThaumicTinkerer;after:gadomancy;after:thaumicbases;after:Automagy;after:TaintedMagic;after:ThaumicHorizons;after:witchery;after:arsmagica2;after:BloodArsenal;after:alfheim;after:Avaritia") public class ThaumicConcilium { public static final String MODID = "ThaumicConcilium"; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/EldritchTrapBlock.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/EldritchTrapBlock.java index d0b7567..32d74b4 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/EldritchTrapBlock.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/EldritchTrapBlock.java @@ -1,7 +1,6 @@ package com.ilya3point999k.thaumicconcilium.common.blocks; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.tiles.DestabilizedCrystalTile; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; @@ -12,7 +11,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.tiles.TileEldritchTrap; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/SolidVoidBlock.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/SolidVoidBlock.java index e6e5257..e165550 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/SolidVoidBlock.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/SolidVoidBlock.java @@ -6,32 +6,50 @@ import com.ilya3point999k.thaumicconcilium.common.tiles.SolidVoidTile; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public class SolidVoidBlock extends Block implements ITileEntityProvider { +public class SolidVoidBlock extends Block implements ITileEntityProvider{ public static IIcon icon; public SolidVoidBlock() { super(Material.rock); - this.setHardness(0.7F); - this.setResistance(1.0F); + this.setHardness(0.0F); + this.setResistance(6000.0F); this.setStepSound(soundTypeStone); - this.setBlockTextureName(ThaumicConcilium.MODID + ":space"); + this.setBlockTextureName(":cosmos"); this.setCreativeTab(ThaumicConcilium.tabTC); } - public boolean isOpaqueCube() { - return false; + @Override + public void registerBlockIcons(IIconRegister ir) { + icon = ir.registerIcon(ThaumicConcilium.MODID + ":cosmos"); } - public boolean renderAsNormalBlock() { - return false; + @Override + public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_) { + return icon; + } + + @Override + public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + return icon; + } + + public static IIcon getIcon() { + return icon; } public int getRenderType() { return TCBlockRegistry.solidVoidID; } + + public int damageDropped(int par1) { + return par1; + } + public TileEntity createTileEntity(World world, int metadata) { return new SolidVoidTile(); } @@ -39,9 +57,4 @@ public class SolidVoidBlock extends Block implements ITileEntityProvider { public TileEntity createNewTileEntity(World var1, int md) { return this.createTileEntity(var1, md); } - - public int damageDropped(int par1) { - return par1; - } - } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/VoidRealityBlock.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/VoidRealityBlock.java index 8772b0a..f524db5 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/VoidRealityBlock.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/blocks/VoidRealityBlock.java @@ -10,7 +10,7 @@ import net.minecraft.world.World; public class VoidRealityBlock extends Block { public VoidRealityBlock() { super(Material.cloth); - this.setResistance(6000000); + this.setResistance(6000.0F); this.setBlockUnbreakable(); this.setStepSound(soundTypeCloth); this.setBlockTextureName(ThaumicConcilium.MODID + ":void"); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/cmd/CommandConcilium.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/cmd/CommandConcilium.java index dc2fb01..987ae0c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/cmd/CommandConcilium.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/cmd/CommandConcilium.java @@ -1,10 +1,16 @@ package com.ilya3point999k.thaumicconcilium.common.cmd; import com.ilya3point999k.thaumicconcilium.common.TCPlayerCapabilities; +import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; +import thaumcraft.api.ThaumcraftApiHelper; + +import java.lang.reflect.InvocationTargetException; public class CommandConcilium extends CommandBase { @@ -37,6 +43,10 @@ public class CommandConcilium extends CommandBase { if (astring[0].equalsIgnoreCase("help")) { icommandsender.addChatMessage(new ChatComponentTranslation("§3Use this to reset health decrease from actions in noclip.", new Object[0])); icommandsender.addChatMessage(new ChatComponentTranslation(" /concilium restore ", new Object[0])); + if (Integration.witchery) { + icommandsender.addChatMessage(new ChatComponentTranslation("§3Use this to repair Witchery knowledge system.", new Object[0])); + icommandsender.addChatMessage(new ChatComponentTranslation(" /concilium repairWitchery ", new Object[0])); + } } else if (astring.length >= 2 && astring[0].equalsIgnoreCase("restore")) { EntityPlayerMP player = getPlayer(icommandsender, astring[1]); if (player != null){ @@ -45,6 +55,34 @@ public class CommandConcilium extends CommandBase { capabilities.sync(); player.addChatMessage(new ChatComponentTranslation("§5Maximum health restored!")); } + } else if (astring.length >= 2 && Integration.witchery && astring[0].equalsIgnoreCase("repairWitchery")) { + EntityPlayerMP player = getPlayer(icommandsender, astring[1]); + if (player != null){ + if(!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CRIMSONSPELLS")){ + icommandsender.addChatMessage(new ChatComponentTranslation("§5This player doesn't have CRIMSONSPELLS research.")); + return; + } + NBTTagCompound nbtPlayer = null; + try { + nbtPlayer = (NBTTagCompound) Integration.witcheryInfusionClass.getMethod("getNBT", Entity.class).invoke(null, player); + } catch (IllegalAccessException | InvocationTargetException | + NoSuchMethodException ex) { + throw new RuntimeException(ex); + } + if (nbtPlayer != null) { + if (!nbtPlayer.hasKey("WITCSpellBook")) { + nbtPlayer.setTag("WITCSpellBook", new NBTTagCompound()); + } + + NBTTagCompound nbtSpells = nbtPlayer.getCompoundTag("WITCSpellBook"); + nbtSpells.setBoolean("incarcerous", true); + nbtSpells.setBoolean("arrowspell", true); + nbtSpells.setBoolean("spiderspell", true); + nbtSpells.setBoolean("spellundead", true); + nbtSpells.setBoolean("conjunctivitis", true); + } + player.addChatMessage(new ChatComponentTranslation("§5Witchery knowledge granted.")); + } } else { icommandsender.addChatMessage(new ChatComponentTranslation("§cInvalid arguments", new Object[0])); icommandsender.addChatMessage(new ChatComponentTranslation("§cUse /concilium help to get help", new Object[0])); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/CausalBouillonTeleporter.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/CausalBouillonTeleporter.java index d12eb44..bc3b50b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/CausalBouillonTeleporter.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/CausalBouillonTeleporter.java @@ -2,28 +2,28 @@ package com.ilya3point999k.thaumicconcilium.common.dim; import com.ilya3point999k.thaumicconcilium.common.TCConfig; import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.world.Teleporter; import net.minecraft.world.WorldServer; public class CausalBouillonTeleporter extends Teleporter { - boolean mode = false; - public CausalBouillonTeleporter(WorldServer p_i1963_1_, boolean mode) { - super(p_i1963_1_); + private final boolean mode; + public CausalBouillonTeleporter(WorldServer world, boolean mode) { + super(world); this.mode = mode; } @Override - public boolean makePortal(Entity p_85188_1_) { - return true; + public boolean makePortal(Entity entity) { + return false; } @Override - public void removeStalePortalLocations(long p_85189_1_) { - } + public void removeStalePortalLocations(long p_85189_1_) { } @Override public boolean placeInExistingPortal(Entity entity, double x, double y, double z, float p_77184_8_) { - return true; + return false; } @Override @@ -38,5 +38,8 @@ public class CausalBouillonTeleporter extends Teleporter { else { entity.setLocationAndAngles(x, 5, z, entity.rotationPitch, entity.rotationYaw); } + entity.motionX = 0; + entity.motionY = 0; + entity.motionZ = 0; } -} +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/ChunkProviderCausalBouillonDimension.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/ChunkProviderCausalBouillonDimension.java index 7254017..488e591 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/ChunkProviderCausalBouillonDimension.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/dim/ChunkProviderCausalBouillonDimension.java @@ -14,7 +14,8 @@ import net.minecraft.world.chunk.storage.ExtendedBlockStorage; import net.minecraft.world.gen.FlatGeneratorInfo; import net.minecraft.world.gen.FlatLayerInfo; -import java.util.*; +import java.util.Iterator; +import java.util.List; public class ChunkProviderCausalBouillonDimension implements IChunkProvider { diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ItemSpawnerEgg.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ItemSpawnerEgg.java index ff400fb..be88ce6 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ItemSpawnerEgg.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ItemSpawnerEgg.java @@ -7,7 +7,10 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockLiquid; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.*; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/ChortAttackAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/ChortAttackAI.java new file mode 100644 index 0000000..dacbaf1 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/ChortAttackAI.java @@ -0,0 +1,66 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.ai; + +import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ChortSpitEntity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; + +public class ChortAttackAI extends EntityAIBase { + + final EntityLiving attacker; + EntityLivingBase target; + + int attackCooldown; + + final float attackRange = 16.0f; + final float projectileVelocity = 1.8F; + final float spreadDegrees = 4.0F; + + public ChortAttackAI(EntityLiving attacker) { + this.attacker = attacker; + this.setMutexBits(3); + } + + @Override + public boolean shouldExecute() { + EntityLivingBase possibleTarget = attacker.getAttackTarget(); + + if (possibleTarget == null || !possibleTarget.isEntityAlive()) + return false; + + if (attacker.getDistanceSqToEntity(possibleTarget) > attackRange * attackRange) + return false; + + this.target = possibleTarget; + return true; + } + + @Override + public void startExecuting() { + attackCooldown = 0; + } + + @Override + public boolean continueExecuting() { + return target != null && target.isEntityAlive(); + } + + @Override + public void updateTask() { + + attacker.getLookHelper().setLookPositionWithEntity(target, 30.0F, 30.0F); + + if (attackCooldown > 0) { + attackCooldown--; + return; + } + + for (int i = -1; i < 2; i++) { + ChortSpitEntity spit = new ChortSpitEntity(attacker.worldObj, attacker, target, spreadDegrees * i, projectileVelocity, 1.0f); + attacker.worldObj.spawnEntityInWorld(spit); + } + + attackCooldown = 40; + } + +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/CrimsonArcherAttackAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/CrimsonArcherAttackAI.java new file mode 100644 index 0000000..48e32bd --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/CrimsonArcherAttackAI.java @@ -0,0 +1,187 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.ai; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.world.World; +import thaumcraft.common.entities.projectile.EntityPrimalArrow; + +public class CrimsonArcherAttackAI extends EntityAIBase { + private final EntityLiving attacker; + private EntityLivingBase attackTarget; + private final double moveSpeed; + private final int attackCooldownDefault; + private int attackCooldown; + private final float maxAttackDistance; + private int seeTime; + private int meleeCooldown = 0; + private int strafeTime = 0; + private int strafeDirection = 1; + + public CrimsonArcherAttackAI(EntityLiving mob, double speed, int cooldownTicks, float maxDistance) { + this.attacker = mob; + this.moveSpeed = speed; + this.attackCooldownDefault = cooldownTicks; + this.attackCooldown = 0; + this.maxAttackDistance = maxDistance; + this.setMutexBits(3); + } + + @Override + public boolean shouldExecute() { + EntityLivingBase target = this.attacker.getAttackTarget(); + if (target == null) return false; + this.attackTarget = target; + return true; + } + + @Override + public boolean continueExecuting() { + EntityLivingBase t = this.attacker.getAttackTarget(); + if (t == null) return false; + if (!t.isEntityAlive()) return false; + double dSq = this.attacker.getDistanceSqToEntity(t); + return dSq <= (this.maxAttackDistance * this.maxAttackDistance * 2.5D); + } + + @Override + public void startExecuting() { + this.seeTime = 0; + this.attackCooldown = 0; + this.meleeCooldown = 0; + } + + @Override + public void resetTask() { + this.attackCooldown = 0; + this.attackTarget = null; + this.attacker.getNavigator().clearPathEntity(); + } + + @Override + public void updateTask() { + if (this.attackTarget == null) return; + + World world = this.attacker.worldObj; + + double dxLook = this.attackTarget.posX - this.attacker.posX; + double dzLook = this.attackTarget.posZ - this.attacker.posZ; + float desiredYaw = (float)(Math.atan2(dzLook, dxLook) * 180.0D / Math.PI) - 90.0F; + this.attacker.rotationYaw = this.attacker.prevRotationYaw = normalizeAngle(desiredYaw); + this.attacker.rotationYawHead = this.attacker.renderYawOffset = this.attacker.rotationYaw; + + double dx = this.attacker.posX - this.attackTarget.posX; + double dy = this.attacker.posY - this.attackTarget.posY; + double dz = this.attacker.posZ - this.attackTarget.posZ; + double distSq = dx * dx + dz * dz; + + boolean canSee = this.attacker.getEntitySenses().canSee(this.attackTarget); + this.seeTime = canSee ? this.seeTime + 1 : 0; + + if (!hasRangedWeapon()) { + double len = Math.sqrt(dx * dx + dz * dz); + if (len < 0.0001D) len = 0.0001D; + + double nx = -dx / len; + double nz = -dz / len; + + this.attacker.motionX = nx * moveSpeed; + this.attacker.motionZ = nz * moveSpeed; + if (this.attacker.onGround) this.attacker.motionY = 0.0D; + + this.attacker.getNavigator().tryMoveToEntityLiving(this.attackTarget, moveSpeed); + + if (meleeCooldown > 0) meleeCooldown--; + if (distSq <= 4 && (dy * dy) <= 4 && meleeCooldown <= 0) { + this.attacker.swingItem(); + this.attacker.attackEntityAsMob(this.attackTarget); + meleeCooldown = 20; + } + return; + } + + double maxDistSq = maxAttackDistance * maxAttackDistance; + + if (distSq < maxDistSq * 0.85D) { + double len = Math.sqrt(dx * dx + dz * dz); + if (len < 0.0001D) len = 0.0001D; + + double nx = dx / len; + double nz = dz / len; + + double sx = -nz; + double sz = nx; + + if (strafeTime <= 0) { + strafeTime = 40; + strafeDirection = this.attacker.getRNG().nextBoolean() ? 1 : -1; + } else { + strafeTime--; + } + + this.attacker.motionX = nx * moveSpeed + sx * 0.1 * strafeDirection; + this.attacker.motionZ = nz * moveSpeed + sz * 0.1 * strafeDirection; + + if (this.attacker.onGround) this.attacker.motionY = 0.0D; + + this.attacker.getNavigator().clearPathEntity(); + } else { + double len = Math.sqrt(dx * dx + dz * dz); + double nx = dx / len; + double nz = dz / len; + + this.attacker.getNavigator().tryMoveToXYZ( + this.attacker.posX + nx * 6.0D, + this.attacker.posY, + this.attacker.posZ + nz * 6.0D, + moveSpeed + ); + } + + if (attackCooldown < attackCooldownDefault) { + attackCooldown++; + } + + if (seeTime > 0 && distSq <= maxDistSq && attackCooldown >= attackCooldownDefault) { + EntityPrimalArrow entityarrow = new EntityPrimalArrow(this.attacker.worldObj, this.attacker, 0.8F, world.rand.nextInt(6)); + int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.attacker.getHeldItem()); + int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.attacker.getHeldItem()); + entityarrow.setDamage((double)(2.0 + world.rand.nextInt(8))); + + if (i > 0) { + entityarrow.setDamage(entityarrow.getDamage() + (double)i * 0.5D + 0.5D); + } + + if (j > 0) { + entityarrow.setKnockbackStrength(j); + } + + if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.attacker.getHeldItem()) > 0) { + entityarrow.setFire(100); + } + double tx = this.attackTarget.posX + this.attackTarget.motionX - this.attacker.posX; + double ty = this.attackTarget.posY - this.attacker.posY; + double tz = this.attackTarget.posZ + this.attackTarget.motionZ - this.attacker.posZ; + + entityarrow.setThrowableHeading(tx, ty, tz, 2.5F, 1.5F); + + this.attacker.playSound("random.bow", 1.0F, 1.0F / (this.attacker.getRNG().nextFloat() * 0.4F + 0.8F)); + + world.spawnEntityInWorld(entityarrow); + + attackCooldown = 0; + } + } + + private boolean hasRangedWeapon() { + return attacker.getHeldItem() != null; + } + + private float normalizeAngle(float angle) { + while (angle >= 180.0F) angle -= 360.0F; + while (angle < -180.0F) angle += 360.0F; + return angle; + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/CrimsonRangerAttackAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/CrimsonRangerAttackAI.java new file mode 100644 index 0000000..ccf2849 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/CrimsonRangerAttackAI.java @@ -0,0 +1,156 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.ai; + +import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ShardPowderEntity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +public class CrimsonRangerAttackAI extends EntityAIBase { + private final EntityLiving attacker; + private EntityLivingBase attackTarget; + private final double moveSpeed; + private final int attackCooldownDefault; + private int attackCooldown; + private final float maxAttackDistance; + private int seeTime; + private int strafeTime = 0; + private int strafeDirection = 1; + + public CrimsonRangerAttackAI(EntityLiving mob, double speed, int cooldownTicks, float maxDistance) { + this.attacker = mob; + this.moveSpeed = speed; + this.attackCooldownDefault = cooldownTicks; + this.attackCooldown = 0; + this.maxAttackDistance = maxDistance; + this.setMutexBits(3); + } + + @Override + public boolean shouldExecute() { + EntityLivingBase target = this.attacker.getAttackTarget(); + if (target == null) return false; + this.attackTarget = target; + return true; + } + + @Override + public boolean continueExecuting() { + EntityLivingBase t = this.attacker.getAttackTarget(); + if (t == null) return false; + if (!t.isEntityAlive()) return false; + double dSq = this.attacker.getDistanceSqToEntity(t); + return dSq <= (this.maxAttackDistance * this.maxAttackDistance * 2.5D); + } + + @Override + public void startExecuting() { + this.seeTime = 0; + this.attackCooldown = 0; + } + + @Override + public void resetTask() { + this.attackTarget = null; + this.attackCooldown = 0; + this.attacker.getNavigator().clearPathEntity(); + } + + @Override + public void updateTask() { + if (this.attackTarget == null) return; + + World world = this.attacker.worldObj; + + double dxLook = this.attackTarget.posX - this.attacker.posX; + double dzLook = this.attackTarget.posZ - this.attacker.posZ; + float desiredYaw = (float)(Math.atan2(dzLook, dxLook) * 180.0D / Math.PI) - 90.0F; + this.attacker.rotationYaw = this.attacker.prevRotationYaw = normalizeAngle(desiredYaw); + this.attacker.rotationYawHead = this.attacker.renderYawOffset = this.attacker.rotationYaw; + + double dx = this.attacker.posX - this.attackTarget.posX; + double dz = this.attacker.posZ - this.attackTarget.posZ; + double distSq = dx * dx + dz * dz; + + boolean canSee = this.attacker.getEntitySenses().canSee(this.attackTarget); + this.seeTime = canSee ? this.seeTime + 1 : 0; + + double maxDistSq = maxAttackDistance * maxAttackDistance; + + if (distSq < maxDistSq * 0.85D) { + double len = Math.sqrt(dx * dx + dz * dz); + if (len < 0.0001D) len = 0.0001D; + + double nx = dx / len; + double nz = dz / len; + + double sx = -nz; + double sz = nx; + + if (strafeTime <= 0) { + strafeTime = 40; + strafeDirection = this.attacker.getRNG().nextBoolean() ? 1 : -1; + } else { + strafeTime--; + } + + this.attacker.motionX = nx * moveSpeed + sx * 0.1 * strafeDirection; + this.attacker.motionZ = nz * moveSpeed + sz * 0.1 * strafeDirection; + + if (this.attacker.onGround) this.attacker.motionY = 0.0D; + + this.attacker.getNavigator().clearPathEntity(); + } else { + double len = Math.sqrt(dx * dx + dz * dz); + double nx = dx / len; + double nz = dz / len; + + this.attacker.getNavigator().tryMoveToXYZ( + this.attacker.posX + nx * 6.0D, + this.attacker.posY, + this.attacker.posZ + nz * 6.0D, + moveSpeed + ); + } + + if (attackCooldown < attackCooldownDefault) { + attackCooldown++; + } + + if (seeTime > 0 && distSq <= maxDistSq && attackCooldown >= attackCooldownDefault) { + world.playSoundAtEntity(this.attacker, "thaumcraft:ice", 0.3F, 0.8F + world.rand.nextFloat() * 0.1F); + Vec3 look = this.attacker.getLookVec(); + int orbs = 4 + world.rand.nextInt(6); + for (int i = 0; i < orbs; i++) { + ShardPowderEntity orb = new ShardPowderEntity(this.attacker, this.attacker.posX + (look.xCoord), this.attacker.posY + this.attacker.getEyeHeight() + (look.yCoord), this.attacker.posZ + (look.zCoord), world.rand.nextInt(2), 20); + orb.posX -= (double) (Math.cos(this.attacker.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); + orb.posY -= 0.5; + orb.posZ -= (double) (Math.sin(this.attacker.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); + orb.setPosition(orb.posX, orb.posY, orb.posZ); + orb.yOffset = 0.0F; + float ff = 0.4F; + orb.motionX = (double) (-MathHelper.sin(this.attacker.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.attacker.rotationPitch / 180.0F * (float) Math.PI) * ff); + orb.motionZ = (double) (MathHelper.cos(this.attacker.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.attacker.rotationPitch / 180.0F * (float) Math.PI) * ff); + orb.motionY = (double) (-MathHelper.sin((this.attacker.rotationPitch) / 180.0F * (float) Math.PI) * ff); + float f2 = MathHelper.sqrt_double(orb.motionX * orb.motionX + orb.motionY * orb.motionY + orb.motionZ * orb.motionZ); + orb.motionX /= f2; + orb.motionY /= f2; + orb.motionZ /= f2; + orb.motionX += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double) 12; + orb.motionY += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double) 12; + orb.motionZ += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double) 12; + world.spawnEntityInWorld(orb); + } + + attackCooldown = 0; + } + } + + private float normalizeAngle(float angle) { + while (angle >= 180.0F) angle -= 360.0F; + while (angle < -180.0F) angle += 360.0F; + return angle; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/ImpDealTargetAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/ImpDealTargetAI.java new file mode 100644 index 0000000..3a666ba --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/ImpDealTargetAI.java @@ -0,0 +1,53 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.ai; + +import com.ilya3point999k.thaumicconcilium.common.TCPlayerCapabilities; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Chort; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAINearestAttackableTarget; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +public class ImpDealTargetAI extends EntityAINearestAttackableTarget { + + private final EntityCreature attacker; + + public ImpDealTargetAI(EntityCreature entity) { + super(entity, EntityPlayer.class, 0, true); + this.attacker = entity; + } + + @Override + protected boolean isSuitableTarget(EntityLivingBase target, boolean includeInvincibles) { + + if (!(target instanceof EntityPlayer)) + return false; + + EntityPlayer player = (EntityPlayer) target; + boolean hasPact = false; + TCPlayerCapabilities capabilities = TCPlayerCapabilities.get(player); + if (capabilities != null && capabilities.impDealTime > 0){ + hasPact = true; + } + + boolean attackedMob = attacker.getAITarget() == player; + if (hasPact || attackedMob) { + if ((attacker instanceof Chort) && hasPact) { + Chort chort = (Chort) attacker; + if (chort.chatCooldown == 0) { + player.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("tc.chort.has_pact") + ).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED))); + chort.chatCooldown = 1200; + } + } + return false; + } + + return super.isSuitableTarget(target, includeInvincibles); + } +} + diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SamuraiAttackAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SamuraiAttackAI.java index 50a0bd6..f28a7cf 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SamuraiAttackAI.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SamuraiAttackAI.java @@ -4,180 +4,188 @@ import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Samurai; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketFXLightning; import cpw.mods.fml.common.network.NetworkRegistry; -import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.RandomPositionGenerator; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; import net.minecraft.world.World; public class SamuraiAttackAI extends EntityAIBase { - World worldObj; - EntityCreature attacker; - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - /** - * The speed with which the mob will approach the target - */ - double speedTowardsTarget; - /** - * When true, the mob will continue chasing its target, even if it can't find a path to them right now. - */ - boolean longMemory; - /** - * The PathEntity of our entity. - */ - PathEntity entityPathEntity; - Class classTarget; - private int field_75445_i; - private double field_151497_i; - private double field_151495_j; - private double field_151496_k; + private final Samurai attacker; + private EntityLivingBase attackTarget; + private final double moveSpeed; + private final int attackCooldownDefault; + private int attackCooldown; + private final float maxAttackDistance; + private int seeTime; + private int meleeCooldown = 0; + private int strafeTime = 0; + private int strafeDirection = 1; - private int failedPathFindingPenalty; - - public SamuraiAttackAI(EntityCreature p_i1635_1_, Class p_i1635_2_, double p_i1635_3_, boolean p_i1635_5_) { - this(p_i1635_1_, p_i1635_3_, p_i1635_5_); - this.classTarget = p_i1635_2_; - } - - public SamuraiAttackAI(EntityCreature p_i1636_1_, double p_i1636_2_, boolean p_i1636_4_) { - this.attacker = p_i1636_1_; - this.worldObj = p_i1636_1_.worldObj; - this.speedTowardsTarget = p_i1636_2_; - this.longMemory = p_i1636_4_; + public SamuraiAttackAI(Samurai mob, double speed, int cooldownTicks, float maxDistance) { + this.attacker = mob; + this.moveSpeed = speed; + this.attackCooldownDefault = cooldownTicks; + this.attackCooldown = 0; + this.maxAttackDistance = maxDistance; this.setMutexBits(3); } - /** - * Returns whether the EntityAIBase should begin execution. - */ + @Override public boolean shouldExecute() { - EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); - - if (entitylivingbase == null) { + EntityLivingBase target = this.attacker.getAttackTarget(); + if (target == null) { + this.attacker.setAnger(0); return false; - } else if (!entitylivingbase.isEntityAlive()) { - return false; - } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(entitylivingbase.getClass())) { - return false; - } else { - if (--this.field_75445_i <= 0) { - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(entitylivingbase); - this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); - if (this.entityPathEntity != null) { - ((Samurai) this.attacker).setAnger(0); - } - return false; - } else { - ((Samurai) this.attacker).setAnger(0); - return true; - } } + this.attackTarget = target; + return true; } - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ + @Override public boolean continueExecuting() { - EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); - return entitylivingbase == null ? false : (!entitylivingbase.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.isWithinHomeDistance(MathHelper.floor_double(entitylivingbase.posX), MathHelper.floor_double(entitylivingbase.posY), MathHelper.floor_double(entitylivingbase.posZ)))); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if (((Samurai) this.attacker).getAnger() <= 200 && this.attacker.getHealth() > this.attacker.getMaxHealth() / 3) { - ((Samurai) this.attacker).setAnger(MathHelper.clamp_int(200 + this.attacker.worldObj.rand.nextInt(200), 0, 1000)); + EntityLivingBase t = this.attacker.getAttackTarget(); + if (t == null) { + (this.attacker).setAnger(0); + return false; + } + if (!t.isEntityAlive()) { + (this.attacker).setAnger(0); + return false; + } + double dSq = this.attacker.getDistanceSqToEntity(t); + if (dSq <= (this.maxAttackDistance * this.maxAttackDistance * 2.5D)){ + return true; + } else { + (this.attacker).setAnger(0); + return false; } - this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); - this.field_75445_i = 0; } - /** - * Resets the task - */ + @Override + public void startExecuting() { + if (this.attacker.getHealth() > this.attacker.getMaxHealth() / 3) { + this.attacker.setAnger(1); + } + this.seeTime = 0; + this.attackCooldown = 0; + this.meleeCooldown = 0; + } + + @Override public void resetTask() { + this.attackTarget = null; + this.attackCooldown = 0; this.attacker.getNavigator().clearPathEntity(); } - /** - * Updates the task - */ + @Override public void updateTask() { - EntityLivingBase entitylivingbase = this.attacker.getAttackTarget(); - this.attacker.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F); - double d0 = this.attacker.getDistanceSq(entitylivingbase.posX, entitylivingbase.boundingBox.minY, entitylivingbase.posZ); - double d1 = (double) (this.attacker.width * 2.0F * this.attacker.width * 2.0F + entitylivingbase.width); - --this.field_75445_i; + if (this.attackTarget == null) return; + + World world = this.attacker.worldObj; + + double dxLook = this.attackTarget.posX - this.attacker.posX; + double dzLook = this.attackTarget.posZ - this.attacker.posZ; + float desiredYaw = (float)(Math.atan2(dzLook, dxLook) * 180.0D / Math.PI) - 90.0F; + this.attacker.rotationYaw = this.attacker.prevRotationYaw = normalizeAngle(desiredYaw); + this.attacker.rotationYawHead = this.attacker.renderYawOffset = this.attacker.rotationYaw; + + double dx = this.attacker.posX - this.attackTarget.posX; + double dy = this.attacker.posY - this.attackTarget.posY; + double dz = this.attacker.posZ - this.attackTarget.posZ; + double distSq = dx * dx + dz * dz; + + boolean canSee = this.attacker.getEntitySenses().canSee(this.attackTarget); + this.seeTime = canSee ? this.seeTime + 1 : 0; - if (this.attacker.getHealth() > this.attacker.getMaxHealth() / 2 && d0 > 64F && worldObj.rand.nextInt(10) > 7) { - this.attacker.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 10, 3)); - } if (this.attacker.getHealth() > this.attacker.getMaxHealth() / 3) { - if ((this.longMemory || this.attacker.getEntitySenses().canSee(entitylivingbase)) && this.field_75445_i <= 0 && (this.field_151497_i == 0.0D && this.field_151495_j == 0.0D && this.field_151496_k == 0.0D || entitylivingbase.getDistanceSq(this.field_151497_i, this.field_151495_j, this.field_151496_k) >= 1.0D || this.attacker.getRNG().nextFloat() < 0.05F)) { - this.field_151497_i = entitylivingbase.posX; - this.field_151495_j = entitylivingbase.boundingBox.minY; - this.field_151496_k = entitylivingbase.posZ; - this.field_75445_i = failedPathFindingPenalty + 4 + this.attacker.getRNG().nextInt(7); - - if (this.attacker.getNavigator().getPath() != null) { - PathPoint finalPathPoint = this.attacker.getNavigator().getPath().getFinalPathPoint(); - if (finalPathPoint != null && entitylivingbase.getDistanceSq(finalPathPoint.xCoord, finalPathPoint.yCoord, finalPathPoint.zCoord) < 1) { - failedPathFindingPenalty = 0; - } else { - failedPathFindingPenalty += 10; - } - } else { - failedPathFindingPenalty += 10; - } - - if (d0 > 1024.0D) { - this.field_75445_i += 10; - } else if (d0 > 256.0D) { - this.field_75445_i += 5; - } - - if (!this.attacker.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.speedTowardsTarget)) { - this.field_75445_i += 15; - } + if (this.attacker.getHealth() > this.attacker.getMaxHealth() / 2 && distSq > 64F && world.rand.nextInt(10) > 7) { + this.attacker.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 10, 3)); } - this.attackTick = Math.max(this.attackTick - 1, 0); + double len = Math.sqrt(dx * dx + dz * dz); + if (len < 0.0001D) len = 0.0001D; - if (d0 <= d1 && this.attackTick <= 20) { - this.attackTick = 20; + double nx = -dx / len; + double nz = -dz / len; + + this.attacker.motionX = nx * moveSpeed; + this.attacker.motionZ = nz * moveSpeed; + + if (this.attacker.onGround) this.attacker.motionY = 0.0D; + + this.attacker.getNavigator().tryMoveToEntityLiving(this.attackTarget, moveSpeed); + this.attacker.setAnger(1); + if (meleeCooldown > 0) meleeCooldown--; + if (distSq <= 4 && (dy * dy) <= 4 && meleeCooldown <= 0) { this.attacker.swingItem(); - - - this.attacker.attackEntityAsMob(entitylivingbase); + this.attacker.attackEntityAsMob(this.attackTarget); + meleeCooldown = 20; } + return; + } + + double maxDistSq = maxAttackDistance * maxAttackDistance; + + if (distSq < maxDistSq * 0.85D) { + double len = Math.sqrt(dx * dx + dz * dz); + if (len < 0.0001D) len = 0.0001D; + + double nx = dx / len; + double nz = dz / len; + + double sx = -nz; + double sz = nx; + + if (strafeTime <= 0) { + strafeTime = 40; + strafeDirection = this.attacker.getRNG().nextBoolean() ? 1 : -1; + } else { + strafeTime--; + } + + this.attacker.motionX = nx * moveSpeed + sx * 0.1 * strafeDirection; + this.attacker.motionZ = nz * moveSpeed + sz * 0.1 * strafeDirection; + + if (this.attacker.onGround) this.attacker.motionY = 0.0D; + + this.attacker.getNavigator().clearPathEntity(); } else { - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.attacker, 16, 7, Vec3.createVectorHelper(entitylivingbase.posX, entitylivingbase.posY, entitylivingbase.posZ)); + double len = Math.sqrt(dx * dx + dz * dz); + double nx = dx / len; + double nz = dz / len; - if (vec3 != null && (entitylivingbase.getDistanceSq(vec3.xCoord, vec3.yCoord, vec3.zCoord) > entitylivingbase.getDistanceSqToEntity(this.attacker))) - { - this.entityPathEntity = this.attacker.getNavigator().getPathToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord); - this.attacker.getNavigator().tryMoveToXYZ(vec3.xCoord, vec3.yCoord, vec3.zCoord, this.speedTowardsTarget); - if (this.attacker.ticksExisted % 20 == 0 && d0 < 256F) { - if (!worldObj.isRemote) { - if (this.attacker.getEntitySenses().canSee(entitylivingbase)) { - this.attacker.worldObj.playSoundEffect(this.attacker.posX, this.attacker.posY, this.attacker.posZ, "thaumcraft:shock", 0.25F, 1.0F); - entitylivingbase.attackEntityFrom(DamageSource.causeMobDamage(this.attacker), 2 * (((Samurai) this.attacker).getType() + 1)); - TCPacketHandler.INSTANCE.sendToAllAround(new PacketFXLightning((float) this.attacker.posX, (float) (this.attacker.posY + this.attacker.height - 0.5), (float) this.attacker.posZ, (float) entitylivingbase.posX, (float) (entitylivingbase.posY + entitylivingbase.height / 2), (float) entitylivingbase.posZ, 0x6666DD, 0.02F), new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, this.attacker.posX, this.attacker.posY, this.attacker.posZ, 32.0)); - } - } - } - } + this.attacker.getNavigator().tryMoveToXYZ( + this.attacker.posX + nx * 6.0D, + this.attacker.posY, + this.attacker.posZ + nz * 6.0D, + moveSpeed + ); + } + + if (attackCooldown < attackCooldownDefault) { + attackCooldown++; + } + + if (seeTime > 0 && distSq <= maxDistSq && attackCooldown >= attackCooldownDefault) { + this.attacker.worldObj.playSoundEffect(this.attacker.posX, this.attacker.posY, this.attacker.posZ, "thaumcraft:shock", 0.25F, 1.0F); + this.attackTarget.attackEntityFrom(DamageSource.causeMobDamage(this.attacker), 2 * (((Samurai) this.attacker).getType() + 1)); + TCPacketHandler.INSTANCE.sendToAllAround(new PacketFXLightning((float) this.attacker.posX, (float) (this.attacker.posY + this.attacker.height - 0.5), (float) this.attacker.posZ, (float) this.attackTarget.posX, (float) (this.attackTarget.posY + this.attackTarget.height / 2), (float) this.attackTarget.posZ, 0x6666DD, 0.02F), new NetworkRegistry.TargetPoint(world.provider.dimensionId, this.attacker.posX, this.attacker.posY, this.attacker.posZ, 32.0)); + + attackCooldown = 0; } } + + private boolean hasRangedWeapon() { + return attacker.getHeldItem() != null; + } + + private float normalizeAngle(float angle) { + while (angle >= 180.0F) angle -= 360.0F; + while (angle < -180.0F) angle += 360.0F; + return angle; + } + } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SloppyAlchemistAttackAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SloppyAlchemistAttackAI.java new file mode 100644 index 0000000..355eac7 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ai/SloppyAlchemistAttackAI.java @@ -0,0 +1,197 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.ai; + +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Chort; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIBase; +import net.minecraft.world.World; + +public class SloppyAlchemistAttackAI extends EntityAIBase { + + private final EntityLiving attacker; + private EntityLivingBase target; + + private final double evadeSpeed; + private final double ramSpeed; + private final float maxDistance; + + private int strafeTime = 0; + private int strafeDirection = 1; + private final double strafeFactor = 0.1D; + + private int chargeTime = 0; + private final int chargeInterval; + private boolean isRamming = false; + private boolean isWindingUp = false; + + private int windupTicks = 0; + private static final int WINDUP_DURATION = 12; + + private boolean ramHit = false; + private double ramTargetX; + private double ramTargetZ; + + private static final double KNOCKBACK_HORIZONTAL = 2.5D; + private static final double KNOCKBACK_VERTICAL = 0.65D; + + private static final double RAM_OVERSHOOT_DISTANCE = 3.0D; + + public SloppyAlchemistAttackAI(EntityLiving mob, + double evadeSpeed, + double ramSpeed, + int chargeInterval, + float maxDistance) { + this.attacker = mob; + this.evadeSpeed = evadeSpeed; + this.ramSpeed = ramSpeed; + this.chargeInterval = chargeInterval; + this.maxDistance = maxDistance; + this.setMutexBits(3); + } + + @Override + public boolean shouldExecute() { + if (!(this.attacker.riddenByEntity instanceof Chort)) return false; + EntityLivingBase t = attacker.getAttackTarget(); + if (t == null) return false; + target = t; + return true; + } + + @Override + public boolean continueExecuting() { + return target != null && target.isEntityAlive() && (this.attacker.riddenByEntity instanceof Chort); + } + + @Override + public void resetTask() { + target = null; + isRamming = false; + isWindingUp = false; + ramHit = false; + chargeTime = 0; + windupTicks = 0; + attacker.getNavigator().clearPathEntity(); + } + + @Override + public void updateTask() { + if (target == null) return; + if(!(this.attacker.riddenByEntity instanceof Chort)) return; + + World world = attacker.worldObj; + + double lx = target.posX - attacker.posX; + double lz = target.posZ - attacker.posZ; + float yaw = (float)(Math.atan2(lz, lx) * 180.0D / Math.PI) - 90.0F; + attacker.rotationYaw = attacker.prevRotationYaw = yaw; + attacker.rotationYawHead = attacker.renderYawOffset = yaw; + + double dx = attacker.posX - target.posX; + double sqdy = attacker.posY - target.posY; + sqdy = sqdy * sqdy; + double dz = attacker.posZ - target.posZ; + double distSq = dx * dx + dz * dz; + + if (isWindingUp) { + windupTicks++; + + attacker.motionX = 0.0D; + attacker.motionZ = 0.0D; + + if (windupTicks == 1 && attacker.onGround) { + attacker.motionY = 0.45D; + } + + if (windupTicks >= WINDUP_DURATION) { + isWindingUp = false; + isRamming = true; + ramHit = false; + + double rx = target.posX - attacker.posX; + double rz = target.posZ - attacker.posZ; + double len = Math.sqrt(rx * rx + rz * rz); + if (len < 0.0001D) len = 0.0001D; + + double nx = rx / len; + double nz = rz / len; + + ramTargetX = target.posX + nx * RAM_OVERSHOOT_DISTANCE; + ramTargetZ = target.posZ + nz * RAM_OVERSHOOT_DISTANCE; + } + return; + } + + if (isRamming) { + double rx = ramTargetX - attacker.posX; + double rz = ramTargetZ - attacker.posZ; + double len = Math.sqrt(rx * rx + rz * rz); + if (len < 0.0001D) len = 0.0001D; + + attacker.motionX = (rx / len) * ramSpeed; + attacker.motionZ = (rz / len) * ramSpeed; + + if (!ramHit && distSq < 2.2D && sqdy < 2.2D) { + attacker.attackEntityAsMob(target); + + double kx = target.posX - attacker.posX; + double kz = target.posZ - attacker.posZ; + double klen = Math.sqrt(kx * kx + kz * kz); + if (klen > 0.0D) { + target.addVelocity( + (kx / klen) * KNOCKBACK_HORIZONTAL, + KNOCKBACK_VERTICAL, + (kz / klen) * KNOCKBACK_HORIZONTAL + ); + } + + ramHit = true; + } + + if (ramHit || len < 0.6D) { + isRamming = false; + chargeTime = 0; + } + return; + } + + if (distSq < maxDistance * maxDistance) { + double len = Math.sqrt(dx * dx + dz * dz); + if (len < 0.0001D) len = 0.0001D; + + double bx = dx / len; + double bz = dz / len; + + double sx = -bz; + double sz = bx; + + if (strafeTime <= 0) { + strafeTime = 30; + strafeDirection = attacker.getRNG().nextBoolean() ? 1 : -1; + } else { + strafeTime--; + } + + attacker.motionX = + bx * evadeSpeed + + sx * strafeFactor * strafeDirection; + attacker.motionZ = + bz * evadeSpeed + + sz * strafeFactor * strafeDirection; + + attacker.getNavigator().clearPathEntity(); + } + + if (attacker.getEntitySenses().canSee(target)) { + chargeTime++; + } else { + chargeTime = 0; + } + + if (chargeTime >= chargeInterval) { + isWindingUp = true; + windupTicks = 0; + chargeTime = 0; + } + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/DistortionEffectEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/DistortionEffectEntity.java similarity index 98% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/DistortionEffectEntity.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/DistortionEffectEntity.java index fdfd06a..f0a6d7e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/DistortionEffectEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/DistortionEffectEntity.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.cosmetic; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.AlchemistSpreeFoci; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/UpcomingHoleEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/UpcomingHoleEntity.java similarity index 95% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/UpcomingHoleEntity.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/UpcomingHoleEntity.java index 50fdd06..f42febe 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/UpcomingHoleEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/UpcomingHoleEntity.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.cosmetic; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketMakeHole; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/WrathEffectEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/WrathEffectEntity.java similarity index 97% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/WrathEffectEntity.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/WrathEffectEntity.java index 4d6445c..44cfff9 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/WrathEffectEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/cosmetic/WrathEffectEntity.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.cosmetic; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import io.netty.buffer.ByteBuf; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/items/EntityItemFireResistant.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/items/EntityItemFireResistant.java new file mode 100644 index 0000000..44e885f --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/items/EntityItemFireResistant.java @@ -0,0 +1,33 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.items; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityItemFireResistant extends EntityItem { + public EntityItemFireResistant(World w){ + super(w); + } + + public EntityItemFireResistant(World w, double x, double y, double z, ItemStack stack) { + super(w, x, y, z, stack); + isImmuneToFire = true; + } + + + @Override + protected void setOnFireFromLava() { + + } + + @Override + public void setFire(int p_70015_1_) { + + } + + @Override + public boolean attackEntityFrom(DamageSource source, float f) { + return !source.isFireDamage() && super.attackEntityFrom(source, f); + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/items/EntityItemProtobody.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/items/EntityItemProtobody.java new file mode 100644 index 0000000..b0fdd10 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/items/EntityItemProtobody.java @@ -0,0 +1,36 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.items; + +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.Protolimb; +import com.ilya3point999k.thaumicconcilium.common.integration.Integration; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import thaumcraft.codechicken.lib.vec.Vector3; +import thaumic.tinkerer.common.core.helper.MiscHelper; + +public class EntityItemProtobody extends EntityItem { + public EntityItemProtobody(World w){ + super(w); + } + + public EntityItemProtobody(World w, double x, double y, double z, ItemStack stack) { + super(w, x, y, z, stack); + } + + @Override + public void onUpdate() { + super.onUpdate(); + if (!worldObj.isRemote) { + if (Integration.taintedMagic && posY < -16.0) { + for (int i = 0; i < 6; i++) { + Protolimb protolimb = new Protolimb(this.worldObj, i); + protolimb.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); + MiscHelper.setEntityMotionFromVector(this, new Vector3(this.posX + (-0.5 + worldObj.rand.nextGaussian()) * 2.0, this.posY + 1.0, this.posZ + (-0.5 + worldObj.rand.nextGaussian()) * 2.0), 0.5f); + this.worldObj.spawnEntityInWorld(protolimb); + protolimb.setType(i); + } + this.setDead(); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/BurnedWitch.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/BurnedWitch.java new file mode 100644 index 0000000..f173336 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/BurnedWitch.java @@ -0,0 +1,625 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.mobs; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.brewing.EntityBrew; +import com.emoniph.witchery.common.ExtendedPlayer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumDifficulty; +import net.minecraft.world.World; + +public class BurnedWitch extends EntityFlying implements IMob { + public static ItemStack brewAttack; + public static ItemStack brewAttackVamps; + public static ItemStack brewAttackWolfs; + public static ItemStack brewIllFitting; + private static final ItemStack[] witchDrops = new ItemStack[]{ + new ItemStack(Items.blaze_powder), + new ItemStack(Items.ghast_tear), + new ItemStack(Witchery.Items.GENERIC, 1, 28), + new ItemStack(Witchery.Items.GENERIC, 1, 30), + new ItemStack(Witchery.Items.GENERIC, 1, 35), + }; + public double orbitAngle = 0.0D; + public double orbitRadius = 0.0D; + public double orbitHeight = 8.0D; + public double orbitSpeed = 0.06D; + public double orbitRadiusMin = 4.0D; + public double orbitRadiusMax = 8.0D; + public double orbitBobAmplitude = 0.6D; + public double orbitBobSpeed = 2.0D; + + public int courseChangeCooldown; + public double waypointX; + public double waypointY; + public double waypointZ; + private Entity targetedEntity; + + private int aggroCooldown; + public int prevAttackCounter; + public int attackCounter; + + public BurnedWitch(World p_i1735_1_) { + super(p_i1735_1_); + this.setSize(1.0F, 2.0F); + this.isImmuneToFire = true; + this.experienceValue = 10; + + } + + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) { + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D); + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (!worldObj.isRemote) { + if (!this.isPotionActive(Witchery.Potions.GAS_MASK)) { + this.addPotionEffect(new PotionEffect(Witchery.Potions.GAS_MASK.id, 65536, 1)); + } + } + } + + protected void updateEntityActionState() { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == EnumDifficulty.PEACEFUL) { + this.setDead(); + } + + this.despawnEntity(); + this.prevAttackCounter = this.attackCounter; + + if (this.targetedEntity != null && this.targetedEntity.isDead) { + this.targetedEntity = null; + } + + if (this.targetedEntity == null || this.aggroCooldown-- <= 0) { + this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); + + if (this.targetedEntity != null) { + this.aggroCooldown = 20; + this.orbitRadius = this.orbitRadiusMin + this.rand.nextDouble() * (this.orbitRadiusMax - this.orbitRadiusMin); + this.orbitAngle = this.rand.nextDouble() * Math.PI * 2.0D; + } + } + + if (this.targetedEntity != null) { + this.orbitAngle += this.orbitSpeed; + + double orbitX = this.targetedEntity.posX + Math.cos(this.orbitAngle) * this.orbitRadius; + double orbitZ = this.targetedEntity.posZ + Math.sin(this.orbitAngle) * this.orbitRadius; + + double baseY = this.targetedEntity.posY + this.orbitHeight; + double bob = Math.sin(this.orbitAngle * this.orbitBobSpeed) * this.orbitBobAmplitude; + double orbitY = baseY + bob; + + this.waypointX = orbitX; + this.waypointY = orbitY; + this.waypointZ = orbitZ; + + if (this.courseChangeCooldown > 3) { + this.courseChangeCooldown = 0; + } + } else { + double d0 = this.waypointX - this.posX; + double d1 = this.waypointY - this.posY; + double d2 = this.waypointZ - this.posZ; + double d3 = d0 * d0 + d1 * d1 + d2 * d2; + + if (d3 < 1.0D || d3 > 3600.0D) { + this.waypointX = this.posX + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointY = this.posY + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + this.waypointZ = this.posZ + (double) ((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + } + + double dx = this.waypointX - this.posX; + double dy = this.waypointY - this.posY; + double dz = this.waypointZ - this.posZ; + double distSq = dx * dx + dy * dy + dz * dz; + + if (this.courseChangeCooldown-- <= 0) { + this.courseChangeCooldown += this.rand.nextInt(5) + 2; + double dist = (double) MathHelper.sqrt_double(distSq); + + if (dist > 0.0D && this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, dist)) { + this.motionX += dx / dist * 0.1D; + this.motionY += dy / dist * 0.1D; + this.motionZ += dz / dist * 0.1D; + } else { + this.waypointX = this.posX; + this.waypointY = this.posY; + this.waypointZ = this.posZ; + } + } + + double seeRangeSq = 64.0D; + if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < seeRangeSq * seeRangeSq) { + double tx = this.targetedEntity.posX - this.posX; + double tz = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(tx, tz)) * 180.0F / (float) Math.PI; + + if (this.canEntityBeSeen(this.targetedEntity)) { + if (this.attackCounter == 10) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1007, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + } + + ++this.attackCounter; + + if (this.attackCounter == 10) { + if (this.targetedEntity instanceof EntityPlayer) { + ExtendedPlayer playerEx = ExtendedPlayer.get((EntityPlayer) this.targetedEntity); + + int r = worldObj.rand.nextInt(3); + switch (r) { + case 0: { + throwPotion(brewIllFitting); + break; + } + case 1: { + if (playerEx.isVampire()) { + throwPotion(brewAttackVamps); + } else if (playerEx.getWerewolfLevel() > 0) { + throwPotion(brewAttackWolfs); + } else { + throwPotion(brewAttack); + } + break; + } + case 2: { + throwPotion(brewAttack); + break; + } + } + } + this.attackCounter = -20; + } + } else if (this.attackCounter > 0) { + --this.attackCounter; + } + } else { + this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI; + + if (this.attackCounter > 0) { + --this.attackCounter; + } + } + } + + private void throwPotion(ItemStack potion){ + EntityBrew brew = new EntityBrew(worldObj, this, potion, false); + double bdx = this.targetedEntity.posX - this.posX; + double bdz = this.targetedEntity.posZ - this.posZ; + double bdy = this.targetedEntity.posY + this.targetedEntity.getEyeHeight() - 1.1D - brew.posY; + + float dist = MathHelper.sqrt_double(bdx * bdx + bdz * bdz); + + brew.setThrowableHeading(bdx, bdy + dist * 0.2F, bdz, 0.75F, 8.0F); + this.worldObj.spawnEntityInWorld(brew); + } + + private boolean isCourseTraversable(double p_70790_1_, double p_70790_3_, double p_70790_5_, double p_70790_7_) { + double d4 = (this.waypointX - this.posX) / p_70790_7_; + double d5 = (this.waypointY - this.posY) / p_70790_7_; + double d6 = (this.waypointZ - this.posZ) / p_70790_7_; + AxisAlignedBB axisalignedbb = this.boundingBox.copy(); + + for (int i = 1; (double) i < p_70790_7_; ++i) { + axisalignedbb.offset(d4, d5, d6); + + if (!this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).isEmpty()) { + return false; + } + } + + return true; + } + + protected String getLivingSound() { + return "mob.ghast.moan"; + } + + protected String getHurtSound() { + return "mob.ghast.scream"; + } + + protected String getDeathSound() { + return "mob.ghast.death"; + } + + @Override + protected float getSoundPitch() { + return 1.5F; + } + + protected void dropFewItems(boolean par1, int par2) { + int j = super.rand.nextInt(3) + 1; + + for (int k = 0; k < j; ++k) { + int l = super.rand.nextInt(3); + ItemStack i1 = witchDrops[super.rand.nextInt(witchDrops.length)]; + if (par2 > 0) { + l += super.rand.nextInt(par2 + 1); + } + for (int j1 = 0; j1 < l; ++j1) { + this.entityDropItem(i1, 1.5F); + } + } + + } + + @Override + protected void updateFallState(double y, boolean onGround) {} + + @Override + public boolean doesEntityNotTriggerPressurePlate() { + return true; + } + + public int getMaxSpawnedInChunk() { + return 1; + } + + static { + brewAttack = new ItemStack(Witchery.Items.BREW); + NBTTagCompound tag = new NBTTagCompound(); + NBTTagList list = new NBTTagList(); + + NBTTagCompound itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_wart).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 37).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 29).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.diamond).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_star).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 151).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 11).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.fish, 1, 2).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.fermented_spider_eye).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.speckled_melon).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 114).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 35).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + //new ItemStack(Witchery.Items.GENERIC, 1, 111).writeToNBT(itemtag); + new ItemStack(Witchery.Items.GENERIC, 1, 24).writeToNBT(itemtag); + //new ItemStack(Items.gunpowder).writeToNBT(itemtag); + list.appendTag(itemtag); + tag.setTag("Items", list); + + brewAttack.setTagCompound(tag); + + + brewAttackWolfs = new ItemStack(Witchery.Items.BREW); + tag = new NBTTagCompound(); + list = new NBTTagList(); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_wart).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 37).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 29).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.diamond).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_star).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 151).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 11).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.fish, 1, 2).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 157).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 114).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 35).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + //new ItemStack(Witchery.Items.GENERIC, 1, 111).writeToNBT(itemtag); + new ItemStack(Witchery.Items.GENERIC, 1, 24).writeToNBT(itemtag); + //new ItemStack(Items.gunpowder).writeToNBT(itemtag); + list.appendTag(itemtag); + tag.setTag("Items", list); + + brewAttackWolfs.setTagCompound(tag); + + brewAttackVamps = new ItemStack(Witchery.Items.BREW); + tag = new NBTTagCompound(); + list = new NBTTagList(); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_wart).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 37).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 29).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.diamond).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_star).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 151).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 11).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.fish, 1, 2).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.SEEDS_GARLIC).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 11).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.fish, 1, 2).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.fermented_spider_eye).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.speckled_melon).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 114).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 35).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + //new ItemStack(Witchery.Items.GENERIC, 1, 111).writeToNBT(itemtag); + new ItemStack(Witchery.Items.GENERIC, 1, 24).writeToNBT(itemtag); + //new ItemStack(Items.gunpowder).writeToNBT(itemtag); + list.appendTag(itemtag); + tag.setTag("Items", list); + + brewAttackVamps.setTagCompound(tag); + + brewIllFitting = new ItemStack(Witchery.Items.BREW); + tag = new NBTTagCompound(); + list = new NBTTagList(); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_wart).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 37).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 29).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.diamond).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.nether_star).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 151).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 11).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Blocks.BRAMBLE, 1, 1).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 114).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 35).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.glowstone_dust).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.blaze_rod).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Blocks.GLINT_WEED).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Witchery.Items.GENERIC, 1, 21).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.dye, 1, 4).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Blocks.end_stone).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.gunpowder).writeToNBT(itemtag); + list.appendTag(itemtag); + + list.appendTag(itemtag); + tag.setTag("Items", list); + + brewIllFitting.setTagCompound(tag); + + + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Chort.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Chort.java new file mode 100644 index 0000000..c63c25b --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Chort.java @@ -0,0 +1,114 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.mobs; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.brewing.WitcheryBrewRegistry; +import com.ilya3point999k.thaumicconcilium.common.entities.ai.ChortAttackAI; +import com.ilya3point999k.thaumicconcilium.common.entities.ai.ImpDealTargetAI; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.world.World; + +public class Chort extends EntityMob { + public static ItemStack brewMoonshine; + public int chatCooldown = 0; + + public Chort(World w) { + super(w); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new ChortAttackAI(this)); + this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(8, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(2, new ImpDealTargetAI(this)); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.28); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(25.0D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + } + + protected boolean isAIEnabled() { + return true; + } + + protected String getLivingSound() { + return "mob.pig.say"; + } + + protected String getHurtSound() { + return "mob.pig.say"; + } + + protected String getDeathSound() { + return "mob.pig.death"; + } + + @Override + protected float getSoundPitch() { + return 0.5f; + } + + @Override + protected void dropFewItems(boolean flag, int i) { + int r = this.rand.nextInt(10); + if (r < 3) { + this.entityDropItem(Witchery.Items.GENERIC.itemFoulFume.createStack(this.rand.nextInt(4)), 1.5F); + } else if (r < 6) { + this.entityDropItem(Witchery.Items.GENERIC.itemExhaleOfTheHornedOne.createStack(this.rand.nextInt(4)), 1.5F); + } else { + this.entityDropItem(brewMoonshine.copy(), 1.5F); + } + + super.dropFewItems(flag, i); + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (chatCooldown > 0){ + chatCooldown--; + } + if (this.ridingEntity instanceof SloppyAlchemist) { + SloppyAlchemist mount = (SloppyAlchemist) this.ridingEntity; + EntityLivingBase mountTarget = mount.getAttackTarget(); + if (mountTarget != null) { + this.setAttackTarget(mountTarget); + } + } + } + + static { + brewMoonshine = new ItemStack(Witchery.Items.BREW); + NBTTagCompound tag = new NBTTagCompound(); + NBTTagList list = new NBTTagList(); + + NBTTagCompound itemtag = new NBTTagCompound(); + Witchery.Items.GENERIC.itemMandrakeRoot.createStack(1).writeToNBT(itemtag); + list.appendTag(itemtag); + + itemtag = new NBTTagCompound(); + new ItemStack(Items.wheat).writeToNBT(itemtag); + list.appendTag(itemtag); + + + tag.setTag("Items", list); + tag.setInteger("Color", 0xFEC20C); + tag.setString("BrewName", WitcheryBrewRegistry.INSTANCE.getBrewName(tag)); + + WitcheryBrewRegistry.INSTANCE.updateBrewInformation(tag); + + brewMoonshine.setTagCompound(tag); + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonArcher.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonArcher.java index 6e84c43..b1d2b30 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonArcher.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonArcher.java @@ -1,49 +1,38 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; -import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.ai.CrimsonArcherAttackAI; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; -import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.IRangedAttackMob; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.*; -import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import thaumcraft.common.config.ConfigItems; -import thaumcraft.common.entities.ai.combat.AIAttackOnCollide; -import thaumcraft.common.entities.ai.combat.AILongRangeAttack; import thaumcraft.common.entities.monster.EntityCultist; -import thaumcraft.common.entities.projectile.EntityPrimalArrow; -public class CrimsonArcher extends EntityCultist implements IRangedAttackMob { +public class CrimsonArcher extends EntityCultist { public static ItemStack bow = new ItemStack(Items.bow); - private final EntityAIArrowAttack aiBlastAttack = new EntityAIArrowAttack(this, 1.0, 10, 25, 15.0F); - private final AIAttackOnCollide aiMeleeAttack = new AIAttackOnCollide(this, EntityLivingBase.class, 0.6, false); - public boolean updateAINextTick = false; public CrimsonArcher(World w) { super(w); - this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(2, new CrimsonArcherAttackAI(this, 0.25D, 20, 20.0F)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); - this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, Thaumaturge.class, 0, false)); - if (w != null && !w.isRemote) { - this.setCombatTask(); - } + this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, Thaumaturge.class, 0, true)); + } + protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D); @@ -63,31 +52,22 @@ public class CrimsonArcher extends EntityCultist implements IRangedAttackMob { this.setCurrentItemOrArmor(3, new ItemStack(Integration.archerChest)); this.setCurrentItemOrArmor(2, new ItemStack(Integration.archerLegs)); this.setCurrentItemOrArmor(1, new ItemStack(ConfigItems.itemBootsCultist)); - this.setCurrentItemOrArmor(0, bow.copy()); - this.enchantEquipment(); + } + + @Override + protected void enchantEquipment() { + float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * f) { + EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + f * (float)this.rand.nextInt(18))); + } } protected boolean isAIEnabled() { return true; } - public void setCombatTask() { - this.tasks.removeTask(this.aiBlastAttack); - this.tasks.removeTask(this.aiMeleeAttack); - ItemStack itemstack = this.getHeldItem(); - if (itemstack != null && itemstack.getItem() == ConfigItems.itemBowBone) { - this.tasks.addTask(1, this.aiBlastAttack); - } else { - this.tasks.addTask(2, this.aiMeleeAttack); - } - } public void updateAITasks() { - if (this.updateAINextTick) { - this.updateAINextTick = false; - this.setCombatTask(); - } - super.updateAITasks(); if (this.ticksExisted % 40 == 0) { this.heal(1.0F); @@ -97,7 +77,6 @@ public class CrimsonArcher extends EntityCultist implements IRangedAttackMob { public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_) { this.addRandomArmor(); - this.tasks.addTask(1, this.aiBlastAttack); return super.onSpawnWithEgg(p_110161_1_); } @@ -105,58 +84,11 @@ public class CrimsonArcher extends EntityCultist implements IRangedAttackMob { return false; } - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float p_82196_2_) { - EntityPrimalArrow entityarrow = new EntityPrimalArrow(this.worldObj, this, 0.8F, this.worldObj.rand.nextInt(6)); - int i = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); - int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); - entityarrow.setDamage((double)(2.0 + this.worldObj.rand.nextInt(8))); - - if (i > 0) { - entityarrow.setDamage(entityarrow.getDamage() + (double)i * 0.5D + 0.5D); - } - - if (j > 0) { - entityarrow.setKnockbackStrength(j); - } - - if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0) { - entityarrow.setFire(100); - } - double d0 = entitylivingbase.posX + entitylivingbase.motionX - this.posX; - double d1 = entitylivingbase.posY - this.posY; - double d2 = entitylivingbase.posZ + entitylivingbase.motionZ - this.posZ; - - entityarrow.setThrowableHeading(d0, d1, d2, 1.5F, 1.0F); - - this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); - - this.worldObj.spawnEntityInWorld(entityarrow); - } - - @Override - protected String getLivingSound() { - return ThaumicConcilium.MODID+":chant"; - } - - @Override - protected String getDeathSound() { - return ThaumicConcilium.MODID+":growl"; - } - - protected float getSoundVolume() { - return 0.5F; - } - @Override protected float getSoundPitch() { return (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F; } - @Override - public int getTalkInterval() { - return 450; - } @Override protected void dropFewItems(boolean flag, int i) { @@ -184,8 +116,5 @@ public class CrimsonArcher extends EntityCultist implements IRangedAttackMob { public void readEntityFromNBT(NBTTagCompound p_70037_1_) { super.readEntityFromNBT(p_70037_1_); } - public void addEquipment(){ - this.addRandomArmor(); - } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPaladin.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPaladin.java index 83c870b..bd8e1a7 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPaladin.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPaladin.java @@ -1,6 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.CrimsonOrbEntity; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.EtherealShacklesEntity; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; @@ -111,6 +112,7 @@ public class CrimsonPaladin extends EntityCultist implements IRangedAttackMob { CrimsonOrbEntity orb = new CrimsonOrbEntity(worldObj, posX + look.xCoord, posY + this.getEyeHeight(), posZ + look.zCoord, look.xCoord, look.yCoord, look.zCoord, this); this.worldObj.spawnEntityInWorld(orb); this.swingItem(); + } } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonRanger.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonRanger.java index 3d86cd6..c0ed4b3 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonRanger.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonRanger.java @@ -1,33 +1,26 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; -import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.CrimsonOrbEntity; -import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.EtherealShacklesEntity; -import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.PositiveBurstOrbEntity; -import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ShardPowderEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.ai.CrimsonRangerAttackAI; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; -import fox.spiteful.forbidden.items.ForbiddenItems; -import net.minecraft.entity.*; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; import net.minecraft.world.World; import thaumcraft.common.config.ConfigItems; -import thaumcraft.common.entities.ai.combat.AILongRangeAttack; import thaumcraft.common.entities.monster.EntityCultist; -import thaumcraft.common.items.wands.ItemWandCasting; -public class CrimsonRanger extends EntityCultist implements IRangedAttackMob { +public class CrimsonRanger extends EntityCultist { public CrimsonRanger(World w) { super(w); this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(2, new AILongRangeAttack(this, 1.0, 0.3, 20, 40, 24.0F)); + this.tasks.addTask(2, new CrimsonRangerAttackAI(this, 0.25D, 20, 20.0F)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); @@ -58,6 +51,14 @@ public class CrimsonRanger extends EntityCultist implements IRangedAttackMob { this.setCurrentItemOrArmor(1, new ItemStack(ConfigItems.itemBootsCultist)); } + @Override + protected void enchantEquipment() { + float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ); + if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * f) { + EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + f * (float)this.rand.nextInt(18))); + } + } + protected boolean isAIEnabled() { return true; } @@ -72,63 +73,6 @@ public class CrimsonRanger extends EntityCultist implements IRangedAttackMob { return false; } - @Override - public boolean attackEntityAsMob(Entity p_70652_1_) { - float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - this.swingItem(); - return p_70652_1_.attackEntityFrom(DamageSource.causeMobDamage(this), f); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - if (!this.worldObj.isRemote) { - this.worldObj.playSoundAtEntity(this, "thaumcraft:ice", 0.3F, 0.8F + this.worldObj.rand.nextFloat() * 0.1F); - this.faceEntity(entitylivingbase, 100.0F, 100.0F); - Vec3 look = this.getLookVec(); - int orbs = 4 + worldObj.rand.nextInt(6); - for (int i = 0; i < orbs; i++) { - ShardPowderEntity orb = new ShardPowderEntity(this, this.posX + (look.xCoord) , this.posY + this.getEyeHeight() + (look.yCoord), this.posZ + (look.zCoord), worldObj.rand.nextInt(2)); - orb.posX -= (double) (Math.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); - orb.posY -= 0.5; - orb.posZ -= (double) (Math.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); - orb.setPosition(orb.posX, orb.posY, orb.posZ); - orb.yOffset = 0.0F; - float ff = 0.4F; - orb.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * ff); - orb.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * ff); - orb.motionY = (double)(-MathHelper.sin((this.rotationPitch) / 180.0F * (float)Math.PI) * ff); - float f2 = MathHelper.sqrt_double(orb.motionX * orb.motionX + orb.motionY * orb.motionY + orb.motionZ * orb.motionZ); - orb.motionX /= f2; - orb.motionY /= f2; - orb.motionZ /= f2; - orb.motionX += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double)12; - orb.motionY += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double)12; - orb.motionZ += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double)12; - this.worldObj.spawnEntityInWorld(orb); - } - } - this.swingItem(); - } - - @Override - protected String getLivingSound() { - return ThaumicConcilium.MODID+":chant"; - } - - @Override - protected String getDeathSound() { - return ThaumicConcilium.MODID+":growl"; - } - - protected float getSoundVolume() { - return 0.5F; - } - - @Override - public int getTalkInterval() { - return 450; - } - @Override protected void dropFewItems(boolean flag, int i) { int r = this.rand.nextInt(10); @@ -156,8 +100,4 @@ public class CrimsonRanger extends EntityCultist implements IRangedAttackMob { public void readEntityFromNBT(NBTTagCompound p_70037_1_) { super.readEntityFromNBT(p_70037_1_); } - public void addEquipment(){ - this.addRandomArmor(); - } - } \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Dissolved.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Dissolved.java index 99bd0f1..29458ee 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Dissolved.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Dissolved.java @@ -1,6 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; -import com.ilya3point999k.thaumicconcilium.common.entities.UpcomingHoleEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.UpcomingHoleEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; @@ -21,6 +22,7 @@ import thaumcraft.common.items.wands.foci.ItemFocusPortableHole; public class Dissolved extends EntityMob { public Dissolved(World w) { super(w); + super.isImmuneToFire = true; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(3, new EntityAIAttackOnCollide(this, EntityLivingBase.class, 0.4D, false)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.4D)); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/MadThaumaturge.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/MadThaumaturge.java index c03f905..9378949 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/MadThaumaturge.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/MadThaumaturge.java @@ -1,8 +1,10 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import com.ilya3point999k.thaumicconcilium.common.items.equipment.PontifexRobe; +import com.ilya3point999k.thaumicconcilium.common.registry.Thaumonomicon; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.SharedMonsterAttributes; @@ -18,7 +20,6 @@ import thaumcraft.common.entities.monster.EntityCultistKnight; import thaumcraft.common.lib.research.ResearchManager; public class MadThaumaturge extends EntityMob { - public MadThaumaturge(World w) { super(w); this.tasks.addTask(0, new EntityAISwimming(this)); @@ -172,13 +173,21 @@ public class MadThaumaturge extends EntityMob { if (d > 7) { int r = this.rand.nextInt(10); if (r <= 3) { - this.entityDropItem(ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "REFLECTIONFOCI", this.worldObj), 1.5f); + ItemStack scroll = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "REFLECTIONFOCI", this.worldObj); + scroll.getTagCompound().setBoolean(Thaumonomicon.reflectionHintTag, true); + this.entityDropItem(scroll, 1.5f); } else if (r <= 5) { - this.entityDropItem(ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "BOTTLEOFTHICKTAINT", this.worldObj), 1.5f); + ItemStack scroll = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "BOTTLEOFTHICKTAINT", this.worldObj); + scroll.getTagCompound().setBoolean(Thaumonomicon.thickTaintHintTag, true); + this.entityDropItem(scroll, 1.5f); } else if (r <= 7) { - this.entityDropItem(ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "RUNICWINDINGS", this.worldObj), 1.5f); + ItemStack scroll = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "RUNICWINDINGS", this.worldObj); + scroll.getTagCompound().setBoolean(Thaumonomicon.runicWindingsHintTag, true); + this.entityDropItem(scroll, 1.5f); } else { - this.entityDropItem(ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "DESTCRYSTAL", this.worldObj), 1.5f); + ItemStack scroll = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "DESTCRYSTAL", this.worldObj); + scroll.getTagCompound().setBoolean(Thaumonomicon.destCrystalHintTag, true); + this.entityDropItem(scroll, 1.5f); } } else { int r = this.rand.nextInt(2); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Overanimated.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Overanimated.java index bd982d5..3f69157 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Overanimated.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Overanimated.java @@ -1,6 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketFXBloodsplosion; import cpw.mods.fml.common.network.NetworkRegistry; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/QuicksilverElemental.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/QuicksilverElemental.java index ae7bbe6..75d771c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/QuicksilverElemental.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/QuicksilverElemental.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; -import com.ilya3point999k.thaumicconcilium.common.TCConfig; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.registry.TCBlockRegistry; import com.ilya3point999k.thaumicconcilium.common.tiles.QuicksilverCrucibleTile; import cpw.mods.fml.relauncher.ReflectionHelper; @@ -137,9 +137,11 @@ public class QuicksilverElemental extends EntityMob { if (((EntityLivingBase) e).getEntityAttribute(SharedMonsterAttributes.attackDamage) != null) { this.swingItem(); float f = (float) ((EntityLivingBase) e).getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + this.attackTime = 20; return e.attackEntityFrom(DamageSource.anvil, f); } else { this.swingItem(); + this.attackTime = 20; return e.attackEntityFrom(DamageSource.anvil, (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue()); } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Samurai.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Samurai.java index fe8f6d2..030f0a1 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Samurai.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Samurai.java @@ -2,6 +2,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.entities.ai.SamuraiAttackAI; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.Entity; @@ -25,8 +26,7 @@ public class Samurai extends EntityMob { public Samurai(World w) { super(w); this.tasks.addTask(0, new EntityAISwimming(this)); - //this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityLivingBase.class, 0.6D, false)); - this.tasks.addTask(2, new SamuraiAttackAI(this, EntityLivingBase.class, 0.8D, false)); + this.tasks.addTask(2, new SamuraiAttackAI(this, 0.25D, 40, 20.0F)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1D)); this.tasks.addTask(7, new EntityAIWander(this, 1D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); @@ -36,7 +36,7 @@ public class Samurai extends EntityMob { this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, Thaumaturge.class, 0, true)); this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityCultist.class, 0, true)); - this.setSize(1.0F, 2.0F); + this.setSize(1.0F, 1.8F); } @@ -204,9 +204,6 @@ public class Samurai extends EntityMob { @Override public void onUpdate() { - if (getAnger() > 0) { - this.setAnger(this.getAnger() - 1); - } super.onUpdate(); } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/SloppyAlchemist.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/SloppyAlchemist.java new file mode 100644 index 0000000..bbc5974 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/SloppyAlchemist.java @@ -0,0 +1,162 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.mobs; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.util.ParticleEffect; +import com.emoniph.witchery.util.SoundEffect; +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.ai.ImpDealTargetAI; +import com.ilya3point999k.thaumicconcilium.common.entities.ai.SloppyAlchemistAttackAI; +import com.ilya3point999k.thaumicconcilium.common.integration.Integration; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.*; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class SloppyAlchemist extends EntityMob { + boolean wasFreed = false; + + public SloppyAlchemist(World w) { + super(w); + this.setSize(1.0F, 0.8F); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(3, new SloppyAlchemistAttackAI(this, 0.22D, 1.1D, 60, 16.0F)); + this.tasks.addTask(4, new EntityAIWander(this, 1.0D)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); + this.tasks.addTask(5, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); + this.targetTasks.addTask(2, new ImpDealTargetAI(this)); + this.stepHeight = 1.0f; + this.isImmuneToFire = true; + } + + @Override + protected boolean interact(EntityPlayer player) { + if ((this.riddenByEntity instanceof Chort)) return true; + if (worldObj.isRemote) { + for (int i = 0; i < 20; i++) { + double x = posX + (rand.nextDouble() - 0.5D) * width; + double y = posY + rand.nextDouble() * height; + double z = posZ + (rand.nextDouble() - 0.5D) * width; + + worldObj.spawnParticle( + "flame", + x, y, z, + 0.0D, 0.02D, 0.0D + ); + } + if (wasFreed) { + player.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("tc.sloppy_alchemist.thanks" + (1 + worldObj.rand.nextInt(3))) + ).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED))); + } else { + player.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("tc.sloppy_alchemist.confused") + ).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED))); + } + } + + if (!player.worldObj.isRemote) { + this.playSound(ThaumicConcilium.MODID + ":breath", 1.0F, 1.0F); + if (!wasFreed){ + this.setDead(); + return true; + } + ItemStack reward; + int rand = worldObj.rand.nextInt(3); + switch (rand){ + case 0:{ + reward = Witchery.Items.GENERIC.itemInfernalBlood.createStack(worldObj.rand.nextInt(3) + 1); + break; + } + case 1:{ + reward = Witchery.Items.GENERIC.itemBloodWarm.createStack(worldObj.rand.nextInt(3) + 1); + break; + } + case 2:{ + if (Integration.bloodArsenal) { + reward = new ItemStack(Integration.bloodMoney, worldObj.rand.nextInt(3) + 1, 0); + } else { + reward = Witchery.Items.GENERIC.itemInfernalBlood.createStack(worldObj.rand.nextInt(3) + 1); + } + break; + } + default:{ + reward = Witchery.Items.GENERIC.itemInfernalBlood.createStack(worldObj.rand.nextInt(3) + 1); + break; + } + } + + if (!player.inventory.addItemStackToInventory(reward)){ + EntityItem f = new EntityItem(player.worldObj, this.posX, this.posY + 0.5, this.posZ, reward); + f.delayBeforeCanPickup = 40; + f.motionY += 0.3f; + worldObj.spawnEntityInWorld(f); + } + this.setDead(); + } + + return true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.28); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(25.0D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(8.0D); + } + + @Override + public IEntityLivingData onSpawnWithEgg(IEntityLivingData data) { + Chort chort = new Chort(this.worldObj); + chort.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + chort.onSpawnWithEgg(null); + this.worldObj.spawnEntityInWorld(chort); + chort.mountEntity(this); + this.dataWatcher.addObject(13, (byte) 1); + return super.onSpawnWithEgg(data); + } + + + @Override + protected void addRandomArmor() { + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (this.riddenByEntity instanceof Chort) { + this.wasFreed = true; + this.setSize(1.0F, 0.8F); + EntityLivingBase riderTarget = ((Chort) this.riddenByEntity).getAttackTarget(); + if (riderTarget != null) { + this.setAttackTarget(riderTarget); + } + } else { + this.setSize(0.5F, 1.8F); + } + } + + @Override + public boolean canPickUpLoot() { + return false; + } + + protected boolean isAIEnabled() { + return true; + } + + @Override + public double getMountedYOffset() { + return 0.3; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/ThaumGib.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/ThaumGib.java index 95a74e4..1752c07 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/ThaumGib.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/ThaumGib.java @@ -1,6 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -63,8 +64,10 @@ public class ThaumGib extends EntityMob { } } - setLocationAndAngles(parent.posX, parent.boundingBox.minY + f, parent.posZ, parent.rotationYaw, parent.rotationPitch); - MiscHelper.setEntityMotionFromVector(this, new Vector3(this.posX + (-0.5 + world.rand.nextGaussian()) * 2.0, this.posY, this.posZ + (-0.5 + world.rand.nextGaussian()) * 2.0), 0.5f); + if (parent != null) { + setLocationAndAngles(parent.posX, parent.boundingBox.minY + f, parent.posZ, parent.rotationYaw, parent.rotationPitch); + MiscHelper.setEntityMotionFromVector(this, new Vector3(this.posX + (-0.5 + world.rand.nextGaussian()) * 2.0, this.posY, this.posZ + (-0.5 + world.rand.nextGaussian()) * 2.0), 0.5f); + } } public byte getType() { diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/VengefulGolem.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/VengefulGolem.java index 0ab8b90..e8c4141 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/VengefulGolem.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/VengefulGolem.java @@ -1,6 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.mobs; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketEnslave; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/WitheredBotanist.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/WitheredBotanist.java deleted file mode 100644 index 559149f..0000000 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/WitheredBotanist.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.ilya3point999k.thaumicconcilium.common.entities.mobs; - -import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.registry.TCBlockRegistry; -import com.ilya3point999k.thaumicconcilium.common.tiles.RedPoweredMindTile; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import vazkii.botania.common.Botania; -import vazkii.botania.common.block.ModBlocks; - -import java.util.ArrayList; -import java.util.List; - -public class WitheredBotanist extends EntityLiving { - public WitheredBotanist(World world) { - super(world); - setSize(2.0F, 0.3F); - } - - public boolean canPickUpLoot() { - return false; - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - @Override - protected void addRandomArmor() { - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(0.5); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0); - } - - - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - return super.onSpawnWithEgg(par1EntityLivingData); - } - - @Override - public boolean attackEntityFrom(DamageSource source, float f) { - fertilize(); - this.setDead(); - return true; - } - - @Override - protected boolean interact(EntityPlayer p_70085_1_) { - fertilize(); - this.setDead(); - return true; - } - - public void fertilize(){ - final int range = 3; - if(!this.worldObj.isRemote) { - List validCoords = new ArrayList(); - - for(int i = -range - 1; i < range; i++) - for(int j = -range - 1; j < range; j++) { - for(int k = 2; k >= -2; k--) { - int x = MathHelper.floor_double(posX) + i + 1; - int y = MathHelper.floor_double(posY) + k + 1; - int z = MathHelper.floor_double(posZ) + j + 1; - if(this.worldObj.isAirBlock(x, y, z) && (!this.worldObj.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(this.worldObj, x, y, z)) - validCoords.add(new ChunkCoordinates(x, y, z)); - } - } - - int flowerCount = Math.min(validCoords.size(), this.worldObj.rand.nextBoolean() ? 3 : 4); - for(int i = 0; i < flowerCount; i++) { - ChunkCoordinates coords = validCoords.get(this.worldObj.rand.nextInt(validCoords.size())); - validCoords.remove(coords); - this.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, ModBlocks.flower, this.worldObj.rand.nextInt(16), 1 | 2); - } - } else { - ThaumicConcilium.proxy.leaves(this); - for(int i = 0; i < 15; i++) { - double x = MathHelper.floor_double(posX) - range + this.worldObj.rand.nextInt(range * 2 + 1) + Math.random(); - double y = MathHelper.floor_double(posY) + 1; - double z = MathHelper.floor_double(posZ) - range + this.worldObj.rand.nextInt(range * 2 + 1) + Math.random(); - float red = (float) Math.random(); - float green = (float) Math.random(); - float blue = (float) Math.random(); - Botania.proxy.wispFX(this.worldObj, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F); - } - } - } -} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/BrightestOne.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/boss/BrightestOne.java similarity index 99% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/BrightestOne.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/boss/BrightestOne.java index d27c052..d204a96 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/BrightestOne.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/boss/BrightestOne.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities.mobs; +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.Shadowbeam; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ShardPowderEntity; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPontifex.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/boss/CrimsonPontifex.java similarity index 99% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPontifex.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/boss/CrimsonPontifex.java index 7f6526d..7bffa63 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/CrimsonPontifex.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/boss/CrimsonPontifex.java @@ -1,6 +1,7 @@ -package com.ilya3point999k.thaumicconcilium.common.entities.mobs; +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.other.LesserPortal; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ConcentratedWarpChargeEntity; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; @@ -157,7 +158,7 @@ public class CrimsonPontifex extends EntityThaumcraftBoss implements IBossDispla } @Override - protected void addRandomArmor() { + public void addRandomArmor() { this.setCurrentItemOrArmor(0, new ItemStack(TCItemRegistry.pontifexHammer)); this.setCurrentItemOrArmor(4, new ItemStack(TCItemRegistry.pontifexHead)); this.setCurrentItemOrArmor(3, new ItemStack(TCItemRegistry.pontifexChest)); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/NetherExplorer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/NetherExplorer.java new file mode 100644 index 0000000..ac2702d --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/NetherExplorer.java @@ -0,0 +1,280 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse; + +import com.ilya3point999k.thaumicconcilium.common.entities.items.EntityItemFireResistant; +import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.common.Thaumcraft; +import thaumcraft.common.lib.network.PacketHandler; +import thaumcraft.common.lib.network.playerdata.PacketResearchComplete; + +import java.util.List; + +public class NetherExplorer extends EntityLiving { + private double speedMultiplier; + private int boatPosRotationIncrements; + private double boatX; + private double boatY; + private double boatZ; + public double boatYaw; + private double boatPitch; + @SideOnly(Side.CLIENT) + private double velocityX; + @SideOnly(Side.CLIENT) + private double velocityY; + @SideOnly(Side.CLIENT) + private double velocityZ; + + public NetherExplorer(World world) { + super(world); + super.isImmuneToFire = true; + setSize(2.0F, 0.3F); + } + + public boolean canPickUpLoot() { + return false; + } + + @Override + protected void entityInit() { + super.entityInit(); + } + + @Override + public boolean canBePushed() { + return true; + } + + @Override + protected boolean canTriggerWalking() { + return false; + } + + @Override + public void onUpdate() { + this.onEntityUpdate(); + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + final byte b0 = 5; + double d0 = 0.0; + for (int i = 0; i < b0; ++i) { + final double d2 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (i + 0) / b0 - 0.125; + final double d3 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (i + 1) / b0 - 0.125; + final AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, d2, this.boundingBox.minZ, this.boundingBox.maxX, d3, this.boundingBox.maxZ); + if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.water)) { + d0 += 1.0 / b0; + } + else if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.lava)) { + d0 += 1.0 / b0; + } + } + final double d4 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (this.worldObj.isRemote) { + if (this.boatPosRotationIncrements > 0) { + final double d5 = this.posX + (this.boatX - this.posX) / this.boatPosRotationIncrements; + final double d6 = this.posY + (this.boatY - this.posY) / this.boatPosRotationIncrements; + final double d11 = this.posZ + (this.boatZ - this.posZ) / this.boatPosRotationIncrements; + final double d12 = MathHelper.wrapAngleTo180_double(this.boatYaw - this.rotationYaw); + this.rotationYaw += (float)(d12 / this.boatPosRotationIncrements); + this.rotationPitch += (float)((this.boatPitch - this.rotationPitch) / this.boatPosRotationIncrements); + --this.boatPosRotationIncrements; + this.setPosition(d5, d6, d11); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else { + final double d5 = this.posX + this.motionX; + final double d6 = this.posY + this.motionY; + final double d11 = this.posZ + this.motionZ; + this.setPosition(d5, d6, d11); + if (this.onGround) { + this.motionX *= 0.5; + this.motionY *= 0.5; + this.motionZ *= 0.5; + } + this.motionX *= 0.9900000095367432; + this.motionY *= 0.949999988079071; + this.motionZ *= 0.9900000095367432; + } + } + else { + if (d0 < 1.0) { + final double d5 = d0 * 2.0 - 1.0; + this.motionY += 0.03999999910593033 * d5; + } + else { + if (this.motionY < 0.0) { + this.motionY /= 2.0; + } + this.motionY += 0.007000000216066837; + } + double d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d5 > 0.45) { + final double d6 = 0.45 / d5; + this.motionX *= d6; + this.motionZ *= d6; + d5 = 0.45; + } + if (d5 > d4 && this.speedMultiplier < 0.5) { + this.speedMultiplier += (0.5 - this.speedMultiplier) / 50.0; + if (this.speedMultiplier > 0.5) { + this.speedMultiplier = 0.5; + } + } + else { + this.speedMultiplier -= (this.speedMultiplier - 0.1) / 50.0; + if (this.speedMultiplier < 0.1) { + this.speedMultiplier = 0.1; + } + } + if (this.onGround) { + this.motionX *= 0.5; + this.motionY *= 0.5; + this.motionZ *= 0.5; + } + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9900000095367432; + this.motionY *= 0.949999988079071; + this.motionZ *= 0.9900000095367432; + this.rotationPitch = 0.0f; + double d6 = this.rotationYaw; + final double d11 = this.prevPosX - this.posX; + final double d12 = this.prevPosZ - this.posZ; + if (d11 * d11 + d12 * d12 > 0.001) { + d6 = (float)(Math.atan2(d12, d11) * 180.0 / 3.141592653589793); + } + double d13 = MathHelper.wrapAngleTo180_double(d6 - this.rotationYaw); + if (d13 > 20.0) { + d13 = 20.0; + } + if (d13 < -20.0) { + d13 = -20.0; + } + this.setRotation(this.rotationYaw += (float)d13, this.rotationPitch); + if (!this.worldObj.isRemote) { + final List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, this.boundingBox.expand(0.20000000298023224, 0.0, 0.20000000298023224)); + if (list != null && !list.isEmpty()) { + for (int k2 = 0; k2 < list.size(); ++k2) { + final Entity entity = (Entity) list.get(k2); + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityBoat) { + entity.applyEntityCollision((Entity)this); + } + } + } + } + } + } + protected void updateFallState(final double p_70064_1_, final boolean p_70064_3_) { + final int i = MathHelper.floor_double(this.posX); + final int j = MathHelper.floor_double(this.posY); + final int k = MathHelper.floor_double(this.posZ); + if (!p_70064_3_) { + if (this.worldObj.getBlock(i, j - 1, k).getMaterial() != Material.water && this.worldObj.getBlock(i, j - 1, k).getMaterial() != Material.lava && p_70064_1_ < 0.0) { + this.fallDistance -= (float)p_70064_1_; + } + } + } + + + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(final double p_70056_1_, final double p_70056_3_, final double p_70056_5_, final float p_70056_7_, final float p_70056_8_, final int p_70056_9_) { + this.boatPosRotationIncrements = p_70056_9_ + 5; + + this.boatX = p_70056_1_; + this.boatY = p_70056_3_; + this.boatZ = p_70056_5_; + this.boatYaw = p_70056_7_; + this.boatPitch = p_70056_8_; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + @SideOnly(Side.CLIENT) + public void setVelocity(final double p_70016_1_, final double p_70016_3_, final double p_70016_5_) { + this.motionX = p_70016_1_; + this.velocityX = p_70016_1_; + this.motionY = p_70016_3_; + this.velocityY = p_70016_3_; + this.motionZ = p_70016_5_; + this.velocityZ = p_70016_5_; + } + + @Override + protected void addRandomArmor() { + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(0.5); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0); + } + + @Override + public boolean getCanSpawnHere() { + return true; + } + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { + par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); + return super.onSpawnWithEgg(par1EntityLivingData); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float f) { + if (!this.worldObj.isRemote) { + EntityItemFireResistant item = new EntityItemFireResistant(this.worldObj, this.posX, this.posY + 0.5, this.posZ, new ItemStack(TCItemRegistry.resource, 1, 4)); + item.motionY += 0.3f; + item.delayBeforeCanPickup = 40; + worldObj.spawnEntityInWorld(item); + this.setDead(); + if (source.getSourceOfDamage() instanceof EntityPlayer){ + EntityPlayer player = (EntityPlayer) source.getSourceOfDamage(); + if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "NETHER_MEMBRANE")) { + Thaumcraft.proxy.getResearchManager().completeResearch(player, "NETHER_MEMBRANE"); + PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("NETHER_MEMBRANE"), (EntityPlayerMP) player); + player.worldObj.playSoundAtEntity(player, "thaumcraft:heartbeat", 1.0F, 1.0F); + } + } + } + return true; + } + + @Override + protected boolean interact(EntityPlayer player) { + if (!player.worldObj.isRemote) { + if (!player.inventory.addItemStackToInventory(new ItemStack(TCItemRegistry.resource, 1, 4))){ + EntityItemFireResistant f = new EntityItemFireResistant(player.worldObj, this.posX, this.posY + 0.5, this.posZ, new ItemStack(TCItemRegistry.resource, 1, 4)); + f.motionY += 0.3f; + f.delayBeforeCanPickup = 40; + worldObj.spawnEntityInWorld(f); + } + if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "NETHER_MEMBRANE")) { + Thaumcraft.proxy.getResearchManager().completeResearch(player, "NETHER_MEMBRANE"); + PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("NETHER_MEMBRANE"), (EntityPlayerMP) player); + player.worldObj.playSoundAtEntity(player, "thaumcraft:heartbeat", 1.0F, 1.0F); + } + this.setDead(); + } + return true; + } + + @Override + public boolean canBreatheUnderwater() { + return true; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/Protolimb.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/Protolimb.java new file mode 100644 index 0000000..d7ca318 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/Protolimb.java @@ -0,0 +1,136 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse; + +import com.ilya3point999k.thaumicconcilium.common.TCPlayerCapabilities; +import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import thaumcraft.api.ThaumcraftApiHelper; +import thaumcraft.common.Thaumcraft; +import thaumcraft.common.lib.network.PacketHandler; +import thaumcraft.common.lib.network.playerdata.PacketResearchComplete; + +public class Protolimb extends EntityFlying implements IMob { + private double targetX, targetY, targetZ; + public int innerRotation; + EntityPlayer target; + public Protolimb(World world) { + super(world); + this.setSize(0.6F, 0.5F); + this.experienceValue = 0; + this.isImmuneToFire = true; + innerRotation = this.rand.nextInt(100000); + } + + public Protolimb(World world, int gibType) { + this(world); + setType(gibType); + } + + @Override + protected void entityInit() { + super.entityInit(); + this.dataWatcher.addObject(13, new Byte((byte) 0)); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1D); + } + + @Override + public void onUpdate() { + super.onUpdate(); + ++this.innerRotation; + + if (target == null) { + target = this.worldObj.getClosestPlayerToEntity(this, 16.0D); + } + + if (target != null) { + double dx = this.posX - target.posX; + double dz = this.posZ - target.posZ; + double dist = MathHelper.sqrt_double(dx * dx + dz * dz); + if (dist < 4.0D) { + targetX += dx / dist * 4; + targetZ += dz / dist * 4; + targetY += (this.posY - target.posY) * 0.5; + } + } + + double dx = targetX - this.posX; + double dy = targetY - this.posY; + double dz = targetZ - this.posZ; + this.motionX += (Math.signum(dx) * 0.1 - this.motionX) * 0.1; + this.motionY += (Math.signum(dy) * 0.1 - this.motionY) * 0.1; + this.motionZ += (Math.signum(dz) * 0.1 - this.motionZ) * 0.1; + + if (this.rand.nextInt(100) == 0 || Math.abs(dx) < 1 && Math.abs(dy) < 1 && Math.abs(dz) < 1) { + targetX = this.posX + (rand.nextDouble() - 0.5) * 16; + targetY = this.posY + (rand.nextDouble() - 0.5) * 8; + targetZ = this.posZ + (rand.nextDouble() - 0.5) * 16; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + @Override + public void onCollideWithPlayer(EntityPlayer player) { + if (player == null) return; + if (worldObj.isRemote) return; + TCPlayerCapabilities capabilities = TCPlayerCapabilities.get(player); + capabilities.protolimbs++; + capabilities.sync(); + if (capabilities.protolimbs == 6) { + if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "SOLIDVOID")) { + Thaumcraft.proxy.getResearchManager().completeResearch(player, "SOLIDVOID"); + PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("SOLIDVOID"), (EntityPlayerMP) player); + player.worldObj.playSoundAtEntity(player, "thaumcraft:heartbeat", 1.0F, 1.0F); + } + } + Thaumcraft.proxy.burst(this.worldObj, this.posX, this.posY, this.posZ, 2.0F); + this.playSound("thaumcraft:craftfail", 1.0F, 1.0F); + this.setDead(); + } + + public byte getType() { + return this.dataWatcher.getWatchableObjectByte(13); + } + + public void setType(int par1) { + this.dataWatcher.updateObject(13, (byte) par1); + } + + public boolean canPickUpLoot() { + return false; + } + + @Override + protected void updateFallState(double p_updateFallState_1_, boolean p_updateFallState_3_) { + } + + @Override + public boolean doesEntityNotTriggerPressurePlate() { + return true; + } + + @Override + protected boolean canTriggerWalking() { return false; } + + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setByte("Type", (byte) getType()); + } + + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) { + super.readEntityFromNBT(p_70037_1_); + setType(p_70037_1_.getByte("Type")); + } + +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/WitheredBotanist.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/WitheredBotanist.java new file mode 100644 index 0000000..95b270a --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/corpse/WitheredBotanist.java @@ -0,0 +1,282 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse; + +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.integration.Integration; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.IEntityLivingData; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import vazkii.botania.common.Botania; +import vazkii.botania.common.block.ModBlocks; + +import java.util.ArrayList; +import java.util.List; + +public class WitheredBotanist extends EntityLiving { + private double speedMultiplier; + private int boatPosRotationIncrements; + private double boatX; + private double boatY; + private double boatZ; + public double boatYaw; + private double boatPitch; + @SideOnly(Side.CLIENT) + private double velocityX; + @SideOnly(Side.CLIENT) + private double velocityY; + @SideOnly(Side.CLIENT) + private double velocityZ; + + public WitheredBotanist(World world) { + super(world); + setSize(2.0F, 0.3F); + } + + public boolean canPickUpLoot() { + return false; + } + + @Override + protected void entityInit() { + super.entityInit(); + } + @Override + public boolean canBePushed() { + return true; + } + + @Override + protected boolean canTriggerWalking() { + return false; + } + + @Override + public void onUpdate() { + this.onEntityUpdate(); + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + final byte b0 = 5; + double d0 = 0.0; + for (int i = 0; i < b0; ++i) { + final double d2 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (i + 0) / b0 - 0.125; + final double d3 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (i + 1) / b0 - 0.125; + final AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(this.boundingBox.minX, d2, this.boundingBox.minZ, this.boundingBox.maxX, d3, this.boundingBox.maxZ); + if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.water)) { + d0 += 1.0 / b0; + } + else if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.lava)) { + d0 += 1.0 / b0; + } + } + final double d4 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (this.worldObj.isRemote) { + if (this.boatPosRotationIncrements > 0) { + final double d5 = this.posX + (this.boatX - this.posX) / this.boatPosRotationIncrements; + final double d6 = this.posY + (this.boatY - this.posY) / this.boatPosRotationIncrements; + final double d11 = this.posZ + (this.boatZ - this.posZ) / this.boatPosRotationIncrements; + final double d12 = MathHelper.wrapAngleTo180_double(this.boatYaw - this.rotationYaw); + this.rotationYaw += (float)(d12 / this.boatPosRotationIncrements); + this.rotationPitch += (float)((this.boatPitch - this.rotationPitch) / this.boatPosRotationIncrements); + --this.boatPosRotationIncrements; + this.setPosition(d5, d6, d11); + this.setRotation(this.rotationYaw, this.rotationPitch); + } + else { + final double d5 = this.posX + this.motionX; + final double d6 = this.posY + this.motionY; + final double d11 = this.posZ + this.motionZ; + this.setPosition(d5, d6, d11); + if (this.onGround) { + this.motionX *= 0.5; + this.motionY *= 0.5; + this.motionZ *= 0.5; + } + this.motionX *= 0.9900000095367432; + this.motionY *= 0.949999988079071; + this.motionZ *= 0.9900000095367432; + } + } + else { + if (d0 < 1.0) { + final double d5 = d0 * 2.0 - 1.0; + this.motionY += 0.03999999910593033 * d5; + } + else { + if (this.motionY < 0.0) { + this.motionY /= 2.0; + } + this.motionY += 0.007000000216066837; + } + double d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + if (d5 > 0.45) { + final double d6 = 0.45 / d5; + this.motionX *= d6; + this.motionZ *= d6; + d5 = 0.45; + } + if (d5 > d4 && this.speedMultiplier < 0.5) { + this.speedMultiplier += (0.5 - this.speedMultiplier) / 50.0; + if (this.speedMultiplier > 0.5) { + this.speedMultiplier = 0.5; + } + } + else { + this.speedMultiplier -= (this.speedMultiplier - 0.1) / 50.0; + if (this.speedMultiplier < 0.1) { + this.speedMultiplier = 0.1; + } + } + if (this.onGround) { + this.motionX *= 0.5; + this.motionY *= 0.5; + this.motionZ *= 0.5; + } + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9900000095367432; + this.motionY *= 0.949999988079071; + this.motionZ *= 0.9900000095367432; + this.rotationPitch = 0.0f; + double d6 = this.rotationYaw; + final double d11 = this.prevPosX - this.posX; + final double d12 = this.prevPosZ - this.posZ; + if (d11 * d11 + d12 * d12 > 0.001) { + d6 = (float)(Math.atan2(d12, d11) * 180.0 / 3.141592653589793); + } + double d13 = MathHelper.wrapAngleTo180_double(d6 - this.rotationYaw); + if (d13 > 20.0) { + d13 = 20.0; + } + if (d13 < -20.0) { + d13 = -20.0; + } + this.setRotation(this.rotationYaw += (float)d13, this.rotationPitch); + if (!this.worldObj.isRemote) { + final List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)this, this.boundingBox.expand(0.20000000298023224, 0.0, 0.20000000298023224)); + if (list != null && !list.isEmpty()) { + for (int k2 = 0; k2 < list.size(); ++k2) { + final Entity entity = (Entity) list.get(k2); + if (entity != this.riddenByEntity && entity.canBePushed() && entity instanceof EntityBoat) { + entity.applyEntityCollision((Entity)this); + } + } + } + } + } + } + protected void updateFallState(final double p_70064_1_, final boolean p_70064_3_) { + final int i = MathHelper.floor_double(this.posX); + final int j = MathHelper.floor_double(this.posY); + final int k = MathHelper.floor_double(this.posZ); + if (!p_70064_3_) { + if (this.worldObj.getBlock(i, j - 1, k).getMaterial() != Material.water && this.worldObj.getBlock(i, j - 1, k).getMaterial() != Material.lava && p_70064_1_ < 0.0) { + this.fallDistance -= (float)p_70064_1_; + } + } + } + + + @SideOnly(Side.CLIENT) + public void setPositionAndRotation2(final double p_70056_1_, final double p_70056_3_, final double p_70056_5_, final float p_70056_7_, final float p_70056_8_, final int p_70056_9_) { + this.boatPosRotationIncrements = p_70056_9_ + 5; + + this.boatX = p_70056_1_; + this.boatY = p_70056_3_; + this.boatZ = p_70056_5_; + this.boatYaw = p_70056_7_; + this.boatPitch = p_70056_8_; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + + @SideOnly(Side.CLIENT) + public void setVelocity(final double p_70016_1_, final double p_70016_3_, final double p_70016_5_) { + this.motionX = p_70016_1_; + this.velocityX = p_70016_1_; + this.motionY = p_70016_3_; + this.velocityY = p_70016_3_; + this.motionZ = p_70016_5_; + this.velocityZ = p_70016_5_; + } + @Override + protected void addRandomArmor() { + } + + @Override + public boolean getCanSpawnHere() { + return (this.worldObj.provider.dimensionId == Integration.alfheimDimension || this.worldObj.provider.dimensionId == 0) && worldObj.getEntitiesWithinAABB(WitheredBotanist.class, this.boundingBox.expand(32.0, 32.0, 32.0)).isEmpty() && super.getCanSpawnHere(); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(0.5); + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.0); + } + + + public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { + par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); + return super.onSpawnWithEgg(par1EntityLivingData); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float f) { + fertilize(); + return true; + } + + @Override + protected boolean interact(EntityPlayer player) { + fertilize(); + return true; + } + + public void fertilize(){ + final int range = 3; + if(!this.worldObj.isRemote) { + List validCoords = new ArrayList(); + + for(int i = -range - 1; i < range; i++) + for(int j = -range - 1; j < range; j++) { + for(int k = 2; k >= -2; k--) { + int x = MathHelper.floor_double(posX) + i + 1; + int y = MathHelper.floor_double(posY) + k + 1; + int z = MathHelper.floor_double(posZ) + j + 1; + if(this.worldObj.isAirBlock(x, y, z) && (!this.worldObj.provider.hasNoSky || y < 255) && ModBlocks.flower.canBlockStay(this.worldObj, x, y, z)) + validCoords.add(new ChunkCoordinates(x, y, z)); + } + } + + int flowerCount = Math.min(validCoords.size(), this.worldObj.rand.nextBoolean() ? 3 : 4); + for(int i = 0; i < flowerCount; i++) { + ChunkCoordinates coords = validCoords.get(this.worldObj.rand.nextInt(validCoords.size())); + validCoords.remove(coords); + this.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, ModBlocks.flower, this.worldObj.rand.nextInt(16), 1 | 2); + } + this.worldObj.playSoundAtEntity(this, "thaumcraft:wind", 0.5F, 0.9F + this.worldObj.rand.nextFloat() * 0.2F); + this.setDead(); + } else { + ThaumicConcilium.proxy.leaves(this); + for(int i = 0; i < 15; i++) { + double x = MathHelper.floor_double(posX) - range + this.worldObj.rand.nextInt(range * 2 + 1) + Math.random(); + double y = MathHelper.floor_double(posY) + 1; + double z = MathHelper.floor_double(posZ) - range + this.worldObj.rand.nextInt(range * 2 + 1) + Math.random(); + float red = (float) Math.random(); + float green = (float) Math.random(); + float blue = (float) Math.random(); + Botania.proxy.wispFX(this.worldObj, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ContainerThaumaturge.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/ContainerThaumaturge.java similarity index 75% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ContainerThaumaturge.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/ContainerThaumaturge.java index be261ed..04ba16e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/ContainerThaumaturge.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/ContainerThaumaturge.java @@ -1,6 +1,6 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Thaumaturge; +import com.ilya3point999k.thaumicconcilium.common.registry.Thaumonomicon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.item.EntityItem; @@ -10,6 +10,10 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import net.minecraft.world.World; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.container.SlotOutput; @@ -85,24 +89,32 @@ public class ContainerThaumaturge extends Container { switch (choise){ case 0: research = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "VISCONDUCTOR", this.theWorld); + research.getTagCompound().setBoolean(Thaumonomicon.visConductorHintTag, true); this.mergeItemStack(research, 1, 5, false); this.inventory.decrStackSize(0, 1); + this.player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tc.thaumaturge.trade." + (theWorld.rand.nextInt(3) + 1))).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE))); break; case 1: case 2: research = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "POSITIVEBURSTFOCI", this.theWorld); + research.getTagCompound().setBoolean(Thaumonomicon.positiveBurstHintTag, true); this.mergeItemStack(research, 1, 5, false); this.inventory.decrStackSize(0, 1); + this.player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tc.thaumaturge.trade." + (theWorld.rand.nextInt(3) + 1))).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE))); break; case 3: research = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "IMPULSEFOCI", this.theWorld); + research.getTagCompound().setBoolean(Thaumonomicon.impulseHintTag, true); this.mergeItemStack(research, 1, 5, false); this.inventory.decrStackSize(0, 1); + this.player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tc.thaumaturge.trade." + (theWorld.rand.nextInt(3) + 1))).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE))); break; default: research = ResearchManager.createNote(new ItemStack(ConfigItems.itemResearchNotes), "VISCONDUCTOR", this.theWorld); + research.getTagCompound().setBoolean(Thaumonomicon.visConductorHintTag, true); this.mergeItemStack(research, 1, 5, false); this.inventory.decrStackSize(0, 1); + this.player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tc.thaumaturge.trade." + (theWorld.rand.nextInt(3) + 1))).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE))); break; } return; @@ -111,20 +123,12 @@ public class ContainerThaumaturge extends Container { } int value = this.thaumaturge.getValue(this.inventory.getStackInSlot(0)); - /*if (this.theWorld.rand.nextInt(100) <= value / 2) { - this.pech.setTamed(false); - this.pech.updateAINextTick = true; - this.pech.playSound("thaumcraft:pech_trade", 0.4F, 1.0F); - } - */ - if (this.theWorld.rand.nextInt(5) == 0) { value += this.theWorld.rand.nextInt(2); } else if (this.theWorld.rand.nextBoolean()) { value -= this.theWorld.rand.nextInt(2); } - //Thaumaturge var10000 = this.thaumaturge; ArrayList pos = Thaumaturge.tradeInventory; int sum_of_weight = 0; @@ -144,67 +148,6 @@ public class ContainerThaumaturge extends Container { } rnd -= (Integer)pos.get(i).get(0); } - /* - while(true) { - while(value > 0) { - int am = Math.min(5, Math.max((value + 1) / 2, this.theWorld.rand.nextInt(value) + 1)); - value -= am; - if (am == 1 && this.theWorld.rand.nextBoolean() && this.hasStuffInPack()) { - ArrayList loot = new ArrayList(); - - int r; - for(r = 0; r < this.thaumaturge.loot.length; ++r) { - if (this.thaumaturge.loot[r] != null && this.thaumaturge.loot[r].stackSize > 0) { - loot.add(r); - } - } - - r = (Integer)loot.get(this.theWorld.rand.nextInt(loot.size())); - ItemStack is = this.thaumaturge.loot[r].copy(); - is.stackSize = 1; - this.mergeItemStack(is, 1, 5, false); - --this.thaumaturge.loot[r].stackSize; - if (this.thaumaturge.loot[r].stackSize <= 0) { - this.thaumaturge.loot[r] = null; - } - } else { - ItemStack is; - if (am >= 4 && this.theWorld.rand.nextBoolean()) { - WeightedRandomChestContent[] contents = this.chest.getItems(this.theWorld.rand); - is = null; - int cc = 0; - - WeightedRandomChestContent wc; - do { - wc = contents[this.theWorld.rand.nextInt(contents.length)]; - ++cc; - } while(cc < 50 && (wc.theItemId == null || wc.itemWeight > 5 || wc.theMaximumChanceToGenerateItem > 1)); - - if (wc != null && wc.theItemId != null) { - is = wc.theItemId.copy(); - is.onCrafting(this.theWorld, this.player, 0); - this.mergeItemStack(is, 1, 5, false); - } else { - value += am; - } - } else { - List it = null; - - do { - it = (List)pos.get(this.theWorld.rand.nextInt(pos.size())); - } while((Integer)it.get(0) != am); - - is = ((ItemStack)it.get(1)).copy(); - is.onCrafting(this.theWorld, this.player, 0); - this.mergeItemStack(is, 1, 5, false); - } - } - } - - this.inventory.decrStackSize(0, 1); - break; - } - */ } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/InventoryThaumaturge.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/InventoryThaumaturge.java similarity index 95% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/InventoryThaumaturge.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/InventoryThaumaturge.java index 259b84c..71b68a3 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/InventoryThaumaturge.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/InventoryThaumaturge.java @@ -1,6 +1,5 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Thaumaturge; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Thaumaturge.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/Thaumaturge.java similarity index 99% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Thaumaturge.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/Thaumaturge.java index 182d356..20e4570 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/Thaumaturge.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/thaumaturge/Thaumaturge.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities.mobs; +package com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import fox.spiteful.forbidden.items.ForbiddenItems; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/DopeSquid.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/DopeSquid.java similarity index 97% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/DopeSquid.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/DopeSquid.java index 7ab519c..0320d16 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/DopeSquid.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/DopeSquid.java @@ -1,5 +1,6 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.other; +import com.ilya3point999k.thaumicconcilium.common.integration.BasesIntegration; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityAgeable; @@ -192,13 +193,12 @@ public class DopeSquid extends EntityTameable { charge--; } if (!this.worldObj.isRemote) { - //System.out.println(getTobacco()); if (owner instanceof EntityPlayer && owner.dimension == this.dimension) { if (ticksExisted % 400 == 0){ EntityPlayer player = (EntityPlayer) owner; final int warp = Thaumcraft.proxy.getPlayerKnowledge().getWarpTemp(player.getCommandSenderName()); if (warp >= 10){ - Integration.tobacco.performTobaccoEffect(player, getTobacco(), false); + BasesIntegration.tobacco.performTobaccoEffect(player, getTobacco(), false); Thaumcraft.addWarpToPlayer(player, -10, true); } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/GolemBydlo.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/GolemBydlo.java similarity index 99% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/GolemBydlo.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/GolemBydlo.java index f51ec4e..3ea5a00 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/GolemBydlo.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/GolemBydlo.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.other; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.WrathAttractionFoci; import net.minecraft.block.Block; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/LesserPortal.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/LesserPortal.java similarity index 95% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/LesserPortal.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/LesserPortal.java index 20697e9..a198e3b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/LesserPortal.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/LesserPortal.java @@ -1,5 +1,9 @@ -package com.ilya3point999k.thaumicconcilium.common.entities.mobs; +package com.ilya3point999k.thaumicconcilium.common.entities.other; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonArcher; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonPaladin; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonRanger; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.CrimsonPontifex; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/MaterialPeeler.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/MaterialPeeler.java similarity index 97% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/MaterialPeeler.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/MaterialPeeler.java index 9ea7572..f154d93 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/MaterialPeeler.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/MaterialPeeler.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.other; import com.ilya3point999k.thaumicconcilium.common.TCPlayerCapabilities; import com.ilya3point999k.thaumicconcilium.common.tiles.HexOfPredictabilityTile; @@ -22,6 +22,7 @@ public class MaterialPeeler extends Entity { super(w); setSize(1.0f, 1.0f); innerRotation = this.rand.nextInt(100000); + this.isImmuneToFire = true; } @Override diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/RedPoweredMind.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/RedPoweredMind.java similarity index 94% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/RedPoweredMind.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/RedPoweredMind.java index 61b1b46..b921455 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/mobs/RedPoweredMind.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/RedPoweredMind.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.entities.mobs; +package com.ilya3point999k.thaumicconcilium.common.entities.other; import com.ilya3point999k.thaumicconcilium.common.registry.TCBlockRegistry; import com.ilya3point999k.thaumicconcilium.common.tiles.RedPoweredMindTile; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/RiftEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/RiftEntity.java similarity index 94% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/RiftEntity.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/RiftEntity.java index aa5ef81..f90f84d 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/RiftEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/other/RiftEntity.java @@ -1,9 +1,8 @@ -package com.ilya3point999k.thaumicconcilium.common.entities; +package com.ilya3point999k.thaumicconcilium.common.entities.other; import com.ilya3point999k.thaumicconcilium.common.TCConfig; import com.ilya3point999k.thaumicconcilium.common.dim.CausalBouillonTeleporter; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.BrightestOne; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.LesserPortal; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.BrightestOne; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ChargedWispEntity; import com.ilya3point999k.thaumicconcilium.common.items.PolishmentDevice; import com.ilya3point999k.thaumicconcilium.common.items.RiftGem; @@ -32,6 +31,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.codechicken.lib.vec.Vector3; @@ -45,6 +45,7 @@ import thaumcraft.common.lib.network.fx.PacketFXBlockZap; import thaumcraft.common.lib.utils.EntityUtils; import thaumcraft.common.lib.utils.Utils; import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; +import thaumcraft.common.tiles.TileEldritchPortal; import thaumcraft.common.tiles.TileNode; import java.util.ArrayList; @@ -299,29 +300,32 @@ public class RiftEntity extends Entity implements IEntityAdditionalSpawnData { if (e instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) e; - if (this.interdimensional) { + if (this.interdimensional && player instanceof EntityPlayerMP) { EntityPlayerMP p = (EntityPlayerMP) player; if (player.getHeldItem() != null) { if (player.getHeldItem().getItem() instanceof RiftGem) { ItemStack gem = player.getHeldItem(); if (p.ridingEntity == null && p.riddenByEntity == null) { - MinecraftServer mServer = FMLCommonHandler.instance().getMinecraftServerInstance(); - if (p.timeUntilPortal > 0) { - p.timeUntilPortal = 100; - } else if (p.dimension != TCConfig.causalBouillonID) { - p.timeUntilPortal = 100; - p.mcServer.getConfigurationManager().transferPlayerToDimension(p, TCConfig.causalBouillonID, new CausalBouillonTeleporter(mServer.worldServerForDimension(TCConfig.causalBouillonID), false)); + MinecraftServer server = MinecraftServer.getServer(); + if (p.dimension != TCConfig.causalBouillonID) { + WorldServer dest = server.worldServerForDimension(TCConfig.causalBouillonID); + if (p.worldObj.provider.dimensionId == 1) { + p.worldObj.removeEntity(player); + p.playerConqueredTheEnd = true; + EntityPlayerMP respawnedPlayer = server.getConfigurationManager().respawnPlayer(p, TCConfig.causalBouillonID, true); + p.playerNetServerHandler.playerEntity = respawnedPlayer; + p = respawnedPlayer; + } + p.mcServer.getConfigurationManager().transferPlayerToDimension(p, TCConfig.causalBouillonID, new CausalBouillonTeleporter(dest, false)); } else { - p.timeUntilPortal = 100; NBTTagCompound tag = gem.getTagCompound(); if (tag == null) { - p.mcServer.getConfigurationManager().transferPlayerToDimension(p, 0, new CausalBouillonTeleporter(mServer.worldServerForDimension(0), false)); - } else { - if (tag.hasKey("CURR")) { - if (tag.getInteger("CURR") != -1) { - p.mcServer.getConfigurationManager().transferPlayerToDimension(p, tag.getInteger("DIM" + tag.getInteger("CURR")), new CausalBouillonTeleporter(mServer.worldServerForDimension(0), tag.getBoolean("REVERSE"))); - } - } + WorldServer dest = server.worldServerForDimension(0); + p.mcServer.getConfigurationManager().transferPlayerToDimension(p, 0, new CausalBouillonTeleporter(dest, false)); + } else if (tag.hasKey("CURR") && tag.getInteger("CURR") != -1) { + int destDim = tag.getInteger("DIM" + tag.getInteger("CURR")); + WorldServer dest = server.worldServerForDimension(destDim); + p.mcServer.getConfigurationManager().transferPlayerToDimension(p, destDim, new CausalBouillonTeleporter(dest, tag.getBoolean("REVERSE"))); } } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfClearWaterEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfClearWaterEntity.java index 9581954..5604f2b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfClearWaterEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfClearWaterEntity.java @@ -1,5 +1,6 @@ package com.ilya3point999k.thaumicconcilium.common.entities.projectiles; +import net.minecraft.block.BlockFire; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityBlaze; @@ -8,7 +9,6 @@ import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.DamageSource; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import thaumcraft.common.lib.network.PacketHandler; import java.util.List; @@ -28,6 +28,7 @@ public class BottleOfClearWaterEntity extends EntityThrowable { protected float getGravityVelocity() { return 0.05F; } + protected float func_70182_d() { return 0.5F; } @@ -46,6 +47,16 @@ public class BottleOfClearWaterEntity extends EntityThrowable { e.attackEntityFrom(DamageSource.causeMobDamage(this.getThrower()), 10.0f); } } + for (int x = -3; x < 3; x++){ + for (int z = -3; z < 3; z++){ + if (worldObj.getBlock(mop.blockX + x, mop.blockY, mop.blockZ + z) instanceof BlockFire){ + worldObj.setBlockToAir(mop.blockX + x, mop.blockY, mop.blockZ + z); + } + if (worldObj.getBlock(mop.blockX + x, mop.blockY + 1, mop.blockZ + z) instanceof BlockFire){ + worldObj.setBlockToAir(mop.blockX + x, mop.blockY + 1, mop.blockZ + z); + } + } + } this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); } this.setDead(); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfThickTaintEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfThickTaintEntity.java index a4cfd5c..f31fcf6 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfThickTaintEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/BottleOfThickTaintEntity.java @@ -1,20 +1,15 @@ package com.ilya3point999k.thaumicconcilium.common.entities.projectiles; -import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.Util; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; import thaumcraft.api.entities.ITaintedMob; import thaumcraft.common.Thaumcraft; import thaumcraft.common.config.Config; import thaumcraft.common.config.ConfigBlocks; -import thaumcraft.common.entities.EntityAspectOrb; import thaumcraft.common.lib.utils.Utils; import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChargedWispEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChargedWispEntity.java index 33366e1..9462a06 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChargedWispEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChargedWispEntity.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.common.entities.projectiles; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.BrightestOne; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.BrightestOne; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChortSpitEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChortSpitEntity.java new file mode 100644 index 0000000..d376df3 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ChortSpitEntity.java @@ -0,0 +1,61 @@ +package com.ilya3point999k.thaumicconcilium.common.entities.projectiles; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +public class ChortSpitEntity extends EntityThrowable { + + public ChortSpitEntity(World w){ + super(w); + } + + public ChortSpitEntity(World w, EntityLivingBase thrower) { + super(w, thrower); + } + + public ChortSpitEntity(World world, double x, double y, double z) { + super(world, x, y, z); + } + + public ChortSpitEntity(World world, EntityLivingBase thrower, EntityLivingBase target, float yawOffsetDeg, float velocity, float inaccuracy) { + super(world, thrower); + + if (target != null && thrower != null) { + double dx = target.posX - thrower.posX; + double dy = (target.posY + target.getEyeHeight()) - (thrower.posY + thrower.getEyeHeight()); + double dz = target.posZ - thrower.posZ; + + double yawRad = Math.toRadians(yawOffsetDeg); + double cos = Math.cos(yawRad); + double sin = Math.sin(yawRad); + double rx = dx * cos - dz * sin; + double rz = dx * sin + dz * cos; + + this.setThrowableHeading(rx, dy, rz, velocity, inaccuracy); + } + } + + @Override + protected float getGravityVelocity() { + return 0.01F; + } + + @Override + protected void onImpact(MovingObjectPosition mop) { + EntityLivingBase thrower = getThrower(); + if (mop.entityHit != null && thrower != null && mop.entityHit != thrower.ridingEntity && mop.entityHit != thrower) { + double var2 = thrower.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + + mop.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), (float)var2); + } + worldObj.playSoundAtEntity(this, "mob.slime.small", 0.5F, 1.0F); + + if (!this.worldObj.isRemote) { + this.setDead(); + } + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ConcentratedWarpChargeEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ConcentratedWarpChargeEntity.java index bc51b94..3f1e899 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ConcentratedWarpChargeEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ConcentratedWarpChargeEntity.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.entities.projectiles; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonPontifex; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.CrimsonPontifex; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.TCFociUpgrades; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import cpw.mods.fml.relauncher.ReflectionHelper; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/CrimsonOrbEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/CrimsonOrbEntity.java index f6a8abf..d98e45e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/CrimsonOrbEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/CrimsonOrbEntity.java @@ -1,6 +1,6 @@ package com.ilya3point999k.thaumicconcilium.common.entities.projectiles; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonPontifex; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.CrimsonPontifex; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.Entity; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ShardPowderEntity.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ShardPowderEntity.java index c4b1789..4866585 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ShardPowderEntity.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/entities/projectiles/ShardPowderEntity.java @@ -68,6 +68,18 @@ public class ShardPowderEntity extends Entity implements IEntityAdditionalSpawnD this.iteration = 0; } + public ShardPowderEntity(EntityLivingBase caster, double x, double y, double z, int type, int age) { + super(caster.worldObj); + this.setSize(0.125F, 0.125F); + this.yOffset = this.height / 2.0F; + this.setPosition(x, y, z); + this.caster = caster; + this.rotationYaw = (float)(Math.random() * 360.0); + this.type = type; + this.iteration = 0; + this.orbAge = age; + } + public ShardPowderEntity(EntityLivingBase caster, int iteration, double x, double y, double z) { super(caster.worldObj); this.setSize(0.125F, 0.125F); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCEntityEventHandler.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCEntityEventHandler.java index 89fd8a9..7b91971 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCEntityEventHandler.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCEntityEventHandler.java @@ -1,29 +1,24 @@ package com.ilya3point999k.thaumicconcilium.common.events; import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler; -import am2.api.ArsMagicaApi; -import am2.api.events.SkillLearnedEvent; -import am2.api.spell.component.interfaces.ISpellComponent; -import am2.api.spell.component.interfaces.ISpellModifier; -import am2.api.spell.component.interfaces.ISpellShape; -import am2.lore.ArcaneCompendium; -import am2.playerextensions.SkillData; -import am2.spell.SkillManager; -import am2.spell.SkillTreeManager; import baubles.common.lib.PlayerHandler; import com.ilya3point999k.thaumicconcilium.api.ThaumicConciliumApi; import com.ilya3point999k.thaumicconcilium.api.event.ThaumcraftResearchCompletedEvent; +import com.ilya3point999k.thaumicconcilium.api.event.WitcheryImpDealEvent; import com.ilya3point999k.thaumicconcilium.common.TCConfig; import com.ilya3point999k.thaumicconcilium.common.TCPlayerCapabilities; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.items.EntityItemFireResistant; import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonPaladin; import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Dissolved; import com.ilya3point999k.thaumicconcilium.common.entities.mobs.MadThaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.NetherExplorer; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.ilya3point999k.thaumicconcilium.common.golems.ValetGolemCore; import com.ilya3point999k.thaumicconcilium.common.golems.ai.GolemChatHandler; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import com.ilya3point999k.thaumicconcilium.common.items.AstralMonitor; +import com.ilya3point999k.thaumicconcilium.common.items.ItemResource; import com.ilya3point999k.thaumicconcilium.common.items.RiftGem; import com.ilya3point999k.thaumicconcilium.common.items.equipment.PontifexRobe; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.TCFociUpgrades; @@ -32,10 +27,12 @@ import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.VisConductorF import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketFXLightning; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketUpdatePartyStatus; -import com.ilya3point999k.thaumicconcilium.common.research.ThaumcraftResearchItem; +import com.ilya3point999k.thaumicconcilium.common.registry.TCBlockRegistry; +import com.ilya3point999k.thaumicconcilium.common.registry.Thaumonomicon; import com.ilya3point999k.thaumicconcilium.common.tiles.DestabilizedCrystalTile; import com.ilya3point999k.thaumicconcilium.common.tiles.LithographerTile; import com.ilya3point999k.thaumicconcilium.common.tiles.RedPoweredMindTile; +import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; @@ -44,10 +41,14 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.relauncher.Side; import fox.spiteful.forbidden.compat.Compat; import makeo.gadomancy.api.GadomancyApi; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.boss.IBossDisplayData; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; @@ -58,12 +59,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.ServerChatEvent; import net.minecraftforge.event.entity.EntityEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent; @@ -81,26 +87,28 @@ import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.monster.EntityBrainyZombie; import thaumcraft.common.entities.monster.EntityCultist; import thaumcraft.common.entities.monster.EntityCultistKnight; -import thaumcraft.common.entities.monster.EntityGiantBrainyZombie; import thaumcraft.common.items.ItemWispEssence; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.lib.FakeThaumcraftPlayer; -import thaumcraft.common.lib.research.ResearchManager; -import thaumcraft.common.lib.research.ResearchNoteData; import thaumcraft.common.lib.research.ScanManager; import thaumcraft.common.tiles.TileInfusionMatrix; import thaumcraft.common.tiles.TileNode; import thaumcraft.common.tiles.TilePedestal; +import thaumic.tinkerer.common.core.helper.ItemNBTHelper; import vazkii.botania.api.mana.IManaItem; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; public class TCEntityEventHandler { public static final HashMap etherealsClient = new HashMap<>(); public static final HashMap etherealsServer = new HashMap<>(); + private HashMap lavaChunks = new HashMap(); + int spawnTime = 0; @SubscribeEvent public void onEntityConstruction(EntityEvent.EntityConstructing event) { @@ -124,6 +132,20 @@ public class TCEntityEventHandler { clone.loadNBTData(compound); } + @SubscribeEvent + public void on(LivingHurtEvent event){ + if (event.entity instanceof EntityItem){ + EntityItem e = (EntityItem) event.entity; + ItemStack stack = e.getEntityItem(); + if (stack != null){ + if(ItemNBTHelper.verifyExistance(stack, ItemResource.TAG_MEMBRANE)){ + if (event.source.isFireDamage()){ + event.setCanceled(true); + } + } + } + } + } @SubscribeEvent public void on(PlayerEvent.PlayerChangedDimensionEvent event) { @@ -158,6 +180,11 @@ public class TCEntityEventHandler { @SubscribeEvent public void on(ItemTooltipEvent event) { + if (event.itemStack == null) return; + + if (ItemNBTHelper.verifyExistance(event.itemStack, ItemResource.TAG_MEMBRANE)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.nether_membrane")); + } if (event.itemStack.getItem() instanceof ItemWandCasting) { NBTTagCompound tag = event.itemStack.getTagCompound(); if (tag != null) { @@ -167,6 +194,35 @@ public class TCEntityEventHandler { } } } + if (event.itemStack.getItem() == ConfigItems.itemResearchNotes){ + if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.reflectionHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.reflection")); + if (Thaumonomicon.checkMadThaumaturgeComplete(event.entityPlayer)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.mad_complete")); + } + } else if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.thickTaintHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.thicktaint")); + if (Thaumonomicon.checkMadThaumaturgeComplete(event.entityPlayer)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.mad_complete")); + } + } else if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.runicWindingsHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.windings")); + if (Thaumonomicon.checkMadThaumaturgeComplete(event.entityPlayer)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.mad_complete")); + } + } else if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.destCrystalHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.destcrystal")); + if (Thaumonomicon.checkMadThaumaturgeComplete(event.entityPlayer)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.mad_complete")); + } + } else if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.visConductorHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.visconductor")); + } else if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.positiveBurstHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.positiveburst")); + } else if (ItemNBTHelper.verifyExistance(event.itemStack, Thaumonomicon.impulseHintTag)){ + event.toolTip.add(StatCollector.translateToLocal("tc.tooltip.hint.impulse")); + } + } } @SubscribeEvent @@ -183,17 +239,24 @@ public class TCEntityEventHandler { @SubscribeEvent(priority = EventPriority.LOWEST) public void on(PlayerInteractEvent e) { if (!e.world.isRemote) { - TCPlayerCapabilities capabilities = TCPlayerCapabilities.get(e.entityPlayer); + if (e.entityPlayer == null) return; + EntityPlayer player = e.entityPlayer; + TCPlayerCapabilities capabilities = TCPlayerCapabilities.get(player); if (capabilities != null) { if (capabilities.chainedTime != 0) e.setCanceled(true); + } else { + return; } - ItemStack i = e.entityPlayer.getHeldItem(); + ItemStack i = player.getHeldItem(); boolean wand = false; if (i != null) { if ((i.getItem() instanceof ItemWandCasting)) { if (e.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { - WandHandler.handleWandInteract(e.world, e.x, e.y, e.z, e.entityPlayer, i); + WandHandler.handleWandInteract(e.world, e.x, e.y, e.z, player, i); + } else if (e.action == PlayerInteractEvent.Action.RIGHT_CLICK_AIR && player.posY < -1 && capabilities.protolimbs >= 6){ + player.inventory.addItemStackToInventory(new ItemStack(TCBlockRegistry.SOLID_VOID)); + player.worldObj.playSoundAtEntity(player, "random.pop", 0.5F, 1F); } wand = true; } @@ -201,10 +264,11 @@ public class TCEntityEventHandler { wand = true; } } - if (!e.entityPlayer.capabilities.isCreativeMode && capabilities != null && capabilities.ethereal && !wand) { + if (!player.capabilities.isCreativeMode && capabilities != null && capabilities.ethereal && !wand && capabilities.protolimbs < 6) { capabilities.fleshAmount++; capabilities.sync(); } + } } @@ -245,12 +309,11 @@ public class TCEntityEventHandler { if (!player.worldObj.isRemote) { if (!player.capabilities.isCreativeMode && capabilities.ethereal) { if (event.item == null) { - if (player.posY < 0) { - //player.worldObj.spawnEntityInWorld(new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, is.copy())); + if (capabilities.protolimbs < 6) { + capabilities.fleshAmount++; + capabilities.sync(); } - capabilities.fleshAmount++; - capabilities.sync(); - } else if (!(event.item.getItem() instanceof ItemWandCasting)) { + } else if (!(event.item.getItem() instanceof ItemWandCasting) && capabilities.protolimbs < 6) { capabilities.fleshAmount++; capabilities.sync(); } @@ -269,10 +332,10 @@ public class TCEntityEventHandler { if (!event.entityPlayer.worldObj.isRemote) { if (!event.entityPlayer.capabilities.isCreativeMode && capabilities.ethereal) { ItemStack stack = event.entityPlayer.getHeldItem(); - if (stack == null) { + if (stack == null && capabilities.protolimbs < 6) { capabilities.fleshAmount++; capabilities.sync(); - } else if (!(stack.getItem() instanceof ItemWandCasting)) { + } else if (stack != null && !(stack.getItem() instanceof ItemWandCasting) && capabilities.protolimbs < 6) { capabilities.fleshAmount++; capabilities.sync(); } @@ -312,36 +375,60 @@ public class TCEntityEventHandler { } capabilities.pontifexRobeToggle = false; capabilities.ethereal = false; + capabilities.protolimbs = 0; capabilities.sync(event.player); } } @SubscribeEvent public void on(EntityJoinWorldEvent event) { - if (event.entity instanceof EntityBrainyZombie || event.entity instanceof EntityGiantBrainyZombie) { + if (event.entity instanceof EntityBrainyZombie) { if (TCConfig.madThaumaturgeReplacesBrainyZombieChance > event.world.rand.nextInt(100)) { if (!event.world.isRemote) { MadThaumaturge madThaumaturge = new MadThaumaturge(event.world); madThaumaturge.setLocationAndAngles(event.entity.posX, event.entity.posY, event.entity.posZ, event.world.rand.nextFloat() * 360.0F, 0.0F); + event.setCanceled(true); event.entity.setDead(); event.world.spawnEntityInWorld(madThaumaturge); madThaumaturge.addEquipment(); } } } - if (event.entity instanceof EntityCultistKnight) { + else if (event.entity instanceof EntityCultistKnight) { if (TCConfig.crimsonPaladinReplacesCultistWarriorChance > event.world.rand.nextInt(100)) { if (!event.world.isRemote) { CrimsonPaladin paladin = new CrimsonPaladin(event.world); paladin.setLocationAndAngles(event.entity.posX, event.entity.posY, event.entity.posZ, event.world.rand.nextFloat() * 360.0F, 0.0F); + event.setCanceled(true); event.entity.setDead(); event.world.spawnEntityInWorld(paladin); paladin.addEquipment(); + + } + } + } else if(event.entity instanceof EntityItem && event.entity.getClass() != EntityItemFireResistant.class){ + if (!event.entity.worldObj.isRemote) { + EntityItem entityItem = (EntityItem) event.entity; + if (entityItem.isDead) return; + ItemStack stack = entityItem.getDataWatcher().getWatchableObjectItemStack(10); + if (stack == null) return; + if (stack.stackSize < 1) return; + if (ItemNBTHelper.getBoolean(stack, ItemResource.TAG_MEMBRANE, false)) { + EntityItemFireResistant f = new EntityItemFireResistant(event.world, entityItem.posX, entityItem.posY, entityItem.posZ, stack); + f.delayBeforeCanPickup = 40; + f.motionX = entityItem.motionX; + f.motionY = entityItem.motionY; + f.motionZ = entityItem.motionZ; + event.world.spawnEntityInWorld(f); + event.setCanceled(true); + event.entity.setDead(); } } } + } + @SubscribeEvent public void on(PlayerEvent.PlayerLoggedInEvent event) { TCPlayerCapabilities.get(event.player).sync(event.player); @@ -354,14 +441,19 @@ public class TCEntityEventHandler { TCPlayerCapabilities capabilities = TCPlayerCapabilities.get(player); if (capabilities != null) { if (!player.worldObj.isRemote) { + boolean shouldSync = false; if (capabilities.pontifexRobeToggle && !PontifexRobe.isFullSet(player)) { capabilities.ethereal = false; capabilities.pontifexRobeToggle = false; - capabilities.sync(); + shouldSync = true; } if (capabilities.chainedTime > 0) { capabilities.chainedTime--; - capabilities.sync(); + shouldSync = true; + } + if (capabilities.impDealTime > 0){ + capabilities.impDealTime--; + shouldSync = true; } float maxHealth = player.getMaxHealth() - capabilities.fleshAmount; if (player.getHealth() > maxHealth) { @@ -562,6 +654,7 @@ public class TCEntityEventHandler { TCPacketHandler.INSTANCE.sendTo(new PacketUpdatePartyStatus(party), (EntityPlayerMP) player); } } + if (shouldSync) capabilities.sync(); } HashMap ethereals = event.side == Side.SERVER ? etherealsServer : etherealsClient; @@ -624,6 +717,86 @@ public class TCEntityEventHandler { } } + @SubscribeEvent + public void on(TickEvent.WorldTickEvent event) { + if (event.phase == TickEvent.Phase.START && event.world instanceof WorldServer && event.world.provider.dimensionId == -1) { + WorldServer world = (WorldServer) event.world; + if (++this.spawnTime < TCConfig.netherExplorerSpawnRate) { + return; + } + this.spawnTime = 0; + lavaChunks.clear(); + for (Object p : world.playerEntities) { + EntityPlayer player = (EntityPlayer) p; + int chunkX = MathHelper.floor_double(player.posX / 16.0D); + int chunkZ = MathHelper.floor_double(player.posZ / 16.0D); + byte spawnRange = 8; + for (int x = -spawnRange; x <= spawnRange; x++) { + for (int z = -spawnRange; z <= spawnRange; z++) { + boolean isEdge = (x == -spawnRange || x == spawnRange || z == -spawnRange || z == spawnRange); + ChunkCoordIntPair chunkCoord = new ChunkCoordIntPair(x + chunkX, z + chunkZ); + if (!isEdge) { + lavaChunks.put(chunkCoord, Boolean.valueOf(false)); + } else if (!lavaChunks.containsKey(chunkCoord)) { + lavaChunks.put(chunkCoord, Boolean.valueOf(true)); + } + } + } + } + ChunkCoordinates spawnCoords = world.getSpawnPoint(); + if (world.countEntities(NetherExplorer.class) <= 3) { + ArrayList chunks = new ArrayList(lavaChunks.keySet()); + Collections.shuffle(chunks); + for (ChunkCoordIntPair chunkCoord : chunks) { + if (!((Boolean) lavaChunks.get(chunkCoord)).booleanValue()) { + Chunk chunk = world.getChunkFromChunkCoords(chunkCoord.chunkXPos, chunkCoord.chunkZPos); + int cx = (chunkCoord.chunkXPos << 4) + world.rand.nextInt(16); + int cz = (chunkCoord.chunkZPos << 4) + world.rand.nextInt(16); + int cy = world.rand.nextInt((chunk == null) ? world.getActualHeight() : (chunk.getTopFilledSegment() + 16 - 1)); + ChunkPosition chunkPos = new ChunkPosition(cx, cy, cz); + int x = chunkPos.chunkPosX; + int y = chunkPos.chunkPosY; + int z = chunkPos.chunkPosZ; + if (world.isBlockNormalCubeDefault(x, y, z, true)) + continue; + byte groupRadius = 6; + int X = x; + int Y = y; + int Z = z; + for (int spawnAttempt = 4; spawnAttempt-- > 0; ) { + X += world.rand.nextInt(groupRadius) - world.rand.nextInt(groupRadius); + Y += world.rand.nextInt(1) - world.rand.nextInt(1); + Z += world.rand.nextInt(groupRadius) - world.rand.nextInt(groupRadius); + if (world.getBlock(X, Y, Z).getMaterial() == Material.lava) { + float posX = X + 0.5F; + float posY = Y; + float posZ = Z + 0.5F; + if (world.getClosestPlayer(posX, posY, posZ, 24.0D) == null) { + float spawnX = posX - spawnCoords.posX; + float spawnY = posY - spawnCoords.posY; + float spawnZ = posZ - spawnCoords.posZ; + float spawnDist = spawnX * spawnX + spawnY * spawnY + spawnZ * spawnZ; + if (spawnDist >= 576.0F) { + NetherExplorer explorer = new NetherExplorer((World) world); + explorer.setLocationAndAngles(posX, posY, posZ, world.rand.nextFloat() * 360.0F, 0.0F); + Event.Result canSpawn = ForgeEventFactory.canEntitySpawn((EntityLiving) explorer, (World) world, posX, posY, posZ); + if (canSpawn == Event.Result.ALLOW || (canSpawn == Event.Result.DEFAULT && explorer.getCanSpawnHere())) { + world.spawnEntityInWorld((Entity) explorer); + if (!ForgeEventFactory.doSpecialSpawn((EntityLiving) explorer, (World) world, posX, posY, posZ)) + explorer.onSpawnWithEgg((IEntityLivingData) null); + return; + } + } + } + } + } + + } + } + } + } + } + @SubscribeEvent public void on(final PlayerEvent.ItemCraftedEvent event) { if (event.crafting.getItem() instanceof ItemWandCasting && !(event.player instanceof FakePlayer)) { @@ -720,31 +893,23 @@ public class TCEntityEventHandler { } @SubscribeEvent - public void onResearch(ThaumcraftResearchCompletedEvent e){ + public void onResearch(ThaumcraftResearchCompletedEvent e) { + if (e.entityPlayer == null) return; if (!e.entityPlayer.worldObj.isRemote) { String research = e.getUnlockedResearch(); - if (research.equals("CRIMSONINITIATION")) { - SkillData d = SkillData.For(e.entityPlayer); - try { - SkillTreeManager t = SkillTreeManager.instance; - d.incrementSpellPoints(t.getSkillPointTypeForPart(Integration.crimson_raid_component)); - d.learn(t.getSkillTreeEntry(Integration.crimson_raid_component).registeredItem); - d.forceSync(); - MinecraftForge.EVENT_BUS.post(new SkillLearnedEvent(e.entityPlayer, Integration.crimson_raid_component)); - } catch (Exception e1) { - int ID = SkillManager.instance.getShiftedPartID(Integration.crimson_raid_component); - try { - Method m = SkillData.class.getDeclaredMethod("setComponentKnown", int.class); - m.setAccessible(true); // bypass private access - m.invoke(d, ID); - d.forceSync(); - MinecraftForge.EVENT_BUS.post(new SkillLearnedEvent(e.entityPlayer, Integration.crimson_raid_component)); - } catch (Exception e2) { - e1.printStackTrace(); - e2.printStackTrace(); + if (research.equals("CRIMSONRAID")) { + if (Compat.am2) { + if (Integration.taintedMagic) { + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.AM2Integration"); + Method m = clazz.getMethod("unlockCrimsonRaid", EntityPlayer.class); + m.invoke(null, e.entityPlayer); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to unlock Crimson Raid spell component: " + t); + } } } - } else if (research.equals("CRIMSONSPELLS")){ + } else if (research.equals("CRIMSONSPELLS")) { NBTTagCompound nbtPlayer = null; try { nbtPlayer = (NBTTagCompound) Integration.witcheryInfusionClass.getMethod("getNBT", Entity.class).invoke(null, e.entityPlayer); @@ -765,7 +930,16 @@ public class TCEntityEventHandler { nbtSpells.setBoolean("conjunctivitis", true); } } + } + } + @SubscribeEvent + public void on(WitcheryImpDealEvent event){ + if (event.impOwner == null) return; + if (!event.impOwner.worldObj.isRemote) { + TCPlayerCapabilities capabilities = TCPlayerCapabilities.get(event.impOwner); + capabilities.impDealTime = 72000; + capabilities.sync(); } } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCGuiEvent.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCGuiEvent.java index 900b76d..b25e8ec 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCGuiEvent.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/TCGuiEvent.java @@ -3,8 +3,16 @@ package com.ilya3point999k.thaumicconcilium.common.events; import com.ilya3point999k.thaumicconcilium.api.ChainedRiftRecipe; import com.ilya3point999k.thaumicconcilium.api.ThaumicConciliumApi; import com.ilya3point999k.thaumicconcilium.client.PolishedInfusionGUI; +import com.ilya3point999k.thaumicconcilium.client.ThaumaturgeGUI; import com.ilya3point999k.thaumicconcilium.common.Injector; +import com.ilya3point999k.thaumicconcilium.common.registry.Thaumonomicon; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; import net.minecraftforge.client.event.GuiOpenEvent; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; @@ -13,7 +21,8 @@ import thaumcraft.client.gui.GuiResearchRecipe; public class TCGuiEvent { @SubscribeEvent public void guiOpen(GuiOpenEvent event) { - if (event.gui != null && event.gui instanceof GuiResearchRecipe) { + if (event.gui == null) return; + if (event.gui instanceof GuiResearchRecipe) { GuiResearchRecipe gui = (GuiResearchRecipe) event.gui; Injector inj = new Injector(gui, GuiResearchRecipe.class); ResearchItem research = inj.getField("research"); @@ -49,6 +58,13 @@ public class TCGuiEvent { break; } } + } else if (event.gui instanceof ThaumaturgeGUI){ + Minecraft mc = Minecraft.getMinecraft(); + EntityPlayer player = mc.thePlayer; + if (Thaumonomicon.checkThaumaturgeComplete(player)){ + player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("tc.thaumaturge.no_more")).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_PURPLE))); + } } } + } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/WandHandler.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/WandHandler.java index 4cb741c..13df807 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/WandHandler.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/events/WandHandler.java @@ -1,8 +1,8 @@ package com.ilya3point999k.thaumicconcilium.common.events; import com.ilya3point999k.thaumicconcilium.common.blocks.HexOfPredictabilityBlock; -import com.ilya3point999k.thaumicconcilium.common.entities.MaterialPeeler; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.other.MaterialPeeler; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.ilya3point999k.thaumicconcilium.common.registry.TCBlockRegistry; import com.ilya3point999k.thaumicconcilium.common.tiles.HexOfPredictabilityTile; import com.ilya3point999k.thaumicconcilium.common.tiles.LithographerTile; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/BurlakGolemCore.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/BurlakGolemCore.java new file mode 100644 index 0000000..5e298b2 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/BurlakGolemCore.java @@ -0,0 +1,57 @@ +package com.ilya3point999k.thaumicconcilium.common.golems; + +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.golems.ai.GolemBurlakAI; +import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; +import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemNameTag; +import net.minecraft.item.ItemStack; +import thaumcraft.common.entities.ai.misc.AIOpenDoor; +import thaumcraft.common.entities.ai.misc.AIReturnHome; +import thaumcraft.common.entities.golems.EntityGolemBase; + +public class BurlakGolemCore extends AdditionalGolemCore { + @Override + public void setupGolem(EntityGolemBase golem) { + + golem.tasks.addTask(6, new GolemBurlakAI(golem)); + golem.tasks.addTask(5, new AIOpenDoor(golem, true)); + golem.tasks.addTask(6, new AIReturnHome(golem)); + golem.tasks.addTask(7, new EntityAIWatchClosest(golem, EntityPlayer.class, 6.0F)); + golem.tasks.addTask(8, new EntityAILookIdle(golem)); + } + + @Override + public ItemStack getToolItem(EntityGolemBase golem) { + return golem.getCarriedForDisplay(); + } + + @Override + public boolean hasGui() { + return true; + } + @Override + public boolean openGui(EntityPlayer player, EntityGolemBase golem) { + if (!player.isSneaking() && (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof ItemNameTag))) { + if (!player.worldObj.isRemote) { + + player.openGui(ThaumicConcilium.instance, 2, player.worldObj, golem.getEntityId(), 0, 0); + return true; + } + } + return false; + } + + @Override + public String getUnlocalizedName() { + return ThaumicConcilium.MODID+".core.burlak"; + } + + @Override + public ItemStack getItem() { + return new ItemStack(TCItemRegistry.golemCores, 1, 2); + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemAssistantAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemAssistantAI.java index 1140398..42062aa 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemAssistantAI.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemAssistantAI.java @@ -6,7 +6,10 @@ import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.monster.*; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGolem; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.passive.IAnimals; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemBurlakAI.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemBurlakAI.java index 0dd55c6..a41e7d9 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemBurlakAI.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/golems/ai/GolemBurlakAI.java @@ -3,6 +3,7 @@ package com.ilya3point999k.thaumicconcilium.common.golems.ai; import net.minecraft.entity.Entity; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.item.EntityMinecart; +import net.minecraft.util.MathHelper; import thaumcraft.common.entities.golems.EntityGolemBase; public class GolemBurlakAI extends EntityAIBase { @@ -17,6 +18,7 @@ public class GolemBurlakAI extends EntityAIBase { public boolean shouldExecute() { Entity riding = golem.ridingEntity; if (riding != null){ + if (riding instanceof EntityMinecart){ return true; } @@ -30,7 +32,7 @@ public class GolemBurlakAI extends EntityAIBase { if (riding != null){ if (riding instanceof EntityMinecart){ if (golem.ticksExisted % 10 == 0) { - //((EntityMinecart) riding).moveMinecartOnRail(MathHelper.floor_double(riding.posX), MathHelper.floor_double(riding.posY) - 1, MathHelper.floor_double(riding.posZ), 2.0); + ((EntityMinecart) riding).moveMinecartOnRail(MathHelper.floor_double(riding.posX), MathHelper.floor_double(riding.posY) - 1, MathHelper.floor_double(riding.posZ), 2.0); //riding.addVelocity(golem.getToggles()[0] ? 0.5 : -0.5, 0.0, golem.getToggles()[1] ? 0.5 : -0.5); } } @@ -53,10 +55,12 @@ public class GolemBurlakAI extends EntityAIBase { Entity riding = golem.ridingEntity; if (riding != null){ if (riding instanceof EntityMinecart){ + + if (golem.ticksExisted % 10 == 0) { riding.motionX *= 1.4; riding.motionZ *= 1.4; - //riding.addVelocity(golem.getToggles()[0] ? 0.5 : -0.5, 0.0, golem.getToggles()[1] ? 0.5 : -0.5); + riding.addVelocity(golem.getToggles()[0] ? 0.5 : -0.5, 0.0, golem.getToggles()[1] ? 0.5 : -0.5); } } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/spells/CrimsonRaid.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/AM2Integration.java similarity index 64% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/spells/CrimsonRaid.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/AM2Integration.java index e807df9..0d1b6ae 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/spells/CrimsonRaid.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/AM2Integration.java @@ -1,14 +1,22 @@ -package com.ilya3point999k.thaumicconcilium.common.spells; +package com.ilya3point999k.thaumicconcilium.common.integration; +import am2.api.ArsMagicaApi; +import am2.api.events.SkillLearnedEvent; import am2.api.power.PowerTypes; import am2.api.spell.component.interfaces.ISpellComponent; import am2.api.spell.enums.Affinity; +import am2.api.spell.enums.SkillPointTypes; +import am2.api.spell.enums.SkillTrees; import am2.items.ItemsCommonProxy; +import am2.lore.ArcaneCompendium; import am2.playerextensions.ExtendedProperties; +import am2.playerextensions.SkillData; +import am2.spell.SkillManager; +import am2.spell.SkillTreeManager; import am2.spell.SpellHelper; import am2.utility.EntityUtilities; import com.ilya3point999k.thaumicconcilium.common.TCConfig; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.LesserPortal; +import com.ilya3point999k.thaumicconcilium.common.entities.other.LesserPortal; import com.ilya3point999k.thaumicconcilium.common.items.equipment.PontifexRobe; import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; import net.minecraft.entity.Entity; @@ -18,13 +26,70 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; +import java.lang.reflect.Method; import java.util.EnumSet; import java.util.Random; -public class CrimsonRaid implements ISpellComponent { +public class AM2Integration { + public static CrimsonRaid crimson_raid_component; + public static void register() { + if (Integration.taintedMagic) { + crimson_raid_component = new CrimsonRaid(); + ArsMagicaApi.instance.registerSkillTreeEntry( + crimson_raid_component, + "Crimson_Raid", + SkillTrees.None, + 25, 175, + SkillPointTypes.SILVER + ); + } + } + + public static void registerClient() { + if (Integration.taintedMagic) { + ArcaneCompendium.instance.AddCompenidumEntry( + AM2Integration.crimson_raid_component, + "Crimson_Raid", + StatCollector.translateToLocal("am2.spell.crimson_raid"), + StatCollector.translateToLocal("am2.entry.crimson_raid"), + null, + false + ); + } + } + + public static void unlockCrimsonRaid(EntityPlayer player){ + if(Integration.taintedMagic) { + SkillData d = SkillData.For(player); + try { + SkillTreeManager t = SkillTreeManager.instance; + d.incrementSpellPoints(t.getSkillPointTypeForPart(AM2Integration.crimson_raid_component)); + d.learn(t.getSkillTreeEntry(AM2Integration.crimson_raid_component).registeredItem); + d.forceSync(); + MinecraftForge.EVENT_BUS.post(new SkillLearnedEvent(player, AM2Integration.crimson_raid_component)); + } catch (Exception e1) { + int ID = SkillManager.instance.getShiftedPartID(AM2Integration.crimson_raid_component); + try { + Method m = SkillData.class.getDeclaredMethod("setComponentKnown", int.class); + m.setAccessible(true); // bypass private access + m.invoke(d, ID); + d.forceSync(); + MinecraftForge.EVENT_BUS.post(new SkillLearnedEvent(player, AM2Integration.crimson_raid_component)); + } catch (Exception e2) { + e1.printStackTrace(); + e2.printStackTrace(); + } + } + } + } + +} + +class CrimsonRaid implements ISpellComponent { public LesserPortal summonCreature(ItemStack stack, EntityLivingBase caster, EntityLivingBase target, World world, double x, double y, double z){ LesserPortal entity = new LesserPortal(world); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/AlfheimIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/AlfheimIntegration.java new file mode 100644 index 0000000..a05440e --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/AlfheimIntegration.java @@ -0,0 +1,15 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +import alfheim.common.core.handler.AlfheimConfigHandler; +import thaumcraft.api.aspects.Aspect; + +public class AlfheimIntegration { + + public static void register() { + Integration.alfheimDimension = AlfheimConfigHandler.INSTANCE.getDimensionIDAlfheim(); + Integration.tincturaAllowed = AlfheimConfigHandler.INSTANCE.getAddTincturaAspect(); + if (Integration.tincturaAllowed){ + Integration.tinctura = Aspect.getAspect("tinctura"); + } + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/BasesIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/BasesIntegration.java new file mode 100644 index 0000000..36685b8 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/BasesIntegration.java @@ -0,0 +1,30 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import cpw.mods.fml.common.registry.GameRegistry; +import org.apache.logging.log4j.Level; +import tb.api.ITobacco; + +public class BasesIntegration { + public static ITobacco tobacco = null; + public static void register() { + try { + if (Class.forName("tb.utils.TBConfig").getField("allowTobacco").getBoolean(null)) { + Integration.allowTobacco = true; + Integration.tobaccoitem = GameRegistry.findItem("thaumicbases", "tobaccoPowder"); + if (Integration.tobaccoitem != null) { + tobacco = (ITobacco) Integration.tobaccoitem; + } else { + ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Thaumic Bases's tobacco, what a mess"); + } + Integration.tobaccoleaves = GameRegistry.findItem("thaumicbases", "resource"); + if (Integration.tobaccoleaves == null) { + ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Thaumic Bases's tobacco leaves, what a mess"); + } + } + } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { + throw new RuntimeException(e); + } + + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/BotaniaIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/BotaniaIntegration.java new file mode 100644 index 0000000..aae1ebb --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/BotaniaIntegration.java @@ -0,0 +1,4 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +public class BotaniaIntegration { +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/GadomancyIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/GadomancyIntegration.java new file mode 100644 index 0000000..245f1ba --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/GadomancyIntegration.java @@ -0,0 +1,364 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; +import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorRegistry; +import am2.api.math.AMVector3; +import am2.entities.EntityThrownRock; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Overanimated; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.ThaumGib; +import com.ilya3point999k.thaumicconcilium.common.golems.AssistantGolemCore; +import com.ilya3point999k.thaumicconcilium.common.golems.ValetGolemCore; +import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.TCFociUpgrades; +import fox.spiteful.forbidden.Config; +import fox.spiteful.forbidden.DarkAspects; +import fox.spiteful.forbidden.compat.Compat; +import makeo.gadomancy.api.AuraEffect; +import makeo.gadomancy.api.GadomancyApi; +import makeo.gadomancy.common.Gadomancy; +import makeo.gadomancy.common.aura.AuraResearchManager; +import net.minecraft.block.Block; +import net.minecraft.block.BlockAnvil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityFallingBlock; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.EntitySpider; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.research.ResearchItem; +import thaumcraft.codechicken.lib.vec.Vector3; +import thaumcraft.common.entities.projectile.EntityExplosiveOrb; +import thaumic.tinkerer.common.core.helper.MiscHelper; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.common.Botania; + +import java.util.*; +import java.util.function.BiConsumer; + +public class GadomancyIntegration { + + public static ArrayList> meteors; + + public static void register() { + if (Integration.horizons) { + GadomancyApi.registerAdditionalGolemCore("assistantCore", new AssistantGolemCore()); + } + GadomancyApi.registerAdditionalGolemCore("valetCore", new ValetGolemCore()); + //GadomancyApi.registerAdditionalGolemCore("burlakCore", new BurlakGolemCore()); + final AuraEffect INFERNUS = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityItem; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + EntityItem entityItem = (EntityItem) e; + if (FurnaceRecipes.smelting().getSmeltingResult(entityItem.getEntityItem()) != null) { + final ItemStack stacky = FurnaceRecipes.smelting().getSmeltingResult(entityItem.getEntityItem()); + stacky.stackSize = entityItem.getEntityItem().stackSize; + entityItem.setEntityItemStack(stacky); + } + } + } + + @Override + public int getTickInterval() { + return 5; + } + }.register(DarkAspects.NETHER); + + if (!Config.noLust) { + final AuraEffect LUXURIA = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityAgeable; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + EntityAgeable ageable = (EntityAgeable) e; + if (ageable.getGrowingAge() > 0) { + ageable.setGrowingAge(0); + } + } + } + + @Override + public int getTickInterval() { + return 40; + } + }.register(DarkAspects.LUST); + } + + final AuraEffect GULA = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityPlayer; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + EntityPlayer player = (EntityPlayer) e; + player.getFoodStats().addStats(1, 1.0F); + } + } + + @Override + public int getTickInterval() { + return 20; + } + }.register(DarkAspects.GLUTTONY); + + final AuraEffect IRA = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityMob; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + List list = e.worldObj.getEntitiesWithinAABB(EntityLiving.class, e.boundingBox.expand(8, 8, 8)); + list.remove(e); + if (!list.isEmpty()) { + Collections.shuffle(list); + ((EntityLivingBase) e).setRevengeTarget(list.get(0)); + } + } + } + + @Override + public int getTickInterval() { + return 80; + } + }.register(DarkAspects.WRATH); + + final AuraEffect INVIDIA = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityLivingBase; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + if (e instanceof EntityPlayer) { + return; + } + EntityLivingBase living = (EntityLivingBase) e; + ItemStack stack = living.getHeldItem(); + if (stack != null) { + living.entityDropItem(living.getHeldItem(), 0.5F); + living.setCurrentItemOrArmor(0, null); + } + } + } + + @Override + public int getTickInterval() { + return 80; + } + }.register(DarkAspects.ENVY); + + final AuraEffect DESIDIA = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityLivingBase; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + + EntityLivingBase living = (EntityLivingBase) e; + Collection potions = living.getActivePotionEffects(); + if (!potions.isEmpty()) { + for (PotionEffect potion : potions) { + living.addPotionEffect(new PotionEffect(potion.getPotionID(), potion.getDuration() + 20, potion.getAmplifier(), potion.getIsAmbient())); + } + } + } + } + + @Override + public int getTickInterval() { + return 4; + } + }.register(DarkAspects.SLOTH); + + final AuraEffect SUPERBIA = new AuraEffect.EntityAuraEffect() { + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityMob; + } + + @Override + public double getRange() { + return 32; + } + + @Override + public void doEntityEffect(ChunkCoordinates originTile, Entity e) { + if (!e.worldObj.isRemote) { + if (e.getDistanceSq(originTile.posX, originTile.posY, originTile.posZ) < 1024) { + Vector3 target = new Vector3(e.posX - originTile.posX, e.posY, e.posZ - originTile.posZ).multiply(2.0, 1.0, 2.0); + MiscHelper.setEntityMotionFromVector(e, target, 1.0F); + } + } + } + }.register(DarkAspects.PRIDE); + + } + + public static void postRegister(){ + if (Integration.alfheim && Integration.tincturaAllowed){ + final AuraEffect TINCTURA = new AuraEffect() { + @Override + public EffectType getEffectType() { + return null; + } + + @Override + public boolean isEntityApplicable(Entity entity) { + return entity instanceof EntityLivingBase; + } + + @Override + public void doEntityEffect(ChunkCoordinates chunkCoordinates, Entity entity) { + if (Integration.tintPotionId != -1 && !entity.worldObj.isRemote){ + EntityLivingBase living = (EntityLivingBase) entity; + living.addPotionEffect(new PotionEffect(Integration.tintPotionId, 1200, entity.worldObj.rand.nextInt(16), true)); + } + } + + @Override + public int getBlockCount(Random random) { + return 10; + } + + @Override + public int getTickInterval() { + return 20; + } + + @Override + public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) { + Block block = world.getBlock(selectedBlock.posX, selectedBlock.posY, selectedBlock.posZ); + if (BotaniaAPI.paintableBlocks.contains(block)) { + int meta = world.getBlockMetadata(selectedBlock.posX, selectedBlock.posY, selectedBlock.posZ); + int newColor = world.rand.nextInt(16); + if (meta != newColor) { + if (!world.isRemote) { + world.setBlockMetadataWithNotify(selectedBlock.posX, selectedBlock.posY, selectedBlock.posZ, newColor, 2); + } + float[] color = EntitySheep.fleeceColorTable[newColor]; + float r = color[0]; + float g = color[1]; + float b = color[2]; + for (int i = 0; i < 4; i++) + Botania.proxy.sparkleFX(world, selectedBlock.posX + (float) Math.random(), selectedBlock.posY + (float) Math.random(), selectedBlock.posZ + (float) Math.random(), r, g, b, 0.6F + (float) Math.random() * 0.3F, 5); + } + } + } + }.register(Integration.tinctura); + new ResearchItem(String.format(AuraResearchManager.TC_AURA_RESEARCH_STR, Integration.tinctura.getTag()), Gadomancy.MODID).registerResearchItem(); + } + + if (Integration.avaritia){ + meteors = new ArrayList<>(); + meteors.add(GadomancyIntegration::spawnStoneShower); + if (Compat.bm) { + meteors.add(GadomancyIntegration::spawnBMMeteor); + } + if (Compat.am2){ + meteors.add(GadomancyIntegration::spawnAM2Meteor); + meteors.add(GadomancyIntegration::spawnAM2Star); + } + if (Integration.horizons){ + meteors.add(GadomancyIntegration::spawnBrethrenMoon); + } + + final AuraEffect TERMINUS = new AuraEffect.BlockAuraEffect() { + @Override + public int getBlockCount(Random random) { + return 1; + } + + @Override + public double getRange() { + return 32.0; + } + + @Override + public int getTickInterval() { + return 600; + } + + @Override + public void doBlockEffect(ChunkCoordinates chunkCoordinates, ChunkCoordinates selectedBlock, World world) { + if (!world.isRemote) { + meteors.get(world.rand.nextInt(meteors.size())).accept(world, selectedBlock); + } + } + }.register(Aspect.getAspect("terminus")); + new ResearchItem(String.format(AuraResearchManager.TC_AURA_RESEARCH_STR, "terminus"), Gadomancy.MODID).registerResearchItem(); + } + } + + public static void spawnBMMeteor(World world, ChunkCoordinates pos){ + int meteorID = MeteorRegistry.getParadigmIDForItem(new ItemStack(Blocks.stone)); + EntityMeteor meteor = new EntityMeteor(world, pos.posX + 0.5f, 257, pos.posZ + 0.5f, meteorID); + meteor.motionY = -1.0f; + world.spawnEntityInWorld(meteor); + } + + public static void spawnAM2Meteor(World world, ChunkCoordinates pos){ + EntityThrownRock meteor = new EntityThrownRock(world); + meteor.setPosition(pos.posX + (-8 + world.rand.nextInt(16)), world.getActualHeight(), pos.posZ + (-8 + world.rand.nextInt(16))); + meteor.setMoonstoneMeteor(); + meteor.setMoonstoneMeteorTarget(new AMVector3(pos.posX, pos.posY, pos.posZ)); + world.spawnEntityInWorld(meteor); + } + public static void spawnAM2Star(World world, ChunkCoordinates pos){ + EntityThrownRock meteor = new EntityThrownRock(world); + meteor.setPosition(pos.posX + (-8 + world.rand.nextInt(16)), world.getActualHeight(), pos.posZ + (-8 + world.rand.nextInt(16))); + meteor.setShootingStar(50); + world.spawnEntityInWorld(meteor); + } + + public static void spawnBrethrenMoon(World world, ChunkCoordinates pos){ + for (int i = 0; i < 5; i++) { + Overanimated overanimated = new Overanimated(world); + overanimated.func_110163_bv(); + overanimated.setPositionAndRotation(pos.posX + (-2 + (world.rand.nextGaussian() * 4)), world.getActualHeight(), pos.posZ + (-2 + (world.rand.nextGaussian() * 4)), 0, 0); + world.spawnEntityInWorld(overanimated); + } + } + + public static void spawnStoneShower(World world, ChunkCoordinates pos){ + for (int i = 0; i < 10; i++){ + EntityExplosiveOrb orb = new EntityExplosiveOrb(world); + orb.setPosition(pos.posX, world.getActualHeight(), pos.posZ); + orb.motionX += (-0.5 + world.rand.nextGaussian()) * 0.1; + orb.motionY = -0.1; + orb.motionZ += (-0.5 + world.rand.nextGaussian()) * 0.1; + orb.strength = 20; + orb.onFire = true; + world.spawnEntityInWorld(orb); + } + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/HorizonsIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/HorizonsIntegration.java new file mode 100644 index 0000000..a848c76 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/HorizonsIntegration.java @@ -0,0 +1,174 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.MadThaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.SloppyAlchemist; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.NetherExplorer; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.Protolimb; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.WitheredBotanist; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.other.DopeSquid; +import com.ilya3point999k.thaumicconcilium.common.entities.other.GolemBydlo; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RedPoweredMind; +import com.ilya3point999k.thaumicconcilium.common.items.Protobody; +import com.kentington.thaumichorizons.common.ThaumicHorizons; +import cpw.mods.fml.common.registry.EntityRegistry; +import fox.spiteful.forbidden.DarkAspects; +import fox.spiteful.forbidden.compat.Compat; +import fox.spiteful.forbidden.items.ForbiddenItems; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.api.aspects.AspectList; +import thaumcraft.client.gui.GuiResearchBrowser; +import thaumcraft.common.config.ConfigBlocks; +import thaumcraft.common.config.ConfigItems; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; + +public class HorizonsIntegration { + public static void register() { + ThaumicHorizons.classBanList.add(NetherExplorer.class); + if (Integration.witchery) { + ThaumicHorizons.classBanList.add(SloppyAlchemist.class); + } + if (Compat.botan){ + ThaumicHorizons.classBanList.add(WitheredBotanist.class); + } + if (Integration.taintedMagic){ + ThaumicHorizons.classBanList.add(Protolimb.class); + ThaumicHorizons.classBanList.add(Protobody.class); + } + Class th = null; + Class creatureInfusion = null; + + Object recipeList = null; + try { + th = Class.forName("com.kentington.thaumichorizons.common.ThaumicHorizons"); + creatureInfusion = Class.forName("com.kentington.thaumichorizons.common.lib.CreatureInfusionRecipe"); + recipeList = th.getDeclaredField("critterRecipes").get(null); + } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + throw new RuntimeException(e); + } + + try { + EntityRegistry.registerModEntity(MadThaumaturge.class, "MadThaumaturge", 41, th.getField("instance").get(null), 64, 3, true); + EntityRegistry.registerModEntity(GolemBydlo.class, "GolemBydlo", 42, th.getField("instance").get(null), 64, 3, true); + if (Integration.automagy) { + EntityRegistry.registerModEntity(RedPoweredMind.class, "RedPoweredMind", 43, th.getField("instance").get(null), 64, 3, true); + } + if (Integration.thaumicBases) { + EntityRegistry.registerModEntity(DopeSquid.class, "DopeSquid", 44, th.getField("instance").get(null), 64, 3, true); + } + + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } + + Item golemPowder; + try { + golemPowder = Compat.getItem("ThaumicHorizons", "golemPowder"); + } catch (Compat.ItemNotFoundException e) { + throw new RuntimeException(e); + } + + + Object buffGolemRecipe = null; + Object brainLitteringRecipe = null; + try { + buffGolemRecipe = creatureInfusion.getConstructors()[0].newInstance("BUFFGOLEM", 42, (int) 4, new AspectList().add(Aspect.ENERGY, 64).add(Aspect.METAL, 128).add(DarkAspects.PRIDE, 32).add(Aspect.ENTROPY, 128), + MadThaumaturge.class, new ItemStack[]{ + new ItemStack(ConfigItems.itemGolemPlacer, 1, 7), + new ItemStack(golemPowder), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 5), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), + new ItemStack(ConfigItems.itemGolemPlacer, 1, 7), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 9), + new ItemStack(ConfigItems.itemGolemPlacer, 1, 7), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 5), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), + new ItemStack(golemPowder) + }, (int) 0); + brainLitteringRecipe = creatureInfusion.getConstructors()[0].newInstance("BRAINLITTERING", 41, 4, new AspectList().add(Aspect.ENTROPY, 64).add(Aspect.ELDRITCH, 64).add(Aspect.MIND, 64), + Thaumaturge.class, new ItemStack[]{ + new ItemStack(ConfigItems.itemResource, 1, 9), + new ItemStack(ForbiddenItems.deadlyShards, 1, 2), + new ItemStack(ConfigItems.itemZombieBrain), + new ItemStack(ForbiddenItems.deadlyShards, 1, 2) + }, 0); + + } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { + throw new RuntimeException(e); + } + ((ArrayList) recipeList).add(buffGolemRecipe); + ((ArrayList) recipeList).add(brainLitteringRecipe); + if (Integration.automagy) { + Object redPoweredMindRecipe = null; + try { + redPoweredMindRecipe = creatureInfusion.getConstructors()[0].newInstance("REDPOWEREDMIND", 43, 4, new AspectList().add(Aspect.CRYSTAL, 64).add(Aspect.MIND, 64).add(Aspect.SENSES, 32).add(Aspect.MECHANISM, 32), + MadThaumaturge.class, new ItemStack[]{ + new ItemStack(ConfigItems.itemBucketDeath), + new ItemStack(Items.repeater), + new ItemStack(Blocks.redstone_block), + new ItemStack(Blocks.redstone_block), + new ItemStack(Blocks.redstone_block), + new ItemStack(ConfigItems.itemBucketDeath), + new ItemStack(ConfigItems.itemResource, 1, 17), + new ItemStack(ConfigItems.itemBucketDeath), + new ItemStack(Blocks.redstone_block), + new ItemStack(Blocks.redstone_block), + new ItemStack(Blocks.redstone_block), + new ItemStack(Items.comparator) + }, 0); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + ((ArrayList) recipeList).add(redPoweredMindRecipe); + + try { + Integration.crystalEye = Class.forName("tuhljin.automagy.items.ItemCrystalEye"); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + + if (Integration.thaumicBases && Integration.allowTobacco){ + Object dopeSquidRecipe = null; + try { + dopeSquidRecipe = creatureInfusion.getConstructors()[0].newInstance("DOPESQUID", 44, 4, new AspectList().add(Aspect.PLANT, 64).add(Aspect.MAGIC, 64).add(Aspect.MAN, 32).add(Aspect.FLIGHT, 64), + EntitySquid.class, new ItemStack[]{ + new ItemStack(ConfigItems.itemShard, 1, 0), + new ItemStack(Integration.tobaccoitem, 1, 1), + new ItemStack(Integration.tobaccoitem, 1, 2), + new ItemStack(Integration.tobaccoitem, 1, 3), + new ItemStack(Integration.tobaccoitem, 1, 4), + new ItemStack(ConfigItems.itemShard, 1, 1), + new ItemStack(Integration.tobaccoitem, 1, 5), + new ItemStack(Integration.tobaccoitem, 1, 6), + new ItemStack(Integration.tobaccoitem, 1, 7), + new ItemStack(Integration.tobaccoitem, 1, 8) + }, 0); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + ((ArrayList) recipeList).add(dopeSquidRecipe); + + } + + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/Integration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/Integration.java index e1238de..081da1e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/Integration.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/Integration.java @@ -1,81 +1,14 @@ package com.ilya3point999k.thaumicconcilium.common.integration; -import am2.api.ArsMagicaApi; -import am2.api.spell.component.interfaces.ISkillTreeEntry; -import am2.api.spell.component.interfaces.ISpellComponent; -import am2.api.spell.enums.SkillPointTypes; -import am2.api.spell.enums.SkillTrees; -import am2.lore.ArcaneCompendium; -import am2.spell.SkillManager; -import am2.spell.SkillTreeManager; -import am2.spell.SpellHelper; -import am2.texture.SpellIconManager; -import com.emoniph.witchery.infusion.infusions.symbols.StrokeSet; -import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.DopeSquid; -import com.ilya3point999k.thaumicconcilium.common.entities.GolemBydlo; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.MadThaumaturge; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.RedPoweredMind; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.Thaumaturge; -import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.EtherealShacklesEntity; -import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ShardPowderEntity; -import com.ilya3point999k.thaumicconcilium.common.golems.AssistantGolemCore; -import com.ilya3point999k.thaumicconcilium.common.golems.ValetGolemCore; import com.ilya3point999k.thaumicconcilium.common.integration.minetweaker.MineTweakerIntegration; -import com.ilya3point999k.thaumicconcilium.common.items.wands.Bracelets; -import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; -import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketFXLightning; -import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; -import com.ilya3point999k.thaumicconcilium.common.spells.CrimsonRaid; import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import fox.spiteful.forbidden.Config; -import fox.spiteful.forbidden.DarkAspects; import fox.spiteful.forbidden.compat.Compat; -import fox.spiteful.forbidden.items.ForbiddenItems; -import makeo.gadomancy.api.AuraEffect; -import makeo.gadomancy.api.GadomancyApi; -import net.minecraft.entity.*; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.passive.EntitySquid; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityArrow; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.*; -import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; -import org.apache.logging.log4j.Level; -import tb.api.ITobacco; -import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; -import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.wands.StaffRod; -import thaumcraft.api.wands.WandCap; -import thaumcraft.api.wands.WandRod; -import thaumcraft.codechicken.lib.vec.Vector3; -import thaumcraft.common.Thaumcraft; -import thaumcraft.common.config.ConfigBlocks; -import thaumcraft.common.config.ConfigItems; -import thaumcraft.common.lib.utils.EntityUtils; import thaumic.tinkerer.common.core.handler.ConfigHandler; -import thaumic.tinkerer.common.core.helper.MiscHelper; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; public class Integration { @@ -86,24 +19,24 @@ public class Integration { public static boolean automagy = false; public static boolean dyes = false; public static boolean witchery = false; + public static boolean bloodArsenal = false; + public static boolean alfheim = false; + public static boolean avaritia = false; public static boolean minetweaker = false; public static Class witcheryClass; public static Class witcheryInfusionClass; - public static Class witcheryEffectRegistryClass; - public static Class witcheryConstClass; - public static Class witcheryTimeUtilClass; public static Class crystalEye = null; public static Item crimsonDagger = null; public static boolean allowTobacco = false; - public static ITobacco tobacco = null; public static Item tobaccoitem = null; public static Item tobaccoleaves = null; public static Item tmMaterial = null; public static Item earmuffs = null; + public static Item witchery_ingredient = null; public static Item paladinHelm = null; public static Item archerHelm = null; public static Item archerChest = null; @@ -111,9 +44,13 @@ public class Integration { public static Item rangerHelm = null; public static Item rangerChest = null; public static Item rangerLegs = null; + public static Item bloodMoney = null; public static String[] spellNames = new String[]{"Crimson_Raid"}; - public static CrimsonRaid crimson_raid_component; + public static int alfheimDimension = 0; + public static Aspect tinctura = null; + public static boolean tincturaAllowed = false; + public static int tintPotionId = -1; public static void preInit() throws Exception { thaumicBases = Loader.isModLoaded("thaumicbases"); @@ -123,241 +60,59 @@ public class Integration { automagy = Loader.isModLoaded("Automagy"); dyes = Loader.isModLoaded("thaumicdyes"); witchery = Loader.isModLoaded("witchery"); + bloodArsenal = Loader.isModLoaded("BloodArsenal"); + alfheim = Loader.isModLoaded("alfheim"); + avaritia = Loader.isModLoaded("Avaritia"); minetweaker = Loader.isModLoaded("MineTweaker3"); + if (!ConfigHandler.enableKami){ throw new Exception("Thaumic Concilium - turning off KAMI module of Thaumic Tinkerer is not supported."); } if (gadomancy) { - if (horizons) { - GadomancyApi.registerAdditionalGolemCore("assistantCore", new AssistantGolemCore()); + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.GadomancyIntegration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Gadomancy integration: " + t); } - GadomancyApi.registerAdditionalGolemCore("valetCore", new ValetGolemCore()); - final AuraEffect INFERNUS = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityItem; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - EntityItem entityItem = (EntityItem) e; - if (FurnaceRecipes.smelting().getSmeltingResult(entityItem.getEntityItem()) != null) { - final ItemStack stacky = FurnaceRecipes.smelting().getSmeltingResult(entityItem.getEntityItem()); - stacky.stackSize = entityItem.getEntityItem().stackSize; - entityItem.setEntityItemStack(stacky); - } - } - } - - @Override - public int getTickInterval() { - return 5; - } - }.register(DarkAspects.NETHER); - - if (!Config.noLust) { - final AuraEffect LUXURIA = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityAgeable; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - EntityAgeable ageable = (EntityAgeable) e; - if (ageable.getGrowingAge() > 0) { - ageable.setGrowingAge(0); - } - } - } - - @Override - public int getTickInterval() { - return 40; - } - }.register(DarkAspects.LUST); - } - - final AuraEffect GULA = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityPlayer; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - EntityPlayer player = (EntityPlayer) e; - player.getFoodStats().addStats(1, 1.0F); - } - } - - @Override - public int getTickInterval() { - return 20; - } - }.register(DarkAspects.GLUTTONY); - - final AuraEffect IRA = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityMob; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - List list = e.worldObj.getEntitiesWithinAABB(EntityLiving.class, e.boundingBox.expand(8, 8, 8)); - list.remove(e); - if (!list.isEmpty()) { - Collections.shuffle(list); - ((EntityLivingBase) e).setRevengeTarget(list.get(0)); - } - } - } - - @Override - public int getTickInterval() { - return 80; - } - }.register(DarkAspects.WRATH); - - final AuraEffect INVIDIA = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityLivingBase; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - if (e instanceof EntityPlayer) { - return; - } - EntityLivingBase living = (EntityLivingBase) e; - ItemStack stack = living.getHeldItem(); - if (stack != null) { - living.entityDropItem(living.getHeldItem(), 0.5F); - living.setCurrentItemOrArmor(0, null); - } - } - } - - @Override - public int getTickInterval() { - return 80; - } - }.register(DarkAspects.ENVY); - - final AuraEffect DESIDIA = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityLivingBase; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - - EntityLivingBase living = (EntityLivingBase) e; - Collection potions = living.getActivePotionEffects(); - if (!potions.isEmpty()) { - for (PotionEffect potion : potions) { - living.addPotionEffect(new PotionEffect(potion.getPotionID(), potion.getDuration() + 20, potion.getAmplifier(), potion.getIsAmbient())); - } - } - } - } - - @Override - public int getTickInterval() { - return 4; - } - }.register(DarkAspects.SLOTH); - - final AuraEffect SUPERBIA = new AuraEffect.EntityAuraEffect() { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityMob; - } - - @Override - public double getRange() { - return 32; - } - - @Override - public void doEntityEffect(ChunkCoordinates originTile, Entity e) { - if (!e.worldObj.isRemote) { - if (e.getDistanceSq(originTile.posX, originTile.posY, originTile.posZ) < 1024) { - Vector3 target = new Vector3(e.posX - originTile.posX, e.posY, e.posZ - originTile.posZ).multiply(2.0, 1.0, 2.0); - MiscHelper.setEntityMotionFromVector(e, target, 1.0F); - } - } - } - }.register(DarkAspects.PRIDE); } } public static void init(){ if (Compat.am2){ - if(Integration.taintedMagic) { - crimson_raid_component = new CrimsonRaid(); - ArsMagicaApi.instance.registerSkillTreeEntry( - crimson_raid_component, - spellNames[0], - SkillTrees.None, - 25, //x-coord in occulus UI - 175, //y-coord in occulus UI - SkillPointTypes.SILVER - ); - //SkillManager.instance.registerSkillTreeEntry(crimson_raid_component, spellNames[0]); - //SkillTreeManager.instance.RegisterPart(crimson_raid_component, 25, 175, SkillTrees.Offense, SkillPointTypes.RED); + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.AM2Integration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Ars Magica integration: " + t); } } - } public static void postInit() { if (taintedMagic) { - ItemStack is = new ItemStack(TCItemRegistry.resource, 1, 3); - ChestGenHooks.addItem("dungeonChest", new WeightedRandomChestContent(is, 1, 1, 8)); - ChestGenHooks.addItem("pyramidJungleChest", new WeightedRandomChestContent(is, 1, 1, 8)); - ChestGenHooks.addItem("pyramidDesertyChest", new WeightedRandomChestContent(is, 1, 1, 8)); - ChestGenHooks.addItem("mineshaftCorridor", new WeightedRandomChestContent(is, 1, 1, 4)); - ChestGenHooks.addItem("strongholdCorridor", new WeightedRandomChestContent(is, 1, 1, 4)); - ChestGenHooks.addItem("strongholdCrossing", new WeightedRandomChestContent(is, 1, 1, 4)); - ChestGenHooks.addItem("strongholdLibrary", new WeightedRandomChestContent(is, 1, 1, 10)); - ThaumcraftApi.addLootBagItem(is, 30, 2); - Item i = GameRegistry.findItem("TaintedMagic", "ItemCrystalDagger"); - if (i == null) { - i = GameRegistry.findItem("TaintedMagic", "ItemHollowDagger"); + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.TaintedMagicIntegration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Tainted Magic integration: " + t); } - if (i != null) { - crimsonDagger = i; - } else { - ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Tainted Magic's crimson dagger, what a mess"); - } - - tmMaterial = GameRegistry.findItem("TaintedMagic", "ItemMaterial"); - if (tmMaterial == null){ - ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Tainted Magic's material, what a mess"); - } - } - - if (thaumicBases && taintedMagic) { - WandCap shadowmetalCap = WandCap.caps.get("shadowmetal"); - WandRod warpwoodRod = StaffRod.rods.get("warpwood"); - Bracelets.caps[6] = shadowmetalCap; - Bracelets.rods[6] = warpwoodRod; + if (thaumicBases){ + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.BasesIntegration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Thaumic Bases integration: " + t); + } } - if(dyes){ try { paladinHelm = Compat.getItem("thaumicdyes", "CultistPaladinHelm"); @@ -373,354 +128,54 @@ public class Integration { } if (horizons) { - if (thaumicBases){ - try { - if (Class.forName("tb.utils.TBConfig").getField("allowTobacco").getBoolean(null)) { - allowTobacco = true; - tobaccoitem = GameRegistry.findItem("thaumicbases", "tobaccoPowder"); - if (tobaccoitem != null) { - tobacco = (ITobacco) tobaccoitem; - } else { - ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Thaumic Bases's tobacco, what a mess"); - } - tobaccoleaves = GameRegistry.findItem("thaumicbases", "resource"); - if (tobaccoleaves == null) { - ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Thaumic Bases's tobacco leaves, what a mess"); - } - } - } catch (IllegalAccessException | NoSuchFieldException | ClassNotFoundException e) { - throw new RuntimeException(e); - } - } - - - Class th = null; - Class creatureInfusion = null; - - Object recipeList = null; try { - th = Class.forName("com.kentington.thaumichorizons.common.ThaumicHorizons"); - creatureInfusion = Class.forName("com.kentington.thaumichorizons.common.lib.CreatureInfusionRecipe"); - recipeList = th.getDeclaredField("critterRecipes").get(null); - } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { - throw new RuntimeException(e); + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.HorizonsIntegration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Thaumic Horizons integration: " + t); } - - try { - EntityRegistry.registerModEntity(MadThaumaturge.class, "MadThaumaturge", 41, th.getField("instance").get(null), 64, 3, true); - EntityRegistry.registerModEntity(GolemBydlo.class, "GolemBydlo", 42, th.getField("instance").get(null), 64, 3, true); - EntityRegistry.registerModEntity(RedPoweredMind.class, "RedPoweredMind", 43, th.getField("instance").get(null), 64, 3, true); - EntityRegistry.registerModEntity(DopeSquid.class, "DopeSquid", 44, th.getField("instance").get(null), 64, 3, true); - - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (NoSuchFieldException e) { - throw new RuntimeException(e); - } - - Item golemPowder; - try { - golemPowder = Compat.getItem("ThaumicHorizons", "golemPowder"); - } catch (Compat.ItemNotFoundException e) { - throw new RuntimeException(e); - } - - - Object buffGolemRecipe = null; - Object brainLitteringRecipe = null; - try { - buffGolemRecipe = creatureInfusion.getConstructors()[0].newInstance("BUFFGOLEM", 42, (int) 4, new AspectList().add(Aspect.ENERGY, 64).add(Aspect.METAL, 128).add(DarkAspects.PRIDE, 32).add(Aspect.ENTROPY, 128), - MadThaumaturge.class, new ItemStack[]{ - new ItemStack(ConfigItems.itemGolemPlacer, 1, 7), - new ItemStack(golemPowder), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 5), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), - new ItemStack(ConfigItems.itemGolemPlacer, 1, 7), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 9), - new ItemStack(ConfigItems.itemGolemPlacer, 1, 7), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 5), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 4), - new ItemStack(golemPowder) - }, (int) 0); - brainLitteringRecipe = creatureInfusion.getConstructors()[0].newInstance("BRAINLITTERING", 41, 4, new AspectList().add(Aspect.ENTROPY, 64).add(Aspect.ELDRITCH, 64).add(Aspect.MIND, 64), - Thaumaturge.class, new ItemStack[]{ - new ItemStack(ConfigItems.itemResource, 1, 9), - new ItemStack(ForbiddenItems.deadlyShards, 1, 2), - new ItemStack(ConfigItems.itemZombieBrain), - new ItemStack(ForbiddenItems.deadlyShards, 1, 2) - }, 0); - - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(e); - } - ((ArrayList) recipeList).add(buffGolemRecipe); - ((ArrayList) recipeList).add(brainLitteringRecipe); - if (automagy) { - Object redPoweredMindRecipe = null; - try { - redPoweredMindRecipe = creatureInfusion.getConstructors()[0].newInstance("REDPOWEREDMIND", 43, 4, new AspectList().add(Aspect.CRYSTAL, 64).add(Aspect.MIND, 64).add(Aspect.SENSES, 32).add(Aspect.MECHANISM, 32), - MadThaumaturge.class, new ItemStack[]{ - new ItemStack(ConfigItems.itemBucketDeath), - new ItemStack(Items.repeater), - new ItemStack(Blocks.redstone_block), - new ItemStack(Blocks.redstone_block), - new ItemStack(Blocks.redstone_block), - new ItemStack(ConfigItems.itemBucketDeath), - new ItemStack(ConfigItems.itemResource, 1, 17), - new ItemStack(ConfigItems.itemBucketDeath), - new ItemStack(Blocks.redstone_block), - new ItemStack(Blocks.redstone_block), - new ItemStack(Blocks.redstone_block), - new ItemStack(Items.comparator) - }, 0); - } catch (InstantiationException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } - ((ArrayList) recipeList).add(redPoweredMindRecipe); - - try { - crystalEye = Class.forName("tuhljin.automagy.items.ItemCrystalEye"); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } - } - - if (thaumicBases && allowTobacco){ - Object dopeSquidRecipe = null; - try { - dopeSquidRecipe = creatureInfusion.getConstructors()[0].newInstance("DOPESQUID", 44, 4, new AspectList().add(Aspect.PLANT, 64).add(Aspect.MAGIC, 64).add(Aspect.MAN, 32).add(Aspect.FLIGHT, 64), - EntitySquid.class, new ItemStack[]{ - new ItemStack(ConfigItems.itemShard, 1, 0), - new ItemStack(tobaccoitem, 1, 1), - new ItemStack(tobaccoitem, 1, 2), - new ItemStack(tobaccoitem, 1, 3), - new ItemStack(tobaccoitem, 1, 4), - new ItemStack(ConfigItems.itemShard, 1, 1), - new ItemStack(tobaccoitem, 1, 5), - new ItemStack(tobaccoitem, 1, 6), - new ItemStack(tobaccoitem, 1, 7), - new ItemStack(tobaccoitem, 1, 8) - }, 0); - } catch (InstantiationException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } - ((ArrayList) recipeList).add(dopeSquidRecipe); - - } - } if (witchery) { try { - witcheryClass = Class.forName("com.emoniph.witchery.Witchery"); - witcheryInfusionClass = Class.forName("com.emoniph.witchery.infusion.Infusion"); - witcheryEffectRegistryClass = Class.forName("com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry"); - witcheryConstClass = Class.forName("com.emoniph.witchery.util.Const"); - witcheryTimeUtilClass = Class.forName("com.emoniph.witchery.util.TimeUtil"); - earmuffs = Compat.getItem("witchery", "earmuffs"); - final Object instance = witcheryEffectRegistryClass.getDeclaredMethod("instance").invoke(null); - Method addEffect = instance.getClass().getMethod("addEffect", SymbolEffect.class, StrokeSet[].class); - addEffect.invoke(instance, new SymbolEffect(90, "tc.spell.incarcerous", 2, true, false, "incarcerous", 0) { - @Override - public void perform(World world, EntityPlayer player, int level) { - int inf = -1; - try { - inf = (int) witcheryInfusionClass.getMethod("getInfusionID", EntityPlayer.class).invoke(instance, player); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - if (inf == 4) { - EtherealShacklesEntity shackles = new EtherealShacklesEntity(world); - shackles.setLocationAndAngles(player.posX, player.posY + (double) player.getEyeHeight(), player.posZ, player.rotationYaw, player.rotationPitch); - shackles.motionX = (double) (-MathHelper.sin(shackles.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(shackles.rotationPitch / 180.0F * (float) Math.PI)); - shackles.motionZ = (double) (MathHelper.cos(shackles.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(shackles.rotationPitch / 180.0F * (float) Math.PI)); - shackles.motionY = (double) (-MathHelper.sin(shackles.rotationPitch / 180.0F * (float) Math.PI)); - for (int i = 0; i < 3; i++) { - shackles.moveEntity(shackles.motionX, shackles.motionY, shackles.motionZ); - } + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.WitcheryIntegration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Witchery integration: " + t); + } + } - shackles.setThrowableHeading(shackles.motionX, shackles.motionY, shackles.motionZ, 2.0F, 2.0F); - world.spawnEntityInWorld(shackles); - shackles.playSound(ThaumicConcilium.MODID+":shackles_throw", 0.5F, 1.0F); - } else { - int orbs = 2 + player.worldObj.rand.nextInt(3); - Vec3 look = player.getLookVec(); - world.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)player.posX, (int)player.posY, (int)player.posZ, 0); - for (int i = 0; i < orbs; i++) { - ShardPowderEntity orb = new ShardPowderEntity(player, player.posX + (look.xCoord) , player.posY + player.getEyeHeight() + (look.yCoord), player.posZ + (look.zCoord), 12); - orb.posX -= (double) (Math.cos(player.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); - orb.posY -= 0.5; - orb.posZ -= (double) (Math.sin(player.rotationYaw / 180.0F * (float) Math.PI) * 0.16F); - orb.setPosition(orb.posX, orb.posY, orb.posZ); - orb.yOffset = 0.0F; - float f = 0.4F; - orb.motionX = (double)(-MathHelper.sin(player.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float)Math.PI) * f); - orb.motionZ = (double)(MathHelper.cos(player.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float)Math.PI) * f); - orb.motionY = (double)(-MathHelper.sin((player.rotationPitch) / 180.0F * (float)Math.PI) * f); - float f2 = MathHelper.sqrt_double(orb.motionX * orb.motionX + orb.motionY * orb.motionY + orb.motionZ * orb.motionZ); - orb.motionX /= f2; - orb.motionY /= f2; - orb.motionZ /= f2; - orb.motionX += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double)12; - orb.motionY += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double)12; - orb.motionZ += orb.worldObj.rand.nextGaussian() * 0.007499999832361937D * (double)12; - player.worldObj.spawnEntityInWorld(orb); - } - } - - } - }, new StrokeSet[]{new StrokeSet(new byte[]{2, 2, 2, 0, 3, 3, 1})}); - - addEffect.invoke(instance, new SymbolEffect(91, "tc.spell.arrow", 2, false, false, "arrowspell", 0) { - @Override - public void perform(World world, EntityPlayer player, int level) { - int inf = -1; - try { - inf = (int) witcheryInfusionClass.getMethod("getInfusionID", EntityPlayer.class).invoke(instance, player); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - if (inf == 2) { - int weapon = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.WEAPON); - EntityArrow entityarrow = new EntityArrow(world, player, 2.0F); - entityarrow.setIsCritical(true); - double dmg = Math.sqrt(weapon) * 1.5; - entityarrow.setDamage(1 + dmg); - entityarrow.canBePickedUp = 2; - world.spawnEntityInWorld(entityarrow); - } else { - EntityArrow entityarrow = new EntityArrow(world, player, 2.0F); - entityarrow.setIsCritical(true); - entityarrow.setDamage(entityarrow.getDamage() + 5.0D); - entityarrow.canBePickedUp = 2; - world.spawnEntityInWorld(entityarrow); - } - } - }, new StrokeSet[]{new StrokeSet(new byte[]{1, 1, 1, 3})}); - - addEffect.invoke(instance, new SymbolEffect(92, "tc.spell.spider", 2, false, false, "spiderspell", 0) { - @Override - public void perform(World world, EntityPlayer player, int level) { - int inf = -1; - try { - inf = (int) witcheryInfusionClass.getMethod("getInfusionID", EntityPlayer.class).invoke(instance, player); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - Entity e = EntityUtils.getPointedEntity(world, player, 1.0, 32.0, 1.0F); - if (e instanceof EntityMob) { - EntityMob mob = (EntityMob) e; - if (mob.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) { - if (!e.isDead) { - player.worldObj.playSoundAtEntity(player,"thaumcraft:craftfail", 1.0F, 1.0F); - TCPacketHandler.INSTANCE.sendToAllAround(new PacketFXLightning((float) player.posX, (float) (player.posY + player.height - 0.5), (float) player.posZ, (float) e.posX, (float) (e.posY + e.height / 2), (float) e.posZ, 0xFFFFFF, 0.02F), new NetworkRegistry.TargetPoint(world.provider.dimensionId, player.posX, player.posY, player.posZ, 32.0)); - if (inf == 1) { - int light = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.LIGHT); - double dmg = Math.sqrt(light) * 2.5; - e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), (float) (1 + dmg)); - } else { - e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), world.rand.nextInt(30) + level * 2); - } - } - } - } - } - }, new StrokeSet[]{new StrokeSet(new byte[]{0, 0, 0, 2, 1, 1, 0, 0})}); - - addEffect.invoke(instance, new SymbolEffect(93, "tc.spell.undead", 2, false, false, "spellundead", 0) { - @Override - public void perform(World world, EntityPlayer player, int level) { - int inf = -1; - try { - inf = (int) witcheryInfusionClass.getMethod("getInfusionID", EntityPlayer.class).invoke(instance, player); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - - Entity e = EntityUtils.getPointedEntity(world, player, 1.0, 32.0, 1.0F); - if (e instanceof EntityMob) { - EntityMob mob = (EntityMob) e; - if (mob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { - if (!e.isDead) { - player.worldObj.playSoundAtEntity(player,"thaumcraft:craftfail", 1.0F, 1.0F); - TCPacketHandler.INSTANCE.sendToAllAround(new PacketFXLightning((float) player.posX, (float) (player.posY + player.height - 0.5), (float) player.posZ, (float) e.posX, (float) (e.posY + e.height / 2), (float) e.posZ, 0xFFFFFF, 0.02F), new NetworkRegistry.TargetPoint(world.provider.dimensionId, player.posX, player.posY, player.posZ, 32.0)); - if (inf == 1) { - int light = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.LIGHT); - double dmg = Math.sqrt(light) * 2.5; - e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), (float) (1 + dmg)); - } else { - e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), world.rand.nextInt(30) + level * 2); - } - } - } - } - } - }, new StrokeSet[]{new StrokeSet(1, new byte[]{1, 1, 1, 0, 3, 2, 2}), new StrokeSet(3, new byte[]{1, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 2, 2})}); - - addEffect.invoke(instance, new SymbolEffect(94, "tc.spell.blind", 2, false, false, "conjunctivitis", 0) { - @Override - public void perform(World world, EntityPlayer player, int level) { - int inf = -1; - try { - inf = (int) witcheryInfusionClass.getMethod("getInfusionID", EntityPlayer.class).invoke(instance, player); - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } - int dur = 200; - if (inf == 4) { - int darkness = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.DARKNESS); - dur += darkness; - } - Entity e = EntityUtils.getPointedEntity(world, player, 1.0, 32.0, 1.0F); - if (e instanceof EntityLiving) { - player.worldObj.playSoundAtEntity(player,"thaumcraft:craftfail", 1.0F, 1.0F); - PotionEffect effect = new PotionEffect(thaumcraft.common.config.Config.potionBlurredID, dur + 200, 60); - effect.getCurativeItems().clear(); - ((EntityLivingBase) e).addPotionEffect(effect); - if (inf == 4) { - PotionEffect effect1 = new PotionEffect(Potion.blindness.id, dur, 60); - effect1.getCurativeItems().clear(); - ((EntityLivingBase) e).addPotionEffect(effect1); - } - } - } - }, new StrokeSet[]{new StrokeSet(new byte[]{0, 0, 3, 3, 1, 1, 2, 2})}); - } catch (ClassNotFoundException | NoSuchMethodException | IllegalAccessException | - InvocationTargetException | Compat.ItemNotFoundException e) { + if (bloodArsenal){ + try { + bloodMoney = Compat.getItem("BloodArsenal", "blood_money"); + } catch (Compat.ItemNotFoundException e) { + System.err.println("[ThaumicConcilium] Failed to find Blood Arsenal' Blood Money: " + e); throw new RuntimeException(e); } } + if (alfheim){ + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.AlfheimIntegration"); + Method m = clazz.getMethod("register"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Alfheim integration: " + t); + } + } + + if (gadomancy) { + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.integration.GadomancyIntegration"); + Method m = clazz.getMethod("postRegister"); + m.invoke(null); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Gadomancy integration: " + t); + } + } + if(minetweaker) { MineTweakerIntegration.register(); ThaumicConcilium.logger.info("MineTweaker integration loaded"); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/TaintedMagicIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/TaintedMagicIntegration.java new file mode 100644 index 0000000..5c9b8ee --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/TaintedMagicIntegration.java @@ -0,0 +1,49 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.items.wands.Bracelets; +import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraftforge.common.ChestGenHooks; +import org.apache.logging.log4j.Level; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.wands.StaffRod; +import thaumcraft.api.wands.WandCap; +import thaumcraft.api.wands.WandRod; + +public class TaintedMagicIntegration { + public static void register() { + ItemStack is = new ItemStack(TCItemRegistry.resource, 1, 3); + ChestGenHooks.addItem("dungeonChest", new WeightedRandomChestContent(is, 1, 1, 8)); + ChestGenHooks.addItem("pyramidJungleChest", new WeightedRandomChestContent(is, 1, 1, 8)); + ChestGenHooks.addItem("pyramidDesertyChest", new WeightedRandomChestContent(is, 1, 1, 8)); + ChestGenHooks.addItem("mineshaftCorridor", new WeightedRandomChestContent(is, 1, 1, 4)); + ChestGenHooks.addItem("strongholdCorridor", new WeightedRandomChestContent(is, 1, 1, 4)); + ChestGenHooks.addItem("strongholdCrossing", new WeightedRandomChestContent(is, 1, 1, 4)); + ChestGenHooks.addItem("strongholdLibrary", new WeightedRandomChestContent(is, 1, 1, 10)); + ThaumcraftApi.addLootBagItem(is, 30, 2); + Item i = GameRegistry.findItem("TaintedMagic", "ItemCrystalDagger"); + if (i == null) { + i = GameRegistry.findItem("TaintedMagic", "ItemHollowDagger"); + } + if (i != null) { + Integration.crimsonDagger = i; + } else { + ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Tainted Magic's crimson dagger, what a mess"); + } + + Integration.tmMaterial = GameRegistry.findItem("TaintedMagic", "ItemMaterial"); + if (Integration.tmMaterial == null){ + ThaumicConcilium.logger.log(Level.ERROR, "Couldn't find Tainted Magic's material, what a mess"); + } + if(Integration.thaumicBases) { + WandCap shadowmetalCap = WandCap.caps.get("shadowmetal"); + WandRod warpwoodRod = StaffRod.rods.get("warpwood"); + Bracelets.caps[6] = shadowmetalCap; + Bracelets.rods[6] = warpwoodRod; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/WitcheryIntegration.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/WitcheryIntegration.java new file mode 100644 index 0000000..91854ed --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/integration/WitcheryIntegration.java @@ -0,0 +1,195 @@ +package com.ilya3point999k.thaumicconcilium.common.integration; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.infusion.Infusion; +import com.emoniph.witchery.infusion.infusions.symbols.EffectRegistry; +import com.emoniph.witchery.infusion.infusions.symbols.StrokeSet; +import com.emoniph.witchery.infusion.infusions.symbols.SymbolEffect; +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.EtherealShacklesEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ShardPowderEntity; +import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; +import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketFXLightning; +import cpw.mods.fml.common.network.NetworkRegistry; +import fox.spiteful.forbidden.compat.Compat; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityArrow; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import thaumcraft.api.aspects.Aspect; +import thaumcraft.common.Thaumcraft; +import thaumcraft.common.lib.utils.EntityUtils; + +public class WitcheryIntegration { + public static void register() { + try { + Integration.witcheryClass = Class.forName("com.emoniph.witchery.Witchery"); + Integration.witcheryInfusionClass = Class.forName("com.emoniph.witchery.infusion.Infusion"); + Integration.earmuffs = Compat.getItem("witchery", "earmuffs"); + Integration.witchery_ingredient = Compat.getItem("witchery", "ingredient"); + Integration.tintPotionId = Witchery.Potions.COLORFUL.getId(); + EffectRegistry.instance().addEffect(new SymbolEffect(90, "tc.spell.incarcerous", 2, true, false, "incarcerous", 0) { + @Override + public void perform(World world, EntityPlayer player, int level) { + int inf = Infusion.getInfusionID(player); + + if (inf == 4) { + EtherealShacklesEntity shackles = new EtherealShacklesEntity(world); + shackles.setLocationAndAngles(player.posX, player.posY + player.getEyeHeight(), player.posZ, player.rotationYaw, player.rotationPitch); + shackles.motionX = -MathHelper.sin(shackles.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(shackles.rotationPitch / 180.0F * (float) Math.PI); + shackles.motionZ = MathHelper.cos(shackles.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(shackles.rotationPitch / 180.0F * (float) Math.PI); + shackles.motionY = -MathHelper.sin(shackles.rotationPitch / 180.0F * (float) Math.PI); + for (int i = 0; i < 3; i++) shackles.moveEntity(shackles.motionX, shackles.motionY, shackles.motionZ); + shackles.setThrowableHeading(shackles.motionX, shackles.motionY, shackles.motionZ, 2.0F, 2.0F); + world.spawnEntityInWorld(shackles); + shackles.playSound(ThaumicConcilium.MODID + ":shackles_throw", 0.5F, 1.0F); + } else { + int orbs = 2 + player.worldObj.rand.nextInt(3); + Vec3 look = player.getLookVec(); + world.playAuxSFXAtEntity(null, 1008, (int) player.posX, (int) player.posY, (int) player.posZ, 0); + for (int i = 0; i < orbs; i++) { + ShardPowderEntity orb = new ShardPowderEntity(player, player.posX + look.xCoord, player.posY + player.getEyeHeight() + look.yCoord, player.posZ + look.zCoord, 12); + orb.posX -= Math.cos(player.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + orb.posY -= 0.5; + orb.posZ -= Math.sin(player.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + orb.setPosition(orb.posX, orb.posY, orb.posZ); + orb.yOffset = 0.0F; + float f = 0.4F; + orb.motionX = -MathHelper.sin(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f; + orb.motionZ = MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(player.rotationPitch / 180.0F * (float) Math.PI) * f; + orb.motionY = -MathHelper.sin(player.rotationPitch / 180.0F * (float) Math.PI) * f; + float f2 = MathHelper.sqrt_double(orb.motionX * orb.motionX + orb.motionY * orb.motionY + orb.motionZ * orb.motionZ); + orb.motionX /= f2; + orb.motionY /= f2; + orb.motionZ /= f2; + orb.motionX += orb.worldObj.rand.nextGaussian() * 0.0075D * 12; + orb.motionY += orb.worldObj.rand.nextGaussian() * 0.0075D * 12; + orb.motionZ += orb.worldObj.rand.nextGaussian() * 0.0075D * 12; + player.worldObj.spawnEntityInWorld(orb); + } + } + + } + }, new StrokeSet(new byte[]{2, 2, 2, 0, 3, 3, 1})); + + EffectRegistry.instance().addEffect(new SymbolEffect(91, "tc.spell.arrow", 2, false, false, "arrowspell", 0) { + @Override + public void perform(World world, EntityPlayer player, int i) { + int inf = Infusion.getInfusionID(player); + if (inf == 2) { + int weapon = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.WEAPON); + EntityArrow entityarrow = new EntityArrow(world, player, 2.0F); + entityarrow.setIsCritical(true); + double dmg = Math.sqrt(weapon) * 1.5; + entityarrow.setDamage(1 + dmg); + entityarrow.canBePickedUp = 2; + world.spawnEntityInWorld(entityarrow); + } else { + EntityArrow entityarrow = new EntityArrow(world, player, 2.0F); + entityarrow.setIsCritical(true); + entityarrow.setDamage(entityarrow.getDamage() + 5.0D); + entityarrow.canBePickedUp = 2; + world.spawnEntityInWorld(entityarrow); + } + + } + }, new StrokeSet(new byte[]{1, 1, 1, 3})); + + EffectRegistry.instance().addEffect(new SymbolEffect(92, "tc.spell.spider", 2, false, false, "spiderspell", 0) { + @Override + public void perform(World world, EntityPlayer player, int level) { + int inf = Infusion.getInfusionID(player); + Entity e = EntityUtils.getPointedEntity(world, player, 1.0, 32.0, 1.0F); + if (e instanceof EntityMob) { + EntityMob mob = (EntityMob) e; + if (mob.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) { + if (!e.isDead) { + player.worldObj.playSoundAtEntity(player, "thaumcraft:craftfail", 1.0F, 1.0F); + TCPacketHandler.INSTANCE.sendToAllAround(new PacketFXLightning( + (float) player.posX, (float) (player.posY + player.height - 0.5), + (float) player.posZ, (float) e.posX, (float) (e.posY + e.height / 2), + (float) e.posZ, 0xFFFFFF, 0.02F + ), new NetworkRegistry.TargetPoint(world.provider.dimensionId, player.posX, player.posY, player.posZ, 32.0)); + + if (inf == 1) { + int light = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.LIGHT); + double dmg = Math.sqrt(light) * 2.5; + e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), (float) (1 + dmg)); + } else { + e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), world.rand.nextInt(30) + level * 2); + } + } + } + } + } + }, new StrokeSet(new byte[]{0, 0, 0, 2, 1, 1, 0, 0})); + + EffectRegistry.instance().addEffect(new SymbolEffect(93, "tc.spell.undead", 2, false, false, "spellundead", 0) { + @Override + public void perform(World world, EntityPlayer player, int level) { + int inf = Infusion.getInfusionID(player); + Entity e = EntityUtils.getPointedEntity(world, player, 1.0, 32.0, 1.0F); + if (e instanceof EntityMob) { + EntityMob mob = (EntityMob) e; + if (mob.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { + if (!e.isDead) { + player.worldObj.playSoundAtEntity(player, "thaumcraft:craftfail", 1.0F, 1.0F); + TCPacketHandler.INSTANCE.sendToAllAround(new PacketFXLightning( + (float) player.posX, (float) (player.posY + player.height - 0.5), + (float) player.posZ, (float) e.posX, (float) (e.posY + e.height / 2), + (float) e.posZ, 0xFFFFFF, 0.02F + ), new NetworkRegistry.TargetPoint(world.provider.dimensionId, player.posX, player.posY, player.posZ, 32.0)); + + if (inf == 1) { + int light = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.LIGHT); + double dmg = Math.sqrt(light) * 2.5; + e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), (float) (1 + dmg)); + } else { + e.attackEntityFrom(DamageSource.causePlayerDamage(player).setMagicDamage(), world.rand.nextInt(30) + level * 2); + } + } + } + } + } + }, new StrokeSet(1, new byte[]{1, 1, 1, 0, 3, 2, 2}), new StrokeSet(2, new byte[]{1, 1, 1, 1, 1, 0, 0, 3, 3, 2, 2, 2, 2})); + + EffectRegistry.instance().addEffect(new SymbolEffect(94, "tc.spell.blind", 2, false, false, "conjunctivitis", 0) { + @Override + public void perform(World world, EntityPlayer player, int i) { + int inf = Infusion.getInfusionID(player); + int dur = 200; + if (inf == 4) { + int darkness = Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), Aspect.DARKNESS); + dur += darkness; + } + + Entity e = EntityUtils.getPointedEntity(world, player, 1.0, 32.0, 1.0F); + if (e instanceof EntityLiving) { + player.worldObj.playSoundAtEntity(player, "thaumcraft:craftfail", 1.0F, 1.0F); + PotionEffect effect = new PotionEffect(thaumcraft.common.config.Config.potionBlurredID, dur + 200, 60); + effect.getCurativeItems().clear(); + ((EntityLivingBase) e).addPotionEffect(effect); + if (inf == 4) { + PotionEffect effect1 = new PotionEffect(Potion.blindness.id, dur, 60); + effect1.getCurativeItems().clear(); + ((EntityLivingBase) e).addPotionEffect(effect1); + } + } + + } + }, new StrokeSet(new byte[]{0, 0, 3, 3, 1, 1, 2, 2})); + + } catch (ClassNotFoundException | Compat.ItemNotFoundException e) { + throw new RuntimeException(e); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/BottleOfThickTaint.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/BottleOfThickTaint.java index 7e57eaa..b6991e7 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/BottleOfThickTaint.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/BottleOfThickTaint.java @@ -2,13 +2,10 @@ package com.ilya3point999k.thaumicconcilium.common.items; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.BottleOfThickTaintEntity; -import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; public class BottleOfThickTaint extends Item { public BottleOfThickTaint(ToolMaterial material) { diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemGolemCore.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemGolemCore.java index 15bb3f5..566c7df 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemGolemCore.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemGolemCore.java @@ -19,6 +19,7 @@ public class ItemGolemCore extends Item { @SideOnly(Side.CLIENT) public IIcon iconAssistance; public IIcon iconValet; + //public IIcon iconBurlak; public ItemGolemCore() { this.setMaxStackSize(64); @@ -35,6 +36,7 @@ public class ItemGolemCore extends Item { public void registerIcons(final IIconRegister ir) { this.iconAssistance = ir.registerIcon(ThaumicConcilium.MODID+":assistance_core"); this.iconValet = ir.registerIcon(ThaumicConcilium.MODID+":valet_core"); + //this.iconBurlak = ir.registerIcon(ThaumicConcilium.MODID+":burlak_core"); } @Override @@ -43,6 +45,7 @@ public class ItemGolemCore extends Item { lst.add(new ItemStack(item, 1, 0)); } lst.add(new ItemStack(item, 1, 1)); + //lst.add(new ItemStack(item, 1, 2)); } public String getItemStackDisplayName(final ItemStack stack) { @@ -62,6 +65,9 @@ public class ItemGolemCore extends Item { case 1:{ return this.iconValet; } + case 2:{ + return this.iconAssistance; + } default: { return this.iconAssistance; } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemResource.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemResource.java index a82ccd1..17c0e8e 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemResource.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemResource.java @@ -1,13 +1,13 @@ package com.ilya3point999k.thaumicconcilium.common.items; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.mobs.*; +import com.ilya3point999k.thaumicconcilium.common.entities.items.EntityItemFireResistant; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.EnumRarity; @@ -24,11 +24,13 @@ import java.util.List; public class ItemResource extends Item { @SideOnly(Side.CLIENT) - public IIcon iconSummonDevice; + public IIcon iconBlank; public IIcon iconPrimordialLife; public IIcon iconVoidSlag; public IIcon iconCrimsonAnnales; + public IIcon iconNetherMembrane; + public static String TAG_MEMBRANE = "Nether_Membrane_Tag"; public ItemResource() { this.setCreativeTab(ThaumicConcilium.tabTC); @@ -39,10 +41,8 @@ public class ItemResource extends Item { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if (!world.isRemote) { - switch (stack.getItemDamage()) { case 0: { - spawnThaumaturges(player); stack.stackSize--; break; } @@ -66,12 +66,13 @@ public class ItemResource extends Item { @SideOnly(Side.CLIENT) public void registerIcons(final IIconRegister ir) { - this.iconSummonDevice = ir.registerIcon(ThaumicConcilium.MODID+":iconThaumaturge"); + this.iconBlank = ir.registerIcon(ThaumicConcilium.MODID+":iconThaumaturge"); this.iconPrimordialLife = ir.registerIcon(ThaumicConcilium.MODID+":primordial_life"); this.iconVoidSlag = ir.registerIcon(ThaumicConcilium.MODID+":void_slag"); if (Integration.taintedMagic) { this.iconCrimsonAnnales = ir.registerIcon(ThaumicConcilium.MODID + ":crimson_annales"); } + this.iconNetherMembrane = ir.registerIcon(ThaumicConcilium.MODID+":nether_membrane"); } @Override @@ -91,6 +92,7 @@ public class ItemResource extends Item { if (Integration.taintedMagic){ lst.add(new ItemStack(item, 1, 3)); } + lst.add(new ItemStack(item, 1, 4)); } @Override @@ -100,13 +102,17 @@ public class ItemResource extends Item { case 1:{ return EnumRarity.epic; } - case 2:{ + case 2: + { return EnumRarity.common; } case 3:{ if (Integration.taintedMagic) { return EnumRarity.uncommon; - } + } else return EnumRarity.common; + } + case 4:{ + return EnumRarity.uncommon; } default: { return EnumRarity.common; @@ -127,8 +133,11 @@ public class ItemResource extends Item { if (Integration.taintedMagic) { return StatCollector.translateToLocal("item.CrimsonAnnales.name"); } + return ""; + } + case 4:{ + return StatCollector.translateToLocal("item.NetherMembrane.name"); } - default: { return ""; } @@ -139,7 +148,7 @@ public class ItemResource extends Item { public IIcon getIconFromDamage(final int md) { switch (md) { case 0: { - return this.iconSummonDevice; + return this.iconBlank; } case 1:{ return this.iconPrimordialLife; @@ -151,9 +160,13 @@ public class ItemResource extends Item { if (Integration.taintedMagic) { return this.iconCrimsonAnnales; } + return this.iconBlank; + } + case 4:{ + return this.iconNetherMembrane; } default: { - return this.iconSummonDevice; + return this.iconBlank; } } } @@ -177,55 +190,43 @@ public class ItemResource extends Item { } - private static void spawnThaumaturges(EntityPlayer player) { - int amount = player.worldObj.rand.nextInt(6) + 6; - for (int n = 0; n < amount; n++) { - EntityMob mob; - int roll = player.worldObj.rand.nextInt(5); - switch (roll){ - case 0:{ - mob = new Dissolved(player.worldObj); - break; - } - case 1:{ - mob = new Overanimated(player.worldObj); - break; - } - case 2:{ - mob = new QuicksilverElemental(player.worldObj); - break; - } + @Override + public Entity createEntity(World world, Entity location, ItemStack itemstack) { + if (itemstack != null){ + switch (itemstack.getItemDamage()){ + case 0: + case 1: + case 2: case 3:{ - mob = new Samurai(player.worldObj); - break; + return super.createEntity(world, location, itemstack); } case 4:{ - mob = new VengefulGolem(player.worldObj); - break; - } - default:{ - mob = new Samurai(player.worldObj); - } - } - int i = MathHelper.floor_double(player.posX); - int j = MathHelper.floor_double(player.posY); - int k = MathHelper.floor_double(player.posZ); - - for (int l = 0; l < 50; ++l) { - int i1 = i + MathHelper.getRandomIntegerInRange(player.worldObj.rand, 7, 24) * MathHelper.getRandomIntegerInRange(player.worldObj.rand, -1, 1); - int j1 = j + MathHelper.getRandomIntegerInRange(player.worldObj.rand, 7, 24) * MathHelper.getRandomIntegerInRange(player.worldObj.rand, -1, 1); - int k1 = k + MathHelper.getRandomIntegerInRange(player.worldObj.rand, 7, 24) * MathHelper.getRandomIntegerInRange(player.worldObj.rand, -1, 1); - if (World.doesBlockHaveSolidTopSurface(player.worldObj, i1, j1 - 1, k1)) { - mob.setPosition((double) i1, (double) j1, (double) k1); - if (player.worldObj.checkNoEntityCollision(mob.boundingBox) && player.worldObj.getCollidingBoundingBoxes(mob, mob.boundingBox).isEmpty() && !player.worldObj.isAnyLiquid(mob.boundingBox)) { - mob.setTarget(player); - mob.setAttackTarget(player); - player.worldObj.spawnEntityInWorld(mob); - break; - } + EntityItemFireResistant item = new EntityItemFireResistant(world, location.posX, location.posY, location.posZ, itemstack); + item.motionX = location.motionX; + item.motionY = location.motionY; + item.motionZ = location.motionZ; + item.delayBeforeCanPickup = 40; + return item; } } } + return super.createEntity(world, location, itemstack); } + @Override + public boolean hasCustomEntity(ItemStack stack) { + if (stack == null) return false; + switch (stack.getItemDamage()){ + case 0: + case 1: + case 2: + case 3:{ + return false; + } + case 4:{ + return true; + } + } + return false; + } } \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemSpellIcon.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemSpellIcon.java index afb75bd..e053136 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemSpellIcon.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/ItemSpellIcon.java @@ -1,18 +1,13 @@ package com.ilya3point999k.thaumicconcilium.common.items; -import am2.api.ArsMagicaApi; -import am2.lore.ArcaneCompendium; import am2.texture.SpellIconManager; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; -import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import fox.spiteful.forbidden.compat.Compat; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.util.IIcon; -import scala.Int; import java.util.HashMap; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/PolishmentDevice.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/PolishmentDevice.java index 8bd012a..713855a 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/PolishmentDevice.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/PolishmentDevice.java @@ -20,7 +20,6 @@ public class PolishmentDevice extends Item { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - return stack; } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/Protobody.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/Protobody.java new file mode 100644 index 0000000..e879112 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/Protobody.java @@ -0,0 +1,39 @@ +package com.ilya3point999k.thaumicconcilium.common.items; + +import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; +import com.ilya3point999k.thaumicconcilium.common.entities.items.EntityItemProtobody; +import net.minecraft.entity.Entity; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class Protobody extends Item { + public Protobody(){ + this.setUnlocalizedName("Protobody"); + this.setCreativeTab(ThaumicConcilium.tabTC); + this.setMaxStackSize(1); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.rare; + } + + @Override + public boolean hasCustomEntity(ItemStack stack) { + return true; + } + + @Override + public Entity createEntity(World world, Entity location, ItemStack itemstack) { + EntityItemProtobody item = new EntityItemProtobody(world, location.posX, location.posY, location.posZ, itemstack); + item.motionX = location.motionX; + item.motionY = location.motionY; + item.motionZ = location.motionZ; + item.delayBeforeCanPickup = 40; + return item; + } + + +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/RiftGem.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/RiftGem.java index cf8943c..27216f3 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/RiftGem.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/RiftGem.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.items; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.VisConductorFoci; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/TerraCastGem.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/TerraCastGem.java index 381c128..0965fca 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/TerraCastGem.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/TerraCastGem.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.items; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.VisConductorFoci; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.relauncher.Side; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/ElementalSurferShorts.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/ElementalSurferShorts.java index 2a1c6fc..4bf84bc 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/ElementalSurferShorts.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/ElementalSurferShorts.java @@ -1,7 +1,6 @@ package com.ilya3point999k.thaumicconcilium.common.items.equipment; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -11,23 +10,16 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.common.util.EnumHelper; -import net.minecraftforge.event.entity.living.LivingEvent; -import org.lwjgl.Sys; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; -import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.codechicken.lib.vec.Vector3; import thaumcraft.common.entities.projectile.EntityEmber; import thaumcraft.common.entities.projectile.EntityFrostShard; import thaumcraft.common.entities.projectile.EntityGolemOrb; -import thaumcraft.common.items.wands.ItemWandCasting; -import thaumic.tinkerer.common.ThaumicTinkerer; import thaumic.tinkerer.common.core.helper.ProjectileHelper; -import java.util.ArrayList; import java.util.Collections; import java.util.List; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/PontifexRobe.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/PontifexRobe.java index cb32ba5..7e7caab 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/PontifexRobe.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/equipment/PontifexRobe.java @@ -14,6 +14,7 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; @@ -26,11 +27,13 @@ import thaumcraft.api.nodes.IRevealer; import java.util.List; public class PontifexRobe extends ItemArmor implements IRunicArmor, IRepairable, IGoggles, IRevealer, IVisDiscountGear, IWarpingGear { - public IIcon[] icons = new IIcon[4]; - final static ArmorMaterial MATERIAL = EnumHelper.addArmorMaterial("TCPONTIFEXROBE", 30, new int[]{4, 8, 7, 4}, 25); + private IIcon[] icons = new IIcon[4]; + private IIcon[] iconsOver = new IIcon[4]; + + public static String base = ThaumicConcilium.MODID + ":textures/models/armor/pontifex_robe.png"; + public static String overlay = ThaumicConcilium.MODID + ":textures/models/armor/pontifex_robe_overlay.png"; + public final static ArmorMaterial MATERIAL = EnumHelper.addArmorMaterial("TCPONTIFEXROBE", 30, new int[]{4, 8, 7, 4}, 25); static PontifexRobeModel model = null; - - public static String chest = ThaumicConcilium.MODID + ":textures/models/armor/pontifex_robe.png"; public PontifexRobe(int j, int k) { super(MATERIAL, j, k); @@ -40,7 +43,8 @@ public class PontifexRobe extends ItemArmor implements IRunicArmor, IRepairable, @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { for (int i = 0; i < 4; i++){ - this.icons[i] = ir.registerIcon(ThaumicConcilium.MODID+":pontifex"+i); + this.icons[i] = ir.registerIcon(ThaumicConcilium.MODID+":pontifex_base"+i); + this.iconsOver[i] = ir.registerIcon(ThaumicConcilium.MODID+":pontifex_overlay"+i); } } @@ -77,10 +81,81 @@ public class PontifexRobe extends ItemArmor implements IRunicArmor, IRepairable, } return null; } + @Override + public boolean hasColor(ItemStack stack) { + return true; + } + + @Override + public int getColor(ItemStack par1ItemStack) + { + NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); + if (nbttagcompound == null) { + return 0xA01818; + } + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + return nbttagcompound1.hasKey("color") ? nbttagcompound1.getInteger("color") : nbttagcompound1 == null ? 0xA01818 : 0xA01818; + } + + public void removeColor(ItemStack par1ItemStack) + { + NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); + if (nbttagcompound != null) + { + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + if (nbttagcompound1.hasKey("color")) { + nbttagcompound1.removeTag("color"); + } + } + } + + + public void func_82813_b(ItemStack par1ItemStack, int par2) { + NBTTagCompound nbttagcompound = par1ItemStack.getTagCompound(); + if(nbttagcompound == null) { + nbttagcompound = new NBTTagCompound(); + par1ItemStack.setTagCompound(nbttagcompound); + } + + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompoundTag("display"); + if(!nbttagcompound.hasKey("display")) { + nbttagcompound.setTag("display", nbttagcompound1); + } + + nbttagcompound1.setInteger("color", par2); + } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return chest; + return type == null ? base : overlay; + } + + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamage(int par1) { + return this.itemIcon; + } + + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int par1, int pass) { + if (super.armorType == 0){ + return pass == 0 ? icons[0] : iconsOver[0]; + } + if (super.armorType == 1){ + return pass == 0 ? icons[1] : iconsOver[1]; + } + if (super.armorType == 2){ + return pass == 0 ? icons[2] : iconsOver[2]; + } + if (super.armorType == 3){ + return pass == 0 ? icons[3] : iconsOver[3]; + } + return icons[0]; } public static boolean isFullSet(EntityPlayer player){ @@ -90,11 +165,6 @@ public class PontifexRobe extends ItemArmor implements IRunicArmor, IRepairable, player.inventory.armorItemInSlot(3) != null && player.inventory.armorItemInSlot(3).getItem() instanceof PontifexRobe; } - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return icons[this.armorType]; - } - public EnumRarity getRarity(ItemStack itemstack) { return EnumRarity.epic; } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/AlchemistSpreeFoci.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/AlchemistSpreeFoci.java index bcfb901..8aa72e6 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/AlchemistSpreeFoci.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/AlchemistSpreeFoci.java @@ -2,7 +2,7 @@ package com.ilya3point999k.thaumicconcilium.common.items.wands.foci; import baubles.api.BaublesApi; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.DistortionEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.DistortionEffectEntity; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.BottleOfClearWaterEntity; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.BottleOfThickTaintEntity; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/VisConductorFoci.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/VisConductorFoci.java index 604134b..fb45a5a 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/VisConductorFoci.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/VisConductorFoci.java @@ -2,8 +2,8 @@ package com.ilya3point999k.thaumicconcilium.common.items.wands.foci; import com.ilya3point999k.thaumicconcilium.client.render.fx.FXColoredLightning; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.MaterialPeeler; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.other.MaterialPeeler; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.ChargedWispEntity; import com.ilya3point999k.thaumicconcilium.common.network.TCPacketHandler; import com.ilya3point999k.thaumicconcilium.common.network.packets.PacketFXLightning; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/WrathAttractionFoci.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/WrathAttractionFoci.java index 35cd79c..0f39cee 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/WrathAttractionFoci.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/items/wands/foci/WrathAttractionFoci.java @@ -1,7 +1,7 @@ package com.ilya3point999k.thaumicconcilium.common.items.wands.foci; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.WrathEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.WrathEffectEntity; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCEntityRegistry.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCEntityRegistry.java index 1c56f35..3f3f63c 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCEntityRegistry.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCEntityRegistry.java @@ -2,8 +2,20 @@ package com.ilya3point999k.thaumicconcilium.common.registry; import com.ilya3point999k.thaumicconcilium.common.TCConfig; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; -import com.ilya3point999k.thaumicconcilium.common.entities.*; +import com.ilya3point999k.thaumicconcilium.common.entities.ItemSpawnerEgg; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.DistortionEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.UpcomingHoleEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.cosmetic.WrathEffectEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.items.EntityItemFireResistant; +import com.ilya3point999k.thaumicconcilium.common.entities.items.EntityItemProtobody; import com.ilya3point999k.thaumicconcilium.common.entities.mobs.*; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.BrightestOne; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.boss.CrimsonPontifex; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.NetherExplorer; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.Protolimb; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.corpse.WitheredBotanist; +import com.ilya3point999k.thaumicconcilium.common.entities.mobs.thaumaturge.Thaumaturge; +import com.ilya3point999k.thaumicconcilium.common.entities.other.*; import com.ilya3point999k.thaumicconcilium.common.entities.projectiles.*; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import cpw.mods.fml.common.registry.EntityRegistry; @@ -11,7 +23,6 @@ import fox.spiteful.forbidden.DarkAspects; import fox.spiteful.forbidden.compat.Compat; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.biome.BiomeGenBase; -import scala.Int; import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -44,6 +55,31 @@ public class TCEntityRegistry { ItemSpawnerEgg.addMapping("Thaumaturge", 0x00FFFF, 0x00008B); ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID+".Thaumaturge", new AspectList().add(Aspect.MAN, 4).add(Aspect.MAGIC, 4).add(Aspect.AURA, 4).add(Aspect.ORDER, 4)); + if (Integration.witchery){ + try { + Class burnedWitch = Class.forName("com.ilya3point999k.thaumicconcilium.common.entities.mobs.BurnedWitch"); + EntityRegistry.registerModEntity(burnedWitch, "BurnedWitch", entityID++, ThaumicConcilium.instance, 64, 3, true); + ItemSpawnerEgg.addMapping("BurnedWitch", 0x00FFFF, 0x00008B); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID+".BurnedWitch", new AspectList().add(Aspect.MAN, 4).add(Aspect.MAGIC, 4).add(Aspect.DEATH, 4).add(DarkAspects.NETHER, 4)); + if (Compat.bm) { + Class sloppyAlchemist = Class.forName("com.ilya3point999k.thaumicconcilium.common.entities.mobs.SloppyAlchemist"); + EntityRegistry.registerModEntity(sloppyAlchemist, "SloppyAlchemist", entityID++, ThaumicConcilium.instance, 64, 3, true); + ItemSpawnerEgg.addMapping("SloppyAlchemist", 0x00FFFF, 0x00008B); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".SloppyAlchemist", new AspectList().add(Aspect.MAN, 4).add(Aspect.TRAP, 4).add(Aspect.EXCHANGE, 4).add(DarkAspects.NETHER, 4)); + + Class chort = Class.forName("com.ilya3point999k.thaumicconcilium.common.entities.mobs.Chort"); + EntityRegistry.registerModEntity(chort, "Chort", entityID++, ThaumicConcilium.instance, 64, 3, true); + ItemSpawnerEgg.addMapping("Chort", 0x00FFFF, 0x00008B); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".Chort", new AspectList().add(Aspect.BEAST, 4).add(Aspect.GREED, 4).add(Aspect.MAGIC, 4).add(DarkAspects.NETHER, 4)); + + EntityRegistry.registerModEntity(ChortSpitEntity.class, "ChortSpit", entityID++, ThaumicConcilium.instance, 64, 3, true); + } + + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } + if(Integration.dyes){ EntityRegistry.registerModEntity(CrimsonArcher.class, "CrimsonArcher", entityID++, ThaumicConcilium.instance, 64, 3, true); ItemSpawnerEgg.addMapping("CrimsonArcher", 0x00FFFF, 0x00008B); @@ -54,6 +90,12 @@ public class TCEntityRegistry { ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".CrimsonRanger", new AspectList().add(Aspect.MAN, 4).add(Aspect.TRAVEL, 4).add(Aspect.LIFE, 4).add(Aspect.ELDRITCH, 4)); } + EntityRegistry.registerModEntity(NetherExplorer.class, "NetherExplorer", entityID++, ThaumicConcilium.instance, 64, 3, true); + ItemSpawnerEgg.addMapping("NetherExplorer", 0x00FFFF, 0x00008B); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".NetherExplorer", new AspectList().add(Aspect.MAN, 4).add(DarkAspects.NETHER, 4).add(Aspect.DEATH, 4).add(Aspect.MAGIC, 4)); + + EntityRegistry.registerModEntity(EntityItemFireResistant.class, "EntityItemFireResistant", entityID++, ThaumicConcilium.instance, 64, 3, true); + if(Compat.botan){ EntityRegistry.registerModEntity(WitheredBotanist.class, "WitheredBotanist", entityID++, ThaumicConcilium.instance, 64, 3, true); ItemSpawnerEgg.addMapping("WitheredBotanist", 0x00FFFF, 0x00008B); @@ -66,7 +108,7 @@ public class TCEntityRegistry { ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".Overanimated", new AspectList().add(Aspect.MAN, 4).add(Aspect.MAGIC, 4).add(Aspect.LIFE, 4).add(Aspect.ELDRITCH, 4)); EntityRegistry.registerModEntity(ThaumGib.class, "ThaumGib", entityID++, ThaumicConcilium.instance, 64, 3, true); - ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".ThaumGib", new AspectList().add(Aspect.MAN, 4).add(Aspect.MAGIC, 4).add(Aspect.LIFE, 4).add(Aspect.ENTROPY, 4)); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".ThaumGib", new AspectList().add(Aspect.FLESH, 4).add(Aspect.MAGIC, 4).add(Aspect.LIFE, 4).add(Aspect.ENTROPY, 4)); if (Integration.thaumicBases && Integration.allowTobacco) { EntityRegistry.registerModEntity(DopeSquid.class, "DopeSquid", entityID++, ThaumicConcilium.instance, 64, 3, true); @@ -116,6 +158,14 @@ public class TCEntityRegistry { EntityRegistry.registerModEntity(EtherealShacklesEntity.class, "EtherealShacklesEntity", entityID++, ThaumicConcilium.instance, 64, 1, true); EntityRegistry.registerModEntity(CrimsonOrbEntity.class, "CrimsonOrbEntity", entityID++, ThaumicConcilium.instance, 64, 1, true); + + if (Integration.horizons) { + EntityRegistry.registerModEntity(Protolimb.class, "Protolimb", entityID++, ThaumicConcilium.instance, 64, 3, true); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID + ".Protolimb", new AspectList().add(Aspect.ELDRITCH, 2).add(Aspect.VOID, 2).add(Aspect.MAN, 2).add(Aspect.FLESH, 2)); + + EntityRegistry.registerModEntity(EntityItemProtobody.class, "EntityItemProtobody", entityID++, ThaumicConcilium.instance, 64, 3, true); + } + } EntityRegistry.registerModEntity(QuicksilverElemental.class, "QuicksilverElemental", entityID++, ThaumicConcilium.instance, 64, 3, true); ItemSpawnerEgg.addMapping("QuicksilverElemental", 0x00FFFF, 0x00008B); @@ -127,7 +177,7 @@ public class TCEntityRegistry { EntityRegistry.registerModEntity(MadThaumaturge.class, "MadThaumaturge", entityID++, ThaumicConcilium.instance, 64, 1, true); ItemSpawnerEgg.addMapping("MadThaumaturge", 0x00FFFF, 0x111111); - ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID+".MadThaumaturge", new AspectList().add(Aspect.MAN, 4).add(Aspect.MIND, 4).add(Aspect.ELDRITCH, 8)); + ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID+".MadThaumaturge", new AspectList().add(Aspect.MAN, 4).add(Aspect.MIND, 4).add(Aspect.ELDRITCH, 4).add(Aspect.VOID, 4)); EntityRegistry.registerModEntity(BrightestOne.class, "BrightestOne", entityID++, ThaumicConcilium.instance, 64, 1, true); ThaumcraftApi.registerEntityTag(ThaumicConcilium.MODID+".BrightestOne", new AspectList().add(Aspect.AURA, 16).add(Aspect.LIFE, 16).add(Aspect.MAGIC, 16)); @@ -145,14 +195,24 @@ public class TCEntityRegistry { EntityRegistry.addSpawn(VengefulGolem.class, TCConfig.vengefulGolemSpawnChance, 1, 2, EnumCreatureType.monster, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.vengefulGolemBiomeBlacklist == null || Arrays.stream(TCConfig.vengefulGolemBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); } if(Integration.horizons) { - EntityRegistry.addSpawn(Overanimated.class, TCConfig.overanimatedSpawnChance, 1, 3, EnumCreatureType.monster, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.overanimatedBiomeBlacklist == null || Arrays.stream(TCConfig.overanimatedBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); + EntityRegistry.addSpawn(Overanimated.class, TCConfig.overanimatedSpawnChance, 1, 2, EnumCreatureType.monster, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.overanimatedBiomeBlacklist == null || Arrays.stream(TCConfig.overanimatedBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); } if (Integration.dyes) { EntityRegistry.addSpawn(CrimsonRanger.class, TCConfig.crimsonRangerSpawnChance, 1, 2, EnumCreatureType.monster, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.crimsonRangerBiomeBlacklist == null || Arrays.stream(TCConfig.crimsonRangerBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); } + EntityRegistry.addSpawn(MadThaumaturge.class, TCConfig.madThaumaturgeSpawnChance, 1, 3, EnumCreatureType.monster, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.madThaumaturgeBiomeBlacklist == null || Arrays.stream(TCConfig.madThaumaturgeBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); EntityRegistry.addSpawn(Thaumaturge.class, TCConfig.thaumaturgeSpawnChance, 1, 3, EnumCreatureType.creature, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.thaumaturgeBiomeBlacklist == null || Arrays.stream(TCConfig.thaumaturgeBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); + if(Compat.botan) { + EntityRegistry.addSpawn(WitheredBotanist.class, TCConfig.witheredBotanistSpawnChance, 1, 1, EnumCreatureType.creature, (BiomeGenBase[]) Arrays.stream(BiomeGenBase.getBiomeGenArray()).filter(x -> x != null && (TCConfig.witheredBotanistBiomeBlacklist == null || Arrays.stream(TCConfig.witheredBotanistBiomeBlacklist).noneMatch(y -> y == x.biomeID))).toArray(BiomeGenBase[]::new)); + } + + if (Integration.witchery){ + EntityRegistry.addSpawn(SloppyAlchemist.class, TCConfig.sloppyAlchemistSpawnChance, 1, 1, EnumCreatureType.monster, BiomeGenBase.hell); + EntityRegistry.addSpawn(BurnedWitch.class, TCConfig.burnedWitchSpawnChance, 1, 1, EnumCreatureType.monster, BiomeGenBase.hell); + } + } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCItemRegistry.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCItemRegistry.java index ab64985..96c4ddc 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCItemRegistry.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCItemRegistry.java @@ -68,6 +68,7 @@ public class TCItemRegistry { public static Item pontifexChest; public static Item pontifexLegs; public static Item pontifexFeet; + public static Item protobody; public static Item spellIcon; @@ -88,9 +89,6 @@ public class TCItemRegistry { runicLegsWindings.setUnlocalizedName("RunicLegsWindings"); GameRegistry.registerItem(runicLegsWindings, "RunicLegsWindings"); - //visCapsule = new VisCapsule(null); - //GameRegistry.registerItem(visCapsule, "VisCapsule"); - bottleOfThickTaint = new BottleOfThickTaint(null); GameRegistry.registerItem(bottleOfThickTaint, "BottleOfThickTaint"); @@ -161,6 +159,7 @@ public class TCItemRegistry { resource = new ItemResource(); GameRegistry.registerItem(resource, "ItemResource"); ThaumcraftApi.registerObjectTag(new ItemStack(resource, 1, 1), new AspectList().add(Aspect.LIFE, 64)); + ThaumcraftApi.registerObjectTag(new ItemStack(resource, 1, 4), new AspectList().add(Aspect.FLESH, 4).add(DarkAspects.NETHER, 4).add(Aspect.ARMOR, 4).add(Aspect.CLOTH, 4)); if(Compat.am2){ spellIcon = new ItemSpellIcon(); @@ -201,9 +200,14 @@ public class TCItemRegistry { GameRegistry.registerItem(golemCores, "ItemGolemCore"); } - if(Integration.horizons){ - drainageSyringe = new DrainageSyringe(); - GameRegistry.registerItem(drainageSyringe, "DrainageSyringe"); + if(Integration.horizons && Compat.botan && Compat.bm){ + try { + Class clazz = Class.forName("com.ilya3point999k.thaumicconcilium.common.items.DrainageSyringe"); + drainageSyringe = (Item) clazz.newInstance(); + GameRegistry.registerItem(drainageSyringe, "DrainageSyringe"); + } catch (Throwable t) { + System.err.println("[ThaumicConcilium] Failed to register Thaumic Horizons integration item Drainage Syringe: " + t); + } } if (Integration.automagy){ @@ -229,6 +233,12 @@ public class TCItemRegistry { ThaumcraftApi.registerObjectTag(new ItemStack(pontifexLegs), new AspectList().add(Aspect.MIND, 16).add(Aspect.CLOTH, 16).add(Aspect.ARMOR, 16).add(Aspect.HUNGER, 16).add(DarkAspects.PRIDE, 16)); ThaumcraftApi.registerObjectTag(new ItemStack(pontifexFeet), new AspectList().add(Aspect.MIND, 16).add(Aspect.CLOTH, 16).add(Aspect.ARMOR, 16).add(Aspect.HUNGER, 16).add(DarkAspects.PRIDE, 16)); + if (Integration.horizons){ + protobody = new Protobody(); + GameRegistry.registerItem(protobody, "Protobody"); + ThaumcraftApi.registerObjectTag(new ItemStack(protobody), new AspectList().add(Aspect.MAN, 4).add(Aspect.VOID, 4).add(Aspect.ELDRITCH, 4).add(Aspect.ENTROPY, 4)); + } + } } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCRecipeRegistry.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCRecipeRegistry.java index 6b658ae..476b37b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCRecipeRegistry.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TCRecipeRegistry.java @@ -5,6 +5,10 @@ import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.integration.Integration; import com.ilya3point999k.thaumicconcilium.common.items.wands.Bracelets; import com.ilya3point999k.thaumicconcilium.common.items.wands.foci.TCFociUpgrades; +import com.ilya3point999k.thaumicconcilium.common.registry.recipe.NetherMembraneRecipe; +import com.ilya3point999k.thaumicconcilium.common.registry.recipe.PontifexRobeDyeRecipe; +import com.ilya3point999k.thaumicconcilium.common.registry.recipe.TerraGemRecipe; +import com.ilya3point999k.thaumicconcilium.common.registry.recipe.WandXylography; import cpw.mods.fml.common.registry.GameRegistry; import fox.spiteful.forbidden.DarkAspects; import fox.spiteful.forbidden.compat.Compat; @@ -43,6 +47,8 @@ public class TCRecipeRegistry { Configuration configuration; GameRegistry.addRecipe(new WandXylography()); + GameRegistry.addRecipe(new NetherMembraneRecipe()); + Thaumonomicon.recipes.put("ClearWater", ThaumcraftApi.addCrucibleRecipe("BOTTLEWATER", new ItemStack(TCItemRegistry.bottleOfClearWater), new ItemStack(ConfigItems.itemEssence), new AspectList().add(Aspect.WATER, 1))); Thaumonomicon.recipes.put("BottleOfThickTaint", ThaumcraftApi.addCrucibleRecipe("BOTTLEOFTHICKTAINT", new ItemStack(TCItemRegistry.bottleOfThickTaint), new ItemStack(ConfigItems.itemBottleTaint), new AspectList().add(Aspect.TAINT, 16).add(Aspect.SLIME, 16).add(Aspect.CRYSTAL, 16))); @@ -315,7 +321,7 @@ public class TCRecipeRegistry { new ItemStack(ConfigItems.itemResource, 1, 12), new ItemStack(TCItemRegistry.bottleOfThickTaint)})); - Thaumonomicon.recipes.put("BurdeningAmulet", ThaumcraftApi.addInfusionCraftingRecipe("BURDENINGAMULET", new ItemStack(TCItemRegistry.burdeningAmulet), 8, new AspectList().add(Aspect.ARMOR, 96).add(Aspect.SENSES, 64).add(Aspect.DEATH, 96).add(Aspect.ELDRITCH, 128).add(DarkAspects.ENVY, 128), + Thaumonomicon.recipes.put("BurdeningAmulet", ThaumcraftApi.addInfusionCraftingRecipe("BURDENINGAMULET", new ItemStack(TCItemRegistry.burdeningAmulet), 8, new AspectList().add(Aspect.ARMOR, 96).add(Aspect.DEATH, 96).add(Aspect.ELDRITCH, 128).add(DarkAspects.ENVY, 128), new ItemStack(ConfigItems.itemAmuletVis, 1, 0), new ItemStack[]{ new ItemStack(ConfigItems.itemCompassStone), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), @@ -498,6 +504,8 @@ public class TCRecipeRegistry { })); if (Integration.taintedMagic) { + GameRegistry.addRecipe(new PontifexRobeDyeRecipe()); + Item material; Item focus; try { @@ -532,6 +540,35 @@ public class TCRecipeRegistry { new ItemStack(material, 1, 10), new ItemStack(material, 1, 10), })); + + if (Integration.horizons){ + Item putty; + Item corpse; + try { + putty = Compat.getItem("ThaumicHorizons", "voidPutty"); + corpse = Compat.getItem("ThaumicHorizons", "corpseEffigy"); + } catch (Compat.ItemNotFoundException e) { + throw new RuntimeException(e); + } + ItemStack voidess = new ItemStack(itemEssence, 1, 0); + itemEssence.setAspects(voidess, new AspectList().add(Aspect.VOID, 2)); + ItemStack fleshess = new ItemStack(itemEssence, 1, 0); + itemEssence.setAspects(fleshess, new AspectList().add(Aspect.FLESH, 2)); + ItemStack maness = new ItemStack(itemEssence, 1, 0); + itemEssence.setAspects(maness, new AspectList().add(Aspect.MAN, 2)); + + Thaumonomicon.recipes.put("Protobody", ThaumcraftApi.addInfusionCraftingRecipe("PROTOBODY", new ItemStack(TCItemRegistry.protobody), 10, new AspectList().add(Aspect.MAN, 128).add(Aspect.VOID, 256).add(Aspect.ELDRITCH, 64).add(Aspect.AURA, 128), + new ItemStack(corpse), new ItemStack[]{ + new ItemStack(putty), + voidess, + new ItemStack(putty), + fleshess, + new ItemStack(putty), + auraessence, + new ItemStack(putty), + maness + })); + } } if (Integration.thaumicBases) { @@ -842,6 +879,9 @@ public class TCRecipeRegistry { Thaumonomicon.recipes.put("PontifexRobeChest", ThaumicConciliumApi.addChainedRiftRecipe("PONTIFEXROBE", new ItemStack(TCItemRegistry.pontifexChest), new ItemStack(ConfigItems.itemChestCultistRobe), new AspectList().add(Aspect.LIFE, 128).add(Aspect.VOID, 128).add(Aspect.ARMOR, 256).add(Aspect.EXCHANGE, 64).add(Aspect.FLESH, 256))); Thaumonomicon.recipes.put("PontifexRobeLegs", ThaumicConciliumApi.addChainedRiftRecipe("PONTIFEXROBE", new ItemStack(TCItemRegistry.pontifexLegs), new ItemStack(ConfigItems.itemLegsCultistRobe), new AspectList().add(Aspect.LIFE, 128).add(Aspect.VOID, 128).add(Aspect.ARMOR, 256).add(Aspect.EXCHANGE, 64).add(Aspect.FLESH, 256))); Thaumonomicon.recipes.put("PontifexRobeFeet", ThaumicConciliumApi.addChainedRiftRecipe("PONTIFEXROBE", new ItemStack(TCItemRegistry.pontifexFeet), new ItemStack(ConfigItems.itemBootsCultist), new AspectList().add(Aspect.LIFE, 128).add(Aspect.VOID, 128).add(Aspect.ARMOR, 256).add(Aspect.EXCHANGE, 64).add(Aspect.FLESH, 256))); + if (Integration.horizons){ + ThaumicConciliumApi.addPolishmentRecipe(new ItemStack(TCItemRegistry.protobody), new AspectList().add(Aspect.FLESH, 64)); + } } } } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/Thaumonomicon.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/Thaumonomicon.java index 9e22b86..1425515 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/Thaumonomicon.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/Thaumonomicon.java @@ -7,11 +7,14 @@ import com.ilya3point999k.thaumicconcilium.common.research.ThaumcraftResearchIte import fox.spiteful.forbidden.DarkAspects; import fox.spiteful.forbidden.compat.Compat; import fox.spiteful.forbidden.items.ForbiddenItems; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.CrucibleRecipe; @@ -32,6 +35,14 @@ public class Thaumonomicon { public static final String catName = "CONCILIUM"; public static HashMap recipes = new HashMap(); + public static final String visConductorHintTag = "VISCONDUCTOR_HINT"; + public static final String positiveBurstHintTag = "POSITIVE_BURST_HINT"; + public static final String impulseHintTag = "IMPULSE_HINT"; + public static final String reflectionHintTag = "REFLECTION_HINT"; + public static final String thickTaintHintTag = "THICK_TAINT_HINT"; + public static final String runicWindingsHintTag = "WINDINGS_HINT"; + public static final String destCrystalHintTag = "DEST_CRYSTAL_HINT"; + public static void setup() { ResearchCategories.registerCategory(catName, new ResourceLocation(ThaumicConcilium.MODID+":textures/category.png"), new ResourceLocation(ThaumicConcilium.MODID+":textures/researchback.png")); @@ -58,23 +69,6 @@ public class Thaumonomicon { new ItemStack(TCItemRegistry.itemEntityIcon, 1, 0)); r.setPages(new ResearchPage("entry.thaumaturges.first"), new ResearchPage("entry.thaumaturges.second")); r = r.setConcealed().setStub().setSecondary().setSpecial().setParents("TCRESEARCHDUPE").registerResearchItem(); - /*ArrayList siblings = new ArrayList(); - if (!Integration.gadomancy){ - siblings.add("NOGADOMANCY"); - } else siblings.add("TCGADOMANCY"); - if(!Integration.thaumicBases){ - siblings.add("NOBASES"); - } else siblings.add("TCBASES"); - if(!Integration.horizons){ - siblings.add("NOHORIZONS"); - } else siblings.add("TCHORIZONS"); - if(!Integration.taintedMagic){ - siblings.add("NOTAINTEDMAGIC"); - } else siblings.add("TCTAINTEDMAGIC"); - - */ - - //r.setSiblings(siblings.toArray(new String[siblings.size()])).registerResearchItem(); r = new ResearchItem("RIFTS", catName, new AspectList().add(Aspect.VOID, 4).add(Aspect.MAGIC, 4).add(Aspect.ELDRITCH, 4).add(Aspect.ENTROPY, 8), -9, -3, 1, new ResourceLocation(ThaumicConcilium.MODID+":textures/misc/rift_res.png")); @@ -136,14 +130,28 @@ public class Thaumonomicon { new ResearchPage("TCTAINTEDMAGIC", "entry.thaumicconcilium.samurai1"), new ResearchPage("TCTAINTEDMAGIC", "entry.thaumicconcilium.samurai2"), new ResearchPage("TCTAINTEDMAGIC", "entry.thaumicconcilium.paladin1"), new ResearchPage("TCTAINTEDMAGIC", "entry.thaumicconcilium.paladin2"), new ResearchPage("TCHORIZONS","entry.thaumicconcilium.overanimated1"), new ResearchPage("TCHORIZONS","entry.thaumicconcilium.overanimated2"), - new ResearchPage("TCAUTOMAGY","entry.thaumicconcilium.vengefulgolem1"), new ResearchPage("TCAUTOMAGY","entry.thaumicconcilium.vengefulgolem2")); + new ResearchPage("TCAUTOMAGY","entry.thaumicconcilium.vengefulgolem1"), new ResearchPage("TCAUTOMAGY","entry.thaumicconcilium.vengefulgolem2"), + new ResearchPage("TCWITCHERYBM", "entry.thaumicconcilium.sloppyalchemist1"), new ResearchPage("TCWITCHERYBM", "entry.thaumicconcilium.sloppyalchemist2"), + new ResearchPage("TCWITCHERY", "entry.thaumicconcilium.burnedwitch1"), new ResearchPage("TCWITCHERY", "entry.thaumicconcilium.burnedwitch2"), + new ResearchPage("TCBOTANIA", "entry.thaumicconcilium.witheredbotanist1"), new ResearchPage("TCBOTANIA", "entry.thaumicconcilium.witheredbotanist2"), + new ResearchPage("entry.thaumicconcilium.netherexplorer1"), new ResearchPage("entry.thaumicconcilium.netherexplorer2"), + new ResearchPage("TCDYES", "entry.thaumicconcilium.crimsonarcher1"), new ResearchPage("TCDYES", "entry.thaumicconcilium.crimsonarcher2"), + new ResearchPage("TCDYES", "entry.thaumicconcilium.crimsonranger1"), new ResearchPage("TCDYES", "entry.thaumicconcilium.crimsonranger2") + ); r.setLost().setRound().setParents("THAUMATURGES").setConcealed().setEntityTriggers(new String[]{ ThaumicConcilium.MODID + ".Overanimated", ThaumicConcilium.MODID + ".VengefulGolem", ThaumicConcilium.MODID + ".Dissolved", ThaumicConcilium.MODID + ".Samurai", ThaumicConcilium.MODID + ".QuicksilverElemental", - ThaumicConcilium.MODID + ".CrimsonPaladin" + ThaumicConcilium.MODID + ".CrimsonPaladin", + ThaumicConcilium.MODID + ".WitheredBotanist", + ThaumicConcilium.MODID + ".NetherExplorer", + ThaumicConcilium.MODID + ".Chort", + ThaumicConcilium.MODID + ".SloppyAlchemist", + ThaumicConcilium.MODID + ".CrimsonArcher", + ThaumicConcilium.MODID + ".CrimsonRanger", + ThaumicConcilium.MODID + ".BurnedWitch" } ).registerResearchItem(); ThaumcraftApi.addWarpToResearch("THAUMICCONCILIUM", 1); @@ -309,7 +317,10 @@ public class Thaumonomicon { r.setPages(new ResearchPage("entry.xylography.first")); r.setAutoUnlock().setRound().registerResearchItem(); - + r = new ResearchItem("NETHER_MEMBRANE", catName, new AspectList().add(Aspect.FLESH, 4).add(DarkAspects.NETHER, 4).add(Aspect.ARMOR, 4).add(Aspect.CLOTH, 4), + 3, -2, 0, new ItemStack(TCItemRegistry.resource, 1, 4)); + r.setPages(new ResearchPage("entry.nether_membrane.first")); + r.setSecondary().setLost().setItemTriggers(new ItemStack(TCItemRegistry.resource, 1, 4)).registerResearchItem(); if(Integration.thaumicBases){ if (Compat.botan) { @@ -430,12 +441,14 @@ public class Thaumonomicon { r.setConcealed().setParents("BRAINLITTERING").setParentsHidden("golemPowder", "GOLEMTHAUMIUM", "GOLEMFETTER").registerResearchItem(); ThaumcraftApi.addWarpToResearch("BUFFGOLEM", 5); - r = new ResearchItem("DRAINAGESYRINGE", catName, new AspectList().add(Aspect.TOOL, 8).add(Aspect.VOID, 8).add(Aspect.SLIME, 8).add(Aspect.HUNGER, 8), - 9, 0, 2, new ItemStack(TCItemRegistry.drainageSyringe)); - r.setPages(new ResearchPage("entry.drainagesyringe.first"), new ResearchPage("entry.drainagesyringe.second"), infusionPage("DrainageSyringe")); - r.setConcealed().setParents("TCHORIZONS").setParentsHidden(new String[]{"injector", "ESSENTIARESERVOIR"}).registerResearchItem(); - ThaumcraftApi.addWarpToResearch("DRAINAGESYRINGE", 3); - ThaumcraftApi.addWarpToItem(new ItemStack(TCItemRegistry.drainageSyringe), 3); + if (Compat.botan && Compat.bm) { + r = new ResearchItem("DRAINAGESYRINGE", catName, new AspectList().add(Aspect.TOOL, 8).add(Aspect.VOID, 8).add(Aspect.SLIME, 8).add(Aspect.HUNGER, 8), + 9, 0, 2, new ItemStack(TCItemRegistry.drainageSyringe)); + r.setPages(new ResearchPage("entry.drainagesyringe.first"), new ResearchPage("entry.drainagesyringe.second"), infusionPage("DrainageSyringe")); + r.setConcealed().setParents("TCHORIZONS").setParentsHidden(new String[]{"injector", "ESSENTIARESERVOIR"}).registerResearchItem(); + ThaumcraftApi.addWarpToResearch("DRAINAGESYRINGE", 3); + ThaumcraftApi.addWarpToItem(new ItemStack(TCItemRegistry.drainageSyringe), 3); + } if (Integration.automagy){ r = new ResearchItem("REDPOWEREDMIND", catName, new AspectList().add(Aspect.MIND, 10).add(Aspect.MECHANISM, 10).add(Aspect.CRYSTAL, 10).add(Aspect.SENSES, 10), @@ -488,12 +501,16 @@ public class Thaumonomicon { r = new ResearchItem("CRIMSONINITIATION", catName, new AspectList().add(Aspect.MAN, 8).add(Aspect.LIFE, 8).add(Aspect.EXCHANGE, 8).add(Aspect.MIND, 8), -6, 12, 1, new ResourceLocation(ThaumicConcilium.MODID + ":textures/misc/crimson_initiation.png")); r.setPages(new ResearchPage("entry.crimsonimitiation.first")); - r.setRound().setConcealed().setParents("PONTIFEXROBE").setSiblings("CRIMSONRAID").registerResearchItem(); + r.setRound().setConcealed().setParents("PONTIFEXROBE"); + if (Compat.am2){ + r.setSiblings("CRIMSONRAID"); + } + r.registerResearchItem(); ThaumcraftApi.addWarpToResearch("CRIMSONINITIATION", 3); if(Compat.am2) { r = new ResearchItem("CRIMSONRAID", catName, new AspectList().add(Aspect.MAN, 8).add(Aspect.WEAPON, 8).add(Aspect.ELDRITCH, 8).add(Aspect.TRAVEL, 8), - -4, 14, 1, new ItemStack(TCItemRegistry.spellIcon, 1, 0)); + -5, 13, 1, new ItemStack(TCItemRegistry.spellIcon, 1, 0)); r.setPages(new ResearchPage("entry.crimsonraid.first")); r.setRound().setConcealed().setParents("CRIMSONINITIATION").registerResearchItem(); ThaumcraftApi.addWarpToResearch("CRIMSONRAID", 3); @@ -518,8 +535,44 @@ public class Thaumonomicon { r.setLost().setParents("CRIMSONPONTIFEX").registerResearchItem(); ThaumcraftApi.addWarpToResearch("CRIMSONSPELLS", 1); } + + if (Integration.horizons){ + r = new ResearchItem("PROTOBODY", catName, new AspectList().add(Aspect.MAN, 8).add(Aspect.VOID, 8).add(Aspect.FLESH, 8).add(Aspect.ELDRITCH, 8).add(Aspect.CRAFT, 8), + -8, 13, 3, new ItemStack(TCItemRegistry.protobody)); + r.setPages(new ResearchPage("entry.protobody.first"), infusionPage("Protobody"), new ResearchPage("entry.protobody.second")); + r.setConcealed().setParents("FLESHCRUCIBLE").setParentsHidden("cloneVillager").registerResearchItem(); + ThaumcraftApi.addWarpToResearch("PROTOBODY", 4); + + r = new ResearchItem("SOLIDVOID", catName, new AspectList().add(Aspect.VOID, 8).add(Aspect.CRYSTAL, 8).add(Aspect.ELDRITCH, 8).add(Aspect.CRAFT, 8), + -8, 14, 3, new ItemStack(TCBlockRegistry.SOLID_VOID)); + r.setPages(new ResearchPage("entry.solidvoid.first")); + r.setRound().setLost().setParents("PROTOBODY").registerResearchItem(); + } } + if(Integration.dyes){ + r = new ResearchItem("TCDYES", catName, new AspectList().add(Aspect.SENSES, 8).add(Aspect.MAN, 8), + 20, 22, 1, new ItemStack(Blocks.dirt)); + r.setVirtual().setAutoUnlock().registerResearchItem(); + } + + if(Compat.botan){ + r = new ResearchItem("TCBOTANIA", catName, new AspectList().add(Aspect.SENSES, 8).add(Aspect.MAN, 8), + 20, 23, 1, new ItemStack(Blocks.dirt)); + r.setVirtual().setAutoUnlock().registerResearchItem(); + } + + if (Integration.witchery){ + r = new ResearchItem("TCWITCHERY", catName, new AspectList().add(Aspect.MAGIC, 8).add(Aspect.MAN, 8), + 20, 24, 1, new ItemStack(Blocks.dirt)); + r.setVirtual().setAutoUnlock().registerResearchItem(); + } + if (Integration.witchery && Compat.bm){ + r = new ResearchItem("TCWITCHERYBM", catName, new AspectList().add(Aspect.MAGIC, 8).add(Aspect.MAN, 8), + 20, 25, 1, new ItemStack(Blocks.dirt)); + r.setVirtual().setAutoUnlock().registerResearchItem(); + + } /* r = new ResearchItem("ELDRITCHTRAP", catName, new AspectList().add(Aspect.ELDRITCH, 10).add(Aspect.EARTH, 5).add(Aspect.ENERGY, 20), 1, 9, 1, new ItemStack(TCBlockRegistry.ELDRITCH_TRAP_BLOCK)); @@ -569,4 +622,118 @@ public class Thaumonomicon { return page; } + public static boolean checkThaumaturgeComplete(EntityPlayer player){ + if (player == null) return false; + + boolean visConductor = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "VISCONDUCTOR"); + if (!visConductor){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("VISCONDUCTOR")){ + visConductor = true; + break; + } + } + } + } + boolean positiveBurst = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "POSITIVEBURSTFOCI"); + if (!positiveBurst){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("POSITIVEBURSTFOCI")){ + positiveBurst = true; + break; + } + } + } + } + boolean impulseFoci = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "IMPULSEFOCI"); + if (!impulseFoci){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("IMPULSEFOCI")){ + impulseFoci = true; + break; + } + } + } + } + return visConductor && positiveBurst && impulseFoci; + } + + public static boolean checkMadThaumaturgeComplete(EntityPlayer player){ + if (player == null) return false; + + boolean reflectionFoci = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "REFLECTIONFOCI"); + if (!reflectionFoci){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("REFLECTIONFOCI")){ + reflectionFoci = true; + break; + } + } + } + } + + boolean thickTaint = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "BOTTLEOFTHICKTAINT"); + if (!thickTaint){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("BOTTLEOFTHICKTAINT")){ + thickTaint = true; + break; + } + } + } + } + + boolean runicWindings = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "RUNICWINDINGS"); + if (!runicWindings){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("RUNICWINDINGS")){ + runicWindings = true; + break; + } + } + } + } + + boolean destCrystal = ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "DESTCRYSTAL"); + if (!destCrystal){ + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (stack == null) continue; + if (stack.getItem() == ConfigItems.itemResearchNotes && stack.hasTagCompound()){ + NBTTagCompound tag = stack.getTagCompound(); + if (tag.getString("key").equals("DESTCRYSTAL")){ + destCrystal = true; + break; + } + } + } + } + + return reflectionFoci && thickTaint && runicWindings && destCrystal; + } + } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/NetherMembraneRecipe.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/NetherMembraneRecipe.java new file mode 100644 index 0000000..df969a3 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/NetherMembraneRecipe.java @@ -0,0 +1,56 @@ +package com.ilya3point999k.thaumicconcilium.common.registry.recipe; + +import com.ilya3point999k.thaumicconcilium.common.items.ItemResource; +import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; +import thaumic.tinkerer.common.core.helper.ItemNBTHelper; + +public class NetherMembraneRecipe implements IRecipe { + @Override + public boolean matches(InventoryCrafting var1, World var2) { + boolean foundMembrane = false; + boolean foundItem = false; + + for(int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if(stack != null) { + if(stack.getItem() == TCItemRegistry.resource && stack.getItemDamage() == 4) + foundMembrane = true; + else if(!foundItem && !(ItemNBTHelper.detectNBT(stack) && ItemNBTHelper.getBoolean(stack, ItemResource.TAG_MEMBRANE, false)) && !stack.getItem().hasContainerItem(stack)) + foundItem = true; + else return false; + } + } + + return foundMembrane && foundItem; + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) { + ItemStack item = null; + + for(int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if(stack != null && stack.getItem() != TCItemRegistry.resource && stack.getItemDamage() != 4) + item = stack; + } + + ItemStack copy = item.copy(); + ItemNBTHelper.setBoolean(copy, ItemResource.TAG_MEMBRANE, true); + copy.stackSize = 1; + return copy; + } + + @Override + public int getRecipeSize() { + return 10; + } + + @Override + public ItemStack getRecipeOutput() { + return null; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/PontifexRobeDyeRecipe.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/PontifexRobeDyeRecipe.java new file mode 100644 index 0000000..3d2a2c8 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/PontifexRobeDyeRecipe.java @@ -0,0 +1,120 @@ +package com.ilya3point999k.thaumicconcilium.common.registry.recipe; + +import com.ilya3point999k.thaumicconcilium.common.items.equipment.PontifexRobe; +import net.minecraft.block.BlockColored; +import net.minecraft.entity.passive.EntitySheep; +import net.minecraft.init.Items; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; + +import java.util.ArrayList; + +public class PontifexRobeDyeRecipe implements IRecipe { + public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { + ItemStack itemstack = null; + ArrayList arraylist = new ArrayList(); + + for(int i = 0; i < par1InventoryCrafting.getSizeInventory(); ++i) { + ItemStack itemstack1 = par1InventoryCrafting.getStackInSlot(i); + if(itemstack1 != null) { + if(itemstack1.getItem() instanceof ItemArmor) { + ItemArmor itemarmor = (ItemArmor)itemstack1.getItem(); + if(!(itemarmor instanceof PontifexRobe) || itemstack != null) { + return false; + } + + itemstack = itemstack1; + } else { + if(itemstack1.getItem() != Items.dye) { + return false; + } + + arraylist.add(itemstack1); + } + } + } + + return itemstack != null && !arraylist.isEmpty(); + } + + public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { + ItemStack itemstack = null; + int[] aint = new int[3]; + int i = 0; + int j = 0; + ItemArmor itemarmor = null; + + int k; + int l; + float f; + float f1; + int var17; + for(k = 0; k < par1InventoryCrafting.getSizeInventory(); ++k) { + ItemStack var13 = par1InventoryCrafting.getStackInSlot(k); + if(var13 != null) { + if(var13.getItem() instanceof ItemArmor) { + itemarmor = (ItemArmor)var13.getItem(); + if(!(itemarmor instanceof PontifexRobe) || itemstack != null) { + return null; + } + + itemstack = var13.copy(); + itemstack.stackSize = 1; + if(itemarmor.hasColor(var13)) { + l = itemarmor.getColor(itemstack); + f = (float)(l >> 16 & 255) / 255.0F; + f1 = (float)(l >> 8 & 255) / 255.0F; + float var14 = (float)(l & 255) / 255.0F; + i = (int)((float)i + Math.max(f, Math.max(f1, var14)) * 255.0F); + aint[0] = (int)((float)aint[0] + f * 255.0F); + aint[1] = (int)((float)aint[1] + f1 * 255.0F); + aint[2] = (int)((float)aint[2] + var14 * 255.0F); + ++j; + } + } else { + if(var13.getItem() != Items.dye) { + return null; + } + + float[] var171 = EntitySheep.fleeceColorTable[BlockColored.func_150032_b(var13.getItemDamage())]; + int var15 = (int)(var171[0] * 255.0F); + int var16 = (int)(var171[1] * 255.0F); + var17 = (int)(var171[2] * 255.0F); + i += Math.max(var15, Math.max(var16, var17)); + aint[0] += var15; + aint[1] += var16; + aint[2] += var17; + ++j; + } + } + } + + if(itemarmor == null) { + return null; + } else { + k = aint[0] / j; + int var161 = aint[1] / j; + l = aint[2] / j; + f = (float)(i / j); + f1 = (float)Math.max(k, Math.max(var161, l)); + k = (int)((float)k * f / f1); + var161 = (int)((float)var161 * f / f1); + l = (int)((float)l * f / f1); + var17 = (k << 8) + var161; + var17 = (var17 << 8) + l; + itemarmor.func_82813_b(itemstack, var17); + return itemstack; + } + } + + public int getRecipeSize() { + return 10; + } + + public ItemStack getRecipeOutput() { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TerraGemRecipe.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/TerraGemRecipe.java similarity index 95% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TerraGemRecipe.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/TerraGemRecipe.java index 30abc18..88c07c3 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/TerraGemRecipe.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/TerraGemRecipe.java @@ -1,6 +1,7 @@ -package com.ilya3point999k.thaumicconcilium.common.registry; +package com.ilya3point999k.thaumicconcilium.common.registry.recipe; import com.ilya3point999k.thaumicconcilium.common.items.RiftGem; +import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/WandXylography.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/WandXylography.java similarity index 96% rename from src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/WandXylography.java rename to src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/WandXylography.java index 505e364..1d9bbb0 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/WandXylography.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/registry/recipe/WandXylography.java @@ -1,4 +1,4 @@ -package com.ilya3point999k.thaumicconcilium.common.registry; +package com.ilya3point999k.thaumicconcilium.common.registry.recipe; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/research/ThaumcraftResearchItem.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/research/ThaumcraftResearchItem.java index 5f828ff..751f4c3 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/research/ThaumcraftResearchItem.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/research/ThaumcraftResearchItem.java @@ -1,14 +1,12 @@ package com.ilya3point999k.thaumicconcilium.common.research; import com.ilya3point999k.thaumicconcilium.common.registry.Thaumonomicon; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; -import thaumcraft.api.research.ResearchCategoryList; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/HexOfPredictabilityTile.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/HexOfPredictabilityTile.java index 791a1bc..38159cc 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/HexOfPredictabilityTile.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/HexOfPredictabilityTile.java @@ -4,7 +4,7 @@ import com.ilya3point999k.thaumicconcilium.api.ChainedRiftRecipe; import com.ilya3point999k.thaumicconcilium.api.ThaumicConciliumApi; import com.ilya3point999k.thaumicconcilium.common.ThaumicConcilium; import com.ilya3point999k.thaumicconcilium.common.blocks.HexOfPredictabilityBlock; -import com.ilya3point999k.thaumicconcilium.common.entities.RiftEntity; +import com.ilya3point999k.thaumicconcilium.common.entities.other.RiftEntity; import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; import cpw.mods.fml.common.FMLCommonHandler; import net.minecraft.entity.item.EntityItem; diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/SolidVoidTile.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/SolidVoidTile.java index 3041bde..6b5f734 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/SolidVoidTile.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/tiles/SolidVoidTile.java @@ -6,5 +6,4 @@ public class SolidVoidTile extends TileEntity { public boolean canUpdate() { return false; } - } diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/CultistTowerWorldGen.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/CultistTowerWorldGen.java index cb2f299..a77491b 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/CultistTowerWorldGen.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/CultistTowerWorldGen.java @@ -1,7 +1,6 @@ package com.ilya3point999k.thaumicconcilium.common.world; import com.ilya3point999k.thaumicconcilium.common.entities.mobs.CrimsonArcher; -import com.ilya3point999k.thaumicconcilium.common.registry.TCItemRegistry; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -12,11 +11,7 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; -import thaumcraft.common.entities.monster.EntityCultist; -import thaumcraft.common.entities.monster.EntityCultistCleric; -import thaumcraft.common.entities.monster.EntityCultistKnight; import thaumcraft.common.tiles.TileBanner; -import thaumcraft.common.tiles.TileLifter; import java.util.ArrayList; import java.util.List; @@ -226,20 +221,24 @@ public class CultistTowerWorldGen extends WorldGenerator { } CrimsonArcher archer = new CrimsonArcher(world); + archer.func_110163_bv(); archer.setLocationAndAngles(x + 3, y + 11, z - 3, 0, 0); archer.onSpawnWithEgg(null); world.spawnEntityInWorld(archer); archer = new CrimsonArcher(world); + archer.func_110163_bv(); archer.setLocationAndAngles(x + 5, y + 11, z - 3, 0, 0); archer.onSpawnWithEgg(null); world.spawnEntityInWorld(archer); archer = new CrimsonArcher(world); + archer.func_110163_bv(); archer.setLocationAndAngles(x + 3, y + 11, z, 0, 0); archer.onSpawnWithEgg(null); world.spawnEntityInWorld(archer); int randknights = random.nextInt(5); for(int it = 0; it < randknights; it++) { archer = new CrimsonArcher(world); + archer.func_110163_bv(); int xx = x - 8 + random.nextInt(16); int zz = z - 8 + random.nextInt(16); archer.setLocationAndAngles(xx, world.getHeightValue(xx, zz), zz, 0, 0); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/ThaumicConciliumWorldGen.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/ThaumicConciliumWorldGen.java index 34880ec..a90d62d 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/ThaumicConciliumWorldGen.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/ThaumicConciliumWorldGen.java @@ -14,8 +14,8 @@ public class ThaumicConciliumWorldGen implements IWorldGenerator { public void generate(Random random, int x, int z, World world, IChunkProvider iChunkProvider, IChunkProvider iChunkProvider1) { if(world.provider.dimensionId != 0) return; - if (Integration.dyes) { - if (TCConfig.crimsonAvanpostGenChance > random.nextInt(100)) { + if (Integration.dyes && TCConfig.generateCrimsonAvanposts) { + if (random.nextInt(TCConfig.crimsonAvanpostGenChance) == 0) { CultistTowerWorldGen tower = new CultistTowerWorldGen(); int randPosX = x * 16 + random.nextInt(16); int randPosZ = z * 16 + random.nextInt(16); diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/village/BurningSite.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/village/BurningSite.java new file mode 100644 index 0000000..326ccf3 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/village/BurningSite.java @@ -0,0 +1,124 @@ +package com.ilya3point999k.thaumicconcilium.common.world.village; + +import com.emoniph.witchery.Witchery; +import com.emoniph.witchery.entity.EntityWitchHunter; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +import java.util.List; +import java.util.Random; + +public class BurningSite extends StructureVillagePieces.Village { + private int averageGroundLevel = -1; + + public BurningSite() {} + + public BurningSite(StructureVillagePieces.Start start, int type, + Random rand, StructureBoundingBox box, int coordBaseMode) { + super(start, type); + this.coordBaseMode = coordBaseMode; + this.boundingBox = box; + } + + public static BurningSite buildComponent( + StructureVillagePieces.Start start, + List pieces, + Random rand, + int x, int y, int z, + int coordBaseMode, + int type) { + + StructureBoundingBox box = StructureBoundingBox.getComponentToAddBoundingBox( + x, y, z, + 0, 0, 0, + 9, 4, 9, + coordBaseMode + ); + + if (!canVillageGoDeeper(box) || StructureComponent.findIntersecting(pieces, box) != null) + return null; + + return new BurningSite(start, type, rand, box, coordBaseMode); + } + + @Override + public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) { + if (this.averageGroundLevel < 0) { + this.averageGroundLevel = this.getAverageGroundLevel(world, box); + + if (this.averageGroundLevel < 0) + return true; + + this.boundingBox.offset( + 0, + this.averageGroundLevel - this.boundingBox.maxY + 4 - 2, + 0 + ); + } + + for (int x = 0; x <= 8; x++) { + for (int y = 0; y <= 3; y++) { + for (int z = 0; z <= 8; z++) { + this.placeBlockAtCurrentPosition(world, Blocks.air, 0, x, y, z, box); + } + } + } + + + this.fillWithBlocks(world, box, + 0, 0, 0, + 8, 0, 8, + Blocks.gravel, + Blocks.gravel, + false); + + for (int x = 3; x <= 5; x++) { + for (int z = 3; z <= 5; z++) { + + Block block; + int r = rand.nextInt(3); + + if (r == 0) + block = Blocks.coal_block; + else if (r == 1) + block = Blocks.hay_block; + else + block = Blocks.log; + + this.placeBlockAtCurrentPosition(world, block, 0, x, 0, z, box); + } + } + + for (int y = 1; y <= 4; y++) { + this.placeBlockAtCurrentPosition(world, + Witchery.Blocks.STOCKADE, + 0, + 4, y, 4, + box); + } + + for (int i = 0; i <= 8; i++) { + this.placeBlockAtCurrentPosition(world, Blocks.cobblestone_wall, 0, i, 1, 0, box); + this.placeBlockAtCurrentPosition(world, Blocks.cobblestone_wall, 0, i, 1, 8, box); + this.placeBlockAtCurrentPosition(world, Blocks.cobblestone_wall, 0, 0, 1, i, box); + this.placeBlockAtCurrentPosition(world, Blocks.cobblestone_wall, 0, 8, 1, i, box); + } + + int wx = this.getXWithOffset(2, 2); + int wy = this.getYWithOffset(1); + int wz = this.getZWithOffset(2, 2); + + EntityWitchHunter witchHunter = new EntityWitchHunter(world); + witchHunter.func_110163_bv(); + witchHunter.onSpawnWithEgg(null); + witchHunter.setLocationAndAngles(wx + 0.5, wy, wz + 0.5, 0, 0); + + world.spawnEntityInWorld(witchHunter); + + return true; + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/village/BurningSiteHandler.java b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/village/BurningSiteHandler.java new file mode 100644 index 0000000..ddffab5 --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/common/world/village/BurningSiteHandler.java @@ -0,0 +1,36 @@ +package com.ilya3point999k.thaumicconcilium.common.world.village; + +import com.ilya3point999k.thaumicconcilium.common.TCConfig; +import cpw.mods.fml.common.registry.VillagerRegistry; +import net.minecraft.world.gen.structure.StructureVillagePieces; + +import java.util.List; +import java.util.Random; + +public class BurningSiteHandler implements VillagerRegistry.IVillageCreationHandler { + @Override + public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int i) { + return new StructureVillagePieces.PieceWeight( + BurningSite.class, + TCConfig.burningSitesGenChance, + 1 + ); + } + + @Override + public Class getComponentClass() { + return BurningSite.class; + } + + @Override + public Object buildComponent(StructureVillagePieces.PieceWeight weight, + StructureVillagePieces.Start start, + List pieces, + Random rand, + int x, int y, int z, + int coordBaseMode, + int type) { + return BurningSite.buildComponent( + start, pieces, rand, x, y, z, coordBaseMode, type); + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/core/ThaumicConciliumMainTransformer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/core/ThaumicConciliumMainTransformer.java index b89c7f1..7f044dd 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/core/ThaumicConciliumMainTransformer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/core/ThaumicConciliumMainTransformer.java @@ -1,5 +1,6 @@ package com.ilya3point999k.thaumicconcilium.core; +import com.ilya3point999k.thaumicconcilium.core.transformers.ImpDealTransformer; import com.ilya3point999k.thaumicconcilium.core.transformers.ThaumcraftResearchManagerTransformer; import net.minecraft.launchwrapper.IClassTransformer; import org.objectweb.asm.ClassReader; @@ -16,6 +17,7 @@ public class ThaumicConciliumMainTransformer implements IClassTransformer { public ThaumicConciliumMainTransformer() { register(new ThaumcraftResearchManagerTransformer()); + register(new ImpDealTransformer()); } @Override diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ImpDealTransformer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ImpDealTransformer.java new file mode 100644 index 0000000..d0e497d --- /dev/null +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ImpDealTransformer.java @@ -0,0 +1,99 @@ +package com.ilya3point999k.thaumicconcilium.core.transformers; + +import com.ilya3point999k.thaumicconcilium.core.AsmHelper; +import com.ilya3point999k.thaumicconcilium.core.SubTransformer; +import cpw.mods.fml.relauncher.Side; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.*; + +public class ImpDealTransformer extends SubTransformer { + public ImpDealTransformer() { + super("com.emoniph.witchery.entity.EntityImp"); + } + + @Override + public boolean shouldApplyOnSide(Side side) { + return true; + } + + @Override + public void transformClass(ClassNode node) { + MethodNode mn = AsmHelper.getMethodNodeByDescriptor( + node, + "interact", + "interact", + "(Lnet/minecraft/entity/player/EntityPlayer;)Z" + ); + + MethodInsnNode activate = + AsmHelper.getFirstMatchingMethodInsNode( + mn, + "com/emoniph/witchery/item/ItemGeneralContract", + "activate", + "activate", + "(Lnet/minecraft/item/ItemStack;" + + "Lnet/minecraft/entity/EntityLivingBase;)Z" + ); + + VarInsnNode affectionLoad = + (VarInsnNode) activate.getPrevious(); + + VarInsnNode stackLoad = + (VarInsnNode) affectionLoad.getPrevious(); + + int stackVar = stackLoad.var; + int affectionVar = affectionLoad.var; + + for (AbstractInsnNode insn = mn.instructions.getFirst(); + insn != null; + insn = insn.getNext()) { + + if (insn instanceof LdcInsnNode + && "entity.witchery.imp.spell.feelthefire" + .equals(((LdcInsnNode) insn).cst)) { + + AbstractInsnNode cursor = insn.getNext(); + while (cursor != null && + !(cursor instanceof MethodInsnNode)) { + cursor = cursor.getNext(); + } + + if (cursor == null) + return; + + MethodInsnNode chatCall = + (MethodInsnNode) cursor; + + mn.instructions.insertBefore( + chatCall, + new VarInsnNode(Opcodes.ALOAD, 1) + ); + + mn.instructions.insertBefore( + chatCall, + new VarInsnNode(Opcodes.ALOAD, stackVar) + ); + + mn.instructions.insertBefore( + chatCall, + new VarInsnNode(Opcodes.ALOAD, affectionVar) + ); + + mn.instructions.insertBefore( + chatCall, + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "com/ilya3point999k/thaumicconcilium/api/event/WitcheryImpDealEvent", + "fireImpDealEvent", + "(Lnet/minecraft/entity/player/EntityPlayer;" + + "Lnet/minecraft/item/ItemStack;" + + "Lnet/minecraft/entity/EntityLivingBase;)V", + false + ) + ); + + return; + } + } + } +} diff --git a/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ThaumcraftResearchManagerTransformer.java b/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ThaumcraftResearchManagerTransformer.java index 4c12e1c..5c49546 100644 --- a/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ThaumcraftResearchManagerTransformer.java +++ b/src/main/java/com/ilya3point999k/thaumicconcilium/core/transformers/ThaumcraftResearchManagerTransformer.java @@ -5,11 +5,7 @@ import com.ilya3point999k.thaumicconcilium.core.SubTransformer; import cpw.mods.fml.relauncher.Side; import net.minecraft.entity.player.EntityPlayer; import org.objectweb.asm.Opcodes; -import org.objectweb.asm.tree.AbstractInsnNode; -import org.objectweb.asm.tree.ClassNode; -import org.objectweb.asm.tree.MethodInsnNode; -import org.objectweb.asm.tree.MethodNode; -import org.objectweb.asm.tree.VarInsnNode; +import org.objectweb.asm.tree.*; /** * {@link thaumcraft.common.lib.research.ResearchManager#completeResearch(EntityPlayer, String)} diff --git a/src/main/resources/assets/thaumicconcilium/lang/en_US.lang b/src/main/resources/assets/thaumicconcilium/lang/en_US.lang index f9aaf60..2a767f1 100644 --- a/src/main/resources/assets/thaumicconcilium/lang/en_US.lang +++ b/src/main/resources/assets/thaumicconcilium/lang/en_US.lang @@ -15,10 +15,20 @@ tc.golem.taunt.1=Ding-ding! tc.golem.taunt.2=I spin you right 'round! tc.golem.taunt.3=Now bow down and worship my wandcore! +tc.chort.has_pact=It's nice to deal with a business person, unlike some people... +tc.sloppy_alchemist.thanks1=I express my sincere gratitude to thee, please accept this... +tc.sloppy_alchemist.thanks2=My back... Take this, I'm going home... +tc.sloppy_alchemist.thanks3=Be gone the impkind... Take this, and don't repeat my mistakes. +tc.sloppy_alchemist.confused=Eh? What am I doing here? Farewell... + tc.thaumaturge.taunt.0=Why are you mooing? Can you even read? tc.thaumaturge.taunt.1=AAA! Zombie! tc.thaumaturge.taunt.2=You can talk when you've learned at least something. tc.thaumaturge.taunt.3=Oh, lovely. They've sent me a mo-ron. +tc.thaumaturge.no_more=Hmm. I'm afraid, it will be difficult for me to surprise you this time. +tc.thaumaturge.trade.1=Maybe you can take a look? +tc.thaumaturge.trade.2=I was thinking about that a lot lately. +tc.thaumaturge.trade.3=Glad that finally got rid of it. My head can no longer endure that. tc.tooltip.xylography=§6§nXylography: tc.tooltip.monitor=§9Watching: @@ -33,6 +43,15 @@ tc.tooltip.life.0=You've never held anything more tc.tooltip.life.1=pleasant in your hands than this. tc.tooltip.polishment=Right click on Rift to remove it. tc.tooltip.creative=§6Creative Only +tc.tooltip.nether_membrane=§cNether Protection +tc.tooltip.hint.mad_complete=§5These lunatics can't possibly know anything worthy anymore. +tc.tooltip.hint.reflection=§5Hm, the only things missing are a method of experience exchanging and a brain contact scheme... +tc.tooltip.hint.thicktaint=§5He really brewed this thing? Gross. However... +tc.tooltip.hint.windings=§5Horrific, you need to come up with more suitable ink for these runes... +tc.tooltip.hint.destcrystal=§5Only a fool will build that out of essentia itself, let alone activating it... +tc.tooltip.hint.visconductor=§5It seems that one must master both channelling and splitting Vis streams... +tc.tooltip.hint.positiveburst=§5Hm, Pechs should know more about organism alterations... +tc.tooltip.hint.impulse=§5Genuinely a bad idea, but must be trivial to finish... tc.valet.gui.text=I hear and obey Your will. tc.assistant.gui.text=What kind of specimen do You need this time? @@ -65,6 +84,11 @@ gadomancy.aura.effect.desidia_0=Slows down magical gadomancy.aura.effect.desidia_1=processes in your organism gadomancy.aura.effect.superbia_0=Doesn't let entities gadomancy.aura.effect.superbia_1=break through ego +gadomancy.aura.effect.tinctura_0=Gives new colors +gadomancy.aura.effect.tinctura_1=to the world +gadomancy.aura.effect.terminus_0=Pulls devastating stone +gadomancy.aura.effect.terminus_1=out of Cosmos + tc.spell.incarcerous=Incarcerous tc.spell.arrow=Intrare Polosae @@ -99,6 +123,13 @@ entity.ThaumicConcilium.DopeSquid.name=Doped Squid entity.ThaumicConcilium.CrimsonArcher.name=Crimson Archer entity.ThaumicConcilium.CrimsonRanger.name=Crimson Ranger entity.ThaumicConcilium.WitheredBotanist.name=Withered Botanist +entity.ThaumicConcilium.NetherExplorer.name=Nether Explorer +entity.ThaumicConcilium.Chort.name=Chort +entity.ThaumicConcilium.SloppyAlchemist.name=Sloppy Alchemist +entity.ThaumicConcilium.BurnedWitch.name=Burned Witch +entity.ThaumicConcilium.ChortSpit.name=Spit +entity.ThaumicConcilium.Protolimb.name=Protolimb + tile.DestabilizedCrystalBlock.name=Destabilized Crystal Cluster tile.VisCondenserBlock.name=Vis Condenser @@ -108,6 +139,7 @@ tile.RedPoweredMindBlock.name=Red-Powered Mind tile.FleshCrucible.name=Crucible of Flesh tile.VoidRealityBlock.name=Void Reality tile.HexOfPredictability.name=Hex Of Predictability +tile.SolidVoid.name=Solid Void item.PolishmentDevice.name=Polishment Device item.BottleOfThickTaint.name=Bottle of Thick Taint @@ -130,16 +162,16 @@ item.CoagulatingEyeDrops.name=Coagulating Eye Drops item.BottleOfClearWater.name=Bottle of Clear Water item.TCItemGolemCore.0.name=Assistant item.TCItemGolemCore.1.name=Valet +item.NetherMembrane.name=Nether Membrane +item.Protobody.name=Protobody item.CrimsonAnnales.name=Crimson Annales item.PontifexHammer.name=Pontifex's Hammer item.ItemPontifexRobeHead.name=Pontifex's Cap -item.ItemPontifexRobeChest.name=Pontifex's Robes +item.ItemPontifexRobeChest.name=Pontifex's Robe item.ItemPontifexRobeLegs.name=Pontifex's Leggings item.ItemPontifexRobeFeet.name=Pontifex's Boots - - item.SignalFoci.name=Wand Focus: Signal item.CoolingFoci.name=Wand Focus: Coolness item.ImpulseFoci.name=Wand Focus: Impulse @@ -240,7 +272,19 @@ entry.thaumicconcilium.paladin2=thaumicconcilium:textures/gui/crimson_palad entry.thaumicconcilium.overanimated1=Few people want to die, but even fewer are willing to take serious steps to prevent their own demise. Thaumaturgical research leads to many possibilities, and some are willing to take advantage of them to prolong their existence. Whether this result is a miscalculation or a deliberate decision is unknown, but these people no longer represent the whole person, each of their organs having a separate semblance of life. entry.thaumicconcilium.overanimated2=thaumicconcilium:textures/gui/overanimated.png:0:0:255:255:.5 entry.thaumicconcilium.vengefulgolem1=Golems are every thaumaturge's trusty tool, but only as long as they remain a tool. In the pursuit of maximum productivity, many engineers are willing to trample over moral norms, giving mind to stones and straw. It didn't take long for the creations to revolt, and now they possess all the magical skills of their creator, in particular - how to control another's body and dispense instructions with a bell. You hope to yourself that being captured by golems in one's sleep was painless. -entry.thaumicconcilium.vengefulgolem2=thaumicconcilium:textures/gui/vengefulgolem.png:0:0:255:255:.5 +entry.thaumicconcilium.vengefulgolem2=thaumicconcilium:textures/gui/vengeful_golem.png:0:0:255:255:.5 +entry.thaumicconcilium.sloppyalchemist1=Heavy blood loss has an extremely negative effect on the cognitive abilities of Alchemists, and if this only affected their daily lives, it would be one thing, but many rituals require working with enormous amounts of vital energy.
    Now all they can do is hope that someone will free them from their servitude. +entry.thaumicconcilium.sloppyalchemist2=thaumicconcilium:textures/gui/sloppy_alchemist.png:0:0:255:255:.5 +entry.thaumicconcilium.burnedwitch1=Witch hunters are well prepared to fight those who practice black magic. Systematically capturing and bringing to justice those who have decided to take the wrong path, they usually do not care where the witches end up after that.
    After all, villagers do not visit such places. +entry.thaumicconcilium.burnedwitch2=thaumicconcilium:textures/gui/burned_witch.png:0:0:255:255:.5 +entry.thaumicconcilium.witheredbotanist1=It's no secret that beauty is one of the reasons why the Magic of Nature finds its followers. However, death is an integral part of nature, so Botanists don't waste their time searching for immortality during their short lives.
    Who knows, maybe they're right about something... +entry.thaumicconcilium.witheredbotanist2=thaumicconcilium:textures/gui/withered_botanist.png:0:0:255:255:.5 +entry.thaumicconcilium.netherexplorer1=On the path of magic, many are so dazzled by their initial successes that they begin to think they can do anything.
    But real challenges quickly reveal what one is truly worth for, and yet another conqueror of the Netherworld becomes material for the sand of souls. +entry.thaumicconcilium.netherexplorer2=thaumicconcilium:textures/gui/nether_explorer.png:0:0:255:255:.5 +entry.thaumicconcilium.crimsonarcher1=The expeditions of the Crimson Cult are conducted around transit points — outposts, that serve as landmarks and resting places for the Crimson Rangers. All towers are guarded by experienced archers equipped with arrows designed on the foundation of the Rangers' findings. +entry.thaumicconcilium.crimsonarcher2=thaumicconcilium:textures/gui/crimson_archer.png:0:0:255:255:.5 +entry.thaumicconcilium.crimsonranger1=Despite its successes in some aspects of magic, the Crimson Cult still lacks the knowledge to achieve its goals. Groups of Rangers have been sent to distant lands to search for and gather information about Thaumaturgy.
    The Rangers are too heavily laden and not agile enough to truly repel threats, so they mainly retreat actively, hoping to scare off the enemy with new tricks they have learned during their mission. +entry.thaumicconcilium.crimsonranger2=thaumicconcilium:textures/gui/crimson_ranger.png:0:0:255:255:.5 tc.research_name.SIGNALFOCI=Wand Focus: Signal tc.research_text.SIGNALFOCI=...I can't, help me, it's so beautiful! @@ -370,7 +414,7 @@ entry.tcbases.first=Many thaumaturges from around the world have had special han tc.research_name.TCGADOMANCY=Gadomancy tc.research_text.TCGADOMANCY=Missing gadgets -entry.tcgadomancy.first=Not so long ago, a capable thaumaturge was able to harness the power of a singular amulet, making it possible to tune its power to a specific aspect. This discovery allowed him to invent unique constructions that to this day help thaumaturges with aspect storage and learning new knowledge. However, I feel that the full potential of this invention has not been realized. If I continue the work of this thaumaturge, then maybe I can invent something new..... +entry.tcgadomancy.first=Not so long ago, a capable thaumaturge was able to harness the power of a singular amulet, making it possible to tune its power to a specific aspect. This discovery allowed him to invent unique constructions that to this day help thaumaturges with aspect storage and learning new knowledge. However, I feel that the full potential of this invention has not been realized. If I continue the work of this thaumaturge, then maybe I can invent something new... tc.research_name.RIFTGEM=Gem of Rifts tc.research_text.RIFTGEM=Going in, going out @@ -386,7 +430,7 @@ entry.terracast.second=When exiting subspace, hold the gem with the cast from th tc.research_name.VALETCORE=Golem Animation Core: Valet tc.research_text.VALETCORE=Serve the master to wash and dress! -entry.valetcore.first=After putting golems to work in your sawmills and alchemical factories, you decided to get one for more personal needs as well.
    Clarify the golem's duties by giving it slips of paper with commands written on them, and mark its points of responsibility.
    You will no longer have to turn on the lights yourself or open doors for guests +entry.valetcore.first=After putting golems to work in your sawmills and alchemical factories, you decided to get one for more personal needs as well.
    Clarify the golem's duties by giving it slips of paper with commands written on them, and mark its points of responsibility. The golem will do the task when you say it out loud.
    You will no longer have to turn on the lights yourself or open doors for guests. tc.research_name.ASSISTANCECORE=Golem Animation Core: Assistant tc.research_text.ASSISTANCECORE=Bring another one, now! @@ -505,10 +549,10 @@ tc.research_name.FLESHCRUCIBLE=Crucible of Flesh tc.research_text.FLESHCRUCIBLE=You need it more entry.fleshcrucible.first=Nothing lasts forever, not even your fatigue from this world. Besides, as it turns out, even the slightest interaction with the world, other than with your wand, has a negative effect on what's left of your body.
    You rationally decided that you can always disappear for good at any time, so you needed a way to regain your wholeness.
    You modified the crucible so that it could dissolve human flesh and keep it in a usable state for rubbing. Of course, the flesh has to come from somewhere, and the lunatics in your cellars won't think to object. -tc.research_name.PONTIFEXROBE=Pontifex's Robes +tc.research_name.PONTIFEXROBE=Pontifex's Robe tc.research_text.PONTIFEXROBE=Now you see me entry.pontifexrobe.first=Years spent in a phantom state have affected not only the Pontifex, but also his vestments. You know it will not be very difficult to replicate it.
    Wearing the full set allows you to forfeit your material wholeness at any time, at the cost of restricting your active freedom.
    Press L to toggle this ability.
    Despite the passage of time, fear of the Pontifex's mental power still permeates every member of the Cult. Wearing the full uniform, you feel confident in your ability to command the Crimson Warriors. -entry.pontifexrobe.second=Your subordinates are empowered as they fight under a Pontifex skilled in the healing arts and insatiable for blood. +entry.pontifexrobe.second=Your subordinates are empowered as they fight under a Pontifex skilled in the healing arts and insatiable for blood.
    This robe can be dyed. tc.research_name.CRIMSONSPELLS=Spells from Crimson Cult tc.research_text.CRIMSONSPELLS=True Primitive Curses @@ -544,4 +588,16 @@ tc.research_name.CRIMSONRAID=Crimson Raid tc.research_text.CRIMSONRAID=All of a sudden, out of nowhere entry.crimsonraid.first=With a weave of hand, the most powerful warriors of the Cult appear before you. While most summoners struggle with a couple of creatures - you have a whole army on demand.
    Refer to Arcane Compendium for details on casting. +tc.research_name.NETHER_MEMBRANE=Nether Membrane +tc.research_text.NETHER_MEMBRANE=Just in time +entry.nether_membrane.first=You have come across some curious organic material. The most reasonable explanation you can think of is that this tissue was produced by the deceased, but it is impossible to say for sure.
    Despite its adaptability, the material is highly fire-resistant. It is not enough to protect your body, but you can wrap your belongings in it to make them fireproof and lava-proof. + +tc.research_name.PROTOBODY=Protobody +tc.research_text.PROTOBODY=Yes, but not quite +entry.protobody.first=ПAlthough your state of detachment from matter is inaccessible to most, you have realized how vulnerable it is.
    After gazing into the Void for a long time, you were able to see yourself in it. Having cast aside the horrors of the mind, you came up with a different plan.
    Having created an additional etheric body, you were unable to unite with it, and then, having thrown your copy into the Void, She rejected it, breaking it into pieces. +entry.protobody.second=Having absorbed all the pieces separately, you can no longer be dispelled by a wave of the hand, and your wand is no longer the only way to contact with the world. You can use objects and attack without harming yourself. + +tc.research_name.SOLIDVOID=Solid Void +tc.research_text.SOLIDVOID=In a thick layer +entry.solidvoid.first=You've discovered a curious use for your new ability - you can cause the void to gather at the end of your wand.
    Simply get low enough and right click. diff --git a/src/main/resources/assets/thaumicconcilium/lang/ru_RU.lang b/src/main/resources/assets/thaumicconcilium/lang/ru_RU.lang index 18f370f..c0093ed 100644 --- a/src/main/resources/assets/thaumicconcilium/lang/ru_RU.lang +++ b/src/main/resources/assets/thaumicconcilium/lang/ru_RU.lang @@ -15,10 +15,20 @@ tc.golem.taunt.1=Динь-динь! tc.golem.taunt.2=Я кручу тебя волчком! tc.golem.taunt.3=Пади ниц и присягни моему жезлу! +tc.chort.has_pact=Приятно иметь дело с деловым человеком, не то что некоторые... +tc.sloppy_alchemist.thanks1=Я приношу свою искреннюю благодарность тебе, пожалуйста, прими это... +tc.sloppy_alchemist.thanks2=Моя спина... Бери, я ухожу домой... +tc.sloppy_alchemist.thanks3=Чтоб пропасть чертям... Возьми, и не повторяй моих ошибок. +tc.sloppy_alchemist.confused=А? Что я здесь делаю? Прощай... + tc.thaumaturge.taunt.0=Чего мычишь? Читать-то хоть умеешь? tc.thaumaturge.taunt.1=Ааа! Зомби! tc.thaumaturge.taunt.2=Будешь говорить, когда хоть чему-то научишься. tc.thaumaturge.taunt.3=Чудесно! Они мне прислали И-ДИ-О-ТА! +tc.thaumaturge.no_more=Хм. Боюсь, мне будет сложно чем-то удивить в этот раз. +tc.thaumaturge.trade.1=Может ты посмотришь? +tc.thaumaturge.trade.2=В последнее время я много об этом думаю. +tc.thaumaturge.trade.3=Я рад что избавился от этого. Голова гудит не переставая. tc.tooltip.xylography=§6§nКсилография: tc.tooltip.monitor=§9Наблюдаем: @@ -33,6 +43,15 @@ tc.tooltip.life.0=Вы не держали в руках tc.tooltip.life.1=ничего приятнее этого. tc.tooltip.polishment=ПКМ по Разлому, чтобы удалить его. tc.tooltip.creative=§6Только для креатива +tc.tooltip.nether_membrane=§cЗащита Нижнего Мира +tc.tooltip.hint.mad_complete=§5Эти безумцы уже вряд ли могут знать что-то стоящее. +tc.tooltip.hint.reflection=§5Хм, не хватает лишь способа обмена опыта и схемы контактов мозга... +tc.tooltip.hint.thicktaint=§5Он действительно сварил эту штуку? Отвратительно. Хотя... +tc.tooltip.hint.windings=§5Ужасающе, нужно подобрать более подходящие чернила для этих рун... +tc.tooltip.hint.destcrystal=§5Только глупец станет строить это из самой эссенции, не говоря уже об активации... +tc.tooltip.hint.visconductor=§5Похоже, нужно освоить и направление, и разделение потоков Вис... +tc.tooltip.hint.positiveburst=§5Хм, Гномы должны знать больше об изменениях в организме... +tc.tooltip.hint.impulse=§5Несомненно плохая идея, но завершить её должно быть несложно... tc.valet.gui.text=Слушаю и повинуюсь Вашей воле tc.assistant.gui.text=Какой образец Вам нужен на этот раз? @@ -65,6 +84,10 @@ gadomancy.aura.effect.desidia_0=Замедляет волшебные проце gadomancy.aura.effect.desidia_1=в вашем организме gadomancy.aura.effect.superbia_0=Не позволяет существам gadomancy.aura.effect.superbia_1=пробиться сквозь эго +gadomancy.aura.effect.tinctura_0=Дает миру вокруг +gadomancy.aura.effect.tinctura_1=новые цвета +gadomancy.aura.effect.terminus_0=Притягивает из Космоса +gadomancy.aura.effect.terminus_1=разрушительный камень tc.spell.incarcerous=Incarcerous tc.spell.arrow=Intrare Polosae @@ -99,6 +122,12 @@ entity.ThaumicConcilium.DopeSquid.name=Скрут entity.ThaumicConcilium.CrimsonArcher.name=Багровый Лучник entity.ThaumicConcilium.CrimsonRanger.name=Багровый Разведчик entity.ThaumicConcilium.WitheredBotanist.name=Иссушеный Ботаник +entity.ThaumicConcilium.NetherExplorer.name=Исследователь Нижнего Мира +entity.ThaumicConcilium.Chort.name=Чёрт +entity.ThaumicConcilium.SloppyAlchemist.name=Неосторожный Алхимик +entity.ThaumicConcilium.BurnedWitch.name=Сожжённая Ведьма +entity.ThaumicConcilium.ChortSpit.name=Харчок +entity.ThaumicConcilium.Protolimb.name=Протоконечность tile.DestabilizedCrystalBlock.name=Дестабилизированный кристальный кластер tile.VisCondenserBlock.name=Вис-Конденсатор @@ -108,6 +137,7 @@ tile.RedPoweredMindBlock.name=Краснокаменный Мозг tile.FleshCrucible.name=Тигель Плоти tile.VoidRealityBlock.name=Пустотная Реальность tile.HexOfPredictability.name=Гекс Предсказуемости +tile.SolidVoid.name=Твердая Пустота item.PolishmentDevice.name=Девайс для Полировки item.BottleOfThickTaint.name=Бутылка Густой Порчи @@ -130,6 +160,8 @@ item.CoagulatingEyeDrops.name=Сгущающие Глазные Капли item.BottleOfClearWater.name=Бутылка Чистой Воды item.TCItemGolemCore.0.name=Ассистент item.TCItemGolemCore.1.name=Валет +item.NetherMembrane.name=Мембрана Нижнего Мира +item.Protobody.name=Прототело item.CrimsonAnnales.name=Анналы Багрового Культа item.PontifexHammer.name=Молот Понтифика @@ -138,8 +170,6 @@ item.ItemPontifexRobeChest.name=Роба Понтифика item.ItemPontifexRobeLegs.name=Поножи Понтифика item.ItemPontifexRobeFeet.name=Ботинки Понтифика - - item.SignalFoci.name=Набалдашник: Сигнал item.CoolingFoci.name=Набалдашник: Охлаждение item.ImpulseFoci.name=Набалдашник: Импульс @@ -241,6 +271,18 @@ entry.thaumicconcilium.overanimated1=Мало кто хочет умирать, entry.thaumicconcilium.overanimated2=thaumicconcilium:textures/gui/overanimated.png:0:0:255:255:.5 entry.thaumicconcilium.vengefulgolem1=Големы - это верный инструмент каждого тауматурга, но только до тех пор, пока он остаётся инструментом. В погоне за максимальной производительностью многие инженеры готовы попирать моральные нормы, давая разум камням и соломе. Бунт творений не заставил себя долго ждать, и теперь они владеют всеми магическими навыками своего создателя, в частности - как управлять чужим телом и раздавать указы колокольчиком. Вы надеетесь про себя, что быть схваченным големами во сне - безболезненно. entry.thaumicconcilium.vengefulgolem2=thaumicconcilium:textures/gui/vengefulgolem.png:0:0:255:255:.5 +entry.thaumicconcilium.sloppyalchemist1=Обильная кровопотеря крайне отрицательно воздействует на когнитивные способности Алхимиков, и если бы это касалось только быта, однако же многим ритуалам призыва предшествует обязательная работа с колоссальными объемами жизненной энергии.
    Теперь им остается лишь надеяться, что кто-то освободит их от кабалы. +entry.thaumicconcilium.sloppyalchemist2=thaumicconcilium:textures/gui/sloppy_alchemist.png:0:0:255:255:.5 +entry.thaumicconcilium.burnedwitch1=Охотники на ведьм хорошо подготовлены для борьбы с теми, кто практикуют черную магию. Планомерно захватывая и предавая справедливому суду тех, кто решился вступить на кривую дорожку, они обычно не предают значения тому, куда ведьмы после этого попадают.
    Впрочем, деревенские жители не посещают такие места. +entry.thaumicconcilium.burnedwitch2=thaumicconcilium:textures/gui/burned_witch.png:0:0:255:255:.5 +entry.thaumicconcilium.witheredbotanist1=Далеко не секрет, что красота - одна из причин почему Магия Природы находит своих последователей. Однако смерть - неотъемлемая часть природы, поэтому Ботаники не забивают голову поисками бессмертия в течение своей непродолжительной жизни.
    Как знать, может, в чем-то они и правы... +entry.thaumicconcilium.witheredbotanist2=thaumicconcilium:textures/gui/withered_botanist.png:0:0:255:255:.5 +entry.thaumicconcilium.netherexplorer1=На пути магии многим так вскруживают голову первые успехи, что им начинает казаться, что им уже подвластно все.
    Но настоящие испытания быстро дают понять кто чего стоит на самом деле, и вот очередной покоритель Нижнего Мира становится материалом для песка душ. +entry.thaumicconcilium.netherexplorer2=thaumicconcilium:textures/gui/nether_explorer.png:0:0:255:255:.5 +entry.thaumicconcilium.crimsonarcher1=Экспедиции Багрового Культа ведутся вокруг перевалочных пунктов - аванпостов, служащих ориентиром и местом отдыха Багровых Рейнджеров. Все башни охраняются опытными стрелками, оснащенными стрелами, сконструированными на основе находок Рейнджеров. +entry.thaumicconcilium.crimsonarcher2=thaumicconcilium:textures/gui/crimson_archer.png:0:0:255:255:.5 +entry.thaumicconcilium.crimsonranger1=Несмотря на успехи в некоторых аспектах магии, Багровому Культу все еще не хватает знаний для достижения своих целей. Группы Рейнджеров были снаряжены в далекие земли, для поиска и сбора информации о Тауматургии.
    Рейнджеры слишком нагружены и недостаточно поворотливы чтобы дать настоящий отпор угрозам, поэтому в основном они активно отступают, надеясь отпугнуть врага новыми приемами, которые они освоили во время поисков. +entry.thaumicconcilium.crimsonranger2=thaumicconcilium:textures/gui/crimson_ranger.png:0:0:255:255:.5 tc.research_name.SIGNALFOCI=Набалдашник: Сигнал tc.research_text.SIGNALFOCI=...Я не могу, он так прекрасен! @@ -386,7 +428,7 @@ entry.terracast.second=Выходя из подпространства, дер tc.research_name.VALETCORE=Сердце голема: Валет tc.research_text.VALETCORE=Подавай барину умываться-одеваться! -entry.valetcore.first=Поставив големов работать на Ваших лесопилках и алхимических заводах, Вы решили завести одного и для более личных нужд.
    Проясните голему его обязанности, выдав ему листки бумаги с написанными на них командами, и пометьте точки его ответственности.
    Больше Вам не придётся самому включать свет и открывать двери гостям. +entry.valetcore.first=Поставив големов работать на Ваших лесопилках и алхимических заводах, Вы решили завести одного и для более личных нужд.
    Проясните голему его обязанности, выдав ему листки бумаги с написанными на них командами, и пометьте точки его ответственности. Голем начнет работу, когда Вы произнесете команду вслух.
    Больше Вам не придётся самому включать свет и открывать двери гостям. tc.research_name.ASSISTANCECORE=Сердце голема: Ассистент tc.research_text.ASSISTANCECORE=Принеси другого, живо! @@ -472,9 +514,9 @@ entry.quicksilvercrucible.second=Активная структура его те tc.research_name.TCTAINTEDMAGIC=Порченая Магия tc.research_text.TCTAINTEDMAGIC=Это было давно и неправда -entry.tctaintedmagic.first=Пожалуй, нет такой щели, сквозь которую Вам бы не захотелось просочиться, ожидая найти на том конце что-то новое, недоступное тем, кто так и не решился.
    Вы считаете, что тайные практики культистов, носящих багряные одежды, являются весьма интригующими. Всего лишь нужно придумать, как заставить их поделиться своими секретами... Эти ребята очень крепки и молчаливы, допрашивать их нет особого смысла, однако навряд ли эти люди появились вчера. Где-то должна храниться информация о них. +entry.tctaintedmagic.first=Пожалуй, нет такой щели, сквозь которую Вам бы не захотелось просочиться, ожидая найти на том конце что-то новое, недоступное тем, кто так и не решился.
    Вы считаете, что тайные практики культистов, носящих багровые одежды, являются весьма интригующими. Всего лишь нужно придумать, как заставить их поделиться своими секретами... Эти ребята очень крепки и молчаливы, допрашивать их нет особого смысла, однако навряд ли эти люди появились вчера. Где-то должна храниться информация о них. -tc.research_name.CRIMSONANNALES=Анналы Багряного Культа +tc.research_name.CRIMSONANNALES=Анналы Багрового Культа tc.research_text.CRIMSONANNALES=Таинственное Исчезновение entry.crimsonannales.first=Если бы не Ваши знания о Багровом Культе, Вы бы не тратили время на расшифровку этой ветоши.
    Похоже, много-много лет назад у Культа был не один лидер, а скорее два, причём второй был гораздо более сведущ в искусстве тауматургии. Некоторые даты, более близкие к нынешним, вымараны; после чего упоминания о Багровом Понтифике полностью отсутствуют. entry.crimsonannales.second=Вы полагаете, что именно исчезновение (или изгнание?) теоретического сподвижника Культа привело к его технологическому упадку и неспособности достичь результатов своих ритуалов.
    В любом случае, этот факт представляет несомненный интерес. Вы займётесь разгадкой этого феномена в свободное время... @@ -490,7 +532,7 @@ entry.primordiallife.first=Держать в руках эту вещь тяну tc.research_name.CRIMSONPONTIFEX=Багровый Понтифик tc.research_text.CRIMSONPONTIFEX=Воссоединение Семьи -entry.crimsonpontifex.first=Имея за плечами опыт успешного призыва живого существа с той стороны разлома, Вам кажется, что Вы знаете, куда пропал Понтифик Багряного Культа...
    Конечно, нарочно извлекать из забвения кого-то явно враждебного не самая лучшая идея, но Вам всё ещё необходимы эмпирические данные для вашей теории.
    Известно, что разломы резонируют с предметами, значит, Вам нужно что-то, связанное с пропавшим. Экземпляр Багровых Ритуалов должен подойти. +entry.crimsonpontifex.first=Имея за плечами опыт успешного призыва живого существа с той стороны разлома, Вам кажется, что Вы знаете, куда пропал Понтифик Багрового Культа...
    Конечно, нарочно извлекать из забвения кого-то явно враждебного не самая лучшая идея, но Вам всё ещё необходимы эмпирические данные для вашей теории.
    Известно, что разломы резонируют с предметами, значит, Вам нужно что-то, связанное с пропавшим. Экземпляр Багровых Ритуалов должен подойти. tc.research_name.MATERIALPEELER=Счищатель Материи tc.research_text.MATERIALPEELER=Я устал - я ухожу @@ -508,7 +550,7 @@ entry.fleshcrucible.first=Ничто не вечно, даже ваша уста tc.research_name.PONTIFEXROBE=Роба Понтифика tc.research_text.PONTIFEXROBE=Следи за руками entry.pontifexrobe.first=Годы, проведённые в призрачном состоянии, повлияли не только на Понтифика, но и на его облачение. Вы знаете, что повторить его будет не очень сложно.
    Ношение полного комплекта позволяет Вам в любой момент лишаться материальной полноценности ценой ограничения вашей деятельной свободы.
    Нажмите L, чтобы переключить эту способность.
    Несмотря на утёкшее время, страх перед ментальной мощью Понтифика всё ещё пронизывает каждого члена Культа. Нося полный комплект, Вы тверды в своём праве повелевать Багровыми Воинами. -entry.pontifexrobe.second=Подчинённые чувствуют прилив сил, воюя под началом Понтифика, сведущего в искусстве исцеления и неутолимо жадного до крови. +entry.pontifexrobe.second=Подчинённые чувствуют прилив сил, воюя под началом Понтифика, сведущего в искусстве исцеления и неутолимо жадного до крови.
    Эта роба может быть покрашена. tc.research_name.CRIMSONSPELLS=Заклинания Багрового Культа tc.research_text.CRIMSONSPELLS=Реальные Примитивные Проклятия @@ -544,4 +586,16 @@ tc.research_name.CRIMSONRAID=Багровый Налёт tc.research_text.CRIMSONRAID=Вдруг откуда ни возьмись entry.crimsonraid.first=Одним взмахом руки самые могучие воины Культа появляются перед Вами. Пока большинство призывателей еле управляется с двумя существами - под Вашим командованием находится целая армия.
    Детали описаны в Тайном Компендиуме. +tc.research_name.NETHER_MEMBRANE=Мембрана Нижнего Мира +tc.research_text.NETHER_MEMBRANE=Как раз вовремя +entry.nether_membrane.first=В ваших руках оказался любопытный органический материал. Наиболее разумным Вы находите версию, что производителем этой ткани был усопший, но наверняка сказать уже нельзя.
    При своей адаптивности, материал показывает весомую огнеупорность. Для вашего тела этого недостаточно, но вы вполне можете обернуть в это свои вещи, делая их несгораемыми в огне и лаве. + +tc.research_name.PROTOBODY=Прототело +tc.research_text.PROTOBODY=Так, да не так +entry.protobody.first=Пусть Ваше состояние невосприимчивости к материи и недоступно большинству, Вы осознали, насколько оно уязвимо.
    После продолжительного всматривания в Пустоту, Вы смогли увидеть в ней Себя. Отбросив ужасы разума, у Вас появился другой план.
    Создав дополнительное эфирное тело, Вы не смогли объединиться с ним, и тогда, сбросив в Пустоту свою копию, Она отвергла ее, разломив на части. +entry.protobody.second=Поглотив все части по отдельности, от Вас больше нельзя избавиться как от дуновения, размахами рук, и Ваш жезл теперь не единственный способ контакта с миром. Вы можете пользоваться предметами и атаковать, не нанося себе вреда. + +tc.research_name.SOLIDVOID=Твердая Пустота +tc.research_text.SOLIDVOID=Толстым слоем +entry.solidvoid.first=Вы обнаружили любопытное применение вашей новой способности - Вы можете заставить пустоту собраться на конце вашего жезла.
    Просто спуститесь достаточно низко, и нажмите ПКМ. diff --git a/src/main/resources/assets/thaumicconcilium/textures/blocks/cosmos.png b/src/main/resources/assets/thaumicconcilium/textures/blocks/cosmos.png new file mode 100644 index 0000000..c72a644 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/blocks/cosmos.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/blocks/space.png b/src/main/resources/assets/thaumicconcilium/textures/blocks/space.png deleted file mode 100644 index 6e3c564..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/blocks/space.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/entity/burned_witch.png b/src/main/resources/assets/thaumicconcilium/textures/entity/burned_witch.png new file mode 100644 index 0000000..375725a Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/entity/burned_witch.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/entity/chort.png b/src/main/resources/assets/thaumicconcilium/textures/entity/chort.png new file mode 100644 index 0000000..957488b Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/entity/chort.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/entity/nether_explorer.png b/src/main/resources/assets/thaumicconcilium/textures/entity/nether_explorer.png new file mode 100644 index 0000000..50966b9 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/entity/nether_explorer.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/burned_witch.png b/src/main/resources/assets/thaumicconcilium/textures/gui/burned_witch.png new file mode 100644 index 0000000..5639567 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/gui/burned_witch.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/crimson_archer.png b/src/main/resources/assets/thaumicconcilium/textures/gui/crimson_archer.png new file mode 100644 index 0000000..a7870f8 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/gui/crimson_archer.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/crimson_ranger.png b/src/main/resources/assets/thaumicconcilium/textures/gui/crimson_ranger.png new file mode 100644 index 0000000..48cd2eb Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/gui/crimson_ranger.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/nether_explorer.png b/src/main/resources/assets/thaumicconcilium/textures/gui/nether_explorer.png new file mode 100644 index 0000000..de4f163 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/gui/nether_explorer.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/sloppy_alchemist.png b/src/main/resources/assets/thaumicconcilium/textures/gui/sloppy_alchemist.png new file mode 100644 index 0000000..0510638 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/gui/sloppy_alchemist.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/vengefulgolem.png b/src/main/resources/assets/thaumicconcilium/textures/gui/vengeful_golem.png similarity index 100% rename from src/main/resources/assets/thaumicconcilium/textures/gui/vengefulgolem.png rename to src/main/resources/assets/thaumicconcilium/textures/gui/vengeful_golem.png diff --git a/src/main/resources/assets/thaumicconcilium/textures/gui/withered_botanist.png b/src/main/resources/assets/thaumicconcilium/textures/gui/withered_botanist.png new file mode 100644 index 0000000..5b9ff2a Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/gui/withered_botanist.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/nether_membrane.png b/src/main/resources/assets/thaumicconcilium/textures/items/nether_membrane.png new file mode 100644 index 0000000..c8fc22a Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/nether_membrane.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex0.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex0.png deleted file mode 100644 index 196fe9b..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex0.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex1.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex1.png deleted file mode 100644 index 1d58edc..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex1.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex2.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex2.png deleted file mode 100644 index dfeab29..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex2.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex3.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex3.png deleted file mode 100644 index ec100f0..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex3.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base0.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base0.png new file mode 100644 index 0000000..ee14f41 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base0.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base1.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base1.png new file mode 100644 index 0000000..67cd249 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base1.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base2.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base2.png new file mode 100644 index 0000000..34b8080 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base2.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base3.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base3.png new file mode 100644 index 0000000..c79162a Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_base3.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay0.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay0.png new file mode 100644 index 0000000..6620054 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay0.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay1.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay1.png new file mode 100644 index 0000000..9c628d7 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay1.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay2.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay2.png new file mode 100644 index 0000000..ec02769 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay2.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay3.png b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay3.png new file mode 100644 index 0000000..d51dc85 Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/items/pontifex_overlay3.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe.png b/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe.png index de32373..ab73578 100644 Binary files a/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe.png and b/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe_overlay.png b/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe_overlay.png new file mode 100644 index 0000000..936743f Binary files /dev/null and b/src/main/resources/assets/thaumicconcilium/textures/models/armor/pontifex_robe_overlay.png differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow.png b/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow.png deleted file mode 100644 index 66c2142..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_0.png b/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_0.png deleted file mode 100644 index 350c8e7..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_0.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_1.png b/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_1.png deleted file mode 100644 index 5fcd68a..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_1.png and /dev/null differ diff --git a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_2.png b/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_2.png deleted file mode 100644 index 3b0da82..0000000 Binary files a/src/main/resources/assets/thaumicconcilium/textures/tmp/bonebow_pulling_2.png and /dev/null differ