generated from tilera/1710mod
parent
c79f7779bb
commit
6ffec2106c
|
@ -24,7 +24,7 @@ apply from: './gradle/scripts/mixins.gradle'
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
version = "1.7.4"
|
version = "1.7.5"
|
||||||
group= "dev.tilera"
|
group= "dev.tilera"
|
||||||
archivesBaseName = "auracore"
|
archivesBaseName = "auracore"
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class ContainerWorkbench extends Container {
|
||||||
this.tileEntity.eventHandler = this;
|
this.tileEntity.eventHandler = this;
|
||||||
this.ip = par1InventoryPlayer;
|
this.ip = par1InventoryPlayer;
|
||||||
this.addSlotToContainer((Slot)new SlotCraftingArcaneWorkbench(par1InventoryPlayer.player, this.tileEntity, this.tileEntity, 9, 124, 29));
|
this.addSlotToContainer((Slot)new SlotCraftingArcaneWorkbench(par1InventoryPlayer.player, this.tileEntity, this.tileEntity, 9, 124, 29));
|
||||||
this.addSlotToContainer(new SlotWorkbenchWand(this.tileEntity, 10, 124, 61));
|
this.addSlotToContainer(new SlotWorkbenchWand(this.tileEntity, 10, 124, 61, par1InventoryPlayer.player));
|
||||||
for (var6 = 0; var6 < 3; ++var6) {
|
for (var6 = 0; var6 < 3; ++var6) {
|
||||||
for (var7 = 0; var7 < 3; ++var7) {
|
for (var7 = 0; var7 < 3; ++var7) {
|
||||||
this.addSlotToContainer(new Slot(this.tileEntity, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18));
|
this.addSlotToContainer(new Slot(this.tileEntity, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18));
|
||||||
|
|
|
@ -1,18 +1,37 @@
|
||||||
package dev.tilera.auracore.container;
|
package dev.tilera.auracore.container;
|
||||||
|
|
||||||
import dev.tilera.auracore.api.IWand;
|
import dev.tilera.auracore.api.IWand;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import thaumcraft.common.Thaumcraft;
|
||||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||||
|
import thaumcraft.common.tiles.TileArcaneWorkbench;
|
||||||
|
|
||||||
class SlotWorkbenchWand extends Slot {
|
class SlotWorkbenchWand extends Slot {
|
||||||
public SlotWorkbenchWand(IInventory par2IInventory, int par3, int par4, int par5) {
|
TileArcaneWorkbench workbench;
|
||||||
|
EntityPlayer player;
|
||||||
|
|
||||||
|
public SlotWorkbenchWand(TileArcaneWorkbench par2IInventory, int par3, int par4, int par5, EntityPlayer player) {
|
||||||
super(par2IInventory, par3, par4, par5);
|
super(par2IInventory, par3, par4, par5);
|
||||||
|
this.workbench = par2IInventory;
|
||||||
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||||
return par1ItemStack.getItem() instanceof ItemWandCasting || par1ItemStack.getItem() instanceof IWand;
|
return par1ItemStack.getItem() instanceof ItemWandCasting || par1ItemStack.getItem() instanceof IWand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSlotChanged() {
|
||||||
|
super.onSlotChanged();
|
||||||
|
if (
|
||||||
|
!this.workbench.getWorldObj().isRemote &&
|
||||||
|
this.inventory.getStackInSlot(this.getSlotIndex()) != null &&
|
||||||
|
this.inventory.getStackInSlot(this.getSlotIndex()).getItem() instanceof ItemWandCasting) {
|
||||||
|
player.openGui(Thaumcraft.instance, 13, this.workbench.getWorldObj(), this.workbench.xCoord, this.workbench.yCoord, this.workbench.zCoord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,7 @@ public class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean spendCharge(final ItemStack itemstack, final EntityPlayer player, int amount) {
|
public static boolean spendCharge(final ItemStack itemstack, final EntityPlayer player, int amount) {
|
||||||
|
if (itemstack == null) return false;
|
||||||
final int discount = 100 - Math.min(50, getTotalVisDiscount(player));
|
final int discount = 100 - Math.min(50, getTotalVisDiscount(player));
|
||||||
amount = Math.round(amount * (discount / 100.0f));
|
amount = Math.round(amount * (discount / 100.0f));
|
||||||
return ((IWand) itemstack.getItem()).consumeVis(itemstack, amount);
|
return ((IWand) itemstack.getItem()).consumeVis(itemstack, amount);
|
||||||
|
|
Loading…
Reference in a new issue