add wrapper world
This commit is contained in:
parent
9197914aed
commit
54a730754f
6 changed files with 67 additions and 11 deletions
|
@ -8,6 +8,7 @@
|
|||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/api" />
|
||||
<option value="$PROJECT_DIR$/test-plugin" />
|
||||
</set>
|
||||
</option>
|
||||
|
|
|
@ -5,16 +5,11 @@
|
|||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="9d5d9b6f-43c8-41a4-bb42-a66ffc96c9b0" name="Changes" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/EntityLibPlatform.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/WrapperWorld.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/EntityMeta.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/display/BlockDisplayMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/display/BlockDisplayMeta.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/display/ItemDisplayMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/display/ItemDisplayMeta.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/display/TextDisplayMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/display/TextDisplayMeta.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test-plugin/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/build.gradle" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestCommand.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestDisplayCommand.java" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/java/me/tofaa/entitylib/TestDisplayCommand.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test-plugin/src/main/resources/plugin.yml" beforeDir="false" afterPath="$PROJECT_DIR$/test-plugin/src/main/resources/plugin.yml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/settings.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/settings.gradle" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -84,7 +79,7 @@
|
|||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"WebServerToolWindowFactoryState": "false",
|
||||
"git-widget-placeholder": "master",
|
||||
"git-widget-placeholder": "feat/platform-api",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"jdk.selected.JAVA_MODULE": "corretto-17",
|
||||
"kotlin-language-version-configured": "true",
|
||||
|
@ -238,7 +233,7 @@
|
|||
<line-breakpoint enabled="true" type="java-method">
|
||||
<url>file://$PROJECT_DIR$/src/main/java/me/tofaa/entitylib/meta/types/DisplayMeta.java</url>
|
||||
<line>153</line>
|
||||
<properties class="me.tofaa.entitylib.meta.types.DisplayMeta" method="setShadowRadius">
|
||||
<properties class="me.tofaa.entitylib.meta.types.DisplayMeta">
|
||||
<option name="EMULATED" value="true" />
|
||||
<option name="WATCH_EXIT" value="false" />
|
||||
</properties>
|
||||
|
|
19
api/build.gradle
Normal file
19
api/build.gradle
Normal file
|
@ -0,0 +1,19 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
}
|
||||
|
||||
group = 'me.tofaa.entitylib'
|
||||
version = '1.0-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation platform('org.junit:junit-bom:5.9.1')
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
rootProject.name = 'EntityLib'
|
||||
include 'test-plugin'
|
||||
include 'api'
|
||||
|
||||
|
|
15
src/main/java/me/tofaa/entitylib/EntityLibPlatform.java
Normal file
15
src/main/java/me/tofaa/entitylib/EntityLibPlatform.java
Normal file
|
@ -0,0 +1,15 @@
|
|||
package me.tofaa.entitylib;
|
||||
|
||||
import com.github.retrooper.packetevents.PacketEventsAPI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface EntityLibPlatform<W> {
|
||||
|
||||
@NotNull PacketEventsAPI<?> getPacketEvents();
|
||||
|
||||
@NotNull WrapperWorld<W> createWorld(UUID uuid, String name);
|
||||
|
||||
|
||||
}
|
25
src/main/java/me/tofaa/entitylib/WrapperWorld.java
Normal file
25
src/main/java/me/tofaa/entitylib/WrapperWorld.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package me.tofaa.entitylib;
|
||||
|
||||
import me.tofaa.entitylib.entity.WrapperEntity;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* A platform independent wrapper for a "world" object.
|
||||
* @param <W> The generic takes the actual world handle used by the platform.
|
||||
*/
|
||||
public interface WrapperWorld<W> {
|
||||
|
||||
@NotNull UUID getUuid();
|
||||
|
||||
@NotNull String getName();
|
||||
|
||||
@Nullable WrapperEntity getEntity(@NotNull UUID uuid);
|
||||
|
||||
@Nullable WrapperEntity getEntity(int entityId);
|
||||
|
||||
@NotNull W getHandle();
|
||||
|
||||
}
|
Loading…
Reference in a new issue