From 9cf011fbd94f64e1416a595ea861aade83acd8a0 Mon Sep 17 00:00:00 2001 From: hilburn Date: Fri, 6 Feb 2015 00:44:01 +0000 Subject: [PATCH 1/4] Diviner Changes Doesn't require Ritual Stones in creative mode Doesn't scroll both the direction and ritual any more (direction only changes when non-shifted) Can scroll the direction backwards --- .../common/items/ItemRitualDiviner.java | 58 +++++++++++-------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java index fc4a64db..e130b118 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/items/ItemRitualDiviner.java @@ -154,7 +154,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner { int direction = this.getDirection(par1ItemStack); - EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer); + if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer)) return false; ItemStack[] playerInventory = par2EntityPlayer.inventory.mainInventory; TileEntity tileEntity = par3World.getTileEntity(par4, par5, par6); @@ -187,7 +187,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner { if (par3World.isAirBlock(par4 + rc.getX(direction), par5 + rc.getY(), par6 + rc.getZ(direction))) { - if (playerInvRitualStoneLocation >= 0) + if (playerInvRitualStoneLocation >= 0 || par2EntityPlayer.capabilities.isCreativeMode) { if (rc.getStoneType() > this.maxMetaData + this.getMaxRuneDisplacement(par1ItemStack)) { @@ -243,7 +243,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner } } } - }else if(!(par3World.getBlock(par4, par5, par6) instanceof IRitualStone)) + }else if(!(par3World.getBlock(par4, par5, par6) instanceof IRitualStone) && !par2EntityPlayer.isSneaking()) { if(par3World.isRemote) { @@ -251,6 +251,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner } this.cycleDirection(par1ItemStack); par2EntityPlayer.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.ritualdiviner.ritualtunedto") + " " + this.getNameForDirection(this.getDirection(par1ItemStack)))); + return true; } return false; @@ -259,18 +260,9 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking()) + if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) && par3EntityPlayer.isSneaking()) { - int maxRitualID = Rituals.getNumberOfRituals(); - String currentRitualID = this.getCurrentRitual(par1ItemStack); - - this.setCurrentRitual(par1ItemStack, Rituals.getNextRitualKey(currentRitualID)); - - if (par2World.isRemote) - { - IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(par1ItemStack))); - par3EntityPlayer.addChatComponentMessage(chatmessagecomponent); - } + rotateRituals(par2World,par3EntityPlayer, par1ItemStack, true); } return par1ItemStack; @@ -283,17 +275,23 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner { EntityPlayer player = (EntityPlayer) entityLiving; - if (player.isSneaking() && !player.isSwingInProgress) + if (!EnergyItems.checkAndSetItemOwner(stack,player)) return true; + + if (!player.isSwingInProgress) { - int maxRitualID = Rituals.getNumberOfRituals(); - String currentRitualID = this.getCurrentRitual(stack); - - this.setCurrentRitual(stack, Rituals.getPreviousRitualKey(currentRitualID)); - - if (entityLiving.worldObj.isRemote) + if (player.isSneaking()) { - IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(stack))); - player.addChatComponentMessage(chatmessagecomponent); + rotateRituals(player.worldObj, player, stack, false); + } + else + { + if (!player.worldObj.isRemote) + { + int direction = this.getDirection(stack) - 1; + if (direction == 0) direction = 4; + this.setDirection(stack, direction); + player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.ritualdiviner.ritualtunedto") + " " + this.getNameForDirection(direction))); + } } } } @@ -301,6 +299,20 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner return false; } + public void rotateRituals(World world, EntityPlayer player, ItemStack stack, boolean next) + { + int maxRitualID = Rituals.getNumberOfRituals(); + String currentRitualID = this.getCurrentRitual(stack); + + this.setCurrentRitual(stack, next? Rituals.getNextRitualKey(currentRitualID):Rituals.getPreviousRitualKey(currentRitualID)); + + if (world.isRemote) + { + IChatComponent chatmessagecomponent = new ChatComponentText(StatCollector.translateToLocal("message.ritual.currentritual") + " " + Rituals.getNameOfRitual(this.getCurrentRitual(stack))); + player.addChatComponentMessage(chatmessagecomponent); + } + } + @Override public String getCurrentRitual(ItemStack par1ItemStack) { From 365f6588370da87176851b3db7601701ce150742 Mon Sep 17 00:00:00 2001 From: hilburn Date: Fri, 6 Feb 2015 02:32:23 +0000 Subject: [PATCH 2/4] Blacklist Time Torch Talking to Reika about the ChromatiCraft one --- .../alchemicalWizardry/AlchemicalWizardry.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index 1d8c757c..ac0dd81f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -771,6 +771,8 @@ public class AlchemicalWizardry this.blacklistDemons(); + this.blacklistAccelerators(); + MinecraftForge.EVENT_BUS.register(new ModLivingDropsEvent()); proxy.InitRendering(); NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); @@ -1150,6 +1152,15 @@ public class AlchemicalWizardry // this.createItemTextureFiles(); } + public static void blacklistAccelerators() + { + if (Loader.isModLoaded("Torcherino")) + { + FMLInterModComms.sendMessage("Torcherino", "blacklist-tile", TEAltar.class.getName()); + FMLInterModComms.sendMessage("Torcherino", "blacklist-tile", TEMasterStone.class.getName()); + } + } + public static void blacklistDemons() { String[] mobs = new String[]{"FallenAngel","LowerGuardian","BileDemon","WingedFireDemon","SmallEarthGolem","IceDemon","BoulderFist","Shade","AirElemental", From 678870c8f62474246cd3d1a1dcff44359d5aaefc Mon Sep 17 00:00:00 2001 From: hilburn Date: Sat, 7 Feb 2015 11:41:09 +0000 Subject: [PATCH 3/4] Blacklist ChromatiCraft Tile Accelerator --- .../AlchemicalWizardry.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java index ac0dd81f..2064bf5f 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java +++ b/src/main/java/WayofTime/alchemicalWizardry/AlchemicalWizardry.java @@ -9,10 +9,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; +import java.lang.reflect.*; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -1159,6 +1156,22 @@ public class AlchemicalWizardry FMLInterModComms.sendMessage("Torcherino", "blacklist-tile", TEAltar.class.getName()); FMLInterModComms.sendMessage("Torcherino", "blacklist-tile", TEMasterStone.class.getName()); } + if (Loader.isModLoaded("ChromatiCraft")) + { + try + { + Class api = Class.forName("Reika.ChromatiCraft.API.AcceleratorBlacklist"); + Class reason = Class.forName("Reika.ChromatiCraft.API.AcceleratorBlacklist$BlacklistReason"); + Object exploit = Enum.valueOf(reason,"EXPLOIT"); + Method add = api.getMethod("addBlacklist", Class.class, String.class, reason); + add.invoke(null, TEAltar.class, TEAltar.class.getSimpleName(),exploit); + add.invoke(null, TEMasterStone.class, TEMasterStone.class.getSimpleName(),exploit); + } catch (Exception e) + { + logger.log(Level.ERROR, "ChromatiCraft Accelerator Blacklist Failure"); + } + + } } public static void blacklistDemons() From f10189efad6b8635c54e9f4c6c977d8e40c681a7 Mon Sep 17 00:00:00 2001 From: hilburn Date: Fri, 13 Feb 2015 02:01:11 +0000 Subject: [PATCH 4/4] Prevents removal of Soul Fray with milk Yes it's stupid, Potions are stupid --- .../common/potion/PotionSoulFray.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java index 78febaff..304b0307 100644 --- a/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java +++ b/src/main/java/WayofTime/alchemicalWizardry/common/potion/PotionSoulFray.java @@ -1,7 +1,11 @@ package WayofTime.alchemicalWizardry.common.potion; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; +import java.util.ArrayList; + public class PotionSoulFray extends Potion { public PotionSoulFray(int par1, boolean par2, int par3) @@ -15,4 +19,16 @@ public class PotionSoulFray extends Potion super.setIconIndex(par1, par2); return this; } + + @Override + public void performEffect(EntityLivingBase entityLivingBase, int level) + { + entityLivingBase.getActivePotionEffect(this).setCurativeItems(new ArrayList()); + } + + @Override + public boolean isReady(int duration, int level) + { + return true; + } }