mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 10:36:17 +01:00
started adding tag registry and updated to support 1.10_R1
This commit is contained in:
parent
6fa6175856
commit
8a528230a3
@ -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;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.sekwah.advancedportals.api;
|
||||
package com.sekwah.advancedportals.api.portaldata;
|
||||
|
||||
public class PortalArg {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.sekwah.advancedportals.api;
|
||||
package com.sekwah.advancedportals.api.portaldata;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
16
src/com/sekwah/advancedportals/api/registry/TagInfo.java
Normal file
16
src/com/sekwah/advancedportals/api/registry/TagInfo.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
25
src/com/sekwah/advancedportals/api/registry/TagRegistry.java
Normal file
25
src/com/sekwah/advancedportals/api/registry/TagRegistry.java
Normal 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(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
27
src/com/sekwah/advancedportals/compat/bukkit/v1_10_R1.java
Normal file
27
src/com/sekwah/advancedportals/compat/bukkit/v1_10_R1.java
Normal 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);
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.sekwah.advancedportals.portals;
|
||||
|
||||
import com.sekwah.advancedportals.api.portaldata.PortalArg;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
||||
|
@ -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 {
|
||||
|
||||
|
||||
}
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user