Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package InvSubPanel;
- import net.risingworld.api.Plugin;
- import net.risingworld.api.events.EventMethod;
- import net.risingworld.api.events.Listener;
- import net.risingworld.api.events.player.PlayerConnectEvent;
- import net.risingworld.api.objects.Player;
- import net.risingworld.api.ui.UIElement;
- import net.risingworld.api.ui.UITarget;
- import net.risingworld.api.ui.style.Pivot;
- public class InvSubPanel extends Plugin implements Listener{
- @Override
- public void onEnable() {
- this.registerEventListener(this);
- }
- @Override
- public void onDisable() {
- }
- @EventMethod
- public void playerConnect(PlayerConnectEvent evt){
- Player player = evt.getPlayer();
- addElement(player);
- }
- public void addElement(Player player){
- UIElement invSubPanel = new UIElement();
- invSubPanel.setPivot(Pivot.MiddleLeft);
- invSubPanel.setSize(15, 45, true);
- invSubPanel.setPosition(78f, 43f, true);
- invSubPanel.setBackgroundColor(0, 0, 0, 0.75f);
- invSubPanel.setVisible(true);
- player.setAttribute("Inventory_Sub_Panel", invSubPanel);
- player.addUIElement(invSubPanel, UITarget.Inventory);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement