started adding tag registry and updated to support 1.10_R1

This commit is contained in:
Alastair 2016-07-28 23:09:30 +01:00
parent 6fa6175856
commit 8a528230a3
9 changed files with 73 additions and 16 deletions

View File

@ -1,8 +1,8 @@
package com.sekwah.advancedportals;
import com.sekwah.advancedportals.api.portaldata.PortalArg;
import com.sekwah.advancedportals.listeners.Listeners;
import com.sekwah.advancedportals.portals.Portal;
import com.sekwah.advancedportals.portals.PortalArg;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;

View File

@ -1,4 +1,4 @@
package com.sekwah.advancedportals.api;
package com.sekwah.advancedportals.api.portaldata;
public class PortalArg {

View File

@ -1,4 +1,4 @@
package com.sekwah.advancedportals.api;
package com.sekwah.advancedportals.api.portaldata;
import java.util.ArrayList;
import java.util.HashMap;

View File

@ -0,0 +1,16 @@
package com.sekwah.advancedportals.api.registry;
/**
* Created by on 25/07/2016.
*
* @author sekwah41
*/
public class TagInfo {
private final String dataType;
public TagInfo(String tag, String dataType){
this.dataType = dataType;
}
}

View File

@ -0,0 +1,25 @@
package com.sekwah.advancedportals.api.registry;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/**
* Created by on 25/07/2016.
*
* @author sekwah41
*/
public class TagRegistry {
private ArrayList<String> tags = new ArrayList<String>();
private Map<String, TagInfo> tagDesc = new HashMap<String, TagInfo>();
public TagRegistry(){
}
}

View File

@ -0,0 +1,27 @@
package com.sekwah.advancedportals.compat.bukkit;
import net.minecraft.server.v1_10_R1.IChatBaseComponent;
import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public class v1_10_R1 implements NMS {
@Override
public void sendRawMessage(String rawMessage, Player player) {
IChatBaseComponent comp = IChatBaseComponent.ChatSerializer.a(rawMessage);
// "json message", position(0: chat (chat box), 1: system message (chat box), 2: above action bar)
PacketPlayOutChat packet = new PacketPlayOutChat(comp, (byte) 1);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
@Override
public void sendActionBarMessage(String rawMessage, Player player) {
IChatBaseComponent comp = IChatBaseComponent.ChatSerializer.a(rawMessage);
// "json message", position(0: chat (chat box), 1: system message (chat box), 2: above action bar)
PacketPlayOutChat packet = new PacketPlayOutChat(comp, (byte) 2);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}

View File

@ -1,5 +1,6 @@
package com.sekwah.advancedportals.portals;
import com.sekwah.advancedportals.api.portaldata.PortalArg;
import org.bukkit.Location;
import org.bukkit.Material;

View File

@ -1,13 +0,0 @@
package com.sekwah.advancedportals.portals;
/**
* Created by on 29/02/2016.
* <p>
* TODO create argument registry for easier altering and control :) also allows other coders to add custom args
*
* @author sekwah41
*/
public class ArgRegistry {
}

View File

@ -12,6 +12,7 @@ import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionAttachment;
import com.sekwah.advancedportals.api.portaldata.PortalArg;
import java.util.ArrayList;
import java.util.Set;