2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs.containers;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
|
import net.minecraft.inventory.Slot;
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
import noppes.npcs.constants.EnumCompanionTalent;
|
|
|
|
|
import noppes.npcs.entity.EntityNPCInterface;
|
|
|
|
|
import noppes.npcs.roles.RoleCompanion;
|
|
|
|
|
|
2025-03-12 20:12:01 -04:00
|
|
|
public class ContainerNPCCompanion extends ContainerNpcInterface {
|
2018-09-13 12:03:28 -04:00
|
|
|
public InventoryNPC currencyMatrix;
|
2025-03-12 20:12:01 -04:00
|
|
|
public RoleCompanion role;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
2025-03-12 20:12:01 -04:00
|
|
|
public ContainerNPCCompanion(EntityNPCInterface npc, EntityPlayer player) {
|
|
|
|
|
super(player);
|
|
|
|
|
role = (RoleCompanion) npc.roleInterface;
|
|
|
|
|
for (int k = 0; k < 3; k++) {
|
|
|
|
|
for (int j1 = 0; j1 < 9; j1++) {
|
|
|
|
|
addSlotToContainer(new Slot(player.inventory, j1 + k * 9 + 9, 6 + j1 * 18, 87 + k * 18));
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-12 20:12:01 -04:00
|
|
|
for (int l = 0; l < 9; l++) {
|
|
|
|
|
addSlotToContainer(new Slot(player.inventory, l, 6 + l * 18, 145));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (role.talents.containsKey(EnumCompanionTalent.INVENTORY)) {
|
|
|
|
|
int size = (role.getTalentLevel(EnumCompanionTalent.INVENTORY) + 1) * 2;
|
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
|
addSlotToContainer(new Slot(role.inventory, i, 114 + i % 3 * 18, 8 + i / 3 * 18));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (role.getTalentLevel(EnumCompanionTalent.ARMOR) > 0) {
|
|
|
|
|
for (int l = 0; l < 4; l++) {
|
|
|
|
|
addSlotToContainer(new SlotCompanionArmor(role, npc.inventory, l, 6, 8 + l * 18, l));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (role.getTalentLevel(EnumCompanionTalent.SWORD) > 0) {
|
|
|
|
|
addSlotToContainer(new SlotCompanionWeapon(role, npc.inventory, 4, 79, 17));
|
2018-09-13 12:03:28 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
2025-03-12 20:12:01 -04:00
|
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int i) {
|
2018-09-13 12:03:28 -04:00
|
|
|
return null;
|
|
|
|
|
}
|
2025-03-12 20:12:01 -04:00
|
|
|
|
2018-09-13 12:03:28 -04:00
|
|
|
@Override
|
2025-03-12 20:12:01 -04:00
|
|
|
public void onContainerClosed(EntityPlayer entityplayer) {
|
2018-09-13 12:03:28 -04:00
|
|
|
super.onContainerClosed(entityplayer);
|
|
|
|
|
role.setStats();
|
|
|
|
|
}
|
|
|
|
|
}
|