1.15 support

This commit is contained in:
Govindas 2020-01-13 12:37:12 +02:00
parent 41e22aaf16
commit 7cddbf3b06
49 changed files with 611 additions and 114 deletions

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

View File

@ -0,0 +1,10 @@
<component name="ArtifactManager">
<artifact type="jar" build-on-make="true" name="SkStuff:jar">
<output-path>$PROJECT_DIR$/out/artifacts/SkStuff_jar</output-path>
<root id="archive" name="SkStuff.jar">
<element id="module-output" name="SkStuff" />
<element id="file-copy" path="$PROJECT_DIR$/plugin.yml" />
<element id="dir-copy" path="$PROJECT_DIR$/src" />
</root>
</artifact>
</component>

View File

@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="Govindas">
<words>
<w>elytra</w>
</words>
</dictionary>
</component>

9
.idea/discord.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DiscordProjectSettings">
<option name="show" value="true" />
</component>
<component name="ProjectNotificationSettings">
<option name="askShowProject" value="false" />
</component>
</project>

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/SkStuff.iml" filepath="$PROJECT_DIR$/SkStuff.iml" />
</modules>
</component>
</project>

124
.idea/uiDesigner.xml Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

75
.idea/workspace.xml Normal file
View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="70d91eb4-a0dc-47e6-9359-422d8a6dbe67" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ErrorTreeViewConfiguration">
<option name="autoscrollToSource" value="true" />
<option name="IS_AUTOSCROLL_TO_SOURCE" value="true" />
</component>
<component name="ProjectId" id="1TbbrehnIFtL8XeJqI8ub1rnUl0" />
<component name="ProjectViewState">
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$/../import/craftbukkit-1.15.1-R0.1-SNAPSHOT.jar!/" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="run.code.analysis.last.selected.profile" value="pProject Default" />
</component>
<component name="RecentsManager">
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="me.TheBukor.SkStuff.util" />
<recent name="me.TheBukor.SkStuff.pathfinders" />
</key>
</component>
<component name="ServiceViewManager">
<option name="viewStates">
<list>
<serviceView>
<treeState>
<expand />
<select />
</treeState>
</serviceView>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="70d91eb4-a0dc-47e6-9359-422d8a6dbe67" name="Default Changelist" comment="" />
<created>1573731941395</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1573731941395</updated>
</task>
<servers />
</component>
<component name="WindowStateProjectService">
<state x="479" y="248" width="408" height="241" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes" timestamp="1578911142305">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="479" y="248" width="408" height="241" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes/0.0.1366.728@0.0.1366.728" timestamp="1578911142305" />
<state x="463" y="118" key="FileChooserDialogImpl" timestamp="1578911282656">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="463" y="118" key="FileChooserDialogImpl/0.0.1366.728@0.0.1366.728" timestamp="1578911282656" />
<state x="163" y="0" key="SettingsEditor" timestamp="1578911286394">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="163" y="0" key="SettingsEditor/0.0.1366.728@0.0.1366.728" timestamp="1578911286394" />
<state x="65" y="0" key="new project wizard" timestamp="1577106946881">
<screen x="0" y="0" width="1366" height="728" />
</state>
<state x="65" y="0" key="new project wizard/0.0.1366.728@0.0.1366.728" timestamp="1577106946881" />
</component>
</project>

2
META-INF/MANIFEST.MF Normal file
View File

@ -0,0 +1,2 @@
Manifest-Version: 1.0

View File

