Skip to content

Instantly share code, notes, and snippets.

@Flashback083
Created March 6, 2019 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Flashback083/ea05800aef646fa345e80f161c4a2b16 to your computer and use it in GitHub Desktop.
Save Flashback083/ea05800aef646fa345e80f161c4a2b16 to your computer and use it in GitHub Desktop.
Update for offline player, and add reload commands
/bin/
.gradle
.settings
build
gradle
libs
run
*.launch
*.classpath
*.project
/libs/
/.idea/
/out/
*.iml
/run/
before_script:
# Sets the gradle home to .gradle so that all downloaded minecraft and forge libaries can be cached
- export GRADLE_USER_HOME=`pwd`/.gradle
cache:
paths:
- .gradle/wrapper
- .gradle/caches
gradle-build:
stage: build
script:
- export GRADLE_OPTS="-Xmx4G -Xms4G"
- chmod +x ./gradlew
- ./gradlew build
artifacts:
paths:
- build/libs/*-universal.jar
expire_in: 3 days
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="PixelExtras_api" target="1.8" />
<module name="PixelExtras_main" target="1.8" />
<module name="PixelExtras_test" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$USER_HOME$/.gradle" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
<component name="libraryTable">
<library name="Gradle: ca.weblite:java-objc-bridge:1.0.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ca.weblite/java-objc-bridge/1.0.0/6ef160c3133a78de015830860197602ca1c855d3/java-objc-bridge-1.0.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ca.weblite/java-objc-bridge/1.0.0/fb0092f22cb4fe8e631452f577b7a238778abf2a/java-objc-bridge-1.0.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/ca.weblite/java-objc-bridge/1.0.0/865837a198189aee737019561ece842827f24278/java-objc-bridge-1.0.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.google.code.findbugs:jsr305:3.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/f7be08ec23c21485b9b5a1cf1654c2ec8c58168d/jsr305-3.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/3d7ec36bbfbf5d7259356a6b8fec0ce4f96e3f47/jsr305-3.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.1/a2926c057ca3b662b9db194c869bdbe7d3bb8aef/jsr305-3.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.google.code.gson:gson:2.8.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/c4ba5371a29ac9b2ad6129b1d39ea38750043eff/gson-2.8.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/4791230388bf03457c7e235b69479b46a5931861/gson-2.8.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.0/baf95d8519fc1a11d388f8543cb40cd2bb9d66dc/gson-2.8.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.google.guava:guava:21.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/3a3d111be1be1b745edfa7d91678a12d7ed38709/guava-21.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/7d48c9b5304b8bab31d1ed7c9ef9670b646866c0/guava-21.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/21.0/b9ed26b8c23fe7cd3e6b463b34e54e5c6d9536d5/guava-21.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.ibm.icu:icu4j-core-mojang:51.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j-core-mojang/51.2/63d216a9311cca6be337c1e458e587f99d382b84/icu4j-core-mojang-51.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.ibm.icu/icu4j-core-mojang/51.2/814397ccbafff1132758e551c37396c528d7f2d7/icu4j-core-mojang-51.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.mojang:authlib:1.5.25">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/authlib/1.5.25/9834cdf236c22e84b946bba989e2f94ef5897c3c/authlib-1.5.25.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/authlib/1.5.25/18840707f662a3236542716fff61c659584f3e6c/authlib-1.5.25-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.mojang:patchy:1.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/patchy/1.1/aef610b34a1be37fa851825f12372b78424d8903/patchy-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/patchy/1.1/5e398295fbcb8fb590e3e3bddace13f659792e50/patchy-1.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.mojang:realms:1.10.22">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/realms/1.10.22/bd0dccebdf3744c75f1ca20063f16e8f7d5e663f/realms-1.10.22.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.mojang:text2speech:1.10.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/text2speech/1.10.3/48fd510879dff266c3815947de66e3d4809f8668/text2speech-1.10.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.mojang/text2speech/1.10.3/404339fe43d1011ee046a249b0ec7ae9ce04a834/text2speech-1.10.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.paulscode:codecjorbis:20101023">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/codecjorbis/20101023/c73b5636faf089d9f00e8732a829577de25237ee/codecjorbis-20101023.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/codecjorbis/20101023/4ca2436396bc14ebd78b7db1d4e11ca607c8705e/codecjorbis-20101023-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.paulscode:codecwav:20101023">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/codecwav/20101023/12f031cfe88fef5c1dd36c563c0a3a69bd7261da/codecwav-20101023.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/codecwav/20101023/71ec00b9b9c1a6a2c3a8a25f481a23ddb5b21ddb/codecwav-20101023-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.paulscode:libraryjavasound:20101123">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/libraryjavasound/20101123/5c5e304366f75f9eaa2e8cca546a1fb6109348b3/libraryjavasound-20101123.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/libraryjavasound/20101123/945ff5711de27751cf699641d1ea316ba6cf7589/libraryjavasound-20101123-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.paulscode:librarylwjglopenal:20100824">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/librarylwjglopenal/20100824/73e80d0794c39665aec3f62eee88ca91676674ef/librarylwjglopenal-20100824.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/librarylwjglopenal/20100824/ecfc8dac1d41bef748997e4edf563d486923ee1e/librarylwjglopenal-20100824-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.paulscode:soundsystem:20120107">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/soundsystem/20120107/419c05fe9be71f792b2d76cfc9b67f1ed0fec7f6/soundsystem-20120107.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.paulscode/soundsystem/20120107/1b9f4eb11ef11fede7fd76a2e5e8203c2a8adcd/soundsystem-20120107-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.typesafe.akka:akka-actor_2.11:2.3.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.typesafe.akka/akka-actor_2.11/2.3.3/ed62e9fc709ca0f2ff1a3220daa8b70a2870078e/akka-actor_2.11-2.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.typesafe.akka/akka-actor_2.11/2.3.3/d81a273b777f369b260b031f99bac327aff69281/akka-actor_2.11-2.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.typesafe.akka/akka-actor_2.11/2.3.3/9dbceb71c4fd943b4eb4607847261075a989d47f/akka-actor_2.11-2.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: com.typesafe:config:1.2.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.2.1/f771f71fdae3df231bcd54d5ca2d57f0bf93f467/config-1.2.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.2.1/855ac28cc00935e194ae6809828fc2397ecf8ace/config-1.2.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.typesafe/config/1.2.1/bdacf4f82ce9b29cd474bfde2e91eeb0ca623d28/config-1.2.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: commons-codec:commons-codec:1.10">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.10/4b95f4897fa13f2cd904aee711aeafc0c5295cd8/commons-codec-1.10.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.10/8176f1eb181cde7c9e4b5290f0365652777b3b87/commons-codec-1.10-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.10/11fb3d88ae7e3b757d70237064210ceb954a5a04/commons-codec-1.10-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: commons-io:commons-io:2.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.5/2852e6e05fbb95076fc091f6d1780f1f8fe35e0f/commons-io-2.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.5/b219c20b7b44a4da22cb1898bfc6bfbb100f33c7/commons-io-2.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-io/commons-io/2.5/caf033a4a7c37b4a8ff3ea084cba591539b0b69/commons-io-2.5-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: commons-logging:commons-logging:1.1.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/f6f66e966c70a83ffbdb6f17a0919eaf7c8aca7f/commons-logging-1.1.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/8a9805acc4e492afb6a400b6e32cfd98ed263caa/commons-logging-1.1.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/commons-logging/commons-logging/1.1.3/28bb0405fddaf04f15058fbfbe01fe2780d7d3b6/commons-logging-1.1.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: io.netty:netty-all:4.1.9.Final">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.netty/netty-all/4.1.9.Final/97860965d6a0a6b98e7f569f3f966727b8db75/netty-all-4.1.9.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.netty/netty-all/4.1.9.Final/e69a6d93a78793fbf8a820fe69bac56d2f20a187/netty-all-4.1.9.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.netty/netty-all/4.1.9.Final/69b921f5e296428c88c2ea4418e630443a699b06/netty-all-4.1.9.Final-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: it.unimi.dsi:fastutil:7.1.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/7.1.0/9835253257524c1be7ab50c057aa2d418fb72082/fastutil-7.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/7.1.0/2815415482b446185884c6354e4743d14fbdbb05/fastutil-7.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/it.unimi.dsi/fastutil/7.1.0/4a33438326f2fea664656d63d655c349d4131e14/fastutil-7.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: java3d:vecmath:1.5.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/java3d/vecmath/1.5.2/79846ba34cbd89e2422d74d53752f993dcc2ccaf/vecmath-1.5.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/java3d/vecmath/1.5.2/42442b23189fbef9353c1751055610b63dd57e85/vecmath-1.5.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: lzma:lzma:0.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/lzma/lzma/0.0.1/521616dc7487b42bef0e803bd2fa3faf668101d7/lzma-0.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.dev.jna:jna:4.4.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/4.4.0/cb208278274bf12ebdb56c61bd7407e6f774d65a/jna-4.4.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/4.4.0/dbaa5b1f9a44db1a2ba9070f4b6469ee0f62c3c3/jna-4.4.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/4.4.0/9d45d3dc35711eef7267d8b4fc2c0dc482ef9fd2/jna-4.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.dev.jna:platform:3.4.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/platform/3.4.0/e3f70017be8100d3d6923f50b3d2ee17714e9c13/platform-3.4.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/platform/3.4.0/805360594738e77e7da892f7f6ea563ab246c586/platform-3.4.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/platform/3.4.0/2f42653596d0044f0ab456620cba54c9cf53c5ca/platform-3.4.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.jinput:jinput:2.0.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.5/39c7796b469a600f72380316f6b1f11db6c2c7c4/jinput-2.0.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.5/695a26a9a58e8495c1e3ce7b7f3bec23ecf2ef16/jinput-2.0.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput/2.0.5/82604cfeb87b9ab70ed70aa19a137de8ceb21504/jinput-2.0.5-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.jinput:jinput-platform:natives-linux:2.0.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput-platform/2.0.5/7ff832a6eb9ab6a767f1ade2b548092d0fa64795/jinput-platform-2.0.5-natives-linux.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.jinput:jinput-platform:natives-osx:2.0.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput-platform/2.0.5/53f9c919f34d2ca9de8c51fc4e1e8282029a9232/jinput-platform-2.0.5-natives-osx.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.jinput:jinput-platform:natives-windows:2.0.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jinput/jinput-platform/2.0.5/385ee093e01f587f30ee1c8a2ee7d408fd732e16/jinput-platform-2.0.5-natives-windows.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.java.jutils:jutils:1.0.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jutils/jutils/1.0.0/e12fe1fda814bd348c1579329c86943d2cd3c6a6/jutils-1.0.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jutils/jutils/1.0.0/1ad2673c8dded38030ed77ba393b0253051bb768/jutils-1.0.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.java.jutils/jutils/1.0.0/d18678a00b216863206a1bb6190507e02a32971b/jutils-1.0.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.minecraft:launchwrapper:1.12">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.minecraft/launchwrapper/1.12/111e7bea9c968cdb3d06ef4632bf7ff0824d0f36/launchwrapper-1.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.minecraft/launchwrapper/1.12/fd80cad9a1b967ce2ff20529dc54e520d5338d7/launchwrapper-1.12-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.sf.jopt-simple:jopt-simple:5.0.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/5.0.3/cdd846cfc4e0f7eefafc02c0f5dce32b9303aa2a/jopt-simple-5.0.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/5.0.3/e1daf4f0bf1b85eb69b0b9d82d05f5842c77559f/jopt-simple-5.0.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.jopt-simple/jopt-simple/5.0.3/36d4348605fd4605d36c8641495f3e78756e454b/jopt-simple-5.0.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: net.sf.trove4j:trove4j:3.0.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.trove4j/trove4j/3.0.3/42ccaf4761f0dfdfa805c9e340d99a755907e2dd/trove4j-3.0.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.trove4j/trove4j/3.0.3/dc5c824f98a9bf2e20a2ccfff83e71be2040cc7d/trove4j-3.0.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.sf.trove4j/trove4j/3.0.3/109c5be93362e6e651e417c51d1863477a22969c/trove4j-3.0.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.commons:commons-compress:1.8.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/a698750c16740fd5b3871425f4cb3bbaa87f529d/commons-compress-1.8.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/8e9724537be2a09287d7483c6b4a0c9a0bddf944/commons-compress-1.8.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.8.1/3caea4421428752206c7a94c3e3097f0c47f1bb8/commons-compress-1.8.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.commons:commons-lang3:3.5">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.5/6c6c702c89bfff3cd9e80b04d668c5e190d588c6/commons-lang3-3.5.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.5/337310e98410d577aca675930bb46405a0a8fb0c/commons-lang3-3.5-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-lang3/3.5/f7d878153e86a1cdddf6b37850e00a9f8bff726f/commons-lang3-3.5-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.httpcomponents:httpclient:4.3.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.3.3/18f4247ff4572a074444572cee34647c43e7c9c7/httpclient-4.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.3.3/81ad2c81206a9aaba4c3337902fc60e1d80b686d/httpclient-4.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.3.3/65cba03c4f6207f2885f88206fcf52c53f8d111b/httpclient-4.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.httpcomponents:httpcore:4.3.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/31fbbff1ddbf98f3aa7377c94d33b0447c646b6e/httpcore-4.3.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/37b4a5362830a9b29e68f1a1d179f3aa544fb623/httpcore-4.3.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.3.2/4809f38359edeea9487f747e09aa58ec8d3a54c5/httpcore-4.3.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.logging.log4j:log4j-api:2.8.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.8.1/e801d13612e22cad62a3f4f3fe7fdbe6334a8e72/log4j-api-2.8.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.8.1/beb0e5374901d855d4396ac859ebd67c70e09ea8/log4j-api-2.8.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.8.1/a5edb6b8c77843c8be98e0cb1f875699e76ee122/log4j-api-2.8.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.logging.log4j:log4j-core:2.8.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.8.1/4ac28ff2f1ddf05dae3043a190451e8c46b73c31/log4j-core-2.8.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.8.1/1147684e2e3c2f959fc9b69af236d89e1869b59c/log4j-core-2.8.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-core/2.8.1/a0a7f683da620c345b502fff04d1e46cde2e8d9/log4j-core-2.8.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.apache.maven:maven-artifact:3.5.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4/maven-artifact-3.5.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/780bee612c1c60b05f5668456404ea37a37fc1ef/maven-artifact-3.5.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/25c6b5e0103ae09bc1cac02ee6dff968bacbdba9/maven-artifact-3.5.3-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.codehaus.plexus:plexus-utils:3.1.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.plexus/plexus-utils/3.1.0/60eecb6f15abdb1c653ad80abaac6fe188b3feaa/plexus-utils-3.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.plexus/plexus-utils/3.1.0/7b0ace32907e27d3b5d1d41c9c51a488d42742c5/plexus-utils-3.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.codehaus.plexus/plexus-utils/3.1.0/d4062783613c4c6cf909c939d15fd1f2b584db03/plexus-utils-3.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.jline:jline:3.5.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.5.1/51800e9d7a13608894a5a28eed0f5c7fa2f300fb/jline-3.5.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.5.1/87d558277046b5a35a59ea1f152328442d51967c/jline-3.5.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.5.1/11c92210c8ad3c9610334d66c4d8662cad8d26a2/jline-3.5.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.4-nightly-20150209/697517568c68e78ae0b4544145af031c81082dfe/lwjgl-2.9.4-nightly-20150209.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.4-nightly-20150209/da903f6e4b2174d415cf6c8c5ea21b2b5f990a4/lwjgl-2.9.4-nightly-20150209-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl/2.9.4-nightly-20150209/7da2cff65127b558a66e8e38456174161723d3a7/lwjgl-2.9.4-nightly-20150209-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-linux:2.9.4-nightly-20150209">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl-platform/2.9.4-nightly-20150209/931074f46c795d2f7b30ed6395df5715cfd7675b/lwjgl-platform-2.9.4-nightly-20150209-natives-linux.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-osx:2.9.4-nightly-20150209">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl-platform/2.9.4-nightly-20150209/bcab850f8f487c3f4c4dbabde778bb82bd1a40ed/lwjgl-platform-2.9.4-nightly-20150209-natives-osx.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-windows:2.9.4-nightly-20150209">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl-platform/2.9.4-nightly-20150209/b84d5102b9dbfabfeb5e43c7e2828d98a7fc80e0/lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl_util/2.9.4-nightly-20150209/d51a7c040a721d13efdfbd34f8b257b2df882ad0/lwjgl_util-2.9.4-nightly-20150209.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl_util/2.9.4-nightly-20150209/8745139bfa975ef5d79576d0fc59521d776902f4/lwjgl_util-2.9.4-nightly-20150209-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.lwjgl.lwjgl/lwjgl_util/2.9.4-nightly-20150209/2e3787f55c68a245e994f88755795b3a7684b3/lwjgl_util-2.9.4-nightly-20150209-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.ow2.asm:asm-debug-all:5.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.2/3354e11e2b34215f06dab629ab88e06aca477c19/asm-debug-all-5.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.2/6ba4b7ff53413c639920b522b613d7d7fb4fe68b/asm-debug-all-5.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.ow2.asm/asm-debug-all/5.2/ed60d4287d18996bc940f26656c570532b20d863/asm-debug-all-5.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.11/1.0.1/f05d7345bf5a58924f2837c6c1f4d73a938e1ff0/scala-parser-combinators_2.11-1.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.11/1.0.1/1078474ef0f67e27e5c53bfbe404c2a99fadaf6f/scala-parser-combinators_2.11-1.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-parser-combinators_2.11/1.0.1/34d013c02d0b73794ba2911552896dd9c00f34c3/scala-parser-combinators_2.11-1.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang.modules:scala-swing_2.11:1.0.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-swing_2.11/1.0.1/b1cdd92bd47b1e1837139c1c53020e86bb9112ae/scala-swing_2.11-1.0.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-swing_2.11/1.0.1/205c7295348ced192a726fcedd0b40cfa45da2ee/scala-swing_2.11-1.0.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-swing_2.11/1.0.1/d4bda4281db2ec74b105c5acf2326d160b79164e/scala-swing_2.11-1.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang.modules:scala-xml_2.11:1.0.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.2/820fbca7e524b530fdadc594c39d49a21ea0337e/scala-xml_2.11-1.0.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.2/a06d053a9d8ccf4518b0db56c66abea9f47fee7c/scala-xml_2.11-1.0.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.modules/scala-xml_2.11/1.0.2/312c3557d1ca0b34820f3b3fc5404a47936ceb26/scala-xml_2.11-1.0.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-library_2.11/1.0.2/e517c53a7e9acd6b1668c5a35eccbaa3bab9aac/scala-continuations-library_2.11-1.0.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-library_2.11/1.0.2/5f0bb62bfd94ee7854f8f627e92c621f7f31e284/scala-continuations-library_2.11-1.0.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-library_2.11/1.0.2/495afc106eeaa1b3367f6be0bc3768c398e4d360/scala-continuations-library_2.11-1.0.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-plugin_2.11.1/1.0.2/f361a3283452c57fa30c1ee69448995de23c60f7/scala-continuations-plugin_2.11.1-1.0.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-plugin_2.11.1/1.0.2/16960d5491945a59d05cb5175e5cf558b38a1429/scala-continuations-plugin_2.11.1-1.0.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang.plugins/scala-continuations-plugin_2.11.1/1.0.2/c6f3c092ab731f3cf83fdb376ebc465a243c1f4c/scala-continuations-plugin_2.11.1-1.0.2-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-actors:2.11.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors/2.11.0/8ccfb6541de179bb1c4d45cf414acee069b7f78b/scala-actors-2.11.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors/2.11.0/c07dbf25e7e3b78fb9adbd9c790662b06caef931/scala-actors-2.11.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors/2.11.0/e1dfa274766d5278166b0d660294fe96396693b2/scala-actors-2.11.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-actors-migration_2.11:1.1.0">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors-migration_2.11/1.1.0/dfa8bc42b181d5b9f1a5dd147f8ae308b893eb6f/scala-actors-migration_2.11-1.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors-migration_2.11/1.1.0/2d7a5d0f4b3fba0fa95311cabd66e3dc2efbb8c8/scala-actors-migration_2.11-1.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-actors-migration_2.11/1.1.0/6bccac72dae4d369537e313d12087c1ca295e84f/scala-actors-migration_2.11-1.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-compiler:2.11.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.11.1/56ea2e6c025e0821f28d73ca271218b8dd04926a/scala-compiler-2.11.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.11.1/51ae4b6c6d782c52a20cf1386fcbfa7491c1d26d/scala-compiler-2.11.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-compiler/2.11.1/b031d401aabbf7f5f725db500575da3dff90065f/scala-compiler-2.11.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-library:2.11.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.1/e11da23da3eabab9f4777b9220e60d44c1aab6a/scala-library-2.11.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.1/319900df0d487b36d5b41e1459e37bc270ba8328/scala-library-2.11.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-library/2.11.1/8355e4b6841f772a287167666bad6e9860ac4d3c/scala-library-2.11.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: org.scala-lang:scala-reflect:2.11.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.11.1/6580347e61cc7f8e802941e7fde40fa83b8badeb/scala-reflect-2.11.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.11.1/96f9e99e677be9d3f6f41e6fb2a66b329309ffa7/scala-reflect-2.11.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.scala-lang/scala-reflect/2.11.1/d4c5628e197a0d6af8e9b93a9be32190c547bc8a/scala-reflect-2.11.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: oshi-project:oshi-core:1.1">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/oshi-project/oshi-core/1.1/9ddf7b048a8d701be231c0f4f95fd986198fd2d8/oshi-core-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/oshi-project/oshi-core/1.1/1ec1ab1e6ac5a1572edfd0dd9ac95e83684b8a65/oshi-core-1.1-sources.jar!/" />
</SOURCES>
</library>
</component>
<component name="libraryTable">
<library name="Gradle: reforged:server:Pixelmon-1.12.2-7.0.3-server.jar:7.0.3">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/reforged/server/7.0.3/3415d888dd2a029968960f96a608a76fffea9aae/server-7.0.3.Pixelmon-1.12.2-7.0.3-server.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<list size="3">
<item index="0" class="java.lang.String" itemvalue="net.minecraftforge.fml.common.Mod" />
<item index="1" class="java.lang.String" itemvalue="net.minecraftforge.fml.common.Mod.EventHandler" />
<item index="2" class="java.lang.String" itemvalue="net.minecraftforge.fml.common.eventhandler.SubscribeEvent" />
</list>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/PixelExtras.iml" filepath="$PROJECT_DIR$/.idea/PixelExtras.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/PixelExtras_api.iml" filepath="$PROJECT_DIR$/.idea/modules/PixelExtras_api.iml" group="PixelExtras" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/PixelExtras_main.iml" filepath="$PROJECT_DIR$/.idea/modules/PixelExtras_main.iml" group="PixelExtras" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/PixelExtras_test.iml" filepath="$PROJECT_DIR$/.idea/modules/PixelExtras_test.iml" group="PixelExtras" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="PixelExtras:api" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.pixelextras" external.system.module.type="sourceSet" external.system.module.version="1.12.2-2.4.4-universal" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>FORGE</platformType>
<platformType>MCP</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="McpModuleSettings">
<option name="mappingFiles">
<set>
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\notch-srg.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp-srg.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\srg.exc" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp-notch.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp.exc" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\notch-mcp.srg" />
</set>
</option>
<option name="mcpVersion" value="snapshot_20171007" />
<option name="minecraftVersion" value="1.12.2" />
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/api" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: reforged:server:Pixelmon-1.12.2-7.0.3-server.jar:7.0.3" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../.gradle/minecraft/forgeBin-1.12.2-14.23.5.2768-PROJECT(PixelExtras).jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:patchy:1.1" level="project" />
<orderEntry type="library" name="Gradle: oshi-project:oshi-core:1.1" level="project" />
<orderEntry type="library" name="Gradle: net.java.dev.jna:jna:4.4.0" level="project" />
<orderEntry type="library" name="Gradle: net.java.dev.jna:platform:3.4.0" level="project" />
<orderEntry type="library" name="Gradle: com.ibm.icu:icu4j-core-mojang:51.2" level="project" />
<orderEntry type="library" name="Gradle: net.sf.jopt-simple:jopt-simple:5.0.3" level="project" />
<orderEntry type="library" name="Gradle: io.netty:netty-all:4.1.9.Final" level="project" />
<orderEntry type="library" name="Gradle: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.commons:commons-lang3:3.5" level="project" />
<orderEntry type="library" name="Gradle: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Gradle: net.java.jutils:jutils:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:authlib:1.5.25" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:realms:1.10.22" level="project" />
<orderEntry type="library" name="Gradle: org.apache.commons:commons-compress:1.8.1" level="project" />
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.3.3" level="project" />
<orderEntry type="library" name="Gradle: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.3.2" level="project" />
<orderEntry type="library" name="Gradle: it.unimi.dsi:fastutil:7.1.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-core:2.8.1" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:text2speech:1.10.3" level="project" />
<orderEntry type="library" name="Gradle: net.minecraft:launchwrapper:1.12" level="project" />
<orderEntry type="library" name="Gradle: org.jline:jline:3.5.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-debug-all:5.2" level="project" />
<orderEntry type="library" name="Gradle: com.typesafe.akka:akka-actor_2.11:2.3.3" level="project" />
<orderEntry type="library" name="Gradle: com.typesafe:config:1.2.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-actors-migration_2.11:1.1.0" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-compiler:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-library:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-reflect:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-swing_2.11:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-xml_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: lzma:lzma:0.0.1" level="project" />
<orderEntry type="library" name="Gradle: net.sf.trove4j:trove4j:3.0.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.maven:maven-artifact:3.5.3" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:codecjorbis:20101023" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:codecwav:20101023" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:libraryjavasound:20101123" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:librarylwjglopenal:20100824" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:soundsystem:20120107" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: java3d:vecmath:1.5.2" level="project" />
<orderEntry type="library" name="Gradle: ca.weblite:java-objc-bridge:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-actors:2.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.codehaus.plexus:plexus-utils:3.1.0" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-linux:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-windows:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-osx:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-windows:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-linux:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-osx:2.9.4-nightly-20150209" level="project" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="PixelExtras:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.pixelextras" external.system.module.type="sourceSet" external.system.module.version="1.12.2-2.4.4-universal" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>FORGE</platformType>
<platformType>MCP</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="McpModuleSettings">
<option name="mappingFiles">
<set>
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\notch-srg.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp-srg.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\srg.exc" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp-notch.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp.exc" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\notch-mcp.srg" />
</set>
</option>
<option name="mcpVersion" value="snapshot_20171007" />
<option name="minecraftVersion" value="1.12.2" />
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/../../src/main/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="PixelExtras_api" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: reforged:server:Pixelmon-1.12.2-7.0.3-server.jar:7.0.3" level="project" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../.gradle/minecraft/forgeBin-1.12.2-14.23.5.2768-PROJECT(PixelExtras).jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:patchy:1.1" level="project" />
<orderEntry type="library" name="Gradle: oshi-project:oshi-core:1.1" level="project" />
<orderEntry type="library" name="Gradle: net.java.dev.jna:jna:4.4.0" level="project" />
<orderEntry type="library" name="Gradle: net.java.dev.jna:platform:3.4.0" level="project" />
<orderEntry type="library" name="Gradle: com.ibm.icu:icu4j-core-mojang:51.2" level="project" />
<orderEntry type="library" name="Gradle: net.sf.jopt-simple:jopt-simple:5.0.3" level="project" />
<orderEntry type="library" name="Gradle: io.netty:netty-all:4.1.9.Final" level="project" />
<orderEntry type="library" name="Gradle: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.commons:commons-lang3:3.5" level="project" />
<orderEntry type="library" name="Gradle: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Gradle: net.java.jutils:jutils:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:authlib:1.5.25" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:realms:1.10.22" level="project" />
<orderEntry type="library" name="Gradle: org.apache.commons:commons-compress:1.8.1" level="project" />
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.3.3" level="project" />
<orderEntry type="library" name="Gradle: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.3.2" level="project" />
<orderEntry type="library" name="Gradle: it.unimi.dsi:fastutil:7.1.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-core:2.8.1" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:text2speech:1.10.3" level="project" />
<orderEntry type="library" name="Gradle: net.minecraft:launchwrapper:1.12" level="project" />
<orderEntry type="library" name="Gradle: org.jline:jline:3.5.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-debug-all:5.2" level="project" />
<orderEntry type="library" name="Gradle: com.typesafe.akka:akka-actor_2.11:2.3.3" level="project" />
<orderEntry type="library" name="Gradle: com.typesafe:config:1.2.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-actors-migration_2.11:1.1.0" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-compiler:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-library:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-reflect:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-swing_2.11:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-xml_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: lzma:lzma:0.0.1" level="project" />
<orderEntry type="library" name="Gradle: net.sf.trove4j:trove4j:3.0.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.maven:maven-artifact:3.5.3" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:codecjorbis:20101023" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:codecwav:20101023" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:libraryjavasound:20101123" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:librarylwjglopenal:20100824" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:soundsystem:20120107" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: java3d:vecmath:1.5.2" level="project" />
<orderEntry type="library" name="Gradle: ca.weblite:java-objc-bridge:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-actors:2.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.codehaus.plexus:plexus-utils:3.1.0" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-linux:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-windows:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-osx:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-windows:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-linux:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-osx:2.9.4-nightly-20150209" level="project" />
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="file://$USER_HOME$/.gradle/caches/minecraft/net/minecraftforge/forge/1.12.2-14.23.5.2768/start" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="PixelExtras:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="com.pixelextras" external.system.module.type="sourceSet" external.system.module.version="1.12.2-2.4.4-universal" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>FORGE</platformType>
<platformType>MCP</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
<component name="McpModuleSettings">
<option name="mappingFiles">
<set>
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\notch-srg.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp-srg.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\srg.exc" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp-notch.srg" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\mcp.exc" />
<option value="C:\Users\MayoSama\.gradle\caches\minecraft\de\oceanlabs\mcp\mcp_snapshot\20171007\1.12.2\srgs\notch-mcp.srg" />
</set>
</option>
<option name="mcpVersion" value="snapshot_20171007" />
<option name="minecraftVersion" value="1.12.2" />
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="PixelExtras_main" />
<orderEntry type="module" module-name="PixelExtras_api" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/../../.gradle/minecraft/forgeBin-1.12.2-14.23.5.2768-PROJECT(PixelExtras).jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/minecraft/deobfedDeps/compileDummy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/minecraft/deobfedDeps/providedDummy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="Gradle: reforged:server:Pixelmon-1.12.2-7.0.3-server.jar:7.0.3" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.findbugs:jsr305:3.0.1" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:patchy:1.1" level="project" />
<orderEntry type="library" name="Gradle: oshi-project:oshi-core:1.1" level="project" />
<orderEntry type="library" name="Gradle: net.java.dev.jna:jna:4.4.0" level="project" />
<orderEntry type="library" name="Gradle: net.java.dev.jna:platform:3.4.0" level="project" />
<orderEntry type="library" name="Gradle: com.ibm.icu:icu4j-core-mojang:51.2" level="project" />
<orderEntry type="library" name="Gradle: net.sf.jopt-simple:jopt-simple:5.0.3" level="project" />
<orderEntry type="library" name="Gradle: io.netty:netty-all:4.1.9.Final" level="project" />
<orderEntry type="library" name="Gradle: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.commons:commons-lang3:3.5" level="project" />
<orderEntry type="library" name="Gradle: commons-io:commons-io:2.5" level="project" />
<orderEntry type="library" name="Gradle: commons-codec:commons-codec:1.10" level="project" />
<orderEntry type="library" name="Gradle: net.java.jutils:jutils:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:authlib:1.5.25" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:realms:1.10.22" level="project" />
<orderEntry type="library" name="Gradle: org.apache.commons:commons-compress:1.8.1" level="project" />
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.3.3" level="project" />
<orderEntry type="library" name="Gradle: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.3.2" level="project" />
<orderEntry type="library" name="Gradle: it.unimi.dsi:fastutil:7.1.0" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-api:2.8.1" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-core:2.8.1" level="project" />
<orderEntry type="library" name="Gradle: com.mojang:text2speech:1.10.3" level="project" />
<orderEntry type="library" name="Gradle: net.minecraft:launchwrapper:1.12" level="project" />
<orderEntry type="library" name="Gradle: org.jline:jline:3.5.1" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm-debug-all:5.2" level="project" />
<orderEntry type="library" name="Gradle: com.typesafe.akka:akka-actor_2.11:2.3.3" level="project" />
<orderEntry type="library" name="Gradle: com.typesafe:config:1.2.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-actors-migration_2.11:1.1.0" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-compiler:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.plugins:scala-continuations-library_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.plugins:scala-continuations-plugin_2.11.1:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-library:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-reflect:2.11.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-swing_2.11:1.0.1" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang.modules:scala-xml_2.11:1.0.2" level="project" />
<orderEntry type="library" name="Gradle: lzma:lzma:0.0.1" level="project" />
<orderEntry type="library" name="Gradle: net.sf.trove4j:trove4j:3.0.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.maven:maven-artifact:3.5.3" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:codecjorbis:20101023" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:codecwav:20101023" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:libraryjavasound:20101123" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:librarylwjglopenal:20100824" level="project" />
<orderEntry type="library" name="Gradle: com.paulscode:soundsystem:20120107" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: java3d:vecmath:1.5.2" level="project" />
<orderEntry type="library" name="Gradle: ca.weblite:java-objc-bridge:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: org.scala-lang:scala-actors:2.11.0" level="project" />
<orderEntry type="library" name="Gradle: org.codehaus.plexus:plexus-utils:3.1.0" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-linux:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-windows:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: net.java.jinput:jinput-platform:natives-osx:2.0.5" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-windows:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-linux:2.9.4-nightly-20150209" level="project" />
<orderEntry type="library" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:natives-osx:2.9.4-nightly-20150209" level="project" />
</component>
<component name="TestModuleProperties" production-module="PixelExtras_main" />
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="PixelExtras" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="com.pixelextras" external.system.module.version="1.12.2-2.4.4-universal" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/out" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
version = "1.12.2-2.4.4-universal"
group= "com.pixelextras"
archivesBaseName = "PixelExtras"
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = "UTF-8"
jar {
manifest {
attributes 'FMLAT': 'pixelextras_at.cfg'
}
}
minecraft {
version = "1.12.2-14.23.5.2768"
runDir = "run"
mappings = "snapshot_20171007"
useDepAts = true
}
//Fix forges AT breaking everything because the AT checker is stupid
[tasks.deobfMcMCP, tasks.deobfMcSRG].each { it.failOnAtError = false }
processResources
{
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version':project.version, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
dependencies {
//compile files('libs/Pixelmon-1.12.2-7.0.3-universal.jar')
compile 'reforged:server:7.0.3@Pixelmon-1.12.2-7.0.3-server.jar'
}
repositories {
mavenCentral()
maven {
url 'http://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url "http://dvs1.progwml6.com/files/maven"
}
ivy {
url "https://download.nodecdn.net/containers"
layout "pattern", {
artifact "/[organisation]/[module]/release/[revision]/[ext]"
}
}
}
#Wed Jul 02 15:54:47 CDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-bin.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

Copyright 2014-2015 Ikara Software, All rights reserved.

Pixelmon-Commands

Additional commands for Pixelmon servers.

package com.pixelextras.api.event;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.eventhandler.Cancelable;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* Event fired when a /pokegift is attempted. Cancelling this event will prevent the transfer.
*
* @author Hiroku
*/
@Cancelable
public class PokegiftEvent extends Event
{
public final EntityPlayerMP giver;
public final EntityPlayerMP receiver;
public final Pokemon pokemon;
public PokegiftEvent(EntityPlayerMP giver, EntityPlayerMP receiver, Pokemon pokemon)
{
this.giver = giver;
this.receiver = receiver;
this.pokemon = pokemon;
}
}
package com.pixelextras.api.event;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.EvoCondition;
import net.minecraft.command.ICommandSender;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* Fires when someone used /wiki to get a Pokémon's evolutions but the evolution condition is not in default Pixelmon.
* The purpose of this event is to give you an opportunity to send the ICommandSender a chat message describing
* the evolution condition in the same way that a default evolution condition would be sent.
*
* @author Hiroku
*/
public class UnknownEvolutionConditionEvent extends Event
{
public final ICommandSender sender;
public final EvoCondition condition;
public UnknownEvolutionConditionEvent(ICommandSender sender, EvoCondition condition)
{
this.sender = sender;
this.condition = condition;
}
}
package com.pixelextras.api.event;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.Evolution;
import net.minecraft.command.ICommandSender;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* Fires when someone used /wiki to get a Pokémon's evolutions but the evolution type is not in default Pixelmon.
* The purpose of this event is to give you an opportunity to send the ICommandSender a chat message describing
* the evolution type in the same way that a default evolution type would be sent.
*
* @author Hiroku
*/
public class UnknownEvolutionTypeEvent extends Event
{
public final ICommandSender sender;
public final Evolution evolution;
public UnknownEvolutionTypeEvent(ICommandSender sender, Evolution evolution)
{
this.sender = sender;
this.evolution = evolution;
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelextras.util.Cooldown;
import com.pixelextras.util.CooldownNotifier;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.enums.ReceiveType;
import com.pixelmonmod.pixelmon.api.events.BreedEvent;
import com.pixelmonmod.pixelmon.api.events.PixelmonReceivedEvent;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import com.pixelmonmod.pixelmon.util.helpers.BreedLogic;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class Breed extends CommandBase
{
@Override
public String getName()
{
return "breed";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/breed <party slot #1> <party slot #2>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pokebreed", "pbreed");
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
public static Map<String, Cooldown> breedCooldowns = new ConcurrentHashMap<>();
private final PokemonSpec UNBREEDABLE = new PokemonSpec("unbreedable");
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 2)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
Cooldown cd;
if(breedCooldowns.containsKey(player.getUniqueID().toString()))
{
cd = breedCooldowns.get(player.getUniqueID().toString());
if(System.currentTimeMillis() - cd.getTimeUsed() < PixelExtrasConfig.breedCooldown)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You may use this command again in " + ((PixelExtrasConfig.breedCooldown - (System.currentTimeMillis() - cd.getTimeUsed())) / 1000) + " seconds.");
return;
}
}
else
{
cd = new Cooldown(player.getUniqueID(), 0);
breedCooldowns.put(player.getUniqueID().toString(), cd);
}
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
int slot1 = Integer.parseInt(args[0].replaceAll("[^0-9]", "")) - 1;
int slot2 = Integer.parseInt(args[1].replaceAll("[^0-9]", "")) - 1;
if(slot1 == slot2)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You cannot breed a Pokemon with itself!");
return;
}
Pokemon p1 = pStorage.get(slot1);
Pokemon p2 = pStorage.get(slot2);
if(p1 == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot: " + slot1 + " is empty!");
return;
}
if(p2 == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot: " + slot2 + " is empty!");
return;
}
if(UNBREEDABLE.matches(p1) && UNBREEDABLE.matches(p2))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "%s and %s cannot be bred", p1.getDisplayName(), p2.getDisplayName());
return;
}
else if(UNBREEDABLE.matches(p1))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "pixelmon.ranch.cannotbreed", p1.getDisplayName());
return;
}
else if(UNBREEDABLE.matches(p2))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "pixelmon.ranch.cannotbreed", p2.getDisplayName());
return;
}
if(!p1.isEgg() && !p2.isEgg() && BreedLogic.canBreed(p1, p2))
{
Pokemon egg = BreedLogic.makeEgg(p1, p2);
BreedEvent.MakeEgg makeEggEvent = new BreedEvent.MakeEgg(player.getUniqueID(), null, egg, p1, p2);
if(Pixelmon.EVENT_BUS.post(makeEggEvent))
{
return;
}
egg = makeEggEvent.getEgg();
PixelmonReceivedEvent event = new PixelmonReceivedEvent(player, ReceiveType.Command, egg);
if(Pixelmon.EVENT_BUS.post(event))
{
return;
}
egg = event.pokemon;
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "%s and %s have bred and created an egg!", p1.getDisplayName(), p2.getDisplayName());
pStorage.add(egg);
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "%s doesn't get along well with %s", (p1.isEgg() ? "Egg" : p1.getDisplayName()), (p2.isEgg() ? "Egg" : p2.getDisplayName()));
return;
}
if(cd.getNofifying())
{
CooldownNotifier.addNotifier(player.getUniqueID());
}
else
{
CooldownNotifier.removeNotifier(player.getUniqueID());
}
cd.setTimeUsed(System.currentTimeMillis());
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid number given!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2 || args.length == 3)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.UUID;
import com.pixelextras.util.Cooldown;
import com.pixelextras.util.CooldownNotifier;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextFormatting;
public class Breeding extends CommandBase
{
@Override
public String getName()
{
return "breeding";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/breeding true/false - toggles a notification when /breed cooldown is done";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
UUID playerUUID = player.getUniqueID();
Cooldown cd = Breed.breedCooldowns.get(playerUUID.toString());
if(cd != null)
{
cd.toggleNotifying();
}
if(CooldownNotifier.getNotifiers().contains(playerUUID))
{
CooldownNotifier.removeNotifier(playerUUID);
}
else
{
CooldownNotifier.addNotifier(playerUUID);
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "/breed notification set to " + CooldownNotifier.getNotifiers().contains(playerUUID));
}
else
{
boolean notify = Boolean.parseBoolean(args[0]);
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
UUID playerUUID = player.getUniqueID();
Cooldown cd = Breed.breedCooldowns.get(playerUUID.toString());
if(cd != null)
{
cd.setNotifying(notify);
}
if(notify)
{
CooldownNotifier.addNotifier(playerUUID);
}
else if(!notify && CooldownNotifier.getNotifiers().contains(playerUUID))
{
CooldownNotifier.removeNotifier(playerUUID);
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "/breed notification set to " + notify);
}
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelextras.util.PixelmonHelper;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.storage.PCBox;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
public class CompSearch extends CommandBase
{
@Override
public String getName()
{
return "compsearch";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/compsearch <name> <pokemon>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pokecompsearch", "pcompsearch");
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
private List<ITextComponent> searchComputerPokemon(String name, UUID player)
{
PCBox[] storageBoxes = Pixelmon.storageManager.getPCForPlayer(player).getBoxes();
int boxCount = Pixelmon.storageManager.getPCForPlayer(player).getBoxCount();
int boxLimit = PCBox.POKEMON_PER_BOX;
List<ITextComponent> pokemonList = new ArrayList<>();
for(int i = 0; i < boxCount; i++)
{
List<ITextComponent> boxList = new ArrayList<>();
PCBox b = storageBoxes[i];
for(int j = 0; j < boxLimit; j++)
{
Pokemon pokemon = b.get(j);
if(pokemon != null)
{
if(pokemon.getSpecies().name.equalsIgnoreCase(name))
{
boxList.add(PixelmonHelper.getHoverTextPokemon(pokemon, i + 1, j + 1));
}
}
}
if(boxList.size() != 0)
{
pokemonList.addAll(boxList);
}
}
return pokemonList;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 2)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else
{
try
{
if(PixelExtrasConfig.allowOfflineCheck){
GameProfile gp = server.getPlayerProfileCache().getGameProfileForUsername(args[0]);
UUID uuid = gp.getId();
if (Pixelmon.storageManager.getPCForPlayer(uuid).countPokemon() == 0) {
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This player doesn't exist or don't have any pokemon in his PC");
return;
}
List<ITextComponent> pokemonList = searchComputerPokemon(args[1], uuid);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, args[0] + "'s Computer: (Mouse over for more info)");
for(ITextComponent c : pokemonList)
{
sender.sendMessage(c);
}
}else {
EntityPlayerMP entityPlayer = getPlayer(server, sender, args[0]);
List<ITextComponent> pokemonList = searchComputerPokemon(args[1], entityPlayer.getUniqueID());
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, entityPlayer.getDisplayNameString() + "'s Computer: (Mouse over for more info)");
for(ITextComponent c : pokemonList)
{
sender.sendMessage(c);
}
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendChat(sender, "Invalid Name! Try again!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
List<String> pokemon = new ArrayList<>();
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
for(EnumSpecies p : EnumSpecies.values())
{
pokemon.add(p.name);
}
return getListOfStringsMatchingLastWord(args, pokemon);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import com.mojang.authlib.Agent;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.ProfileLookupCallback;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelextras.util.PixelmonHelper;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.config.PixelmonConfig;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
public class CompSee extends CommandBase
{
@Override
public String getName()
{
return "compsee";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/compsee <name> <box>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pokecompsee", "pcompsee");
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
private void getBoxList(int box, UUID player, ICommandSender sender)
{
Pokemon[] storedPokemon = Pixelmon.storageManager.getPCForPlayer(player).getBox(box).getAll();
for(Pokemon pokemon : storedPokemon)
{
if(pokemon != null)
{
ITextComponent message = PixelmonHelper.getHoverTextPokemon(pokemon, pokemon.getPosition().box + 1, pokemon.getPosition().order + 1);
sender.sendMessage(message);
}
}
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 2)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else
{
try
{
PCStorage storage;
Integer box = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
if(box <= 0 || box > PixelmonConfig.computerBoxes)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "That box does not exist! Must be 1-" + PixelmonConfig.computerBoxes + "!");
return;
}
if(PixelExtrasConfig.allowOfflineCheck){
GameProfile gp = server.getPlayerProfileCache().getGameProfileForUsername(args[0]);
UUID uuid = gp.getId();
if (Pixelmon.storageManager.getPCForPlayer(uuid).countPokemon() == 0) {
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This player doesn't exist or don't have any pokemon in his PC");
return;
}
storage = Pixelmon.storageManager.getPCForPlayer(uuid);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, args[0] + "'s Computer Box " + box + ": (Mouse over for more info)");
getBoxList(box - 1, uuid, sender);
}else {
EntityPlayerMP player = getPlayer(server, sender, args[0]);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, player.getDisplayNameString() + "'s Computer Box " + box + ": (Mouse over for more info)");
getBoxList(box - 1, player.getUniqueID(), sender);
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Please provide a box number!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
if(args.length == 2)
{
String[] boxes = new String[PixelmonConfig.computerBoxes];
for(int i = 0; i < boxes.length; i++)
{
boxes[i] = String.valueOf(i + 1);
}
return getListOfStringsMatchingLastWord(args, boxes);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.config.PixelmonConfig;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class CompTake extends CommandBase
{
@Override
public String getName()
{
return "comptake";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/comptake <player> <box> <slot>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pctake", "ctake");
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args)
{
if(args.length < 3)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
return;
}
if(!(sender instanceof EntityPlayerMP))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Only players can use this command. Maybe you meant /pokedel?");
return;
}
try
{
UUID uuid;
if(PixelExtrasConfig.allowOfflineCheck){
GameProfile gp = server.getPlayerProfileCache().getGameProfileForUsername(args[0]);
uuid = gp.getId();
if (Pixelmon.storageManager.getPCForPlayer(uuid).countPokemon() == 0) {
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This player doesn't exist or don't have any pokemon in his PC");
return;
}
}else {
EntityPlayerMP player = getPlayer(server, sender, args[0]);
uuid = player.getUniqueID();
}
EntityPlayerMP senderPlayer = getCommandSenderAsPlayer(sender);
PCStorage targetStorage = Pixelmon.storageManager.getPCForPlayer(uuid);
PlayerPartyStorage senderStorage = Pixelmon.storageManager.getParty(senderPlayer);
if(senderStorage == null || targetStorage == null)
{
return;
}
int box = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
int slot = Integer.parseInt(args[2].replaceAll("[^0-9]", ""));
if(box < 1 || box > PixelmonConfig.computerBoxes)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Box number must be between 1 and %s.", PixelmonConfig.computerBoxes);
return;
}
if(slot < 1 || slot > 30)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 30.");
return;
}
Pokemon pokemon = targetStorage.getBox(box - 1).get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "They have nothing in that slot!");
return;
}
targetStorage.getBox(box - 1).set(slot - 1, null);
senderStorage.add(pokemon);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You took " + pokemon.getDisplayName() + " from " + args[0] + "!");
if(PixelExtrasConfig.notifyOPs)
{
notifyCommandListener(sender, this, sender.getName() + " has taken a " + pokemon.getDisplayName() + " from " + args[0] + "!");
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot given!");
}
catch(CommandException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Unknown player: " + args[0]);
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getServer().getOnlinePlayerNames());
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.NumberFormat;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
public class DexCheck extends CommandBase
{
public final int pokedexMax = EnumSpecies.values().length;
public String getName()
{
return "dexcheck";
}
public String getUsage(ICommandSender sender)
{
return "/dexcheck";
}
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
int pokedexCount = storage.pokedex.countCaught();
BigDecimal pokedexPercent = BigDecimal.valueOf(pokedexCount).divide(BigDecimal.valueOf(pokedexMax), new MathContext(5, RoundingMode.HALF_EVEN));
NumberFormat numberFormat = NumberFormat.getPercentInstance();
numberFormat.setMinimumFractionDigits(2);
numberFormat.setMaximumFractionDigits(2);
String pokedexPercentString = numberFormat.format(pokedexPercent);
// Trust me it is WAY easier to use the section sign code here
sender.sendMessage(new TextComponentString("\u00A76You have \u00A73" + pokedexCount + "\u00A76 out of \u00A73" + pokedexMax + " \u00A76Pokemon \u00A76in your Pokedex \u00A76(\u00A73" + pokedexPercentString + "\u00A76)"));
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class DisableBattle extends CommandBase
{
@Override
public String getName()
{
return "disablebattle";
}
public String getUsage(ICommandSender sender)
{
return "/disablebattle [player]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
try
{
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
if(args.length > 1 && sender.canUseCommand(getRequiredPermissionLevel(), "pixelextras.command.admin.disablebattle"))
{
player = getPlayer(server, sender, args[0]);
}
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
pStorage.battleEnabled = !pStorage.battleEnabled;
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Battles have been " + (pStorage.battleEnabled ? "enabled" : "disabled") + ".");
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Player doesn't exist!");
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
return null;
}
}
package com.pixelextras.commands;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.config.PixelmonConfig;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import com.pixelmonmod.pixelmon.util.PixelmonPlayerUtils;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
public class EggSteps extends CommandBase
{
@Override
public String getName()
{
return "eggsteps";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/eggsteps [player] <slot>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Not enough arguments"));
sender.sendMessage(new TextComponentString(TextFormatting.RED + getUsage(sender)));
return;
}
EntityPlayerMP player;
int slot;
int argSlotIndex = args.length == 2 ? 1 : 0;
if(args.length == 2)
{
player = PixelmonPlayerUtils.getUniquePlayerStartingWith(args[0]);
if(player == null)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "No usernames starting with " + TextFormatting.BLUE + args[0]));
sender.sendMessage(new TextComponentString(TextFormatting.RED + getUsage(sender)));
return;
}
}
else
{
if(sender instanceof EntityPlayerMP)
{
player = (EntityPlayerMP) sender;
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "To use this command you must be a player or specify a player"));
return;
}
}
try
{
slot = Integer.parseInt(args[argSlotIndex]);
if(slot < 1 || slot > 6)
{
throw new NumberFormatException();
}
slot--;
}
catch(NumberFormatException nfe)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Invalid slot: " + args[argSlotIndex]));
sender.sendMessage(new TextComponentString(TextFormatting.RED + getUsage(sender)));
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
Pokemon pokemon = storage.get(slot);
if(pokemon == null)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "There is not a Pokémon in that slot"));
return;
}
if(pokemon.isEgg())
{
int steps = (pokemon.getEggCycles() + 1) * PixelmonConfig.stepsPerEggCycle - pokemon.getEggSteps();
sender.sendMessage(new TextComponentString(TextFormatting.GRAY + "Remaining steps: " + TextFormatting.YELLOW + steps));
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "That isn't an egg"));
}
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.RandomHelper;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import com.pixelmonmod.pixelmon.entities.pixelmon.abilities.AbilityBase;
import com.pixelmonmod.pixelmon.entities.pixelmon.abilities.ComingSoon;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.Evolution;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.EvoCondition;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
public class Evolve extends CommandBase
{
@Override
public String getName()
{
return "pokeevolve";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokeevolve <player> <slot>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("evolve", "pevolve");
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendChat(sender, this.getUsage(sender));
}
else if(args.length == 1)
{
this.execute(server, sender, new String[] {sender.getName(), args[0]});
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
int slot = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
if(storage.get(slot - 1) != null)
{
Pokemon p = storage.get(slot - 1);
ArrayList<Evolution> evo = p.getBaseStats().evolutions;
if(evo.size() <= 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "There are no more evolutions for this pixelmon!");
return;
}
if(EnumSpecies.hasPokemonAnyCase(evo.get(0).to.name))
{
EntityPixelmon entityPixelmon = p.getOrSpawnPixelmon(player);
boolean evolved = true;
for(Evolution evolution : evo){
if(evoPassesAll(evolution.conditions, entityPixelmon)) {
evolution.doEvolution(entityPixelmon);
evolved = true;
break;
}
evolved = false;
}
if(!evolved) {
p.retrieve();
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "That pokemon cannot evolve!");
}
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You have nothing in that slot!");
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Player does not Exist!");
}
}
}
private boolean evoPassesAll(ArrayList<EvoCondition> evoConditions, EntityPixelmon entityPixelmon){
for(EvoCondition e : evoConditions){
if(!e.passes(entityPixelmon)){
return false;
}
}
return true;
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.StatsType;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class Evs extends CommandBase
{
@Override
public String getName()
{
return "evs";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/evs <slot>";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendChat(sender, this.getUsage(sender));
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
int slot = Integer.parseInt(args[0].replaceAll("[^0-9]", ""));
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendChat(sender, "Slot number must be between 1 and 6.");
}
else
{
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon != null)
{
if(pokemon.isEgg())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Eggs don't have EVs!");
return;
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, pokemon.getDisplayName() + "'s EVs");
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "HP EVs: " + TextFormatting.YELLOW + pokemon.getEVs().get(StatsType.HP));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Attack EVs: " + TextFormatting.YELLOW + pokemon.getEVs().get(StatsType.Attack));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Defence EVs: " + TextFormatting.YELLOW + pokemon.getEVs().get(StatsType.Defence));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Sp. Attack EVs: " + TextFormatting.YELLOW + pokemon.getEVs().get(StatsType.SpecialAttack));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Sp. Defence EVs: " + TextFormatting.YELLOW + pokemon.getEVs().get(StatsType.SpecialDefence));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Speed EVs: " + TextFormatting.YELLOW + pokemon.getEVs().get(StatsType.Speed));
int total = pokemon.getEVs().get(StatsType.HP) + pokemon.getEVs().get(StatsType.Attack) + pokemon.getEVs().get(StatsType.Defence) + pokemon.getEVs().get(StatsType.SpecialAttack) + pokemon.getEVs().get(StatsType.SpecialDefence) + pokemon.getEVs().get(StatsType.Speed);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, TextFormatting.AQUA + "Total: " + TextFormatting.YELLOW + total + "/510 " + TextFormatting.AQUA + "(" + TextFormatting.YELLOW + ((total * 100) / 510) + "%%" + TextFormatting.AQUA + ")");
}
else
{
CommandChatHandler.sendChat(sender, "Nothing exists in this slot!");
}
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot given!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.config.PixelmonConfig;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextFormatting;
public class ExpMod extends CommandBase
{
@Override
public String getName()
{
return "xpmod";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/xpmod <modifier>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 1)
{
float modifier = Float.parseFloat(args[0]);
PixelmonConfig.expModifier = modifier;
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Exp modifier is now " + modifier);
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getName());
}
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.BattleRegistry;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
/**
* Created by MoeBoy76 on 30/01/2018.
*/
public class Faint extends CommandBase
{
@Override
public String getName()
{
return "pokefaint";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokefaint <player> - faints the party";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
if(BattleRegistry.getBattle(player) != null)
{
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
List<Pokemon> party = storage.getTeam();
for(Pokemon pokemon : party)
{
if(pokemon != null)
{
pokemon.setHealth(0);
}
}
TextComponentString chat = new TextComponentString("You have fainted all your Pokemon!");
chat.getStyle().setColor(TextFormatting.GREEN);
sender.sendMessage(chat);
}
else if(args.length == 1)
{
if(args[0].equalsIgnoreCase("all"))
{
List<EntityPlayer> players = sender.getEntityWorld().playerEntities;
for(EntityPlayer player : players)
{
if(BattleRegistry.getBattle(player) != null)
{
continue;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty((EntityPlayerMP) player);
List<Pokemon> party = storage.getTeam();
for(Pokemon pokemon : party)
{
pokemon.setHealth(0);
}
}
notifyCommandListener(sender, this, "All pixelmon were fainted");
}
else
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
if(BattleRegistry.getBattle(player) != null)
{
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
List<Pokemon> party = storage.getTeam();
for(Pokemon pokemon : party)
{
pokemon.setHealth(0);
}
TextComponentString chat = new TextComponentString("You have fainted " + player.getDisplayNameString() + "'s Pokemon!");
chat.getStyle().setColor(TextFormatting.GREEN);
sender.sendMessage(chat);
}
}
else
{
TextComponentString chat = new TextComponentString(getUsage(sender));
chat.getStyle().setColor(TextFormatting.RED);
sender.sendMessage(chat);
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import com.pixelextras.api.event.PokegiftEvent;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.enums.ReceiveType;
import com.pixelmonmod.pixelmon.api.events.PixelmonReceivedEvent;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class Gift extends CommandBase
{
private final PokemonSpec UNTRADEABLE = new PokemonSpec("untradeable");
@Override
public String getName()
{
return "pokesell";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/pokesell <player> <slot>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("psell", "pokegift", "pgift", "gift");
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 2)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
return;
}
if(!(sender instanceof EntityPlayerMP))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Only players can use this command");
return;
}
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
if(((EntityPlayerMP) sender).getUniqueID().equals(player.getUniqueID()))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You cannot send a Pixelmon to yourself");
return;
}
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
PlayerPartyStorage sStorage = Pixelmon.storageManager.getParty(((EntityPlayerMP) sender));
if(sStorage == null || pStorage == null)
{
return;
}
int slot = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
Pokemon pokemon = sStorage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Nothing is in that slot!");
return;
}
if(UNTRADEABLE.matches(pokemon))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This Pokémon cannot be traded.");
return;
}
if(sStorage.getTeam().size() == 1 && !pokemon.isEgg())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You must have more than one pokemon in your party to do this.");
return;
}
sStorage.retrieveAll();
if(Pixelmon.EVENT_BUS.post(new PixelmonReceivedEvent(player, ReceiveType.Command, pokemon)))
{
return;
}
if(Pixelmon.EVENT_BUS.post(new PokegiftEvent((EntityPlayerMP) sender, player, pokemon)))
{
return;
}
sStorage.set(slot - 1, null);
pStorage.add(pokemon);
CommandChatHandler.sendFormattedChat(player, TextFormatting.GREEN, sender.getName() + " has sent you " + pokemon.getDisplayName() + "!");
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You successfully gave " + player.getName() + " your " + pokemon.getDisplayName() + "!");
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot given!");
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelextras.util.Cooldown;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.ChatHandler;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
public class Hatch extends CommandBase
{
@Override
public String getName()
{
return "hatch";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/hatch [player] <slot>";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("phatch", "pokehatch");
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
public static Map<String, Cooldown> hatchCooldowns = new ConcurrentHashMap<>();
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else
{
try
{
EntityPlayerMP player;
if(args.length == 2)
{
player = getPlayer(server, sender, args[0]);
if(!sender.canUseCommand(getRequiredPermissionLevel(), "pixelextras.command.admin.hatch") && !getCommandSenderAsPlayer(sender).equals(player))
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "You don't have permission to use that on others!"));
return;
}
}
else
{
player = getCommandSenderAsPlayer(sender);
}
Cooldown cd;
if(hatchCooldowns.containsKey(player.getUniqueID().toString()))
{
cd = hatchCooldowns.get(player.getUniqueID().toString());
if(System.currentTimeMillis() - cd.getTimeUsed() < PixelExtrasConfig.hatchCooldown)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You may use this command again in " + ((PixelExtrasConfig.hatchCooldown - (System.currentTimeMillis() - cd.getTimeUsed())) / 1000) + " seconds.");
return;
}
}
else
{
cd = new Cooldown(player.getUniqueID(), 0);
hatchCooldowns.put(player.getUniqueID().toString(), cd);
}
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
int slot = Integer.parseInt(args[args.length - 1].replaceAll("[^0-9]", ""));
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "There is nothing in that slot!");
return;
}
if(!pokemon.isEgg())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "That slot does not contain an egg.");
return;
}
pokemon.hatchEgg();
cd.setTimeUsed(System.currentTimeMillis());
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid number given!");
}
}
}
}
package com.pixelextras.commands;
import com.pixelextras.util.PixelmonHelper;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.enums.EnumType;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextFormatting;
public class HiddenPower extends CommandBase
{
@Override
public String getName()
{
return "hiddenpower";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/hiddenpower [slot] - displays the hidden power type of [slot]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 1)
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
int slot = Integer.parseInt(args[0].replaceAll("[^0-9]", ""));
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "There is nothing in that slot!");
return;
}
if(pokemon.isEgg())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Eggs have no stats");
}
else
{
EnumType type = PixelmonHelper.checkStats(pokemon);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Your " + pokemon.getDisplayName() + "'s hidden power is " + type.getName() + " type");
}
}
else
{
CommandChatHandler.sendChat(sender, this.getUsage(sender));
}
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.StatsType;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class Ivs extends CommandBase
{
@Override
public String getName()
{
return "ivs";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/ivs <slot>";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendChat(sender, this.getUsage(sender));
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
int slot = Integer.parseInt(args[0].replaceAll("[^0-9]", ""));
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendChat(sender, "Slot number must be between 1 and 6.");
}
else
{
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon != null)
{
boolean isEgg = false;
if(pokemon.isEgg())
{
if(!PixelExtrasConfig.checkEggIVs)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "IV checking for eggs is disabled");
return;
}
isEgg = pokemon.isEgg();
}
if(isEgg)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, "Egg's IVs");
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, pokemon.getDisplayName() + "'s IVs");
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "HP IVs: " + TextFormatting.YELLOW + pokemon.getIVs().get(StatsType.HP));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Attack IVs: " + TextFormatting.YELLOW + pokemon.getIVs().get(StatsType.Attack));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Defence IVs: " + TextFormatting.YELLOW + pokemon.getIVs().get(StatsType.Defence));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Sp. Attack IVs: " + TextFormatting.YELLOW + pokemon.getIVs().get(StatsType.SpecialAttack));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Sp. Defence IVs: " + TextFormatting.YELLOW + pokemon.getIVs().get(StatsType.SpecialDefence));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Speed IVs: " + TextFormatting.YELLOW + pokemon.getIVs().get(StatsType.Speed));
int total = pokemon.getIVs().get(StatsType.HP) + pokemon.getIVs().get(StatsType.Attack) + pokemon.getIVs().get(StatsType.Defence) + pokemon.getIVs().get(StatsType.SpecialAttack) + pokemon.getIVs().get(StatsType.SpecialDefence) + pokemon.getIVs().get(StatsType.Speed);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, TextFormatting.AQUA + "Total: " + TextFormatting.YELLOW + total + "/186 " + TextFormatting.AQUA + "(" + TextFormatting.YELLOW + ((total * 100) / 186) + "%%" + TextFormatting.AQUA + ")");
}
else
{
CommandChatHandler.sendChat(sender, "Nothing exists in that slot.");
}
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot given!");
}
catch(Exception e)
{
CommandChatHandler.sendChat(sender, "There was an error! Report this to the devs! ");
e.printStackTrace();
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
public class Kill extends CommandBase
{
@Override
public String getName()
{
return "pokekill";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokekill";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
PokemonSpec spec = PokemonSpec.from(args);
int killed = 0;
World world = null;
for(String arg : args)
{
if(world != null)
{
continue;
}
if(arg.startsWith("w:"))
{
arg = arg.replaceAll("w:", "");
for(World w : server.worlds)
{
if(world != null)
{
continue;
}
if(w.getWorldInfo().getWorldName().equalsIgnoreCase(arg))
{
world = w;
}
}
}
}
if(world == null)
{
world = sender.getEntityWorld();
}
for(Entity e : world.loadedEntityList)
{
if(e instanceof EntityPixelmon)
{
EntityPixelmon p = ((EntityPixelmon) e);
if(EnumSpecies.hasPokemon(p.getName()) && p.battleController == null && !p.hasOwner() && spec.matches(p))
{
p.world.removeEntity(p);
killed++;
}
}
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You've killed " + killed + " pixelmon!");
if(PixelExtrasConfig.notifyOPs)
{
notifyCommandListener(sender, this, sender.getName() + " butchered " + killed + " pixelmon!");
}
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.attacks.Attack;
import com.pixelmonmod.pixelmon.battles.attacks.AttackBase;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.comm.packetHandlers.OpenReplaceMoveScreen;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class LearnMove extends CommandBase
{
@Override
public String getName()
{
return "learnmove";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/learnmove <player> <slot> <move>";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
private boolean canLearnOtherMove(Pokemon p, String move)
{
ArrayList<Attack> otherMoves = p.getBaseStats().tutorMoves;
otherMoves.addAll(p.getBaseStats().eggMoves);
for(Attack a : otherMoves)
{
if(a.baseAttack.getTranslatedName().equals(move))
{
return true;
}
}
return false;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else if(args.length == 2)
{
execute(server, sender, new String[] {sender.getName(), args[0], args[1]});
}
else if(args.length == 3)
{
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
int slot = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
if(pStorage.guiOpened)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You can't do this right now," + "" + player.getDisplayNameString() + " has a menu open.");
return;
}
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You have nothing in that slot!");
return;
}
Optional<AttackBase> a = !AttackBase.getAttackBase(args[2].replaceAll("_", " ")).isPresent() ? AttackBase.getAttackBase(Integer.parseInt(args[2].replaceAll("[^0-9]", ""))) : AttackBase.getAttackBase(args[2].replaceAll("_", " "));
if(!a.isPresent())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "That move does not exist!");
return;
}
AttackBase attackBase = a.get();
pStorage.retrieveAll();
if(pokemon.getBaseStats().canLearn(attackBase.getTranslatedName().getUnformattedComponentText()) || canLearnOtherMove(pokemon, attackBase.getTranslatedName().getUnformattedComponentText()))
{
if(!pokemon.getMoveset().hasAttack(attackBase.getTranslatedName().getUnformattedComponentText()))
{
if(pokemon.getMoveset().size() >= 4)
{
Pixelmon.network.sendTo(new OpenReplaceMoveScreen(pokemon.getUUID(), attackBase.attackIndex), pokemon.getOwnerPlayer());
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Successfully sent the move to " + player.getDisplayNameString() + "'s " + pokemon.getDisplayName());
}
else
{
pokemon.getMoveset().add(new Attack(attackBase));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "pixelmon.stats.learnedmove", pokemon.getDisplayName(), attackBase.getTranslatedName());
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, pokemon.getDisplayName() + " has already learned this move!");
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, pokemon.getDisplayName() + " can not learn " + attackBase.getTranslatedName() + "!");
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid number or move name given!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
else if(args.length == 3)
{
return getListOfStringsMatchingLastWord(args, AttackBase.ATTACKS.stream().map(a -> a.getTranslatedName().getUnformattedComponentText().replaceAll(" ", "_")).collect(Collectors.toList()));
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import com.pixelmonmod.pixelmon.util.PixelmonPlayerUtils;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
/**
* Command to disable or enable levelling for an entire party or for
* specific Pokemon of the user or specified player.
*
* @author Hiroku
*/
public class Levelling extends CommandBase
{
@Override
public String getName()
{
return "levelling";
}
@Override
public List<String> getAliases()
{
return Arrays.asList("leveling");
}
@Override
public String getUsage(ICommandSender sender)
{
return "/levelling [player] [slot] <on/off>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Missing arguments: on/off"));
return;
}
EntityPlayerMP player = null;
int slot = -1;
boolean levelling = false;
for(String arg : args)
{
if(slot == -1)
{
try
{
slot = Integer.parseInt(arg);
if(slot > 6 || slot < 1)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Bad slot: " + slot));
return;
}
else
{
continue;
}
}
catch(NumberFormatException ignored)
{
}
}
if(arg.toLowerCase().equals("on"))
{
levelling = true;
}
else if(arg.toLowerCase().equals("off"))
{
levelling = false;
}
else if(player == null)
{
player = PixelmonPlayerUtils.getUniquePlayerStartingWith(arg);
}
}
if(player == null)
{
if(sender instanceof EntityPlayerMP)
{
player = (EntityPlayerMP) sender;
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "No player specified!"));
return;
}
}
if(player != sender && sender instanceof EntityPlayerMP && !sender.canUseCommand(getRequiredPermissionLevel(), "pixelextras.command.admin.levelling"))
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "You don't have permission to use that on others!"));
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(slot == -1)
{
for(Pokemon pokemon : storage.getTeam())
{
if(pokemon != null && !pokemon.isEgg())
{
pokemon.setDoesLevel(levelling);
}
}
if(player != sender)
{
player.sendMessage(new TextComponentString(TextFormatting.YELLOW + "Your Pokemon now have levelling " + (levelling ? "enabled.," : "disabled.")));
sender.sendMessage(new TextComponentString(TextFormatting.DARK_GREEN + "Successfully " + (levelling ? "enabled" : "disabled") + " " + TextFormatting.DARK_AQUA + player.getName() + TextFormatting.DARK_GREEN + "'s party's levelling"));
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.DARK_GREEN + "Successfully " + (levelling ? "enabled" : "disabled") + " levelling."));
}
}
else
{
if(storage.get(slot - 1) == null)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "There is no Pokemon in slot " + slot + "!"));
}
else if(storage.get(slot - 1).isEgg())
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "That's an egg."));
}
else
{
String name = storage.get(slot - 1).getDisplayName();
storage.get(slot - 1).setDoesLevel(levelling);
if(player != sender)
{
player.sendMessage(new TextComponentString(TextFormatting.YELLOW + name + " now has levelling " + (levelling ? "enabled.," : "disabled.")));
sender.sendMessage(new TextComponentString(TextFormatting.DARK_GREEN + "Successfully " + (levelling ? "enabled" : "disabled") + " " + TextFormatting.DARK_AQUA + player.getName() + TextFormatting.DARK_GREEN + "'s " + name + "'s levelling"));
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.DARK_GREEN + "Successfully " + (levelling ? "enabled" : "disabled") + " " + name + "'s levelling."));
}
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
ArrayList<String> tabCompletes = new ArrayList<>(getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames()));
tabCompletes.add("on");
tabCompletes.add("off");
tabCompletes.addAll(Arrays.asList("1", "2", "3", "4", "5", "6"));
return tabCompletes;
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6", "on", "off");
}
else if(args.length == 3)
{
return getListOfStringsMatchingLastWord(args, "on", "off");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.List;
import com.pixelmonmod.pixelmon.battles.attacks.Attack;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.config.PixelmonEntityList;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import org.apache.commons.lang3.StringUtils;
public class MoveList extends CommandBase
{
@Override
public String getName()
{
return "movelist";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/movelist <name>";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
return;
}
else
{
EntityPlayerMP entityPlayer = null;
try
{
entityPlayer = getPlayer(server, sender, sender.getName());
}
catch(PlayerNotFoundException e)
{
e.printStackTrace();
}
String poke = args[0];
if(!EnumSpecies.hasPokemonAnyCase(poke))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, poke + " is not in game!");
return;
}
EntityPixelmon p = (EntityPixelmon) PixelmonEntityList.createEntityByName(poke, entityPlayer.world);
List<Attack> attacks = p.getBaseStats().getAllMoves();
List<String> attackNames = new ArrayList<>();
for(Attack a : attacks)
{
attackNames.add(a.baseAttack.getTranslatedName().getUnformattedComponentText());
}
CommandChatHandler.sendChat(sender, TextFormatting.AQUA + p.getLocalizedName() + "'s Move List:");
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, StringUtils.join(attackNames, TextFormatting.GREEN + ", "));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
List<String> list = new ArrayList<>();
if(args.length == 1)
{
for(EnumSpecies p : EnumSpecies.values())
{
list.add(p.name);
}
return getListOfStringsMatchingLastWord(args, list);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.npcs.*;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.Entity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class NPCKill extends CommandBase
{
private List<String> types = Arrays.asList("all", "chatting", "doctor", "relearner", "shop", "trader", "trainer", "tutor");
@Override
public String getName()
{
return "pokenpckill";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokenpckill <type> - kills the selected type of Pixelmon NPCs";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 1)
{
String type = args[0];
if(types.contains(type))
{
int undeadTrainers = 0;
int slaughterCount = 0;
List<Entity> loadedEntities = sender.getEntityWorld().loadedEntityList;
switch(type)
{
case "all":
for(Entity e : loadedEntities)
{
if(e instanceof EntityNPC)
{
EntityNPC npc = (EntityNPC) e;
if(npc instanceof NPCTrainer)
{
NPCTrainer trainer = (NPCTrainer) npc;
if(trainer.battleController != null)
{
undeadTrainers++;
continue;
}
}
slaughterCount++;
npc.setDead();
}
}
break;
case "chatting":
for(Object e : loadedEntities)
{
if(e instanceof NPCChatting)
{
NPCChatting npc = (NPCChatting) e;
slaughterCount++;
npc.setDead();
}
}
break;
case "doctor":
for(Object e : loadedEntities)
{
if(e instanceof NPCNurseJoy)
{
NPCNurseJoy npc = (NPCNurseJoy) e;
slaughterCount++;
npc.setDead();
}
}
break;
case "relearner":
for(Object e : loadedEntities)
{
if(e instanceof NPCRelearner)
{
NPCRelearner npc = (NPCRelearner) e;
slaughterCount++;
npc.setDead();
}
}
break;
case "shop":
for(Object e : loadedEntities)
{
if(e instanceof NPCShopkeeper)
{
NPCShopkeeper npc = (NPCShopkeeper) e;
slaughterCount++;
npc.setDead();
}
}
break;
case "trader":
for(Object e : loadedEntities)
{
if(e instanceof NPCTrader)
{
NPCTrader npc = (NPCTrader) e;
slaughterCount++;
npc.setDead();
}
}
break;
case "trainer":
for(Object e : loadedEntities)
{
if(e instanceof NPCTrainer)
{
NPCTrainer npc = (NPCTrainer) e;
if(npc.battleController != null)
{
undeadTrainers++;
continue;
}
slaughterCount++;
npc.setDead();
}
}
break;
case "tutor":
for(Object e : loadedEntities)
{
if(e instanceof NPCTutor)
{
NPCTutor npc = (NPCTutor) e;
slaughterCount++;
npc.setDead();
}
}
break;
}
if(slaughterCount > 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, slaughterCount + " " + type + " NPCs are now deceased.");
if(PixelExtrasConfig.notifyOPs)
{
notifyCommandListener(sender, this, sender.getName() + " butchered " + slaughterCount + " \"" + type + "\" NPCs!");
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "No " + type + " NPCs were killed.");
}
if(undeadTrainers > 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "%i Trainers were in battle and not killed!", undeadTrainers);
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "%s is not a valid Pixelmon NPC type", type);
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getUsage(sender));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, types);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.Arrays;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.comm.packetHandlers.clientStorage.newStorage.pc.ClientChangeOpenPC;
import com.pixelmonmod.pixelmon.enums.EnumGui;
import com.pixelmonmod.pixelmon.sounds.PixelSounds;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.text.TextFormatting;
public class PC extends CommandBase
{
@Override
public String getName()
{
return "pc";
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pokepc", "ppc");
}
public String getUsage(ICommandSender sender)
{
return "/pc";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
try
{
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
if(pStorage.guiOpened)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You can't do that right now!");
}
else
{
PCStorage pc = Pixelmon.storageManager.getPC(player, null);
Pixelmon.network.sendTo(new ClientChangeOpenPC(pc.uuid), player);
player.openGui(Pixelmon.instance, EnumGui.PC.getIndex(), player.world, 0, 0, 0);
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Player doesn't exist!");
}
}
}
package com.pixelextras.commands;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.enums.ReceiveType;
import com.pixelmonmod.pixelmon.api.events.PixelmonReceivedEvent;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.ForgeHooks;
/**
* Command for duplicating a Pokemon in pretty much every way
*
* @author Hiroku
*/
public class PokeClone extends CommandBase
{
@Override
public String getName()
{
return "pokeclone";
}
@Override
public List<String> getAliases()
{
return Collections.singletonList("pclone");
}
@Override
public String getUsage(ICommandSender sender)
{
return "&c/pokeclone <slot> [player]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args)
{
if(args.length == 1 && sender == server)
{
sendMessage(sender, "&cYou must specify a player if you are to use this command from console");
sendMessage(sender, getUsage(sender));
}
else if(args.length > 0)
{
try
{
int slot = Integer.parseInt(args[0]);
if(slot < 1 || slot > 6)
{
throw new NumberFormatException();
}
EntityPlayerMP player;
if(args.length == 2)
{
player = server.getPlayerList().getPlayerByUsername(args[1]);
}
else
{
player = (EntityPlayerMP) sender;
}
if(player == null)
{
sendMessage(sender, "&cNo player found with username: " + args[1]);
}
else
{
slot--;
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
Pokemon pokemon = storage.get(slot);
if(pokemon == null)
{
sendMessage(sender, "&cNo pokemon in slot " + (slot + 1));
}
else
{
NBTTagCompound nbt = new NBTTagCompound();
pokemon.writeToNBT(nbt);
Pokemon clone = Pixelmon.pokemonFactory.create(nbt);
//reset this to prevent dupes
clone.setUUID(UUID.randomUUID());
EnumSpecies name = clone.getSpecies();
PixelmonReceivedEvent event = new PixelmonReceivedEvent(player, ReceiveType.Command, clone);
if(Pixelmon.EVENT_BUS.post(event))
{
return;
}
storage.add(clone);
sendMessage(sender, "&2Successfully cloned " + name.name);
}
}
}
catch(NumberFormatException nfe)
{
sendMessage(sender, "&c" + args[0] + " is not a valid slot");
}
}
}
/**
* Sends a message to a CommandSender if the parameter is not a blank String
* Stolen from ObliqueMC's code lmao; it's legal because I wrote it - Hiroku, 2016
*
* @param sender
* The console or the EntityPlayerMP instance representing the player the message should be delivered to
* @param message
* The message itself or blank if no message should be delivered
*/
public static void sendMessage(ICommandSender sender, String message)
{
if(sender != null && message != null && !message.equals(""))
{
sender.sendMessage(ForgeHooks.newChatWithLinks(embedColours(message)));
}
}
/**
* Conversion method to replace the ampersand colours with the EnumTextFormatting format
* Stolen from ObliqueMC's code though so yee
*
* @param str
* The String that needs to be operated on
*
* @return the modified String
*/
private static String embedColours(String str)
{
char curColour = '-';
char curFormat = '-';
for(int i = 0; i < str.length(); i++)
{
if(str.charAt(i) == '&')
{
if(str.charAt(i + 1) != ' ')
{
char code = str.charAt(i + 1);
if(code == '0' || code == '1' || code == '2' || code == '3' || code == '4' || code == '5' || code == '6' || code == '7' || code == '8' || code == '9' || code == 'a' || code == 'b' || code == 'c' || code == 'd' || code == 'e' || code == 'f')
{
curColour = code;
}
else if(code == 'k' || code == 'l' || code == 'm' || code == 'n' || code == 'o')
{
curFormat = code;
}
else if(code == 'r')
{
curColour = '-';
curFormat = '-';
}
}
}
else if(str.charAt(i) == ' ')
{
String charsToAdd = "";
if(curColour != '-')
{
charsToAdd += "&" + curColour;
}
if(curFormat != '-')
{
charsToAdd += "&" + curFormat;
}
str = str.substring(0, i) + " " + charsToAdd + str.substring(i + 1);
i += charsToAdd.length();
}
}
str = str.replaceAll("&0", TextFormatting.BLACK + "");
str = str.replaceAll("&1", TextFormatting.DARK_BLUE + "");
str = str.replaceAll("&2", TextFormatting.DARK_GREEN + "");
str = str.replaceAll("&3", TextFormatting.DARK_AQUA + "");
str = str.replaceAll("&4", TextFormatting.DARK_RED + "");
str = str.replaceAll("&5", TextFormatting.DARK_PURPLE + "");
str = str.replaceAll("&6", TextFormatting.GOLD + "");
str = str.replaceAll("&7", TextFormatting.GRAY + "");
str = str.replaceAll("&8", TextFormatting.DARK_GRAY + "");
str = str.replaceAll("&9", TextFormatting.BLUE + "");
str = str.replaceAll("&a", TextFormatting.GREEN + "");
str = str.replaceAll("&b", TextFormatting.AQUA + "");
str = str.replaceAll("&c", TextFormatting.RED + "");
str = str.replaceAll("&d", TextFormatting.LIGHT_PURPLE + "");
str = str.replaceAll("&e", TextFormatting.YELLOW + "");
str = str.replaceAll("&f", TextFormatting.WHITE + "");
str = str.replaceAll("&k", TextFormatting.OBFUSCATED + "");
str = str.replaceAll("&l", TextFormatting.BOLD + "");
str = str.replaceAll("&m", TextFormatting.STRIKETHROUGH + "");
str = str.replaceAll("&n", TextFormatting.UNDERLINE + "");
str = str.replaceAll("&o", TextFormatting.ITALIC + "");
str = str.replaceAll("&r", TextFormatting.RESET + "");
str = str.replaceAll("\u00A7[0-9a-fk-or]http://", "http://").replaceAll("\u00A7[0-9a-fk-or]http://", "http://");
return str;
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class PokeColour extends CommandBase
{
private static final List<String> formats = new ArrayList<>();
static
{
for(TextFormatting format : TextFormatting.values())
{
formats.add(format.getFriendlyName());
}
}
@Override
public String getName()
{
return "pokecolor";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokecolor <slot> <colour>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 2)
{
try
{
int slot = Integer.parseInt(args[0]) - 1;
TextFormatting format = TextFormatting.getValueByName(args[1]);
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
if(pStorage == null)
{
return;
}
List<Pokemon> party = pStorage.getTeam();
Pokemon pixelmon = party.get(slot);
String name = pixelmon.getDisplayName();
if(name.startsWith("\u00a7"))
{
name = name.substring(2);
}
pixelmon.setNickname(format + name + TextFormatting.WHITE);
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid number given!");
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getUsage(sender));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, formats);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.config.PixelmonConfig;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class PokeDel extends CommandBase
{
@Override
public String getName()
{
return "pokedel";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/pokedel <name> <pc | party> <pokemon [options...] | slot>";
}
@Override
public List<String> getAliases()
{
return Collections.singletonList("pdel");
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 3)
{
CommandChatHandler.sendChat(sender, this.getUsage(sender));
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
Boolean checkingParty = null;
if(args[1].toLowerCase().equals("pc"))
{
checkingParty = false;
}
else if(args[1].toLowerCase().equals("party"))
{
checkingParty = true;
}
if(checkingParty == null)
{
CommandChatHandler.sendChat(sender, this.getUsage(sender));
return;
}
int slot = -1;
int box = -1;
PokemonSpec spec = PokemonSpec.from(args);
boolean emptySpec = false;
try
{
NBTTagCompound nbt = new NBTTagCompound();
emptySpec = spec.matches(nbt);
}
catch(Exception ignored)
{
}
if(emptySpec)
{
try
{
box = Integer.parseInt(args[2]) - 1;
slot = Integer.parseInt(args[3]) - 1;
}
catch(Exception ignored)
{
}
if(checkingParty)
{
if(box < 0 || box > 5)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot or Pokemon spec!");
return;
}
}
else
{
if(box < 0 || box >= PixelmonConfig.computerBoxes || slot < 0 || slot > 5)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot or Pokemon spec!");
return;
}
}
}
boolean confirmed = false;
for(String arg : args)
{
if(arg.toLowerCase().equals("confirm"))
{
confirmed = true;
}
}
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
PCStorage cStorage = Pixelmon.storageManager.getPCForPlayer(player);
if(emptySpec)
{
String name;
if(checkingParty)
{
Pokemon pokemon = pStorage.get(box);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "No Pokemon in slot");
return;
}
name = pokemon.getDisplayName();
pStorage.set(box, null);
}
else
{
Pokemon pokemon = cStorage.getBox(box).get(slot);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "No Pokemon in slot");
return;
}
name = pokemon.getDisplayName();
cStorage.set(box, slot, null);
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.DARK_GREEN, "Deleted " + player.getName() + "'s" + name);
}
else
{
ArrayList<Pokemon> nbts = new ArrayList<>();
if(checkingParty)
{
slot = 0;
for(Pokemon pokemon : pStorage.getTeam())
{
if(pokemon != null && spec.matches(pokemon))
{
if(confirmed)
{
pStorage.set(slot, null);
}
nbts.add(pokemon);
}
slot++;
}
}
else
{
for(box = 0; box < PixelmonConfig.computerBoxes; box++)
{
for(slot = 0; slot < 30; slot++)
{
Pokemon pokemon = cStorage.getBox(box).get(slot);
if(pokemon != null && spec.matches(pokemon))
{
if(confirmed)
{
cStorage.set(box, slot, null);
}
nbts.add(pokemon);
}
}
}
}
if(nbts.isEmpty())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "No matches");
return;
}
if(confirmed)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.DARK_GREEN, "Successfully deleted " + nbts.size() + " Pokemon");
}
else
{
StringBuilder list = new StringBuilder(nbts.get(0).getDisplayName());
for(int i = 1; i < nbts.size(); i++)
{
list.append(", ").append(nbts.get(i).getDisplayName());
}
if(spec.name == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "Warning - The following " + nbts.size() + " Pokemon will be deleted: " + list);
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "Warning - " + nbts.size() + " Pokemon will be deleted");
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "Run this command again with \"confirm\" to delete these Pokemon");
}
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(Exception e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "There was an error! Report this to Hiroku!");
e.printStackTrace();
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
List<String> list = new ArrayList<>();
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
if(args.length == 2)
{
for(int i = 1; i < 17; i++)
{
list.add("box" + i);
}
list.add("party");
return getListOfStringsMatchingLastWord(args, list);
}
if(args.length == 3)
{
for(EnumSpecies p : EnumSpecies.values())
{
list.add(p.name);
}
return getListOfStringsMatchingLastWord(args, list);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.List;
import com.pixelextras.util.TabCompletion;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.StatsType;
import com.pixelmonmod.pixelmon.enums.EnumGrowth;
import com.pixelmonmod.pixelmon.enums.EnumNature;
import com.pixelmonmod.pixelmon.enums.items.EnumPokeballs;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class PokeEdit extends CommandBase
{
@Override
public String getName()
{
return "pokeedit";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
public String getUsage(ICommandSender icommandsender)
{
return "/pokeedit <player> <slot> <params>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 3)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
int slot = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You have nothing in that slot!");
return;
}
pStorage.retrieveAll();
PokemonSpec spec = PokemonSpec.from(args);
spec.apply(pokemon);
pStorage.set(slot - 1, pokemon);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, pokemon.getDisplayName() + " has been edited!");
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid number given!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
List<String> list = new ArrayList<>();
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
else if(args.length >= 3)
{
int start = 0;
String arg = args[args.length - 1].toLowerCase();
if(arg.equals(""))
{
return getListOfStringsMatchingLastWord(args, "nature:", "growth:", "gender:", "ball:", "ability:", "shiny", "notshiny", "evHP:", "evAttack:", "evDefence:", "evSpecialAttack:", "evSpecialDefence:", "evSpeed:", "resetevs", "ivHP:", "ivAttack:", "ivDefence:", "ivSpecialAttack:", "ivSpecialDefence:", "ivSpeed:", "resetivs");
}
if(arg.startsWith("n") || arg.startsWith("n:") || arg.startsWith("nature:"))
{
for(EnumNature n : EnumNature.values())
{
list.add(n.toString());
}
if(arg.startsWith("nature:"))
{
start = 7;
}
else if(arg.startsWith("n:"))
{
start = 2;
}
else if(arg.startsWith("n"))
{
start = 1;
}
return TabCompletion.getListOfStringsMatchingLastWordCustom(args, start, list);
}
else if(arg.startsWith("gr") || arg.startsWith("gr:") || arg.startsWith("growth:"))
{
for(EnumGrowth g : EnumGrowth.values())
{
list.add(g.toString());
}
if(arg.startsWith("growth:"))
{
start = 7;
}
else if(arg.startsWith("gr:"))
{
start = 3;
}
else if(arg.startsWith("gr"))
{
start = 2;
}
return TabCompletion.getListOfStringsMatchingLastWordCustom(args, start, list);
}
else if(arg.startsWith("ev") || arg.startsWith("iv"))
{
for(StatsType s : StatsType.values())
{
if(!s.toString().equals("None") && !s.toString().equals("Evasion") && !s.toString().equals("Accuracy"))
{
list.add(s.toString());
}
}
return TabCompletion.getListOfStringsMatchingLastWordCustom(args, 2, list);
}
else if(arg.startsWith("ball:") || arg.startsWith("ba:") || arg.startsWith("ba"))
{
for(EnumPokeballs b : EnumPokeballs.values())
{
list.add(b.toString().replaceAll("Ball", ""));
}
if(arg.startsWith("ball:"))
{
start = 5;
}
else if(arg.startsWith("ba:"))
{
start = 3;
}
else if(arg.startsWith("ba"))
{
start = 2;
}
return TabCompletion.getListOfStringsMatchingLastWordCustom(args, start, list);
}
else if(arg.startsWith("ability:") || arg.startsWith("ab:") || arg.startsWith("ab"))
{
if(arg.startsWith("ability:"))
{
start = 8;
}
else if(arg.startsWith("ab:"))
{
start = 3;
}
else if(arg.startsWith("ab"))
{
start = 2;
}
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
PlayerPartyStorage pStorage = Pixelmon.storageManager.getParty(player);
Pokemon pokemon = pStorage.get(Integer.parseInt(args[1]) - 1);
if(pokemon != null)
{
return TabCompletion.getListOfStringsMatchingLastWordCustom(args, start, pokemon.getBaseStats().abilities);
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid pokemon in that slot!");
}
}
catch(CommandException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
}
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class PokeExp extends CommandBase
{
@Override
public String getName()
{
return "pokexp";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokexp <slot> <player exp> - converts <player exp> into Pixelmon exp on <slot>";
}
private static void removeExperience(EntityPlayerMP player, int amount)
{
int j = Integer.MIN_VALUE + player.experienceTotal;
if(amount < j)
{
amount = j;
}
//TODO: do more logic that consumes levels first
player.addExperience(amount);
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 2 && sender instanceof EntityPlayerMP)
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
int slot = Integer.parseInt(args[0]) - 1;
int exp = Integer.parseInt(args[1]);
int expToUse = (int) (exp * PixelExtrasConfig.expConversionRate);
int playerTotalXP = player.experienceTotal;
float playerXP = player.experience;
if(expToUse > playerTotalXP)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Not enough experience!");
if(playerXP > 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, playerXP + " exp is left!");
}
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
List<Pokemon> party = storage.getTeam();
Pokemon pixelmon = party.get(slot);
pixelmon.getLevelContainer().awardEXP(exp);
//int expLeft = (int) (player.experienceTotal - (exp * PixelExtrasConfig.expConversionRate));
//player.addExperience((int) -(exp * PixelExtrasConfig.expConversionRate));
removeExperience(player, -(int) (exp * PixelExtrasConfig.expConversionRate));
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getUsage(sender));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.Lists;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.enums.ReceiveType;
import com.pixelmonmod.pixelmon.api.events.PixelmonReceivedEvent;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.enums.items.EnumPokeballs;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import com.pixelmonmod.pixelmon.util.PixelmonPlayerUtils;
import com.pixelmonmod.pixelmon.util.helpers.CollectionHelper;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
public class PokeRandom extends CommandBase
{
@Override
public String getName()
{
return "pokerandom";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public List<String> getAliases()
{
return Collections.singletonList("prandom");
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokerandom <player> [options]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if((args.length < 1 || PixelmonPlayerUtils.getUniquePlayerStartingWith(args[0]) == null) && sender instanceof EntityPlayerMP)
{
this.execute(server, sender, new String[] {sender.getName()});
return;
}
EntityPlayerMP player;
if(args.length < 1)
{
player = getCommandSenderAsPlayer(sender);
}
else
{
player = getPlayer(server, sender, args[0]);
}
if(player == null)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Player not found: " + TextFormatting.DARK_AQUA + args[0]));
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if (storage == null)
{
return;
}
ArrayList<EnumSpecies> possibleSpecies = Lists.newArrayList(EnumSpecies.values());
if (!PixelExtrasConfig.allowRandomLegendaries)
possibleSpecies.removeIf(species -> EnumSpecies.legendaries.contains(species.name));
if (!PixelExtrasConfig.allowRandomUltraBeasts)
possibleSpecies.removeIf(species -> EnumSpecies.ultrabeasts.contains(species.name));
Pokemon pokemon = Pixelmon.pokemonFactory.create(CollectionHelper.getRandomElement(possibleSpecies));
PokemonSpec spec = PokemonSpec.from(args);
spec.name = null;
pokemon.setCaughtBall(EnumPokeballs.PokeBall);
spec.apply(pokemon);
PixelmonReceivedEvent event = new PixelmonReceivedEvent(player, ReceiveType.Command, pokemon);
if (Pixelmon.EVENT_BUS.post(event))
return;
storage.add(pokemon);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You randomly gave a " + pokemon.getDisplayName() + " to " + player.getDisplayNameString());
if (PixelExtrasConfig.notifyOPs)
notifyCommandListener(sender, this, sender.getName() + " randomly gave a " + pokemon.getDisplayName() + " to " + player.getDisplayNameString());
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.BattleRegistry;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.EVStore;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class PokeReset extends CommandBase
{
private static final List<String> aliases = new ArrayList<>();
private static final List<String> slots = Arrays.asList("1", "2", "3", "4", "5", "6");
static
{
aliases.add("preset");
}
@Override
public String getName()
{
return "pokereset";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokereset <player> <slot> [lvl] - resets the pokemon in <slot> of <player> to lvl 5 and 0 EVs";
}
@Override
public List<String> getAliases()
{
return aliases;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 2 || args.length == 3)
{
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
if(BattleRegistry.getBattle(player) != null)
{
return;
}
int slot = Integer.parseInt(args[1]) - 1;
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
if(storage.get(slot) == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "There is no Pixelmon in that slot!");
return;
}
storage.retrieveAll();
Pokemon pokemon = storage.get(slot);
if(args.length == 3)
{
int lvl = Integer.parseInt(args[2]);
pokemon.getLevelContainer().setLevel(lvl);
}
else
{
pokemon.getLevelContainer().setLevel(5);
}
pokemon.getStats().evs = new EVStore();
CommandChatHandler.sendFormattedChat(sender, TextFormatting.WHITE, "%s's %s was reset!", player.getDisplayNameString(), pokemon.getDisplayName());
}
catch(Exception e)
{
e.printStackTrace();
}
}
else if(args.length == 1)
{
try
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
if(BattleRegistry.getBattle(player) != null)
{
return;
}
int intPartySlot = Integer.parseInt(args[0]);
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
Pokemon pokemon = storage.get(intPartySlot - 1);
pokemon.getLevelContainer().setLevel(5);
pokemon.getStats().evs = new EVStore();
CommandChatHandler.sendFormattedChat(sender, TextFormatting.WHITE, "%s's %s was reset!", player.getDisplayNameString(), pokemon.getDisplayName());
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.WHITE, "Incorrect usage. %s", getUsage(sender));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, slots);
}
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
}
package com.pixelextras.commands;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.TickHandler;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.config.PixelmonConfig;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import com.pixelmonmod.pixelmon.storage.PlayerStats;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
public class PokeRestart extends CommandBase
{
@Override
public String getName()
{
return "pokerestart";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pokerestart <confirm | player> <confirm>- allows <player> to reselect their starter";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
EntityPlayerMP player = null;
boolean confirming = false;
if(args.length == 0)
{
if(sender instanceof EntityPlayerMP)
{
player = (EntityPlayerMP) sender;
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Missing argument: player"));
}
}
else
{
for(String arg : args)
{
if(arg.toLowerCase().equals("confirm"))
{
confirming = true;
}
else if(player == null)
{
player = CommandBase.getPlayer(server, sender, arg);
}
}
}
if(confirming && args.length == 1)
{
if(sender instanceof EntityPlayerMP)
{
player = (EntityPlayerMP) sender;
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Missing argument: player"));
}
}
if(player == null)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Player not found"));
}
else if(!confirming)
{
sender.sendMessage(new TextComponentString(TextFormatting.GRAY + "Are you sure? Add 'confirm' to the command to restart " + player.getName() + "'s Pokemon"));
}
else if(player != sender && !sender.canUseCommand(4, "pixelextras.command.admin.pokerestart"))
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "You don't have permission to restart others"));
}
else
{
resetPlayerFiles(player);
if(sender != player)
{
sender.sendMessage(new TextComponentString(TextFormatting.DARK_GREEN + "Successfully restarted " + player.getName() + "'s Pokemon"));
}
}
}
private void resetPlayerFiles(EntityPlayerMP player)
{
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
storage.starterPicked = false;
storage.pokedex.wipe();
storage.stats = new PlayerStats();
PCStorage pcStorage = Pixelmon.storageManager.getPCForPlayer(player);
for(int i = 0; i < 6; i++)
{
Pokemon pokemon = storage.get(i);
if(pokemon != null)
{
storage.set(i, null);
}
}
for(int box = 0; box < PixelmonConfig.computerBoxes; box++)
{
for(int boxPos = 0; boxPos < 30; boxPos++)
{
pcStorage.set(box, boxPos, null);
}
}
TickHandler.registerStarterList(player);
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.battles.BattleRegistry;
import com.pixelmonmod.pixelmon.comm.ChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class PokeRetrieve extends CommandBase
{
public String getName()
{
return "pokeretrieve";
}
public String getUsage(ICommandSender sender)
{
return "/pokeretrieve <player> - returns pokemon to their pokeballs";
}
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
try
{
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
if(BattleRegistry.getBattle(player) != null)
{
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
storage.retrieveAll();
ChatHandler.sendFormattedChat(player, TextFormatting.GREEN, "You have retrieved all of your Pokémon");
}
catch(PlayerNotFoundException e)
{
e.printStackTrace();
}
}
else if(args.length == 1)
{
if(args[0].equalsIgnoreCase("all"))
{
List<EntityPlayer> players = sender.getEntityWorld().playerEntities;
for(EntityPlayer player : players)
{
if(BattleRegistry.getBattle(player) != null)
{
continue;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty((EntityPlayerMP) player);
if(storage != null)
{
storage.retrieveAll();
}
}
ChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You have retrieved all players Pokémon");
if(PixelExtrasConfig.notifyOPs)
{
notifyCommandListener(sender, this, "All pixelmon were returned to their pokeballs");
}
}
else
{
try
{
EntityPlayerMP player = getPlayer(server, sender, args[0]);
if(BattleRegistry.getBattle(player) != null)
{
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
storage.retrieveAll();
EntityPlayer senderPlayer = getCommandSenderAsPlayer(sender);
ChatHandler.sendFormattedChat(senderPlayer, TextFormatting.GREEN, "You have retrieved " + player.getName() + "'s Pokemon!");
}
catch(PlayerNotFoundException e)
{
EntityPlayer senderPlayer = getCommandSenderAsPlayer(sender);
ChatHandler.sendFormattedChat(senderPlayer, TextFormatting.RED, "Player not found!");
e.printStackTrace();
}
}
}
else
{
EntityPlayer senderPlayer = getCommandSenderAsPlayer(sender);
ChatHandler.sendFormattedChat(senderPlayer, TextFormatting.RED, getUsage(sender));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
}
package com.pixelextras.commands;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import com.pixelextras.PixelExtras;
import com.pixelextras.config.PixelExtrasConfig;
import com.mojang.authlib.GameProfile;
import com.pixelextras.util.PixelmonHelper;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.config.Configuration;
public class PokeSee extends CommandBase
{
@Override
public String getName()
{
return "pokesee";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/pokesee <player>";
}
@Override
public List<String> getAliases()
{
return Collections.singletonList("psee");
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if (args.length < 1)
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
else
{
try
{
PlayerPartyStorage storage;
if(PixelExtrasConfig.allowOfflineCheck){
GameProfile gp = server.getPlayerProfileCache().getGameProfileForUsername(args[0]);
UUID uuid = gp.getId();
if (Pixelmon.storageManager.getParty(uuid).countAll() == 0) {
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This player doesn't exist or don't have any pokemon in his Party");
return;
}
storage = Pixelmon.storageManager.getParty(uuid);
}else {
EntityPlayerMP player = getPlayer(server, sender, args[0]);
if(player.canUseCommand(4, "pixelextras.pokesee.exempt") && !sender.canUseCommand(4, "pixelextras.pokesee.exempt"))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You cannot check " + player.getName() + "'s party");
return;
}
storage = Pixelmon.storageManager.getParty(player);
}
if (storage == null)
return;
Pokemon[] party = storage.getAll();
CommandChatHandler.sendFormattedChat(sender, TextFormatting.AQUA, args[0] + "'s Party: (Mouse over for more info)");
for (Pokemon pokemon : party)
{
if (pokemon != null && !pokemon.isEgg())
sender.sendMessage(PixelmonHelper.getHoverTextPokemon(pokemon));
else if (pokemon != null)
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Egg: " + pokemon.getSpecies().getPokemonName());
else
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Empty");
}
}
catch (PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if (args.length == 1)
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import com.google.common.collect.Lists;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.battles.BattleRegistry;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.enums.items.EnumPokeballs;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import scala.util.Random;
public class RandomLeg extends CommandBase implements ICommand
{
private final List<String> aliases;
public RandomLeg()
{
aliases = Lists.newArrayList("rl");
}
@Override
@Nonnull
public String getName()
{
return "randomleg";
}
@Override
@Nonnull
public String getUsage(@Nonnull ICommandSender sender)
{
return TextFormatting.RED + "/rl <player> [spec]";
}
@Override
@Nonnull
public List<String> getAliases()
{
return aliases;
}
@Override
public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) throws CommandException
{
if(args.length == 0)
{
sender.sendMessage(new TextComponentString(getUsage(sender)));
return;
}
int sizeleg = EnumSpecies.legendaries.size();
int random = new Random().nextInt(sizeleg);
EnumSpecies name = EnumSpecies.getFromNameAnyCase(EnumSpecies.legendaries.get(random));
EntityPlayerMP player = getPlayer(server, sender, args[0]);
if(args.length >= 1)
{
Pokemon p = Pixelmon.pokemonFactory.create(name);
PokemonSpec spec = PokemonSpec.from(args);
p.setCaughtBall(EnumPokeballs.PokeBall);
spec.apply(p);
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(BattleRegistry.getBattle(player) == null)
{
storage.add(p);
}
else
{
PCStorage pcStorage = Pixelmon.storageManager.getPCForPlayer(player);
pcStorage.add(p);
}
sender.sendMessage(new TextComponentString(TextFormatting.GREEN + "You've sent a " + TextFormatting.YELLOW + p.getDisplayName() + TextFormatting.GREEN + " to " + TextFormatting.GOLD + player.getName()));
player.sendMessage(new TextComponentString(TextFormatting.GREEN + "You've been given a " + TextFormatting.YELLOW + p.getDisplayName()));
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error!"));
sender.sendMessage(new TextComponentString(getUsage(sender)));
}
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
@Nonnull
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
@Override
public boolean isUsernameIndex(String[] astring, int i)
{
return false;
}
}
package com.pixelextras.commands;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.Lists;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.api.storage.PCStorage;
import com.pixelmonmod.pixelmon.battles.BattleRegistry;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.enums.EnumType;
import com.pixelmonmod.pixelmon.enums.items.EnumPokeballs;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
public class RandomPokeType extends CommandBase implements ICommand
{
private final List<String> aliases;
public RandomPokeType()
{
aliases = Lists.newArrayList("pgt");
}
@Override
@Nonnull
public String getName()
{
return "pokegivetype";
}
@Override
@Nonnull
public String getUsage(@Nonnull ICommandSender sender)
{
return TextFormatting.RED + "/pokegivetype <player> <type> [spec] [-l]";
}
@Override
@Nonnull
public List<String> getAliases()
{
return aliases;
}
@Override
public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) throws CommandException
{
if(args.length == 0)
{
sender.sendMessage(new TextComponentString(getUsage(sender)));
}
else
{
if(args.length >= 2)
{
boolean bug = true;
for(int i = 0; i < EnumType.getAllTypes().size(); i++)
{
if(EnumType.getAllTypes().get(i).name().equalsIgnoreCase(args[1]))
{
bug = false;
}
}
if(args[1].equalsIgnoreCase("mystery"))
{
bug = true;
}
if(bug)
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Type incorrect !"));
return;
}
EntityPlayerMP player = getPlayer(server, server, args[0]);
boolean legendary = false;
for(String arg : args)
{
if(arg.contains("-l"))
{
legendary = true;
}
}
EnumSpecies name = EnumSpecies.getFromNameAnyCase(EnumSpecies.randomPoke(legendary).name);
Pokemon p = Pixelmon.pokemonFactory.create(name);
while(!p.getBaseStats().types.contains(EnumType.parseType(args[1])))
{
name = EnumSpecies.getFromNameAnyCase(EnumSpecies.randomPoke(legendary).name);
p = Pixelmon.pokemonFactory.create(name);
}
PokemonSpec spec = PokemonSpec.from(args);
p.setCaughtBall(EnumPokeballs.PokeBall);
spec.apply(p);
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(BattleRegistry.getBattle(player) == null)
{
storage.add(p);
}
else
{
PCStorage pcStorage = Pixelmon.storageManager.getPCForPlayer(player);
pcStorage.add(p);
}
sender.sendMessage(new TextComponentString(TextFormatting.GREEN + "You've sent a " + TextFormatting.YELLOW + p.getDisplayName() + TextFormatting.GREEN + " to " + TextFormatting.GOLD + player.getName()));
player.sendMessage(new TextComponentString(TextFormatting.GREEN + "You've been given a " + TextFormatting.YELLOW + p.getDisplayName()));
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Error !"));
sender.sendMessage(new TextComponentString(getUsage(sender)));
}
}
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
@Nonnull
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
ArrayList<EnumType> list = new ArrayList<>(EnumType.getAllTypes());
list.remove(EnumType.Mystery);
return getListOfStringsMatchingLastWord(args, list);
}
else
{
return Collections.emptyList();
}
}
@Override
public boolean isUsernameIndex(String[] astring, int i)
{
return false;
}
}
package com.pixelextras.commands;
import java.util.NoSuchElementException;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.enums.ReceiveType;
import com.pixelmonmod.pixelmon.api.events.PixelmonReceivedEvent;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.enums.items.EnumPokeballs;
import com.pixelmonmod.pixelmon.items.ItemCoveredFossil;
import com.pixelmonmod.pixelmon.items.ItemFossil;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextFormatting;
public class RedeemFossil extends CommandBase
{
@Override
public String getName()
{
return "redeemfossil";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/redeemfossil [all]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(!(sender instanceof EntityPlayerMP))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You must be a player to use that command");
return;
}
EntityPlayerMP player = (EntityPlayerMP) sender;
ItemStack held = player.getHeldItem(EnumHand.MAIN_HAND);
if(held.isEmpty())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "You do not have an fossil in your hand to redeem");
return;
}
Item itemInHand = held.getItem();
EnumSpecies pokemonName;
if(itemInHand instanceof ItemFossil)
{
ItemFossil fossil = (ItemFossil) itemInHand;
pokemonName = fossil.fossil.getPokemon();
}
else if(itemInHand instanceof ItemCoveredFossil)
{
ItemCoveredFossil fossil = (ItemCoveredFossil) itemInHand;
pokemonName = fossil.cleanedFossil.fossil.getPokemon();
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "The item in your hand is not a fossil");
return;
}
boolean iterate = args.length > 0 && args[0].toLowerCase().equals("all");
for(int i = 0; i < 1 || (iterate && i < held.getCount()); i++)
{
Pokemon pokemon = Pixelmon.pokemonFactory.create(pokemonName);
pokemon.getLevelContainer().setLevel(1);
pokemon.setCaughtBall(EnumPokeballs.PokeBall);
try
{
Pixelmon.storageManager.getParty(player).add(pokemon);
}
catch(NoSuchElementException nsee)
{
nsee.printStackTrace();
}
Pixelmon.EVENT_BUS.post(new PixelmonReceivedEvent(player, ReceiveType.Command, pokemon));
}
if(iterate)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You've successfully redeemed " + held.getCount() + " " + TextFormatting.DARK_AQUA + pokemonName);
player.inventory.deleteStack(held);
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You've successfully redeemed a " + TextFormatting.DARK_AQUA + pokemonName);
held.splitStack(1);
}
}
}
package com.pixelextras.commands;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.google.common.collect.Lists;
import com.pixelextras.PixelExtras;
import com.pixelextras.config.PixelExtrasConfig;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommand;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.config.Configuration;
public class Reload extends CommandBase implements ICommand{
private final List<String> aliases;
public Reload(){
aliases = Lists.newArrayList("pereload");
}
@Override
@Nonnull
public String getName() {
return "pixelextrasreload";
}
@Override
@Nonnull
public String getUsage(@Nonnull ICommandSender sender) {
return "/pereload";
}
@Override
@Nonnull
public List<String> getAliases()
{
return aliases;
}
@Override
public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] args) throws CommandException {
PixelExtrasConfig.readConfig();
PixelExtrasConfig.loadConfig(PixelExtrasConfig.config);
sender.sendMessage((new TextComponentString(TextFormatting.GREEN+"[PixelExtras]" + TextFormatting.YELLOW+ " Config reload !")));
}
@Override
public int getRequiredPermissionLevel() {
return 2;
}
@Override
@Nonnull
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) {
return Collections.emptyList();
}
@Override
public boolean isUsernameIndex(String[] astring, int i)
{
return false;
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class SpawnCoords extends CommandBase
{
@Override
public String getName()
{
return "pspawn";
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pokespawncoords", "pspawnc", "pspawncoords");
}
@Override
public String getUsage(ICommandSender sender)
{
return "/pspawn <pokemon> <x> <y> <z>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
PokemonSpec spec = PokemonSpec.from(args);
if(spec.name == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Missing argument: Pokemon name");
return;
}
World world = null;
Double posX = null;
Double posY = null;
Double posZ = null;
argumentLoop:
for(String arg : args)
{
EntityPlayerMP player = null;
try
{
player = getPlayer(server, sender, arg);
}
catch(PlayerNotFoundException ignored)
{
}
if(player != null)
{
world = player.world;
posX = player.getPositionVector().x;
posY = player.getPositionVector().y;
posZ = player.getPositionVector().z;
break;
}
if(world == null)
{
for(World worldServer : FMLCommonHandler.instance().getMinecraftServerInstance().worlds)
{
if(worldServer.getWorldInfo().getWorldName().equalsIgnoreCase(arg))
{
world = worldServer;
continue argumentLoop;
}
}
if(world == null)
{
world = sender.getEntityWorld();
}
}
try
{
Double d = Double.parseDouble(arg);
if(posX == null)
{
posX = d;
}
else if(posY == null)
{
posY = d;
}
else if(posZ == null)
{
posZ = d;
}
}
catch(NumberFormatException ignored)
{
}
}
if(posX == null || posY == null || posZ == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Missing at least one of the x y z arguments (or player)");
return;
}
if(world == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Missing argument: world (or player)");
return;
}
Pokemon pokemon = Pixelmon.pokemonFactory.create(spec);
EntityPixelmon pixelmon = pokemon.getOrSpawnPixelmon(world, posX, posY, posZ);
spec.apply(pixelmon);
pixelmon.canDespawn = false;
CommandChatHandler.sendChat(sender, "pixelmon.command.spawn.spawned", new TextComponentTranslation("pixelmon." + pokemon.getSpecies().name + ".name"));
if(PixelExtrasConfig.notifyOPs)
{
notifyCommandListener(sender, this, 0, "pixelmon.command.spawn.spawnednotify", sender.getName(), spec.name);
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
List<String> list = new ArrayList<>();
if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 1)
{
{
for(EnumSpecies p : EnumSpecies.values())
{
list.add(p.name);
}
}
return getListOfStringsMatchingLastWord(args, list);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.TickHandler;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class Starter extends CommandBase
{
@Override
public String getName()
{
return "starter";
}
@Override
public String getUsage(ICommandSender sender)
{
return "/starter <player>- opens the starter screen if it hasn't been displayed yet";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
EntityPlayerMP player;
try
{
player = getCommandSenderAsPlayer(sender);
}
catch(PlayerNotFoundException e1)
{
e1.printStackTrace();
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
if(storage.starterPicked && storage.getTeam().size() > 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Sorry but you cannot pick a starter");
return;
}
storage.starterPicked = false;
TickHandler.registerStarterList(player);
}
else if(args.length == 1)
{
String playerName = args[0];
EntityPlayerMP player;
try
{
player = getPlayer(server, sender, playerName);
}
catch(PlayerNotFoundException e1)
{
e1.printStackTrace();
return;
}
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
if(storage.starterPicked && storage.getTeam().size() > 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Sorry but that player cannot pick a starter");
return;
}
storage.starterPicked = false;
TickHandler.registerStarterList(player);
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getUsage(sender));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import com.mojang.authlib.GameProfile;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.command.PlayerNotFoundException;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.management.PlayerProfileCache;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class Take extends CommandBase
{
@Override
public String getName()
{
return "poketake";
}
@Override
public String getUsage(ICommandSender icommandsender)
{
return "/poketake <player> <slot>";
}
@Override
public List<String> getAliases()
{
return Collections.singletonList("ptake");
}
@Override
public int getRequiredPermissionLevel()
{
return 4;
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 2)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
return;
}
try
{
PlayerPartyStorage pStorage;
if(PixelExtrasConfig.allowOfflineCheck){
GameProfile gp = server.getPlayerProfileCache().getGameProfileForUsername(args[0]);
UUID uuid = gp.getId();
if (Pixelmon.storageManager.getParty(uuid).countAll() == 0) {
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This player doesn't exist or don't have any pokemon in his Party");
return;
}
pStorage = Pixelmon.storageManager.getParty(uuid);
}else {
EntityPlayerMP player = getPlayer(server, sender, args[0]);
pStorage = Pixelmon.storageManager.getParty(player);
}
PlayerPartyStorage sStorage = Pixelmon.storageManager.getParty(getPlayer(server, sender, sender.getName()));
if(pStorage == null || sStorage == null)
{
return;
}
int slot = Integer.parseInt(args[1].replaceAll("[^0-9]", ""));
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
Pokemon pokemon = pStorage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "They have nothing in that slot!");
return;
}
pStorage.retrieveAll();
pStorage.set(slot - 1, null);
sStorage.add(pokemon);
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "You took " + pokemon.getDisplayName() + " from " + args[0] + "!");
if(PixelExtrasConfig.notifyOPs)
{
notifyCommandListener(sender, this, sender.getName() + " has taken a " + pokemon.getDisplayName() + " from " + args[0] + "!");
}
}
catch(PlayerNotFoundException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid Name! Try again!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid slot given!");
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, server.getOnlinePlayerNames());
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.attacks.Attack;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import org.apache.commons.lang3.StringUtils;
public class TM extends CommandBase
{
@Override
public String getName()
{
return "tms";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
public String getUsage(ICommandSender icommandsender)
{
return "/tms <name>";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
}
else
{
String poke = args[0];
if(!EnumSpecies.hasPokemonAnyCase(poke))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, poke + " is not in game!");
return;
}
Pokemon p = Pixelmon.pokemonFactory.create(EnumSpecies.getFromNameAnyCase(poke));
List<Attack> attacks = p.getBaseStats().tmMoves;
List<String> attackNames = new ArrayList<>();
for(Attack a : attacks)
{
attackNames.add(a.baseAttack.getTranslatedName().getUnformattedComponentText());
}
CommandChatHandler.sendChat(sender, TextFormatting.AQUA + p.getDisplayName() + "'s TM/HM List:");
CommandChatHandler.sendChat(sender, StringUtils.join(attackNames, TextFormatting.GREEN + ", "));
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
List<String> list = new ArrayList<>();
if(args.length == 1)
{
for(EnumSpecies p : EnumSpecies.values())
{
list.add(p.name);
}
return getListOfStringsMatchingLastWord(args, list);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.List;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.storage.PlayerPartyStorage;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
public class TradeSim extends CommandBase
{
private final PokemonSpec UNTRADEABLE = new PokemonSpec("untradeable");
@Override
public String getName()
{
return "tradesim";
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public String getUsage(ICommandSender var1)
{
return "/tradesim <slot> [simulated] - simulates a trade of <slot> with [simulated]";
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length < 1)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, this.getUsage(sender));
return;
}
try
{
EntityPlayerMP player = getPlayer(server, sender, sender.getName());
PlayerPartyStorage storage = Pixelmon.storageManager.getParty(player);
if(storage == null)
{
return;
}
int slot = Integer.parseInt(args[0].replaceAll("[^0-9]", ""));
if(slot < 1 || slot > 6)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Slot number must be between 1 and 6.");
return;
}
String name = "Magikarp";
if(args.length > 1)
{
name = args[1];
if(!EnumSpecies.hasPokemonAnyCase(name))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Unknown Pokémon that the trade is simulating with: " + args[1]);
return;
}
}
Pokemon pokemon = storage.get(slot - 1);
if(pokemon == null)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Nothing exists in that slot.");
return;
}
if(pokemon.isEgg())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Simulation failed! Eggs cannot evolve via trade!");
return;
}
if(UNTRADEABLE.matches(pokemon))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "This Pokémon cannot be traded.");
return;
}
EntityPixelmon pixelmon = pokemon.getOrSpawnPixelmon(player.world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ());
pixelmon.testTradeEvolution(EnumSpecies.getFromNameAnyCase(name));
CommandChatHandler.sendFormattedChat(sender, TextFormatting.GREEN, "Simulation complete!");
}
catch(NumberFormatException e)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Please provide a slot!");
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, "1", "2", "3", "4", "5", "6");
}
else if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, EnumSpecies.getNameList());
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.commands;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.pixelextras.api.event.UnknownEvolutionConditionEvent;
import com.pixelextras.api.event.UnknownEvolutionTypeEvent;
import com.pixelextras.util.TextUtil;
import com.pixelmonmod.pixelmon.Pixelmon;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import com.pixelmonmod.pixelmon.api.spawning.SpawnInfo;
import com.pixelmonmod.pixelmon.api.spawning.SpawnLocation;
import com.pixelmonmod.pixelmon.api.spawning.SpawnSet;
import com.pixelmonmod.pixelmon.api.spawning.archetypes.entities.pokemon.SpawnInfoPokemon;
import com.pixelmonmod.pixelmon.api.spawning.conditions.LocationType;
import com.pixelmonmod.pixelmon.api.spawning.util.SetLoader;
import com.pixelmonmod.pixelmon.api.world.WorldTime;
import com.pixelmonmod.pixelmon.battles.attacks.Attack;
import com.pixelmonmod.pixelmon.battles.attacks.AttackBase;
import com.pixelmonmod.pixelmon.comm.CommandChatHandler;
import com.pixelmonmod.pixelmon.entities.SpawnLocationType;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.BaseStats;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.StatsType;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.Evolution;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.BiomeCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.ChanceCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.EvoCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.EvoRockCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.FriendshipCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.GenderCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.HeldItemCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.HighAltitudeCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.LevelCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.MoveCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.MoveTypeCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.PartyCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.StatRatioCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.TimeCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.conditions.WeatherCondition;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.types.InteractEvolution;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.types.LevelingEvolution;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.evolution.types.TradeEvolution;
import com.pixelmonmod.pixelmon.enums.EnumEggGroup;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.enums.EnumType;
import com.pixelmonmod.pixelmon.spawning.PixelmonSpawning;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.item.Item;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class Wiki extends CommandBase
{
private static final List<String> info = Arrays.asList("moves", "biome", "time", "egggroup", "genderratio", "evo", "rarity", "catch", "ha", "fishing", "abilities", "basestats");
public String getName()
{
return "wiki";
}
public String getUsage(ICommandSender sender)
{
return "/wiki <pokemon> [form] <info> - displays the <info> of <pokemon>";
}
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public List<String> getAliases()
{
return Arrays.asList("pinfo", "pokeinfo");
}
@Override
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if(args.length == 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getUsage(sender));
return;
}
String name = args[0];
if (args.length == 2) {
String infoType = args[1];
if (EnumSpecies.hasPokemonAnyCase(name)) {
Pokemon pokemon = Pixelmon.pokemonFactory.create(EnumSpecies.getFromNameAnyCase(name));
sendInfo(pokemon, sender, infoType);
} else {
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "%s is not a valid Pixelmon name", name);
}
}else if (args.length == 3)
{
String infoType = args[2];
Pokemon pokemon = Pixelmon.pokemonFactory.create(EnumSpecies.getFromNameAnyCase(name));
PokemonSpec.from(args[1]).apply(pokemon);
sendInfo(pokemon, sender, infoType);
} else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, getUsage(sender));
}
}
private void sendInfo(Pokemon pokemon, ICommandSender sender, String infoType){
if(info.contains(infoType))
{
if(infoType.equalsIgnoreCase("moves"))
{
HashMap<Integer, ArrayList<Attack>> moves = pokemon.getBaseStats().levelUpMoves;
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "can learn the following moves through level-up:", pokemon.getDisplayName());
ArrayList<Entry<Integer, ArrayList<Attack>>> orderedEntries = new ArrayList<>();
for(Entry<Integer, ArrayList<Attack>> entry : moves.entrySet())
{
int index;
for (index = 0; index < orderedEntries.size(); index++)
if (orderedEntries.get(index).getKey() > entry.getKey())
break;
orderedEntries.add(index, entry);
}
for (Entry<Integer, ArrayList<Attack>> entry : orderedEntries)
{
StringBuilder msg = new StringBuilder(TextFormatting.GOLD + "Level " + TextFormatting.DARK_AQUA + entry.getKey() + TextFormatting.GOLD + ": ");
Object[] translations = new TextComponentTranslation[entry.getValue().size()];
int i = 0;
for (Attack attack : entry.getValue())
{
msg.append(TextFormatting.DARK_AQUA).append("%s").append(TextFormatting.GOLD).append(", ");
translations[i++] = (TextComponentTranslation)TextUtil.applyColour(attack.baseAttack.getTranslatedName(), TextFormatting.DARK_AQUA);
}
msg = new StringBuilder(msg.substring(0, msg.length() - 2));
sender.sendMessage(new TextComponentTranslation(msg.toString(), translations));
}
}
else if(infoType.equalsIgnoreCase("biome"))
{
ArrayList<Biome> allBiomes = new ArrayList<>();
for (Biome biome : GameRegistry.findRegistry(Biome.class)) {
allBiomes.add(biome);
}
for (SpawnSet set : SetLoader.<SpawnSet>getAllSets()) {
if (allBiomes.isEmpty()) {
break;
}
for (SpawnInfo info : set.spawnInfos) {
if (info instanceof SpawnInfoPokemon) {
if (((SpawnInfoPokemon) info).getPokemonSpec().name.equalsIgnoreCase(pokemon.getSpecies().name)) {
if(((SpawnInfoPokemon) info).getPokemonSpec().form != null){
if(pokemon.getFormEnum().getForm() == ((SpawnInfoPokemon) info).getPokemonSpec().form){
if (info.condition != null && info.condition.biomes != null && !info.condition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> !info.condition.biomes.contains(biome));
}
if (info.anticondition != null && info.anticondition.biomes != null && !info.anticondition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> info.anticondition.biomes.contains(biome));
}
if (info.compositeCondition != null) {
if (info.compositeCondition.conditions != null) {
info.compositeCondition.conditions.forEach(condition -> {
if (condition.biomes != null && !condition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> !condition.biomes.contains(biome));
}
});
}
if (info.compositeCondition.anticonditions != null) {
info.compositeCondition.anticonditions.forEach(anticondition -> {
if (anticondition.biomes != null && anticondition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> anticondition.biomes.contains(biome));
}
});
}
}
}
}else {
if (info.condition != null && info.condition.biomes != null && !info.condition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> !info.condition.biomes.contains(biome));
}
if (info.anticondition != null && info.anticondition.biomes != null && !info.anticondition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> info.anticondition.biomes.contains(biome));
}
if (info.compositeCondition != null) {
if (info.compositeCondition.conditions != null) {
info.compositeCondition.conditions.forEach(condition -> {
if (condition.biomes != null && !condition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> !condition.biomes.contains(biome));
}
});
}
if (info.compositeCondition.anticonditions != null) {
info.compositeCondition.anticonditions.forEach(anticondition -> {
if (anticondition.biomes != null && anticondition.biomes.isEmpty()) {
allBiomes.removeIf(biome -> anticondition.biomes.contains(biome));
}
});
}
}
}
}
}
}
}
ArrayList<String> biomeNames = new ArrayList<>();
for (Biome biome : allBiomes) {
biomeNames.add(biome.biomeName);
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "spawns in these biomes:", pokemon.getDisplayName());
StringBuilder message = new StringBuilder(TextFormatting.RED + "None.");
if (!biomeNames.isEmpty()) {
Collections.sort(biomeNames);
message = new StringBuilder(TextFormatting.DARK_AQUA + biomeNames.get(0));
for (int i = 1; i < biomeNames.size(); i++) {
message.append(TextFormatting.GOLD + ", " + TextFormatting.DARK_AQUA).append(biomeNames.get(i));
}
}
CommandChatHandler.sendChat(sender, message.toString());
}
else if(infoType.equalsIgnoreCase("fishing"))
{
ArrayList<Biome> biomes = new ArrayList<>();
for(SpawnSet spawnSet : PixelmonSpawning.fishingSpawner.spawnSets)
{
for(SpawnInfo info : spawnSet.spawnInfos)
{
if(info instanceof SpawnInfoPokemon)
{
if(((SpawnInfoPokemon) info).getPokemonSpec().name.equalsIgnoreCase(pokemon.getSpecies().name))
{
for(Biome biome : info.condition.biomes)
{
if(!biomes.contains(biome))
{
biomes.add(biome);
}
}
}
}
}
}
ArrayList<String> biomeNames = new ArrayList<>();
for(Biome biome : biomes)
{
biomeNames.add(biome.biomeName);
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "can be fished in these biomes:", pokemon.getDisplayName());
StringBuilder message = new StringBuilder(TextFormatting.RED + "None.");
if(!biomeNames.isEmpty())
{
Collections.sort(biomeNames);
message = new StringBuilder(TextFormatting.DARK_AQUA + biomeNames.get(0));
for(int i = 1; i < biomeNames.size(); i++)
{
message.append(TextFormatting.GOLD + ", " + TextFormatting.DARK_AQUA).append(biomeNames.get(i));
}
}
CommandChatHandler.sendChat(sender, message.toString());
}
else if(infoType.equalsIgnoreCase("time"))
{
ArrayList<WorldTime> times = new ArrayList<>();
for(SpawnSet set : SetLoader.<SpawnSet> getAllSets())
{
for(SpawnInfo info : set.spawnInfos)
{
if(info instanceof SpawnInfoPokemon)
{
if(((SpawnInfoPokemon) info).getPokemonSpec().name.equalsIgnoreCase(pokemon.getSpecies().name))
{
times = info.condition.times;
}
}
}
}
if(times == null || times.isEmpty())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "spawns at any time.", pokemon.getDisplayName());
return;
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "spawns at these times:", pokemon.getDisplayName());
for(WorldTime time : times)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.DARK_AQUA, time.name());
}
}
else if(infoType.equalsIgnoreCase("egggroup"))
{
EnumEggGroup[] eggGroups = pokemon.getBaseStats().eggGroups;
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s" + TextFormatting.GOLD + "'s egg groups are:", pokemon.getDisplayName());
StringBuilder msg = new StringBuilder();
for(EnumEggGroup egg : eggGroups)
{
msg.append(TextFormatting.DARK_AQUA).append(egg.name()).append(TextFormatting.GOLD).append(", ");
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RESET, msg.substring(0, msg.length() - 2));
}
else if(infoType.equalsIgnoreCase("genderratio"))
{
int male = pokemon.getBaseStats().malePercent;
if(male == -1)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "is genderless.", pokemon.getDisplayName());
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.YELLOW + pokemon.getDisplayName() + TextFormatting.GOLD + " is male " + TextFormatting.DARK_AQUA + male + "%" + TextFormatting.GOLD + " of the time"));
}
}
else if(infoType.equalsIgnoreCase("evo"))
{
ArrayList<Evolution> evolutions = pokemon.getBaseStats().evolutions;
if(evolutions == null || evolutions.size() == 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "does not evolve.", pokemon.getDisplayName());
return;
}
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "evolutions: ", pokemon.getDisplayName());
for(Evolution evolution : evolutions)
{
if(evolution == null)
{
continue; // Possible, though very unlikely.
}
StringBuilder baseMsg = new StringBuilder(TextFormatting.YELLOW + " " + evolution.to.name + ": " + TextFormatting.GREEN + "Levelling up ");
if(evolution instanceof LevelingEvolution)
{
LevelingEvolution levelingEvolution = (LevelingEvolution) evolution;
if(levelingEvolution.level != null && levelingEvolution.level > 1)
{
baseMsg.append("to level ").append(levelingEvolution.level);
}
}
else if(evolution instanceof InteractEvolution)
{
baseMsg = new StringBuilder(TextFormatting.YELLOW + " " + evolution.to.name + ": " + TextFormatting.AQUA + "When exposed to " + ((InteractEvolution) evolution).item.getItemStack().getDisplayName());
}
else if(evolution instanceof TradeEvolution)
{
TradeEvolution tradeEvo = (TradeEvolution) evolution;
if(tradeEvo.with != null)
{
baseMsg = new StringBuilder(TextFormatting.YELLOW + " " + evolution.to.name + ": " + TextFormatting.LIGHT_PURPLE + "Trading with " + tradeEvo.with.name);
}
else
{
baseMsg = new StringBuilder(TextFormatting.YELLOW + " " + evolution.to.name + ": " + TextFormatting.LIGHT_PURPLE + "Trading");
}
}
else // Is a kind of evolution not in Pixelmon by default
{
Pixelmon.EVENT_BUS.post(new UnknownEvolutionTypeEvent(sender, evolution));
}
CommandChatHandler.sendChat(sender, baseMsg.toString());
if(evolution.conditions != null && !evolution.conditions.isEmpty())
{
TextFormatting headingColour = TextFormatting.GOLD;
TextFormatting valueColour = TextFormatting.DARK_AQUA;
CommandChatHandler.sendChat(sender, TextFormatting.GOLD + " " + TextFormatting.UNDERLINE + "Conditions:");
for(EvoCondition condition : evolution.conditions)
{
if(condition instanceof BiomeCondition)
{
BiomeCondition biomeCondition = (BiomeCondition) condition;
StringBuilder biomes = new StringBuilder(headingColour + "Biomes: " + valueColour);
for(int i = 0; i < biomeCondition.biomes.size(); i++)
{
Biome b = Biome.REGISTRY.getObject(new ResourceLocation(biomeCondition.biomes.get(i)));
String biomeName = b == null ? biomeCondition.biomes.get(i) : b.biomeName;
if(i == 0)
{
biomes.append(biomeName);
}
else
{
biomes.append(headingColour).append(", ").append(valueColour).append(biomeName);
}
}
CommandChatHandler.sendChat(sender, " " + biomes);
}
else if(condition instanceof ChanceCondition)
{
ChanceCondition chanceCondition = (ChanceCondition) condition;
CommandChatHandler.sendChat(sender, " " + valueColour + chanceCondition.chance * 100 + " percent chance");
}
else if(condition instanceof EvoRockCondition)
{
EvoRockCondition evoRockCond = (EvoRockCondition) condition;
CommandChatHandler.sendChat(sender, " " + headingColour + "Within " + valueColour + Math.sqrt(evoRockCond.maxRangeSquared) + " " + headingColour + "blocks of a " + valueColour + evoRockCond.evolutionRock.name());
}
else if(condition instanceof FriendshipCondition)
{
CommandChatHandler.sendChat(sender, " " + headingColour + "Friendship: " + valueColour + ((FriendshipCondition) condition).friendship);
}
else if(condition instanceof GenderCondition)
{
GenderCondition genderCondition = (GenderCondition) condition;
StringBuilder genders = new StringBuilder(headingColour + "Genders: " + valueColour + genderCondition.genders.get(0).name());
for(int i = 1; i < genderCondition.genders.size(); i++)
{
genders.append(headingColour).append(", ").append(valueColour).append(genderCondition.genders.get(i).name());
}
CommandChatHandler.sendChat(sender, " " + genders);
}
else if(condition instanceof HeldItemCondition)
{
HeldItemCondition heldItemCondition = (HeldItemCondition) condition;
CommandChatHandler.sendChat(sender, " " + headingColour + "Held item: " + valueColour + (Item.getByNameOrId(heldItemCondition.item.itemID) == null ? heldItemCondition.item.itemID : I18n.translateToLocal(Item.getByNameOrId(heldItemCondition.item.itemID).getUnlocalizedName() + ".name")));
}
else if(condition instanceof HighAltitudeCondition)
{
HighAltitudeCondition altitudeCondition = (HighAltitudeCondition) condition;
CommandChatHandler.sendChat(sender, " " + headingColour + "Above altitude: " + valueColour + (int) altitudeCondition.minAltitude);
}
else if(condition instanceof LevelCondition)
{
CommandChatHandler.sendChat(sender, " " + headingColour + "Starting at level: " + (((LevelCondition) condition).level));
}
else if(condition instanceof MoveCondition)
{
CommandChatHandler.sendChat(sender, " " + headingColour + "Knowing move: " + valueColour + AttackBase.getAttackBase(((MoveCondition) condition).attackIndex).get().getTranslatedName());
}
else if(condition instanceof MoveTypeCondition)
{
CommandChatHandler.sendChat(sender, " " + headingColour + "With a move of type: " + valueColour + ((MoveTypeCondition) condition).type.getLocalizedName());
}
else if(condition instanceof PartyCondition)
{
ArrayList<EnumSpecies> withPokemon = new ArrayList<>();
ArrayList<EnumType> withTypes = new ArrayList<>();
PartyCondition partyCond = (PartyCondition) condition;
if(partyCond.withPokemon != null)
{
withPokemon = partyCond.withPokemon;
}
if(partyCond.withTypes != null)
{
withTypes = partyCond.withTypes;
}
if(!withPokemon.isEmpty())
{
StringBuilder pokemonWith = new StringBuilder(headingColour + " With these Pokémon in party: " + valueColour + withPokemon.get(0).name);
for(int i = 1; i < withPokemon.size(); i++)
{
pokemonWith.append(headingColour).append(", ").append(valueColour).append(withPokemon.get(i).name);
}
CommandChatHandler.sendChat(sender, pokemonWith.toString());
}
if(!withTypes.isEmpty())
{
StringBuilder typesWith = new StringBuilder(headingColour + " With Pokémon of these types in party: " + valueColour + withTypes.get(0).getLocalizedName());
for(int i = 1; i < withTypes.size(); i++)
{
typesWith.append(headingColour).append(", ").append(valueColour).append(withTypes.get(i).getLocalizedName());
}
CommandChatHandler.sendChat(sender, typesWith.toString());
}
}
else if(condition instanceof StatRatioCondition)
{
StatRatioCondition statCond = (StatRatioCondition) condition;
CommandChatHandler.sendChat(sender, headingColour + " With a stat ratio of " + valueColour + statCond.ratio + headingColour + " between " + valueColour + statCond.stat1.getLocalizedName() + headingColour + " and " + valueColour + statCond.stat2.getLocalizedName());
}
else if(condition instanceof TimeCondition)
{
CommandChatHandler.sendChat(sender, headingColour + " During: " + valueColour + (((TimeCondition) condition).time.name()));
}
else if(condition instanceof WeatherCondition)
{
CommandChatHandler.sendChat(sender, headingColour + " With weather: " + valueColour + "Rain");
}
else // Isn't one of Pixelmon's evolution types
{
Pixelmon.EVENT_BUS.post(new UnknownEvolutionConditionEvent(sender, condition));
}
}
}
}
}
else if(infoType.equalsIgnoreCase("rarity"))
{
float rarity = -1;
for(SpawnSet set : SetLoader.<SpawnSet> getAllSets())
{
for(SpawnInfo info : set.spawnInfos)
{
if(info instanceof SpawnInfoPokemon)
{
if(((SpawnInfoPokemon) info).getPokemonSpec().name.equalsIgnoreCase(pokemon.getSpecies().name))
{
rarity = info.rarity;
}
}
}
}
if(EnumSpecies.legendaries.contains(pokemon.getDisplayName()))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "is a legendary", pokemon.getDisplayName());
}
else if(rarity > 0)
{
sender.sendMessage(new TextComponentString(TextFormatting.GOLD + "The rarity of " + TextFormatting.YELLOW + pokemon.getDisplayName() + TextFormatting.GOLD + " is " + TextFormatting.DARK_AQUA + rarity));
}
else if(rarity <= 0)
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s " + TextFormatting.GOLD + "does not spawn", pokemon.getDisplayName());
}
}
else if(infoType.equalsIgnoreCase("catch"))
{
int rate;
rate = pokemon.getBaseStats().catchRate;
rate = (int) ((rate / 255.0) * 100);
sender.sendMessage(new TextComponentString(TextFormatting.GOLD + "The catch rate of " + TextFormatting.YELLOW + pokemon.getDisplayName() + TextFormatting.GOLD + " is " + TextFormatting.DARK_AQUA + rate));
}
else if(infoType.equalsIgnoreCase("ha"))
{
String ability = pokemon.getBaseStats().abilities[2];
if(ability == null || ability.isEmpty())
{
sender.sendMessage(new TextComponentString(TextFormatting.YELLOW + pokemon.getDisplayName() + TextFormatting.GOLD + " doesn't have a hidden ability"));
}
else
{
sender.sendMessage(new TextComponentString(TextFormatting.GOLD + "The hidden ability of " + TextFormatting.YELLOW + pokemon.getDisplayName() + TextFormatting.GOLD + " is " + TextFormatting.DARK_AQUA + ability));
}
}
else if(infoType.equalsIgnoreCase("abilities"))
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s" + TextFormatting.GOLD + "'s abilities are:", pokemon.getDisplayName());
for(String ability : pokemon.getBaseStats().abilities)
{
if(ability != null && !ability.isEmpty())
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.DARK_AQUA, ability);
}
}
}
else if(infoType.equalsIgnoreCase("basestats")){
CommandChatHandler.sendFormattedChat(sender, TextFormatting.YELLOW, "%s" + TextFormatting.GOLD + "'s base stats are:", pokemon.getDisplayName());
BaseStats bs = pokemon.getBaseStats();
CommandChatHandler.sendFormattedChat(sender, TextFormatting.DARK_AQUA, bs.get(StatsType.HP) + "/" + bs.get(StatsType.Attack) + "/" +bs.get(StatsType.Defence) + "/" +bs.get(StatsType.SpecialAttack) + "/" +bs.get(StatsType.SpecialDefence) + "/" +bs.get(StatsType.Speed));
}
}
else
{
CommandChatHandler.sendFormattedChat(sender, TextFormatting.RED, "Invalid option");
}
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if(args.length == 1)
{
return getListOfStringsMatchingLastWord(args, EnumSpecies.getNameList());
}
if(args.length == 2)
{
return getListOfStringsMatchingLastWord(args, info);
}
return super.getTabCompletions(server, sender, args, pos);
}
}
package com.pixelextras.config;
import java.util.UUID;
import com.pixelextras.commands.Breed;
import com.pixelextras.commands.Hatch;
import com.pixelextras.util.Cooldown;
import net.minecraftforge.common.config.Configuration;
public class CooldownsConfig
{
public static Configuration config;
public static String[] hatchUUIDArray;
public static String[] hatchTimeArray;
public static String[] breedUUIDArray;
public static String[] breedTimeArray;
public static String[] notifyUUIDArray;
public static String[] notifyBooleanArray;
public static void loadConfig(Configuration configuration)
{
config = configuration;
config.addCustomCategoryComment("Cooldowns", "Do NOT touch!");
hatchUUIDArray = config.getStringList("HatchUUID", "cooldowns", new String[] {}, "Don't touch this");
hatchTimeArray = config.getStringList("HatchTime", "cooldowns", new String[] {}, "Don't touch this");
for(int i = 0; i < hatchUUIDArray.length; i++)
{
String[] sigBits = hatchUUIDArray[i].split(":");
Cooldown cd = new Cooldown(new UUID(Long.parseLong(sigBits[0]), Long.parseLong(sigBits[1])), Long.parseLong(hatchTimeArray[i]));
Hatch.hatchCooldowns.put(cd.getPlayerUUID().toString(), cd);
}
breedUUIDArray = config.getStringList("BreedUUID", "cooldowns", new String[] {}, "Don't touch this");
breedTimeArray = config.getStringList("BreedTime", "cooldowns", new String[] {}, "Don't touch this");
for(int i = 0; i < breedUUIDArray.length; i++)
{
String[] sigBits = breedUUIDArray[i].split(":");
Cooldown cd = new Cooldown(new UUID(Long.parseLong(sigBits[0]), Long.parseLong(sigBits[1])), Long.parseLong(breedTimeArray[i]));
Breed.breedCooldowns.put(cd.getPlayerUUID().toString(), cd);
}
notifyUUIDArray = config.getStringList("NotifyUUID", "cooldowns", new String[] {}, "Don't touch this");
notifyBooleanArray = config.getStringList("NotifyBoolean", "cooldowns", new String[] {}, "Don't touch this");
for(int i = 0; i < notifyUUIDArray.length; i++)
{
String[] sigBits = notifyUUIDArray[i].split(":");
UUID playerUUID = new UUID(Long.parseLong(sigBits[0]), Long.parseLong(sigBits[1]));
boolean notify = Boolean.parseBoolean(notifyBooleanArray[i]);
Cooldown cd = Breed.breedCooldowns.get(playerUUID.toString());
cd.setNotifying(notify);
Breed.breedCooldowns.put(playerUUID.toString(), cd);
}
}
}
package com.pixelextras.config;
import com.pixelextras.PixelExtras;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
public class PixelExtrasConfig
{
public static Configuration config;
public static long hatchCooldown = 600;
public static long breedCooldown = 600;
public static boolean allowRandomLegendaries = false;
public static boolean allowRandomUltraBeasts = false;
public static boolean allowNotifications = false;
public static double expConversionRate = 1.0;
public static boolean checkEggIVs = true;
public static boolean notifyOPs = true;
public static boolean allowOfflineCheck = true;
public static void loadConfig(Configuration configuration)
{
config = configuration;
config.addCustomCategoryComment("general", "General settings for Pixel Extras");
Property propHatchCooldown = config.get("general", "Hatch Command Cooldown (in seconds)", 600);
hatchCooldown = propHatchCooldown.getInt(600) * 1000;
propHatchCooldown.setComment("Sets how long the time will be until the user can use /hatch again");
Property propBreedCooldown = config.get("general", "Breed Command Cooldown (in seconds)", 600);
breedCooldown = propBreedCooldown.getInt(600) * 1000;
propBreedCooldown.setComment("Sets how long the time will be until the user can use /breed again");
allowRandomLegendaries = config.get("general", "Allows legendaries via /pokerandom", false, "If true then /pokerandom can potentially select legendaries").getBoolean();
allowRandomUltraBeasts = config.get("general", "Allows ultra beasts via /pokerandom", false, "If true then /pokerandom can potentially select Ultra Beasts").getBoolean();
allowNotifications = config.get("general", "Allow /breed cooldown notifications", false, "If true then players can use /breeding true/false to enable/disable a cooldown message").getBoolean();
notifyOPs = config.get("general", "Notify OPs", true, "Notify OPs when players run certain commands").getBoolean();
checkEggIVs = config.get("general", "Check Egg IVs", true, "Whether or not /ivs will work on eggs").getBoolean();
allowOfflineCheck = config.get("general","Allow offline player via /pokesee etc",true,"If true then /pokesee, /poketake, /compsee, /compsearch, /comptake etc can be use on an offline player").getBoolean();
if(config.hasChanged())
{
config.save();
}
}
public static void readConfig() {
Configuration cfg = config;
try {
cfg.load();
} catch (Exception e1) {
System.out.println("Problem loading config file!");
} finally {
if (cfg.hasChanged()) {
cfg.save();
}
}
}
}
package com.pixelextras;
import java.io.File;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import com.pixelextras.commands.*;
import com.pixelextras.config.CooldownsConfig;
import com.pixelextras.config.PixelExtrasConfig;
import com.pixelextras.util.Cooldown;
import com.pixelextras.util.CooldownNotifier;
import com.pixelextras.util.FriendshipSpec;
import com.pixelextras.util.NonLegendaryFlag;
import com.pixelmonmod.pixelmon.api.pokemon.PokemonSpec;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.event.*;
@Mod(modid = PixelExtras.MODID, name = PixelExtras.NAME, version = PixelExtras.VERSION, acceptableRemoteVersions = "*", dependencies = "required-after:pixelmon")
public class PixelExtras
{
public static final String MODID = "pixelextras";
public static final String NAME = "Pixelmon Extras";
public static final String VERSION = "2.4.3";
@Mod.Instance(MODID)
public static PixelExtras instance;
Configuration config;
public static File configDirectory;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
instance = this;
configDirectory = event.getModConfigurationDirectory();
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
PixelExtrasConfig.loadConfig(config);
}
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
if(PixelExtrasConfig.allowNotifications)
{
MinecraftForge.EVENT_BUS.register(new CooldownNotifier());
}
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
}
@Mod.EventHandler
public void onServerStart(FMLServerStartingEvent event)
{
event.registerServerCommand(new Breed());
event.registerServerCommand(new Breeding());
event.registerServerCommand(new CompSearch());
event.registerServerCommand(new CompSee());
event.registerServerCommand(new CompTake());
event.registerServerCommand(new DexCheck());
event.registerServerCommand(new DisableBattle());
event.registerServerCommand(new EggSteps());
event.registerServerCommand(new Evolve());
event.registerServerCommand(new Evs());
event.registerServerCommand(new ExpMod());
event.registerServerCommand(new Faint());
event.registerServerCommand(new Gift());
event.registerServerCommand(new Hatch());
event.registerServerCommand(new HiddenPower());
event.registerServerCommand(new Ivs());
event.registerServerCommand(new Kill());
event.registerServerCommand(new Levelling());
event.registerServerCommand(new MoveList());
event.registerServerCommand(new NPCKill());
event.registerServerCommand(new PC());
event.registerServerCommand(new PokeClone());
//event.registerServerCommand(new PokeColour());
event.registerServerCommand(new PokeDel());
event.registerServerCommand(new PokeEdit());
//event.registerServerCommand(new PokeExp());
event.registerServerCommand(new PokeRandom());
event.registerServerCommand(new PokeReset());
event.registerServerCommand(new PokeRestart());
event.registerServerCommand(new PokeRetrieve());
event.registerServerCommand(new PokeSee());
event.registerServerCommand(new RandomLeg());
event.registerServerCommand(new RandomPokeType());
event.registerServerCommand(new RedeemFossil());
event.registerServerCommand(new Reload());
event.registerServerCommand(new SpawnCoords());
event.registerServerCommand(new Starter());
event.registerServerCommand(new Take());
event.registerServerCommand(new TM());
event.registerServerCommand(new TradeSim());
event.registerServerCommand(new Wiki());
config = new Configuration(new File(configDirectory + "/cooldowns.cfg"));
config.load();
CooldownsConfig.loadConfig(config);
PokemonSpec.extraSpecTypes.add(new FriendshipSpec(70));
PokemonSpec.extraSpecTypes.add(new NonLegendaryFlag());
}
@Mod.EventHandler
public void onServerStop(FMLServerStoppingEvent event)
{
Iterator<Cooldown> hatchit = Hatch.hatchCooldowns.values().iterator();
List<String> hatchUUIDs = new ArrayList<>();
List<String> hatchTimes = new ArrayList<>();
while(hatchit.hasNext())
{
Cooldown cd = hatchit.next();
hatchUUIDs.add(cd.getPlayerUUID().getMostSignificantBits() + ":" + cd.getPlayerUUID().getLeastSignificantBits());
hatchTimes.add("" + cd.getTimeUsed());
hatchit.remove();
}
Iterator<Cooldown> breedit = Breed.breedCooldowns.values().iterator();
Map<String, Cooldown> breedCooldowns = new ConcurrentHashMap<>();
List<String> breedUUIDs = new ArrayList<>();
List<String> breedTimes = new ArrayList<>();
while(breedit.hasNext())
{
Cooldown cd = breedit.next();
breedCooldowns.put(cd.getPlayerUUID().toString(), cd);
breedUUIDs.add(cd.getPlayerUUID().getMostSignificantBits() + ":" + cd.getPlayerUUID().getLeastSignificantBits());
breedTimes.add("" + cd.getTimeUsed());
breedit.remove();
}
Iterator<UUID> notifyit = CooldownNotifier.getNotifiers().iterator();
List<String> notifyUUIDs = new ArrayList<>();
List<String> notifyBooleans = new ArrayList<>();
while(notifyit.hasNext())
{
Cooldown cd = breedCooldowns.get(notifyit.next().toString());
notifyUUIDs.add(cd.getPlayerUUID().getMostSignificantBits() + ":" + cd.getPlayerUUID().getLeastSignificantBits());
notifyBooleans.add("" + cd.getNofifying());
notifyit.remove();
}
CooldownsConfig.config.get("Cooldowns", "HatchUUID", new String[] {}).set(hatchUUIDs.toArray(new String[0]));
CooldownsConfig.config.get("Cooldowns", "HatchTime", new String[] {}).set(hatchTimes.toArray(new String[0]));
CooldownsConfig.config.get("Cooldowns", "BreedUUID", new String[] {}).set(breedUUIDs.toArray(new String[0]));
CooldownsConfig.config.get("Cooldowns", "BreedTime", new String[] {}).set(breedTimes.toArray(new String[0]));
CooldownsConfig.config.get("Cooldowns", "NotifyUUID", new String[] {}).set(notifyUUIDs.toArray(new String[0]));
CooldownsConfig.config.get("Cooldowns", "NotifyBoolean", new String[] {}).set(notifyBooleans.toArray(new String[0]));
CooldownsConfig.config.save();
}
}
package com.pixelextras.util;
import java.util.UUID;
public class Cooldown
{
private UUID playerUUID;
private long timeUsed;
private boolean notifying = false;
public Cooldown(UUID playerUUID, long timeUsed)
{
this.playerUUID = playerUUID;
this.timeUsed = timeUsed;
}
public UUID getPlayerUUID()
{
return playerUUID;
}
public void setPlayerUUID(UUID playerUUID)
{
this.playerUUID = playerUUID;
}
public long getTimeUsed()
{
return timeUsed;
}
public void setTimeUsed(long timeUsed)
{
this.timeUsed = timeUsed;
}
public boolean getNofifying()
{
return notifying;
}
public void setNotifying(boolean notify)
{
this.notifying = notify;
}
public void toggleNotifying()
{
this.notifying = !notifying;
}
}
package com.pixelextras.util;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import com.pixelextras.PixelExtras;
import com.pixelextras.commands.Breed;
import com.pixelextras.config.PixelExtrasConfig;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
public class CooldownNotifier
{
private static List<UUID> toNotify = new ArrayList<>();
private long timer = PixelExtrasConfig.breedCooldown / 5000 * 20;
private long ticked = 0;
private final TextComponentTranslation CHAT = new TextComponentTranslation("chat.type.announcement", TextFormatting.GREEN + PixelExtras.NAME + TextFormatting.RESET, TextFormatting.LIGHT_PURPLE + "Your /breed cooldown is up!");
@SubscribeEvent
public void onServerTick(TickEvent.ServerTickEvent event)
{
if(event.phase == TickEvent.Phase.END)
{
if(ticked < timer)
{
ticked++;
return;
}
ticked = 0;
ArrayList<UUID> toNotifyCopy = new ArrayList<>(toNotify);
for(UUID playerUUID : toNotifyCopy)
{
Cooldown cd = Breed.breedCooldowns.get(playerUUID.toString());
if(System.currentTimeMillis() - cd.getTimeUsed() >= PixelExtrasConfig.breedCooldown)
{
EntityPlayerMP player = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerByUUID(playerUUID);
if(player != null)
{
player.sendMessage(CHAT);
}
toNotify.remove(playerUUID);
}
}
}
}
public static void addNotifier(UUID playerUUID)
{
if(!toNotify.contains(playerUUID))
{
toNotify.add(playerUUID);
}
}
public static void removeNotifier(UUID playerUUID)
{
toNotify.remove(playerUUID);
}
public static List<UUID> getNotifiers()
{
return toNotify;
}
}
package com.pixelextras.util;
import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.List;
import com.pixelmonmod.pixelmon.api.pokemon.ISpecType;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.api.pokemon.SpecValue;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import net.minecraft.nbt.NBTTagCompound;
/**
* Created by MoeBoy76 on 25/02/2019.
*/
public class FriendshipSpec extends SpecValue<Integer> implements ISpecType
{
public FriendshipSpec(Integer value)
{
super("friendship", value);
}
@Override
public List<String> getKeys()
{
return Arrays.asList("fr", "friend", "friendship");
}
@Override
public Class<Integer> getValueClass()
{
return Integer.class;
}
@Override
public void apply(EntityPixelmon pokemon)
{
pokemon.getPokemonData().setFriendship(value);
}
@Override
public void apply(NBTTagCompound nbtTagCompound)
{
}
@Override
public void apply(Pokemon pokemon)
{
pokemon.setFriendship(value);
}
@Override
public boolean matches(EntityPixelmon entityPixelmon)
{
return matches(entityPixelmon.getPokemonData());
}
@Override
public boolean matches(NBTTagCompound nbtTagCompound)
{
return false;
}
@Override
public boolean matches(Pokemon pokemon)
{
return pokemon.getFriendship() == value;
}
@Override
public SpecValue<Integer> clone()
{
return new FriendshipSpec(this.value);
}
@Override
public SpecValue<?> parse(@Nullable String s)
{
if(s == null)
{
return new FriendshipSpec(70);
}
try
{
return new FriendshipSpec(Integer.parseInt(s));
}
catch(NumberFormatException e)
{
return new FriendshipSpec(70);
}
}
@Override
public SpecValue<?> readFromNBT(NBTTagCompound nbtTagCompound)
{
return null;
}
@Override
public void writeToNBT(NBTTagCompound nbtTagCompound, SpecValue<?> specValue)
{
}
@Override
public Class<? extends SpecValue<?>> getSpecClass()
{
return FriendshipSpec.class;
}
@Override
public String toParameterForm(SpecValue<?> value) {
return value.key + ":" + value.value.toString();
}
}
package com.pixelextras.util;
import java.util.Arrays;
import java.util.List;
import com.pixelmonmod.pixelmon.api.pokemon.SpecFlag;
import com.pixelmonmod.pixelmon.api.pokemon.SpecValue;
import com.pixelmonmod.pixelmon.entities.pixelmon.EntityPixelmon;
import com.pixelmonmod.pixelmon.enums.EnumSpecies;
import com.pixelmonmod.pixelmon.storage.NbtKeys;
import net.minecraft.nbt.NBTTagCompound;
public class NonLegendaryFlag extends SpecFlag
{
public NonLegendaryFlag()
{
super("nonlegendary");
}
@Override
public boolean matches(EntityPixelmon pokemon)
{
return !EnumSpecies.legendaries.contains(pokemon.getName());
}
@Override
public boolean matches(NBTTagCompound nbt)
{
return !EnumSpecies.legendaries.contains(nbt.getCompoundTag(NbtKeys.FORGE_DATA).getString(NbtKeys.NAME));
}
@Override
public void apply(EntityPixelmon pokemon)
{
}
@Override
public void apply(NBTTagCompound nbt)
{
}
@Override
public SpecValue<Boolean> instantiate()
{
return new NonLegendaryFlag();
}
@Override
public List<String> getKeys()
{
return Arrays.asList("nl", "nonlegendary", "!legendary", "notlegendary");
}
}
package com.pixelextras.util;
import com.pixelmonmod.pixelmon.api.pokemon.Pokemon;
import com.pixelmonmod.pixelmon.battles.attacks.AttackBase;
import com.pixelmonmod.pixelmon.battles.attacks.specialAttacks.basic.HiddenPower;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.Gender;
import com.pixelmonmod.pixelmon.entities.pixelmon.stats.StatsType;
import com.pixelmonmod.pixelmon.enums.EnumGrowth;
import com.pixelmonmod.pixelmon.enums.EnumNature;
import com.pixelmonmod.pixelmon.enums.EnumType;
import com.pixelmonmod.pixelmon.storage.NbtKeys;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.event.HoverEvent;
import net.minecraft.util.text.event.HoverEvent.Action;
import net.minecraft.util.text.translation.I18n;
public class PixelmonHelper
{
public static boolean canLearnAbility(Pokemon p, String ability)
{
String[] abil = p.getBaseStats().abilities;
for(String s : abil)
{
if(s != null && s.equals(ability))
{
return true;
}
}
return false;
}
public static boolean isHidden(Pokemon p, String ability)
{
return p.getBaseStats().abilities[2] != null && p.getBaseStats().abilities[2].equalsIgnoreCase(ability);
}
@Deprecated
public static ITextComponent getHoverText(Pokemon pokemon, int... args)
{
NBTTagCompound nbt = new NBTTagCompound();
pokemon.writeToNBT(nbt);
return getHoverText(nbt, args);
}
@Deprecated
private static ITextComponent getHoverText(NBTTagCompound nbt, int... args)
{
ITextComponent statString = new TextComponentString("[Stats]");
statString.getStyle().setColor(TextFormatting.RED);
ITextComponent boxString = new TextComponentString("[Box Info]");
boxString.getStyle().setColor(TextFormatting.YELLOW);
if(args != null)
{
boxString.getStyle().setHoverEvent(new HoverEvent(Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.YELLOW + "Box: " + args[0] + " Slot: " + args[1])));
}
String itemText = "None";
if(nbt.hasKey(NbtKeys.HELD_ITEM_STACK) && !new ItemStack(nbt.getCompoundTag(NbtKeys.HELD_ITEM_STACK)).isEmpty())
{
itemText = I18n.translateToLocal(new ItemStack(nbt.getCompoundTag(NbtKeys.HELD_ITEM_STACK)).getItem().getUnlocalizedName() + ".name");
}
statString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.DARK_GREEN + TextFormatting.UNDERLINE + (nbt.getString(NbtKeys.NICKNAME).equals("") ? nbt.getString(NbtKeys.NAME) : nbt.getString(NbtKeys.NICKNAME)) + (nbt.getByte(NbtKeys.IS_SHINY) == 1 ? TextFormatting.YELLOW + "\u2605" : "") + "\n" + TextFormatting.AQUA + "Level: " + nbt.getInteger(NbtKeys.LEVEL) + "\n" + TextFormatting.YELLOW + "Nature: " + EnumNature.getNatureFromIndex(nbt.getShort(NbtKeys.NATURE)).toString() + "\n" + TextFormatting.GREEN + "Growth: " + EnumGrowth.getGrowthFromIndex(nbt.getShort(NbtKeys.GROWTH)).toString() + "\n" + TextFormatting.GOLD + "Ability: " + (nbt.getInteger(NbtKeys.ABILITY_SLOT) != 2 ? TextFormatting.GOLD : TextFormatting.GRAY) + nbt.getString(NbtKeys.ABILITY) + "\n" + TextFormatting.LIGHT_PURPLE + "Gender: " + Gender.getGender(nbt.getByte(NbtKeys.GENDER)).name() + "\n" + TextFormatting.DARK_PURPLE + "OT: " + nbt.getString(NbtKeys.ORIGINAL_TRAINER) + "\n" + TextFormatting.RED + "Item: " + itemText)));
ITextComponent evString = new TextComponentString("[EVs]");
evString.getStyle().setColor(TextFormatting.GOLD);
evString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.GOLD + TextFormatting.UNDERLINE + "EVs" + "\n" + TextFormatting.GOLD + "HP: " + nbt.getShort(NbtKeys.EV_HP) + "\n" + TextFormatting.GOLD + "Attack: " + nbt.getShort(NbtKeys.EV_ATTACK) + "\n" + TextFormatting.GOLD + "Defence: " + nbt.getShort(NbtKeys.EV_DEFENCE) + "\n" + TextFormatting.GOLD + "Sp. Attack: " + nbt.getShort(NbtKeys.EV_SPECIAL_ATTACK) + "\n" + TextFormatting.GOLD + "Sp. Defence: " + nbt.getShort(NbtKeys.EV_SPECIAL_DEFENCE) + "\n" + TextFormatting.GOLD + "Speed: " + nbt.getShort(NbtKeys.EV_SPEED))));
ITextComponent ivString = new TextComponentString("[IVs]");
ivString.getStyle().setColor(TextFormatting.LIGHT_PURPLE);
ivString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.LIGHT_PURPLE + TextFormatting.UNDERLINE + "IVs" + "\n" + TextFormatting.LIGHT_PURPLE + "HP: " + nbt.getByte(NbtKeys.IV_HP) + "\n" + TextFormatting.LIGHT_PURPLE + "Attack: " + nbt.getByte(NbtKeys.IV_ATTACK) + "\n" + TextFormatting.LIGHT_PURPLE + "Defence: " + nbt.getByte(NbtKeys.IV_DEFENCE) + "\n" + TextFormatting.LIGHT_PURPLE + "Sp. Attack: " + nbt.getByte(NbtKeys.IV_SP_ATT) + "\n" + TextFormatting.LIGHT_PURPLE + "Sp. Defence: " + nbt.getByte(NbtKeys.IV_SP_DEF) + "\n" + TextFormatting.LIGHT_PURPLE + "Speed: " + nbt.getByte(NbtKeys.IV_SPEED))));
ITextComponent movesString = new TextComponentString("[Moves]");
movesString.getStyle().setColor(TextFormatting.BLUE);
movesString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.BLUE + TextFormatting.UNDERLINE + "Moves" + "\n" + TextFormatting.BLUE + "Move 1: " + (nbt.hasKey(NbtKeys.PIXELMON_MOVE_ID + "0") ? AttackBase.getAttackBase(nbt.getShort(NbtKeys.PIXELMON_MOVE_ID + "0")).get().getLocalizedName() : "None") + "\n" + TextFormatting.BLUE + "Move 2: " + (nbt.hasKey(NbtKeys.PIXELMON_MOVE_ID + "1") ? AttackBase.getAttackBase(nbt.getShort(NbtKeys.PIXELMON_MOVE_ID + "1")).get().getLocalizedName() : "None") + "\n" + TextFormatting.BLUE + "Move 3: " + (nbt.hasKey(NbtKeys.PIXELMON_MOVE_ID + "2") ? AttackBase.getAttackBase(nbt.getShort(NbtKeys.PIXELMON_MOVE_ID + "2")).get().getLocalizedName() : "None") + "\n" + TextFormatting.BLUE + "Move 4: " + (nbt.hasKey(NbtKeys.PIXELMON_MOVE_ID + "3") ? AttackBase.getAttackBase(nbt.getShort(NbtKeys.PIXELMON_MOVE_ID + "3")).get().getLocalizedName() : "None"))));
ITextComponent baseString;
if(args != null)
{
baseString = new TextComponentTranslation((nbt.getByte(NbtKeys.IS_SHINY) == 1 ? TextFormatting.YELLOW : "") + nbt.getString(NbtKeys.NAME) + " %s %s %s %s %s", boxString, statString, evString, ivString, movesString);
}
else
{
baseString = new TextComponentTranslation((nbt.getByte(NbtKeys.IS_SHINY) == 1 ? TextFormatting.YELLOW : "") + nbt.getString(NbtKeys.NAME) + " %s %s %s %s", statString, evString, ivString, movesString);
}
baseString.getStyle().setColor(TextFormatting.GREEN);
return baseString;
}
public static ITextComponent getHoverTextPokemon(Pokemon pokemon, int... args)
{
ITextComponent statString = new TextComponentString("[Stats]");
statString.getStyle().setColor(TextFormatting.RED);
ITextComponent boxString = new TextComponentString("[Box Info]");
boxString.getStyle().setColor(TextFormatting.YELLOW);
if (args != null && args.length > 0)
boxString.getStyle().setHoverEvent(new HoverEvent(Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.YELLOW + "Box: " + args[0] + " Slot: " + args[1])));
String itemText = "None";
if(!pokemon.getHeldItem().isEmpty())
itemText = I18n.translateToLocal(pokemon.getHeldItem().getItem().getUnlocalizedName() + ".name");
statString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentTranslation("" + TextFormatting.DARK_GREEN + TextFormatting.UNDERLINE + (pokemon.getSpecies().name != null ? pokemon.getSpecies().name : pokemon.getNickname()) + (pokemon.isShiny() ? TextFormatting.YELLOW + "\u2605" : "") + "\n" + TextFormatting.AQUA + "Level: " + pokemon.getLevel() + "\n" + TextFormatting.YELLOW + "Nature: " + pokemon.getNature().toString() + "\n" + TextFormatting.GREEN + "Growth: " + pokemon.getGrowth().toString() + "\n" + TextFormatting.GOLD + "Ability: %s\n" + TextFormatting.LIGHT_PURPLE + "Gender: " + pokemon.getGender().name() + "\n" + TextFormatting.DARK_PURPLE + "OT: " + pokemon.getOriginalTrainer() + "\n" + TextFormatting.RED + "Item: " + itemText,
TextUtil.applyColour(new TextComponentTranslation(pokemon.getAbility().getUnlocalizedName()), pokemon.getAbilitySlot() == 2 ? TextFormatting.GOLD : TextFormatting.GRAY))));
ITextComponent evString = new TextComponentString("[EVs]");
evString.getStyle().setColor(TextFormatting.GOLD);
evString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.GOLD + TextFormatting.UNDERLINE + "EVs" + "\n" + TextFormatting.GOLD + "HP: " + pokemon.getEVs().get(StatsType.HP) + "\n" + TextFormatting.GOLD + "Attack: " + pokemon.getEVs().get(StatsType.Attack) + "\n" + TextFormatting.GOLD + "Defence: " + pokemon.getEVs().get(StatsType.Defence) + "\n" + TextFormatting.GOLD + "Sp. Attack: " + pokemon.getEVs().get(StatsType.SpecialAttack) + "\n" + TextFormatting.GOLD + "Sp. Defence: " + pokemon.getEVs().get(StatsType.SpecialDefence) + "\n" + TextFormatting.GOLD + "Speed: " + pokemon.getEVs().get(StatsType.Speed))));
ITextComponent ivString = new TextComponentString("[IVs]");
ivString.getStyle().setColor(TextFormatting.LIGHT_PURPLE);
ivString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("" + TextFormatting.LIGHT_PURPLE + TextFormatting.UNDERLINE + "IVs" + "\n" + TextFormatting.LIGHT_PURPLE + "HP: " + pokemon.getIVs().get(StatsType.HP) + "\n" + TextFormatting.LIGHT_PURPLE + "Attack: " + pokemon.getIVs().get(StatsType.Attack) + "\n" + TextFormatting.LIGHT_PURPLE + "Defence: " + pokemon.getIVs().get(StatsType.Defence) + "\n" + TextFormatting.LIGHT_PURPLE + "Sp. Attack: " + pokemon.getIVs().get(StatsType.SpecialAttack) + "\n" + TextFormatting.LIGHT_PURPLE + "Sp. Defence: " + pokemon.getIVs().get(StatsType.SpecialDefence) + "\n" + TextFormatting.LIGHT_PURPLE + "Speed: " + pokemon.getIVs().get(StatsType.Speed))));
ITextComponent movesString = new TextComponentString("[Moves]");
movesString.getStyle().setColor(TextFormatting.BLUE);
movesString.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new TextComponentTranslation("" + TextFormatting.BLUE + TextFormatting.UNDERLINE + "Moves" + "\n" + TextFormatting.BLUE + "Move 1: %s\n" + TextFormatting.BLUE + "Move 2: %s\n" + TextFormatting.BLUE + "Move 3: %s\n" + TextFormatting.BLUE + "Move 4: %s",
TextUtil.applyColour(new TextComponentTranslation(pokemon.getMoveset().get(0) != null ? pokemon.getMoveset().get(0).baseAttack.getUnlocalizedName() : "None"), TextFormatting.BLUE),
TextUtil.applyColour(new TextComponentTranslation(pokemon.getMoveset().get(1) != null ? pokemon.getMoveset().get(1).baseAttack.getUnlocalizedName() : "None"), TextFormatting.BLUE),
TextUtil.applyColour(new TextComponentTranslation(pokemon.getMoveset().get(2) != null ? pokemon.getMoveset().get(2).baseAttack.getUnlocalizedName() : "None"), TextFormatting.BLUE),
TextUtil.applyColour(new TextComponentTranslation(pokemon.getMoveset().get(3) != null ? pokemon.getMoveset().get(3).baseAttack.getUnlocalizedName() : "None"), TextFormatting.BLUE))));
ITextComponent baseString;
if (args != null && args.length > 0)
baseString = new TextComponentTranslation((pokemon.isShiny() ? TextFormatting.YELLOW : "") + pokemon.getSpecies().name + " %s %s %s %s %s", boxString, statString, evString, ivString, movesString);
else
baseString = new TextComponentTranslation((pokemon.isShiny() ? TextFormatting.YELLOW : "") + pokemon.getSpecies().name + " %s %s %s %s", statString, evString, ivString, movesString);
baseString.getStyle().setColor(TextFormatting.GREEN);
return baseString;
}
public static EnumType checkStats(Pokemon p)
{
return HiddenPower.getHiddenPowerType(p.getIVs());
}
}
package com.pixelextras.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
public class TabCompletion
{
/**
* Returns true if the given substring is exactly equal to the start of the
* given string (case insensitive).
*/
private static boolean doesStringStartWith(String par0Str, String par1Str)
{
return par1Str.regionMatches(true, 0, par0Str, 0, par0Str.length());
}
public static List<String> getListOfStringsMatchingLastWordCustom(String[] par0ArrayOfStr, int start, String... par1ArrayOfStr)
{
return getListOfStringsMatchingLastWordCustom(par0ArrayOfStr, start, Arrays.asList(par1ArrayOfStr));
}
public static List<String> getListOfStringsMatchingLastWordCustom(String[] par0ArrayOfStr, int start, Collection<String> list)
{
String s1 = par0ArrayOfStr[par0ArrayOfStr.length - 1].substring(start);
List<String> arraylist = new ArrayList<>();
for(String s2 : list)
{
if(s2 != null && doesStringStartWith(s1, s2))
{
arraylist.add(par0ArrayOfStr[par0ArrayOfStr.length - 1].substring(0, start) + s2);
}
}
return arraylist;
}
}
package com.pixelextras.util;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
public class TextUtil
{
public static ITextComponent applyColour(ITextComponent component, TextFormatting colour)
{
component.getStyle().setColor(colour);
return component;
}
}
[
{
"modid": "pixelextras",
"name": "Pixel Extras",
"description": "Pixelmon commands side-mod",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "http://pixelmonmod.com/downloads.php",
"updateUrl": "http://pixelmonmod.com/downloads.php",
"authorList": ["Rhonim", "MoeBoy76", "Hiroku"],
"credits": "",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
public net.minecraft.world.biome.Biome field_76791_y # The English name of the biome.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment