From a2c0a02d30e327706ffd37bbe459ed3216ba987a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Feb 2019 03:03:21 -0800 Subject: [PATCH] Planning this out is actually quite hard, getting sleepy now so I'll flesh this out tomorrow. --- .../com/gmail/nossr50/datatypes/Block.java | 10 ++++++ .../nossr50/datatypes/BlockProperty.java | 8 +++++ .../gmail/nossr50/datatypes/BlockState.java | 8 +++++ .../datatypes/TargetMinecraftVersion.java | 13 ++++++++ .../nossr50/platform/AbstractPlatform.java | 8 +++++ .../com/gmail/nossr50/platform/Platform.java | 33 +++++++++++++++++++ .../platform/PlatformSoftwareType.java | 10 ++++++ 7 files changed, 90 insertions(+) create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/Block.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java create mode 100644 core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java create mode 100644 core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java create mode 100644 core/src/main/java/com/gmail/nossr50/platform/Platform.java create mode 100644 core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/Block.java b/core/src/main/java/com/gmail/nossr50/datatypes/Block.java new file mode 100644 index 000000000..0fd095d76 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/Block.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.datatypes; + +/** + * Represents a container of properties and values for a Block + * @see BlockProperty + * @see BlockState + */ +public interface Block { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java b/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java new file mode 100644 index 000000000..58c307e9c --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/BlockProperty.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.datatypes; + +/** + * BlockProperties are key value pairs for a blocks state + */ +public interface BlockProperty { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java b/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java new file mode 100644 index 000000000..2d4652ee3 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/BlockState.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.datatypes; + +/** + * Representation of the state for a Block + */ +public interface BlockState { + +} diff --git a/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java b/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java new file mode 100644 index 000000000..47e4b7683 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/datatypes/TargetMinecraftVersion.java @@ -0,0 +1,13 @@ +package com.gmail.nossr50.datatypes; + +import com.gmail.nossr50.platform.Platform; + +/** + * Constants for targeted versions of MC + * @see Platform#getTargetMinecraftVersion() + */ +public class TargetMinecraftVersion { + public static final String MC_VERSION_1_8_8 = "1_8_8"; + public static final String MC_VERSION_1_12_2 = "1_12_2"; + public static final String MC_VERSION_1_13_2 = "1_13_2"; +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java b/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java new file mode 100644 index 000000000..85c2616aa --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/platform/AbstractPlatform.java @@ -0,0 +1,8 @@ +package com.gmail.nossr50.platform; + +/** + * This is the implementation of the Platform Interface + */ +public abstract class AbstractPlatform implements Platform { + +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/Platform.java b/core/src/main/java/com/gmail/nossr50/platform/Platform.java new file mode 100644 index 000000000..7c953f889 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/platform/Platform.java @@ -0,0 +1,33 @@ +package com.gmail.nossr50.platform; + +/** + * Represents the current API Platform + * mcMMO supports multiple platforms, so that abstraction is handled through this interface + */ +public interface Platform { + + /** + * Gets the name of the Platform + * @return name of this platform + */ + String getPlatformName(); + + /** + * Gets the version of this platform + * @return the current version of this platform + */ + String getPlatformVersion(); + + /** + * Gets the target version of Minecraft for this platform + * @return this platform's target minecraft version + */ + String getTargetMinecraftVersion(); + + /** + * Whether or not this platform has been loaded + * @return true if the platform is loaded + */ + Boolean isPlatformLoaded(); + +} diff --git a/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java b/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java new file mode 100644 index 000000000..15c19c069 --- /dev/null +++ b/core/src/main/java/com/gmail/nossr50/platform/PlatformSoftwareType.java @@ -0,0 +1,10 @@ +package com.gmail.nossr50.platform; + +/** + * Constants representing the software the platform belongs to + */ +public enum PlatformSoftwareType { + NMS, + BUKKIT, + SPONGE +}