mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-10-25 20:32:29 +00:00
Fixed #824 amongst other things
This commit is contained in:
5 files changed
+21
-9
No files matched your search
@@ -78,7 +78,7 @@ public class TileEnchanter extends TileEntity implements ISidedInventory, IMovab
|
||||
}
|
||||
|
||||
public void removeLevel(int index) {
|
||||
levels.remove(index);
|
||||
levels.remove(index);
|
||||
}
|
||||
|
||||
public void setEnchant(int index, int enchant) {
|
||||
|
||||
@@ -46,6 +46,7 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
@@ -93,7 +94,7 @@ public class TileAnimationTablet extends TileEntity implements IInventory, IMova
|
||||
List<Entity> detectedEntities = new ArrayList();
|
||||
ItemStack[] inventorySlots = new ItemStack[1];
|
||||
//public String Owner;
|
||||
FakeThaumcraftPlayer player;
|
||||
TabletFakePlayer player;
|
||||
private int swingMod = 0;
|
||||
private boolean isBreaking = false;
|
||||
private int initialDamage = 0;
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
@@ -77,6 +78,11 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack focusstack, int rank) {
|
||||
return new FocusUpgradeType[]{FocusUpgradeType.frugal};
|
||||
}
|
||||
|
||||
private static boolean CheckBlackList(Entity entity) {
|
||||
Class<? extends Entity> aClass=entity.getClass();
|
||||
if(DeflectBlacklist.contains(aClass))
|
||||
@@ -120,7 +126,13 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost(ItemStack stack) {
|
||||
return visUsage;
|
||||
float modifier=this.getUpgradeLevel(stack,FocusUpgradeType.frugal)*0.10f;
|
||||
AspectList cost=visUsage.copy();
|
||||
for(Aspect a:visUsage.getAspects())
|
||||
{
|
||||
cost.remove(a, (int) Math.round(cost.getAmount(a)*modifier));
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -173,10 +173,7 @@ public abstract class ItemModFocus extends ItemFocusBasic implements ITTinkererI
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(ItemStack itemStack, int i) {
|
||||
return new FocusUpgradeType[]{FocusUpgradeType.treasure};
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -62,8 +62,10 @@ public class PacketEnchanterAddEnchant extends PacketTile<TileEnchanter> impleme
|
||||
|
||||
if (message.level == -1) {
|
||||
int index = message.tile.enchantments.indexOf(message.enchant);
|
||||
message.tile.removeLevel(index);
|
||||
message.tile.removeEnchant(index);
|
||||
if(index!=-1) {
|
||||
message.tile.removeLevel(index);
|
||||
message.tile.removeEnchant(index);
|
||||
}
|
||||
} else {
|
||||
if (!message.tile.enchantments.contains(message.enchant)) {
|
||||
if (message.player != null && EnchantmentManager.canApply(message.tile.getStackInSlot(0), Enchantment.enchantmentsList[message.enchant], message.tile.enchantments) && EnchantmentManager.canEnchantmentBeUsed(((EntityPlayer) message.player).getGameProfile().getName(), Enchantment.enchantmentsList[message.enchant])) {
|
||||
|
||||
Reference in new issue
Block a user