@ -1,65 +1,13 @@
## Unofficial fork of [SkStuff](https://github.com/TheBukor/SkStuff)
This fork adds 1.13 and 1.14 support, removes support for older than 1.13 versions, removes worldguard/worldedit, vanishnospacket and nbt stuff. This fork is focused on making pathfinder goals to work as they are unique to SkStuff. Note that I'm not very experienced Java developer yet, so it is possible that I have made some mistakes, but from my little testings things are working.
As the owner is missing for a few weeks, this fork brings nbt support to 1.12. Only use it in case the official one still not supported.
**Download it [here](https://github.com/Govindass/SkStuff/releases)**
**Download it [here](https://github.com/Tuke-Nuke/SkStuff/releases)**
**Little Pathfinder Goals Tutorial**
Add pathfinder goals with:
```
add pathfind[er] goal [[with] priority %-integer%] <insert pathfinder goal here> to %livingentities%
```
List of Pathfinder Goals
```
(avoid|run away from) %entitytype%[, radius %number%[, speed %number%[, speed (if|when) (close|near) %number%]]]
break door[s]
breed[, [move[ment]] speed %number%] #Note 1
eat grass
(flee from the sun|seek shad(e|ow))[, [move[ment]] speed %number%]
(float (in[side]|on) water|swim)
follow (owner|tamer)[, speed %number%[, min[imum] distance %number%[, max[imum] distance %number%]]] #Note 2
follow (adult|parent)[s][, [move[ment]] speed %number%] #Note 3
(fight back|react to|target) (damager|attacker) [[of] type] %entitytype%[, call ([for] help|reinforcement) %boolean%]
o(c|z)elot jump on blocks[, [move[ment]] speed %number%]
leap at target[, [leap] height %number%]
look at %entitytype%[, (radius|max[imum] distance) %number%]
melee attack %entitytype%[, [move[ment]] speed %number%[, (memorize|do('nt| not) forget) target [for [a] long[er] time] %boolean%]] #Note 4
move to[wards] target[, [move[ment]] speed %number%[, (radius|max[imum] distance) %number%]]
target nearest [entity [of] type] %entitytype%[, check sight %boolean%] #Note 5
o(c|z)elot attack #Note 6
open door[s]
(panic|flee)[, [move[ment]] speed %number%]
look around randomly
(walk around randomly|wander)[, [move[ment]] speed %number%[, min[imum] [of] %timespan% between mov(e[ment][s]|ing)]]
sit #Note 2
[creeper] (explode|inflate|swell)
squid (swim around|wander)
shoot fireball[s] #Note 7
[silverfish] hide (in[side]|on) block[s]
(call|summon|wake) [other] [hidden] silverfish[es]
[enderman] pick[[ ]up] block[s]
[enderman] place block[s]
[enderman] attack player (staring|looking) at [their] eye[s]]
ghast move to[wards] target
ghast (idle move[ment]|wander|random fl(ight|y[ing]))
(tempt to|follow players (holding|with)) %itemstack%[, [move[ment]] speed %number%[, scared of player movement %boolean%]]
target [random] %entitytype% (if|when) (not |un)tamed #Note 2
guardian attack [entities] #Note 6
[z[ombie[ ]]pig[man]] attack [player[s]] (if|when) angry
[z[ombie[ ]]pig[man]] (react to|fight back|target) (attacker|damager) (if|when) angry
[rabbit] eat carrot crops
[killer] rabbit [melee] attack
slime [random] jump
slime change (direction|facing) randomly
slime (idle move[ment]|wander)
In case of **bugs**:
* If it is a bug related to NBTs or Pathfind and it only happens in 1.12, you can report it here and I will try to help.
* Any other bugs, should be reported at official pages. Since it is a temporary fork.
Notes:
1 - Can only be applied to breedable animals.
2 - Can only be applied to tameable animals (Wolves and Ocelots).
3 - Only takes effect when the entity is a baby (age is less than 0).
4 - The boolean argument specifies whether or not the entity should lose interest on its target if there's no suitable path. The speed parameter will ALWAYS be 1 for SPIDERS. The boolean will ALWAYS be TRUE for SPIDERS.
5 - The boolean argument specifier whether or not the entity should have a direct line of sight of its target. Examples are spiders, by default they can see players through blocks. The boolean argument will ALWAYS be TRUE for SPIDERS.
6 - If this goal is missing on the entity, it will not be able to attack.
7 - Can only be applied on Ghasts or Blazes.
```
---
[**Github**](https://github.com/TheBukor/SkStuff) - [**skUnity**](https://forums.skunity.com/resources/skstuff.131/)

200
SkStuff.iml Normal file
View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.7.10.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.8.3.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.8.8.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.8.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/Skript.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/VanishNoPacket.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/WorldEdit.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/ProtocolLib.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.9.4.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.9.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.10.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/1.11.jar" />
<libelement value="file://C:/Users/DELL/AppData/Roaming/.minecraft/workspace/eclipse/Build Path/WorldGuard1.11.jar" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/bin" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/guava-28.1-jre.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/Paper-API-1.13.2-2153ca4-20190925-0055.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/javax.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/ProtocolLib.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/gson-2.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/javax.annotation.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/Spigot-API-1.13.2-0c02b0c-20190425-0538.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.13.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.13.2.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.10.2-R0.1-SNAPSHOT-latest.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.10.2-R0.1-SNAPSHOT-latest.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.11.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.11.2.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.9.4-R0.1-SNAPSHOT-latest.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.9.4-R0.1-SNAPSHOT-latest.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.8.8-R0.1-SNAPSHOT-latest.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.12.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.12.2.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.9.2-R0.1-SNAPSHOT-latest.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.9.2-R0.1-SNAPSHOT-latest.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/Skript 2.2 dev36.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.14.4-R0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.14.4-R0.1-SNAPSHOT.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.15.1-R0.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/../import/craftbukkit-1.15.1-R0.1-SNAPSHOT.jar!/" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>

2
bin/.gitignore vendored
View File

@ -1,2 +0,0 @@
/me/
/org/

3
bin/META-INF/MANIFEST.MF Normal file
View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: me.TheBukor.SkStuff.SkStuff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,4 +3,4 @@ author: [TheBukor, Govindas]
description: A Skript addon which adds extra functionalities such as pathfinder goals.
version: 1.6.4.2-fork-1.13-1.14
main: me.TheBukor.SkStuff.SkStuff
depend: [Skript]
softdepend: [Skript]

View File

@ -1,48 +1,22 @@
package me.TheBukor.SkStuff;
import java.io.IOException;
import javax.annotation.Nullable;
import me.TheBukor.SkStuff.util.*;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.event.entity.EntityToggleGlideEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.mcstats.Metrics;
import ch.njol.skript.Skript;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.util.SimpleEvent;
import ch.njol.skript.registrations.EventValues;
import ch.njol.skript.util.Getter;
import me.TheBukor.SkStuff.effects.EffClearPathGoals;
import me.TheBukor.SkStuff.effects.EffGZipFile;
import me.TheBukor.SkStuff.effects.EffMakeJump;
import me.TheBukor.SkStuff.effects.EffRemovePathGoal;
import me.TheBukor.SkStuff.effects.EffResourceSound;
import me.TheBukor.SkStuff.effects.EffSetPathGoal;
import me.TheBukor.SkStuff.effects.EffShowEntityEffect;
import me.TheBukor.SkStuff.expressions.ExprClickedInventory;
import me.TheBukor.SkStuff.effects.*;
import me.TheBukor.SkStuff.expressions.*;
import me.TheBukor.SkStuff.util.*;
import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.event.entity.EntityToggleGlideEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.plugin.java.JavaPlugin;
import org.mcstats.Metrics;
import me.TheBukor.SkStuff.expressions.ExprFireProof;
import me.TheBukor.SkStuff.expressions.ExprGlideState;
import me.TheBukor.SkStuff.expressions.ExprInventoryOwner;
import me.TheBukor.SkStuff.expressions.ExprNoClip;
import me.TheBukor.SkStuff.expressions.ExprNoGravityState;
import me.TheBukor.SkStuff.expressions.ExprTimespanToNumber;
import me.TheBukor.SkStuff.expressions.ExprToLowerCase;
import me.TheBukor.SkStuff.expressions.ExprToUpperCase;
import me.TheBukor.SkStuff.expressions.ExprWordsToUpperCase;
import javax.annotation.Nullable;
import java.io.IOException;
public class SkStuff extends JavaPlugin {
private int condAmount = 0;
@ -126,14 +100,22 @@ public class SkStuff extends JavaPlugin {
private boolean setupNMSVersion() {
String version = ReflectionUtils.getVersion();
if (version.equals("v1_13_R2.")) {
nmsMethods = new NMS_v1_13_R2();
getLogger().info("It looks like you're running 1.13.2!");
} else if (version.equals("v1_14_R1.")) {
nmsMethods = new NMS_v1_14_R1();
getLogger().info("It looks like you're running 1.14.2!");
} else {
getLogger().warning("It looks like you're running an unsupported server version, some features will not be available :(");
switch (version) {
case "v1_13_R2.":
nmsMethods = new NMS_v1_13_R2();
getLogger().info("It looks like you're running 1.13.2!");
break;
case "v1_14_R1.":
nmsMethods = new NMS_v1_14_R1();
getLogger().info("It looks like you're running 1.14.2!");
break;
case "v1_15_R1.":
nmsMethods = new NMS_v1_15_R1();
getLogger().info("It looks like you're running 1.15.1!");
break;
default:
getLogger().warning("It looks like you're running an unsupported server version, some features will not be available :(");
break;
}
return nmsMethods != null;
}

View File

@ -1,12 +1,6 @@
package me.TheBukor.SkStuff.util;
import java.io.File;
import net.minecraft.server.v1_13_R2.EntityTypes;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.inventory.ItemStack;
public interface NMSInterface {

View File

@ -0,0 +1,112 @@
package me.TheBukor.SkStuff.util;
import net.minecraft.server.v1_15_R1.EntityInsentient;
import net.minecraft.server.v1_15_R1.EntityLiving;
import net.minecraft.server.v1_15_R1.PathfinderGoal;
import net.minecraft.server.v1_15_R1.PathfinderGoalSelector;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftLivingEntity;
import org.bukkit.entity.Entity;
import java.util.Iterator;
import java.util.LinkedHashSet;
public class NMS_v1_15_R1 implements NMSInterface {
@Override
public void clearPathfinderGoals(Entity entity) {
EntityInsentient nmsEnt = (EntityInsentient) ((CraftEntity) entity).getHandle();
((LinkedHashSet<?>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, nmsEnt.goalSelector)).clear();
((LinkedHashSet<?>) ReflectionUtils.getField("c", PathfinderGoalSelector.class, nmsEnt.goalSelector)).clear();
((LinkedHashSet<?>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, nmsEnt.targetSelector)).clear();
((LinkedHashSet<?>) ReflectionUtils.getField("c", PathfinderGoalSelector.class, nmsEnt.targetSelector)).clear();
}
@Override
public void removePathfinderGoal(Object entity, Class<?> goalClass, boolean isTargetSelector) {
if (entity instanceof EntityInsentient) {
((EntityInsentient) entity).setGoalTarget(null);
if (isTargetSelector) {
Iterator<?> goals = ((LinkedHashSet<?>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, ((EntityInsentient) entity).targetSelector)).iterator();
while (goals.hasNext()) {
Object goal = goals.next();
if (ReflectionUtils.getField("a", goal.getClass(), goal).getClass() == goalClass) {
goals.remove();
}
}
} else {
Iterator<?> goals = ((LinkedHashSet<?>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, ((EntityInsentient) entity).goalSelector)).iterator();
while (goals.hasNext()) {
Object goal = goals.next();
if (ReflectionUtils.getField("a", goal.getClass(), goal).getClass() == goalClass) {
goals.remove();
}
}
}
}
}
@Override
public void addPathfinderGoal(Object entity, int priority, Object goal, boolean isTargetSelector) {
if (entity instanceof EntityInsentient && goal instanceof PathfinderGoal) {
if (isTargetSelector)
((EntityInsentient) entity).targetSelector.a(priority, (PathfinderGoal) goal);
else
((EntityInsentient) entity).goalSelector.a(priority, (PathfinderGoal) goal);
}
}
@Override
public boolean getNoClip(Entity entity) {
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
return nmsEntity.noclip;
}
@Override
public void setNoClip(Entity entity, boolean noclip) {
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.noclip = noclip;
}
@Override
public boolean getFireProof(Entity entity) {
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
return nmsEntity.isFireProof();
}
@Override
public void setFireProof(Entity entity, boolean fireProof) {
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
ReflectionUtils.setField("fireProof", nmsEntity.getClass(), nmsEntity, fireProof);
}
@Override
public boolean getElytraGlideState(Entity entity) {
EntityLiving nmsEntity = ((CraftLivingEntity) entity).getHandle();
return nmsEntity.getFlag(7);
}
public void setElytraGlideState(Entity entity, boolean glide) {
EntityLiving nmsEntity = ((CraftLivingEntity) entity).getHandle();
nmsEntity.setFlag(7, glide);
}
public boolean getNoGravity(Entity entity) {
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
return nmsEntity.isNoGravity();
}
public void setNoGravity(Entity entity, boolean noGravity) {
net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
nmsEntity.setNoGravity(noGravity);
}
}