mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-14 21:22:09 +00:00
Merge branch 'master' of github.com:essentials/Essentials
This commit is contained in:
commit
5622882602
2 changed files with 14 additions and 6 deletions
|
@ -2,7 +2,6 @@ package com.earth2me.essentials.signs;
|
||||||
|
|
||||||
import com.earth2me.essentials.IEssentials;
|
import com.earth2me.essentials.IEssentials;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
|
||||||
|
|
||||||
|
|
||||||
public class SignDisposal extends EssentialsSign
|
public class SignDisposal extends EssentialsSign
|
||||||
|
@ -15,7 +14,10 @@ public class SignDisposal extends EssentialsSign
|
||||||
@Override
|
@Override
|
||||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess)
|
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess)
|
||||||
{
|
{
|
||||||
player.getBase().openInventory(ess.getServer().createInventory(player, InventoryType.CHEST));
|
player.sendMessage("Bukkit broke this sign :(");
|
||||||
|
//TODO: wait for a fix in bukkit
|
||||||
|
//Problem: Items can be duplicated
|
||||||
|
//player.getBase().openInventory(ess.getServer().createInventory(player, 36));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import static com.earth2me.essentials.I18n._;
|
||||||
import com.earth2me.essentials.IEssentials;
|
import com.earth2me.essentials.IEssentials;
|
||||||
import com.earth2me.essentials.Trade;
|
import com.earth2me.essentials.Trade;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
|
import com.earth2me.essentials.craftbukkit.InventoryWorkaround;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
@ -33,10 +34,15 @@ public class SignFree extends EssentialsSign
|
||||||
throw new SignException(_("cantSpawnItem", "Air"));
|
throw new SignException(_("cantSpawnItem", "Air"));
|
||||||
}
|
}
|
||||||
|
|
||||||
item.setAmount(item.getType().getMaxStackSize() * 9 * 4);
|
item.setAmount(item.getType().getMaxStackSize());
|
||||||
Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST);
|
InventoryWorkaround.addItem(player.getInventory(), true, item);
|
||||||
i.addItem(item);
|
player.sendMessage("Item added to your inventory.");
|
||||||
player.openInventory(i);
|
player.updateInventory();
|
||||||
|
//TODO: wait for a fix in bukkit
|
||||||
|
//Problem: Items can be duplicated
|
||||||
|
//Inventory i = ess.getServer().createInventory(player, InventoryType.CHEST);
|
||||||
|
//i.addItem(item);
|
||||||
|
//player.openInventory(i);
|
||||||
Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess);
|
Trade.log("Sign", "Free", "Interact", username, null, username, new Trade(item, ess), sign.getBlock().getLocation(), ess);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue