commit 8b46b2b687a955966afbe33d0a705877c196d5dd Author: Halbear Date: Wed Apr 29 22:28:28 2026 +0100 initial commit diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..d73085d --- /dev/null +++ b/.classpath @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5daf14c --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +/run/ +/models/ +/elements/ +/build/ +/.settings/ +/.mcreator/ +/.idea/ +/.gradle/ +/hem.mcreator +/mcreator.gradle diff --git a/.project b/.project new file mode 100644 index 0000000..12d808a --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + 1.16.5 + + + + org.eclipse.jdt.core.javanature + + + + org.eclipse.jdt.core.javabuilder + + + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..1b9fa83 --- /dev/null +++ b/build.gradle @@ -0,0 +1,79 @@ +buildscript { + repositories { + maven { url = 'https://maven.minecraftforge.net' } + maven { url = 'https://repo.spongepowered.org/maven' } + mavenCentral() + } + dependencies { + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true + classpath 'org.spongepowered:mixingradle:0.7.+' + } +} +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'org.spongepowered.mixin' +apply plugin: 'eclipse' + +version = '1.0' +group = 'studio.halbear.hem' +archivesBaseName = 'hem' + +java.toolchain.languageVersion = JavaLanguageVersion.of(8) + +minecraft { + mappings channel: 'snapshot', version: '20201028-1.16.3' + + runs { + client { + workingDirectory project.file('run') + arg "-mixin.config=hem.mixin.json" + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + jvmArgs = [ + "--add-exports=java.base/sun.security.util=ALL-UNNAMED", + "--add-opens=java.base/java.util.jar=ALL-UNNAMED" + ] + + mods { + hem { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + jvmArgs = [ + "--add-exports=java.base/sun.security.util=ALL-UNNAMED", + "--add-opens=java.base/java.util.jar=ALL-UNNAMED" + ] + + mods { + hem { + source sourceSets.main + } + } + } + } +} +tasks.named('jar', Jar).configure { + manifest { + attributes([ + 'TweakClass' : 'org.spongepowered.asm.launch.MixinTweaker', + 'TweakOrder' : 0, + 'MixinConfigs' : 'hem.mixin.json' + ]) + } + rename 'mixin.refmap.json', 'hem.mixin-refmap.json' +} +dependencies { + minecraft 'net.minecraftforge:forge:1.16.5-36.2.26' +} + +apply from: 'mcreator.gradle' + diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..7454180 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..ffed3a2 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# 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\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# 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 +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +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" -a "$nonstop" = "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"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # 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 + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@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 + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@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= + +@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 Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_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=%* + +: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 diff --git a/hem_custom/mixin/CameraMixins.java b/hem_custom/mixin/CameraMixins.java new file mode 100644 index 0000000..9aea019 --- /dev/null +++ b/hem_custom/mixin/CameraMixins.java @@ -0,0 +1,30 @@ +package studio.halbear.hem_custom.mixin; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.settings.PointOfView; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.world.IBlockReader; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import static studio.halbear.hem_custom.vehicles.VehicleCameraSettings.GetCameraOffsets; + +@Mixin(ActiveRenderInfo.class) +public abstract class CameraMixins { + + @Inject(method = "update", at = @At(value = "TAIL"),cancellable = true) + private void update(IBlockReader currentRenderedLevel, Entity entity, boolean isDetached, boolean isMirrored, float partialTicks, CallbackInfo ci){ + + if(entity.isPassenger() && Minecraft.getInstance().gameSettings.getPointOfView() != PointOfView.FIRST_PERSON && entity.getRidingEntity().getClass().getName().contains("studio.halbear.hem.entity")){ + Vector3f Position = GetCameraOffsets(); + this.movePosition(-this.calcCameraDistance(Position.getZ()), Position.getY(), Position.getX()); + } + } + @Shadow protected abstract void movePosition(double p_216782_1_, double p_216782_3_, double p_216782_5_); + @Shadow protected abstract double calcCameraDistance(double p_216779_1_); +} diff --git a/hem_custom/vehicles/VehicleCameraSettings.java b/hem_custom/vehicles/VehicleCameraSettings.java new file mode 100644 index 0000000..4b246dc --- /dev/null +++ b/hem_custom/vehicles/VehicleCameraSettings.java @@ -0,0 +1,85 @@ +package studio.halbear.hem_custom.vehicles; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.PointOfView; +import net.minecraft.util.math.vector.Vector3f; +import net.minecraftforge.client.event.EntityViewRenderEvent; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; + +@Mod.EventBusSubscriber +public class VehicleCameraSettings { + private static Vector3f CamOffset = new Vector3f(0.0f, 0.0f, 0.0f); + private static Vector3f CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + private static float CamFOV = 0.0f; + private static float CamFOVExternal = 0.0f; + private static String CurrentEntity = ""; + private static boolean HemVehicle = false; + + public static Vector3f GetCameraOffsets(){ + return CamOffset; + } + + @SubscribeEvent + public static void PlayerTickEvent(TickEvent.PlayerTickEvent event) { + Minecraft minecraftInstance = Minecraft.getInstance(); + if (minecraftInstance.player != null && minecraftInstance.player.isPassenger() && minecraftInstance.player.getRidingEntity() != null + && CurrentEntity != minecraftInstance.player.getRidingEntity().getClass().getName()) { + CurrentEntity = minecraftInstance.player.getRidingEntity().getClass().getName(); + HemVehicle = CurrentEntity.contains("studio.halbear.hem.entity"); + switch (CurrentEntity) { + case "studio.halbear.hem.entity.HotAirBalloonEntity$CustomEntity" : //yeah i hardcoded ts + CamOffset = new Vector3f(0.0f, 1.0f, 4.0f); + CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + CamFOV = 70.0f; + CamFOVExternal = 80.0f; + break; + case "studio.halbear.hem.entity.AirboatEntity$CustomEntity" : + CamOffset = new Vector3f(0.0f, 4.0f, 16.0f); + CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + CamFOV = 70.0f; + CamFOVExternal = 65.0f; + break; + } + } + if (minecraftInstance.player != null && (!minecraftInstance.player.isPassenger() || !HemVehicle) + && (CamFOVExternal != (float) Minecraft.getInstance().gameSettings.fov + || CamFOV != (float) Minecraft.getInstance().gameSettings.fov || CamOffset.getX() != 0 || CamOffset.getY() != 0 + || CamOffset.getZ() != 0 || CamTransformations.getX() != 0 || CamTransformations.getY() != 0 + || CamTransformations.getZ() != 0)) { + CamOffset = new Vector3f(0.0f, 0.0f, 0.0f);// reset if the players not riding an entity and if any the values aren't 0 + CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + CamFOV = (float) Minecraft.getInstance().gameSettings.fov; + CamFOVExternal = (float) Minecraft.getInstance().gameSettings.fov; + if (!minecraftInstance.player.isPassenger()) + CurrentEntity = ""; + } + } + + @SubscribeEvent + public static void onCameraSetup(EntityViewRenderEvent.CameraSetup event) { // sets the Yaw, Roll, and Pitch for the camera, ONLY if its a HEM vehcile as to avoid unnecessary ticks + if (HemVehicle) { + event.setRoll(event.getRoll() + CamTransformations.getX()); + event.setYaw(event.getYaw() + CamTransformations.getY()); + event.setPitch(event.getPitch() + CamTransformations.getZ()); + } + } + + @SubscribeEvent + public static void onCameraSetup(EntityViewRenderEvent.FOVModifier event) { // sets the FOV + if (HemVehicle) { + Minecraft minecraftInstance = Minecraft.getInstance(); + if (minecraftInstance.player != null && minecraftInstance.gameRenderer != null) { + PointOfView Cam = minecraftInstance.gameSettings.getPointOfView(); + if (Cam == PointOfView.FIRST_PERSON) { + event.setFOV(CamFOV); + } else { + event.setFOV(CamFOVExternal); + } + } + } else if (event.getFOV() != Minecraft.getInstance().gameSettings.fov) { + event.setFOV(Minecraft.getInstance().gameSettings.fov); + } + } +} diff --git a/src/main/java/studio/halbear/hem/HemMod.java b/src/main/java/studio/halbear/hem/HemMod.java new file mode 100644 index 0000000..ba68604 --- /dev/null +++ b/src/main/java/studio/halbear/hem/HemMod.java @@ -0,0 +1,103 @@ +/* + * MCreator note: + * + * If you lock base mod element files, you can edit this file and the proxy files + * and they won't get overwritten. If you change your mod package or modid, you + * need to apply these changes to this file MANUALLY. + * + * Settings in @Mod annotation WON'T be changed in case of the base mod element + * files lock too, so you need to set them manually here in such case. + * + * Keep the HemModElements object in this class and all calls to this object + * INTACT in order to preserve functionality of mod elements generated by MCreator. + * + * If you do not lock base mod element files in Workspace settings, this file + * will be REGENERATED on each build. + * + */ +package studio.halbear.hem; + +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; + +import net.minecraftforge.fml.network.simple.SimpleChannel; +import net.minecraftforge.fml.network.NetworkRegistry; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.server.FMLServerStartingEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.item.Item; +import net.minecraft.entity.EntityType; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.block.Block; + +import java.util.function.Supplier; + +@Mod("hem") +public class HemMod { + public static final Logger LOGGER = LogManager.getLogger(HemMod.class); + private static final String PROTOCOL_VERSION = "1"; + public static final SimpleChannel PACKET_HANDLER = NetworkRegistry.newSimpleChannel(new ResourceLocation("hem", "hem"), () -> PROTOCOL_VERSION, + PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals); + public HemModElements elements; + + public HemMod() { + elements = new HemModElements(); + FMLJavaModLoadingContext.get().getModEventBus().register(this); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientLoad); + MinecraftForge.EVENT_BUS.register(new HemModFMLBusEvents(this)); + } + + private void init(FMLCommonSetupEvent event) { + elements.getElements().forEach(element -> element.init(event)); + } + + public void clientLoad(FMLClientSetupEvent event) { + elements.getElements().forEach(element -> element.clientLoad(event)); + } + + @SubscribeEvent + public void registerBlocks(RegistryEvent.Register event) { + event.getRegistry().registerAll(elements.getBlocks().stream().map(Supplier::get).toArray(Block[]::new)); + } + + @SubscribeEvent + public void registerItems(RegistryEvent.Register event) { + event.getRegistry().registerAll(elements.getItems().stream().map(Supplier::get).toArray(Item[]::new)); + } + + @SubscribeEvent + public void registerEntities(RegistryEvent.Register> event) { + event.getRegistry().registerAll(elements.getEntities().stream().map(Supplier::get).toArray(EntityType[]::new)); + } + + @SubscribeEvent + public void registerEnchantments(RegistryEvent.Register event) { + event.getRegistry().registerAll(elements.getEnchantments().stream().map(Supplier::get).toArray(Enchantment[]::new)); + } + + @SubscribeEvent + public void registerSounds(RegistryEvent.Register event) { + elements.registerSounds(event); + } + + private static class HemModFMLBusEvents { + private final HemMod parent; + + HemModFMLBusEvents(HemMod parent) { + this.parent = parent; + } + + @SubscribeEvent + public void serverLoad(FMLServerStartingEvent event) { + this.parent.elements.getElements().forEach(element -> element.serverLoad(event)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/HemModElements.java b/src/main/java/studio/halbear/hem/HemModElements.java new file mode 100644 index 0000000..104bee3 --- /dev/null +++ b/src/main/java/studio/halbear/hem/HemModElements.java @@ -0,0 +1,132 @@ +/* + * MCreator note: + * + * This file is autogenerated to connect all MCreator mod elements together. + * + */ +package studio.halbear.hem; + +import net.minecraftforge.forgespi.language.ModFileScanData; +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.event.server.FMLServerStartingEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.ModList; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.Tag; +import net.minecraft.network.PacketBuffer; +import net.minecraft.item.Item; +import net.minecraft.entity.EntityType; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.block.Block; + +import java.util.function.Supplier; +import java.util.function.Function; +import java.util.function.BiConsumer; +import java.util.Set; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.ArrayList; + +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; + +public class HemModElements { + public final List elements = new ArrayList<>(); + public final List> blocks = new ArrayList<>(); + public final List> items = new ArrayList<>(); + public final List>> entities = new ArrayList<>(); + public final List> enchantments = new ArrayList<>(); + public static Map sounds = new HashMap<>(); + + public HemModElements() { + try { + ModFileScanData modFileInfo = ModList.get().getModFileById("hem").getFile().getScanResult(); + Set annotations = modFileInfo.getAnnotations(); + for (ModFileScanData.AnnotationData annotationData : annotations) { + if (annotationData.getAnnotationType().getClassName().equals(ModElement.Tag.class.getName())) { + Class clazz = Class.forName(annotationData.getClassType().getClassName()); + if (clazz.getSuperclass() == HemModElements.ModElement.class) + elements.add((HemModElements.ModElement) clazz.getConstructor(this.getClass()).newInstance(this)); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + Collections.sort(elements); + elements.forEach(HemModElements.ModElement::initElements); + MinecraftForge.EVENT_BUS.register(new HemModVariables(this)); + } + + public void registerSounds(RegistryEvent.Register event) { + for (Map.Entry sound : sounds.entrySet()) + event.getRegistry().register(sound.getValue().setRegistryName(sound.getKey())); + } + + private int messageID = 0; + + public void addNetworkMessage(Class messageType, BiConsumer encoder, Function decoder, + BiConsumer> messageConsumer) { + HemMod.PACKET_HANDLER.registerMessage(messageID, messageType, encoder, decoder, messageConsumer); + messageID++; + } + + public List getElements() { + return elements; + } + + public List> getBlocks() { + return blocks; + } + + public List> getItems() { + return items; + } + + public List>> getEntities() { + return entities; + } + + public List> getEnchantments() { + return enchantments; + } + + public static class ModElement implements Comparable { + @Retention(RetentionPolicy.RUNTIME) + public @interface Tag { + } + + protected final HemModElements elements; + protected final int sortid; + + public ModElement(HemModElements elements, int sortid) { + this.elements = elements; + this.sortid = sortid; + } + + public void initElements() { + } + + public void init(FMLCommonSetupEvent event) { + } + + public void serverLoad(FMLServerStartingEvent event) { + } + + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + } + + @Override + public int compareTo(ModElement other) { + return this.sortid - other.sortid; + } + } +} diff --git a/src/main/java/studio/halbear/hem/HemModVariables.java b/src/main/java/studio/halbear/hem/HemModVariables.java new file mode 100644 index 0000000..dd6e6d4 --- /dev/null +++ b/src/main/java/studio/halbear/hem/HemModVariables.java @@ -0,0 +1,450 @@ +package studio.halbear.hem; + +import net.minecraftforge.fml.network.PacketDistributor; +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.event.AttachCapabilitiesEvent; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.common.capabilities.ICapabilitySerializable; +import net.minecraftforge.common.capabilities.CapabilityManager; +import net.minecraftforge.common.capabilities.CapabilityInject; +import net.minecraftforge.common.capabilities.Capability; + +import net.minecraft.world.storage.WorldSavedData; +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.IServerWorld; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Direction; +import net.minecraft.network.PacketBuffer; +import net.minecraft.nbt.INBT; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.Minecraft; + +import java.util.function.Supplier; + +public class HemModVariables { + public HemModVariables(HemModElements elements) { + elements.addNetworkMessage(WorldSavedDataSyncMessage.class, WorldSavedDataSyncMessage::buffer, WorldSavedDataSyncMessage::new, + WorldSavedDataSyncMessage::handler); + elements.addNetworkMessage(PlayerVariablesSyncMessage.class, PlayerVariablesSyncMessage::buffer, PlayerVariablesSyncMessage::new, + PlayerVariablesSyncMessage::handler); + FMLJavaModLoadingContext.get().getModEventBus().addListener(this::init); + } + + private void init(FMLCommonSetupEvent event) { + CapabilityManager.INSTANCE.register(PlayerVariables.class, new PlayerVariablesStorage(), PlayerVariables::new); + } + + @SubscribeEvent + public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { + if (!event.getPlayer().world.isRemote()) { + WorldSavedData mapdata = MapVariables.get(event.getPlayer().world); + WorldSavedData worlddata = WorldVariables.get(event.getPlayer().world); + if (mapdata != null) + HemMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) event.getPlayer()), + new WorldSavedDataSyncMessage(0, mapdata)); + if (worlddata != null) + HemMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) event.getPlayer()), + new WorldSavedDataSyncMessage(1, worlddata)); + } + } + + @SubscribeEvent + public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) { + if (!event.getPlayer().world.isRemote()) { + WorldSavedData worlddata = WorldVariables.get(event.getPlayer().world); + if (worlddata != null) + HemMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) event.getPlayer()), + new WorldSavedDataSyncMessage(1, worlddata)); + } + } + + public static class WorldVariables extends WorldSavedData { + public static final String DATA_NAME = "hem_worldvars"; + public boolean EmberleafMilitaryDefeated = false; + public double VehicleID = 0; + + public WorldVariables() { + super(DATA_NAME); + } + + public WorldVariables(String s) { + super(s); + } + + @Override + public void read(CompoundNBT nbt) { + EmberleafMilitaryDefeated = nbt.getBoolean("EmberleafMilitaryDefeated"); + VehicleID = nbt.getDouble("VehicleID"); + } + + @Override + public CompoundNBT write(CompoundNBT nbt) { + nbt.putBoolean("EmberleafMilitaryDefeated", EmberleafMilitaryDefeated); + nbt.putDouble("VehicleID", VehicleID); + return nbt; + } + + public void syncData(IWorld world) { + this.markDirty(); + if (world instanceof World && !world.isRemote()) + HemMod.PACKET_HANDLER.send(PacketDistributor.DIMENSION.with(((World) world)::getDimensionKey), + new WorldSavedDataSyncMessage(1, this)); + } + + static WorldVariables clientSide = new WorldVariables(); + + public static WorldVariables get(IWorld world) { + if (world instanceof ServerWorld) { + return ((ServerWorld) world).getSavedData().getOrCreate(WorldVariables::new, DATA_NAME); + } else { + return clientSide; + } + } + } + + public static class MapVariables extends WorldSavedData { + public static final String DATA_NAME = "hem_mapvars"; + + public MapVariables() { + super(DATA_NAME); + } + + public MapVariables(String s) { + super(s); + } + + @Override + public void read(CompoundNBT nbt) { + } + + @Override + public CompoundNBT write(CompoundNBT nbt) { + return nbt; + } + + public void syncData(IWorld world) { + this.markDirty(); + if (world instanceof World && !world.isRemote()) + HemMod.PACKET_HANDLER.send(PacketDistributor.ALL.noArg(), new WorldSavedDataSyncMessage(0, this)); + } + + static MapVariables clientSide = new MapVariables(); + + public static MapVariables get(IWorld world) { + if (world instanceof IServerWorld) { + return ((IServerWorld) world).getWorld().getServer().getWorld(World.OVERWORLD).getSavedData().getOrCreate(MapVariables::new, + DATA_NAME); + } else { + return clientSide; + } + } + } + + public static class WorldSavedDataSyncMessage { + public int type; + public WorldSavedData data; + + public WorldSavedDataSyncMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.data = this.type == 0 ? new MapVariables() : new WorldVariables(); + this.data.read(buffer.readCompoundTag()); + } + + public WorldSavedDataSyncMessage(int type, WorldSavedData data) { + this.type = type; + this.data = data; + } + + public static void buffer(WorldSavedDataSyncMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeCompoundTag(message.data.write(new CompoundNBT())); + } + + public static void handler(WorldSavedDataSyncMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + if (!context.getDirection().getReceptionSide().isServer()) { + if (message.type == 0) + MapVariables.clientSide = (MapVariables) message.data; + else + WorldVariables.clientSide = (WorldVariables) message.data; + } + }); + context.setPacketHandled(true); + } + } + + @CapabilityInject(PlayerVariables.class) + public static Capability PLAYER_VARIABLES_CAPABILITY = null; + + @SubscribeEvent + public void onAttachCapabilities(AttachCapabilitiesEvent event) { + if (event.getObject() instanceof PlayerEntity && !(event.getObject() instanceof FakePlayer)) + event.addCapability(new ResourceLocation("hem", "player_variables"), new PlayerVariablesProvider()); + } + + private static class PlayerVariablesProvider implements ICapabilitySerializable { + private final LazyOptional instance = LazyOptional.of(PLAYER_VARIABLES_CAPABILITY::getDefaultInstance); + + @Override + public LazyOptional getCapability(Capability cap, Direction side) { + return cap == PLAYER_VARIABLES_CAPABILITY ? instance.cast() : LazyOptional.empty(); + } + + @Override + public INBT serializeNBT() { + return PLAYER_VARIABLES_CAPABILITY.getStorage().writeNBT(PLAYER_VARIABLES_CAPABILITY, this.instance.orElseThrow(RuntimeException::new), + null); + } + + @Override + public void deserializeNBT(INBT nbt) { + PLAYER_VARIABLES_CAPABILITY.getStorage().readNBT(PLAYER_VARIABLES_CAPABILITY, this.instance.orElseThrow(RuntimeException::new), null, + nbt); + } + } + + private static class PlayerVariablesStorage implements Capability.IStorage { + @Override + public INBT writeNBT(Capability capability, PlayerVariables instance, Direction side) { + CompoundNBT nbt = new CompoundNBT(); + nbt.putDouble("BodyTemperature", instance.BodyTemperature); + nbt.putBoolean("DisableClientSideBlocks", instance.DisableClientSideBlocks); + nbt.putBoolean("Eaten", instance.Eaten); + nbt.putDouble("Fuel", instance.Fuel); + nbt.putDouble("GoalMPH", instance.GoalMPH); + nbt.putDouble("GooCooldown", instance.GooCooldown); + nbt.putDouble("Heat", instance.Heat); + nbt.putDouble("LastPlantTrapX", instance.LastPlantTrapX); + nbt.putDouble("LastPlantTrapY", instance.LastPlantTrapY); + nbt.putDouble("LastPlantTrapZ", instance.LastPlantTrapZ); + nbt.putDouble("LastPosX", instance.LastPosX); + nbt.putDouble("LastPosZ", instance.LastPosZ); + nbt.putDouble("MPH", instance.MPH); + nbt.putBoolean("PilotingVehicle", instance.PilotingVehicle); + nbt.putDouble("PilotingVehicleID", instance.PilotingVehicleID); + nbt.putDouble("PSI", instance.PSI); + nbt.putDouble("Speed", instance.Speed); + nbt.putBoolean("VehicleAccelerate", instance.VehicleAccelerate); + nbt.putBoolean("VehicleBackward", instance.VehicleBackward); + nbt.putBoolean("VehicleDecelerate", instance.VehicleDecelerate); + nbt.putBoolean("VehicleForward", instance.VehicleForward); + nbt.putBoolean("VehicleIncreasePressure", instance.VehicleIncreasePressure); + nbt.putDouble("VehicleOdometer", instance.VehicleOdometer); + nbt.putDouble("VehicleOdometerMetres", instance.VehicleOdometerMetres); + nbt.putBoolean("VehicleReleasePressure", instance.VehicleReleasePressure); + nbt.putBoolean("VehicleStrafeLeft", instance.VehicleStrafeLeft); + nbt.putBoolean("VehicleStrafeRight", instance.VehicleStrafeRight); + nbt.putBoolean("VehicleTurnLeft", instance.VehicleTurnLeft); + nbt.putBoolean("VehicleTurnRight", instance.VehicleTurnRight); + nbt.putDouble("VehicleYaw", instance.VehicleYaw); + nbt.putDouble("Altimeter", instance.Altimeter); + return nbt; + } + + @Override + public void readNBT(Capability capability, PlayerVariables instance, Direction side, INBT inbt) { + CompoundNBT nbt = (CompoundNBT) inbt; + instance.BodyTemperature = nbt.getDouble("BodyTemperature"); + instance.DisableClientSideBlocks = nbt.getBoolean("DisableClientSideBlocks"); + instance.Eaten = nbt.getBoolean("Eaten"); + instance.Fuel = nbt.getDouble("Fuel"); + instance.GoalMPH = nbt.getDouble("GoalMPH"); + instance.GooCooldown = nbt.getDouble("GooCooldown"); + instance.Heat = nbt.getDouble("Heat"); + instance.LastPlantTrapX = nbt.getDouble("LastPlantTrapX"); + instance.LastPlantTrapY = nbt.getDouble("LastPlantTrapY"); + instance.LastPlantTrapZ = nbt.getDouble("LastPlantTrapZ"); + instance.LastPosX = nbt.getDouble("LastPosX"); + instance.LastPosZ = nbt.getDouble("LastPosZ"); + instance.MPH = nbt.getDouble("MPH"); + instance.PilotingVehicle = nbt.getBoolean("PilotingVehicle"); + instance.PilotingVehicleID = nbt.getDouble("PilotingVehicleID"); + instance.PSI = nbt.getDouble("PSI"); + instance.Speed = nbt.getDouble("Speed"); + instance.VehicleAccelerate = nbt.getBoolean("VehicleAccelerate"); + instance.VehicleBackward = nbt.getBoolean("VehicleBackward"); + instance.VehicleDecelerate = nbt.getBoolean("VehicleDecelerate"); + instance.VehicleForward = nbt.getBoolean("VehicleForward"); + instance.VehicleIncreasePressure = nbt.getBoolean("VehicleIncreasePressure"); + instance.VehicleOdometer = nbt.getDouble("VehicleOdometer"); + instance.VehicleOdometerMetres = nbt.getDouble("VehicleOdometerMetres"); + instance.VehicleReleasePressure = nbt.getBoolean("VehicleReleasePressure"); + instance.VehicleStrafeLeft = nbt.getBoolean("VehicleStrafeLeft"); + instance.VehicleStrafeRight = nbt.getBoolean("VehicleStrafeRight"); + instance.VehicleTurnLeft = nbt.getBoolean("VehicleTurnLeft"); + instance.VehicleTurnRight = nbt.getBoolean("VehicleTurnRight"); + instance.VehicleYaw = nbt.getDouble("VehicleYaw"); + instance.Altimeter = nbt.getDouble("Altimeter"); + } + } + + public static class PlayerVariables { + public double BodyTemperature = 37.0; + public boolean DisableClientSideBlocks = false; + public boolean Eaten = false; + public double Fuel = 0; + public double GoalMPH = 0; + public double GooCooldown = 0; + public double Heat = 0; + public double LastPlantTrapX = 0; + public double LastPlantTrapY = 0; + public double LastPlantTrapZ = 0; + public double LastPosX = 0; + public double LastPosZ = 0; + public double MPH = 0; + public boolean PilotingVehicle = false; + public double PilotingVehicleID = 0; + public double PSI = 0; + public double Speed = 0; + public boolean VehicleAccelerate = false; + public boolean VehicleBackward = false; + public boolean VehicleDecelerate = false; + public boolean VehicleForward = false; + public boolean VehicleIncreasePressure = false; + public double VehicleOdometer = 0; + public double VehicleOdometerMetres = 0; + public boolean VehicleReleasePressure = false; + public boolean VehicleStrafeLeft = false; + public boolean VehicleStrafeRight = false; + public boolean VehicleTurnLeft = false; + public boolean VehicleTurnRight = false; + public double VehicleYaw = 0; + public double Altimeter = 0; + + public void syncPlayerVariables(Entity entity) { + if (entity instanceof ServerPlayerEntity) + HemMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) entity), new PlayerVariablesSyncMessage(this)); + } + } + + @SubscribeEvent + public void onPlayerLoggedInSyncPlayerVariables(PlayerEvent.PlayerLoggedInEvent event) { + if (!event.getPlayer().world.isRemote()) + ((PlayerVariables) event.getPlayer().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())) + .syncPlayerVariables(event.getPlayer()); + } + + @SubscribeEvent + public void onPlayerRespawnedSyncPlayerVariables(PlayerEvent.PlayerRespawnEvent event) { + if (!event.getPlayer().world.isRemote()) + ((PlayerVariables) event.getPlayer().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())) + .syncPlayerVariables(event.getPlayer()); + } + + @SubscribeEvent + public void onPlayerChangedDimensionSyncPlayerVariables(PlayerEvent.PlayerChangedDimensionEvent event) { + if (!event.getPlayer().world.isRemote()) + ((PlayerVariables) event.getPlayer().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())) + .syncPlayerVariables(event.getPlayer()); + } + + @SubscribeEvent + public void clonePlayer(PlayerEvent.Clone event) { + PlayerVariables original = ((PlayerVariables) event.getOriginal().getCapability(PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new PlayerVariables())); + PlayerVariables clone = ((PlayerVariables) event.getEntity().getCapability(PLAYER_VARIABLES_CAPABILITY, null).orElse(new PlayerVariables())); + clone.BodyTemperature = original.BodyTemperature; + clone.DisableClientSideBlocks = original.DisableClientSideBlocks; + clone.Eaten = original.Eaten; + clone.Fuel = original.Fuel; + clone.GoalMPH = original.GoalMPH; + clone.GooCooldown = original.GooCooldown; + clone.Heat = original.Heat; + clone.LastPlantTrapX = original.LastPlantTrapX; + clone.LastPlantTrapY = original.LastPlantTrapY; + clone.LastPlantTrapZ = original.LastPlantTrapZ; + clone.LastPosX = original.LastPosX; + clone.LastPosZ = original.LastPosZ; + clone.MPH = original.MPH; + clone.PilotingVehicle = original.PilotingVehicle; + clone.PilotingVehicleID = original.PilotingVehicleID; + clone.PSI = original.PSI; + clone.Speed = original.Speed; + clone.VehicleAccelerate = original.VehicleAccelerate; + clone.VehicleBackward = original.VehicleBackward; + clone.VehicleDecelerate = original.VehicleDecelerate; + clone.VehicleForward = original.VehicleForward; + clone.VehicleIncreasePressure = original.VehicleIncreasePressure; + clone.VehicleOdometer = original.VehicleOdometer; + clone.VehicleOdometerMetres = original.VehicleOdometerMetres; + clone.VehicleReleasePressure = original.VehicleReleasePressure; + clone.VehicleStrafeLeft = original.VehicleStrafeLeft; + clone.VehicleStrafeRight = original.VehicleStrafeRight; + clone.VehicleTurnLeft = original.VehicleTurnLeft; + clone.VehicleTurnRight = original.VehicleTurnRight; + clone.VehicleYaw = original.VehicleYaw; + clone.Altimeter = original.Altimeter; + if (!event.isWasDeath()) { + } + } + + public static class PlayerVariablesSyncMessage { + public PlayerVariables data; + + public PlayerVariablesSyncMessage(PacketBuffer buffer) { + this.data = new PlayerVariables(); + new PlayerVariablesStorage().readNBT(null, this.data, null, buffer.readCompoundTag()); + } + + public PlayerVariablesSyncMessage(PlayerVariables data) { + this.data = data; + } + + public static void buffer(PlayerVariablesSyncMessage message, PacketBuffer buffer) { + buffer.writeCompoundTag((CompoundNBT) new PlayerVariablesStorage().writeNBT(null, message.data, null)); + } + + public static void handler(PlayerVariablesSyncMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + if (!context.getDirection().getReceptionSide().isServer()) { + PlayerVariables variables = ((PlayerVariables) Minecraft.getInstance().player.getCapability(PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new PlayerVariables())); + variables.BodyTemperature = message.data.BodyTemperature; + variables.DisableClientSideBlocks = message.data.DisableClientSideBlocks; + variables.Eaten = message.data.Eaten; + variables.Fuel = message.data.Fuel; + variables.GoalMPH = message.data.GoalMPH; + variables.GooCooldown = message.data.GooCooldown; + variables.Heat = message.data.Heat; + variables.LastPlantTrapX = message.data.LastPlantTrapX; + variables.LastPlantTrapY = message.data.LastPlantTrapY; + variables.LastPlantTrapZ = message.data.LastPlantTrapZ; + variables.LastPosX = message.data.LastPosX; + variables.LastPosZ = message.data.LastPosZ; + variables.MPH = message.data.MPH; + variables.PilotingVehicle = message.data.PilotingVehicle; + variables.PilotingVehicleID = message.data.PilotingVehicleID; + variables.PSI = message.data.PSI; + variables.Speed = message.data.Speed; + variables.VehicleAccelerate = message.data.VehicleAccelerate; + variables.VehicleBackward = message.data.VehicleBackward; + variables.VehicleDecelerate = message.data.VehicleDecelerate; + variables.VehicleForward = message.data.VehicleForward; + variables.VehicleIncreasePressure = message.data.VehicleIncreasePressure; + variables.VehicleOdometer = message.data.VehicleOdometer; + variables.VehicleOdometerMetres = message.data.VehicleOdometerMetres; + variables.VehicleReleasePressure = message.data.VehicleReleasePressure; + variables.VehicleStrafeLeft = message.data.VehicleStrafeLeft; + variables.VehicleStrafeRight = message.data.VehicleStrafeRight; + variables.VehicleTurnLeft = message.data.VehicleTurnLeft; + variables.VehicleTurnRight = message.data.VehicleTurnRight; + variables.VehicleYaw = message.data.VehicleYaw; + variables.Altimeter = message.data.Altimeter; + } + }); + context.setPacketHandled(true); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/AntHillBlock.java b/src/main/java/studio/halbear/hem/block/AntHillBlock.java new file mode 100644 index 0000000..4cc6364 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/AntHillBlock.java @@ -0,0 +1,120 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.AntHillUpdateTickProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.MobEntity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class AntHillBlock extends HemModElements.ModElement { + @ObjectHolder("hem:ant_hill") + public static final Block block = null; + + public AntHillBlock(HemModElements instance) { + super(instance, 34); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.EARTH).sound(SoundType.GROUND).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.SHOVEL).setRequiresTool().notSolid().tickRandomly().setOpaque((bs, br, bp) -> false)); + setRegistryName("ant_hill"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(2, 0, 2, 14, 5, 14)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public PathNodeType getAiPathNodeType(BlockState state, IBlockReader world, BlockPos pos, MobEntity entity) { + return PathNodeType.WALKABLE; + } + + @Override + public Block.OffsetType getOffsetType() { + return Block.OffsetType.XZ; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(AntsBlock.block, (int) (2))); + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + super.tick(blockstate, world, pos, random); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + AntHillUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/AntsBlock.java b/src/main/java/studio/halbear/hem/block/AntsBlock.java new file mode 100644 index 0000000..f3e735c --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/AntsBlock.java @@ -0,0 +1,191 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.AntsEntityWalksOnTheBlockProcedure; +import studio.halbear.hem.procedures.AntsBlockAddedProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Mirror; +import net.minecraft.util.Direction; +import net.minecraft.state.StateContainer; +import net.minecraft.state.DirectionProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.PushReaction; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class AntsBlock extends HemModElements.ModElement { + @ObjectHolder("hem:ants") + public static final Block block = null; + + public AntsBlock(HemModElements instance) { + super(instance, 35); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block { + public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; + + public CustomBlock() { + super(Block.Properties.create(Material.PLANTS).sound(SoundType.BASALT).hardnessAndResistance(0.1f, 0f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.SHOVEL).speedFactor(0.8f).jumpFactor(0.9f).notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); + setRegistryName("ants"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + switch ((Direction) state.get(FACING)) { + case SOUTH : + default : + return VoxelShapes.or(makeCuboidShape(16, 0, 16, 0, 1, 0)) + + .withOffset(offset.x, offset.y, offset.z); + case NORTH : + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 1, 16)) + + .withOffset(offset.x, offset.y, offset.z); + case EAST : + return VoxelShapes.or(makeCuboidShape(16, 0, 0, 0, 1, 16)) + + .withOffset(offset.x, offset.y, offset.z); + case WEST : + return VoxelShapes.or(makeCuboidShape(0, 0, 16, 16, 1, 0)) + + .withOffset(offset.x, offset.y, offset.z); + } + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); + } + + public BlockState rotate(BlockState state, Rotation rot) { + return state.with(FACING, rot.rotate(state.get(FACING))); + } + + public BlockState mirror(BlockState state, Mirror mirrorIn) { + return state.rotate(mirrorIn.toRotation(state.get(FACING))); + } + + @Override + public boolean isReplaceable(BlockState state, BlockItemUseContext context) { + return context.getItem().getItem() != this.asItem(); + } + + @Override + public PushReaction getPushReaction(BlockState state) { + return PushReaction.DESTROY; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 0)); + } + + @Override + public void onBlockAdded(BlockState blockstate, World world, BlockPos pos, BlockState oldState, boolean moving) { + super.onBlockAdded(blockstate, world, pos, oldState, moving); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + AntsBlockAddedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + AntsEntityWalksOnTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void onEntityWalk(World world, BlockPos pos, Entity entity) { + super.onEntityWalk(world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + BlockState blockstate = world.getBlockState(pos); + + AntsEntityWalksOnTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BloomedBulbFlowerBlock.java b/src/main/java/studio/halbear/hem/block/BloomedBulbFlowerBlock.java new file mode 100644 index 0000000..6c069ba --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BloomedBulbFlowerBlock.java @@ -0,0 +1,144 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.BulbFlowerPlantRightClickedProcedure; +import studio.halbear.hem.procedures.BloomedBulbFlowerUpdateTickProcedure; +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BloomedBulbFlowerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:bloomed_bulb_flower") + public static final Block block = null; + + public BloomedBulbFlowerBlock(HemModElements instance) { + super(instance, 39); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.PLANTS).sound(SoundType.PLANT).hardnessAndResistance(1f, 1f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.HOE).doesNotBlockMovement().notSolid().tickRandomly().setOpaque((bs, br, bp) -> false)); + setRegistryName("bloomed_bulb_flower"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(-5, 0, -5, 21, 3, 21)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + super.tick(blockstate, world, pos, random); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BloomedBulbFlowerUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (true) + for (int l = 0; l < 1; ++l) { + double d0 = (x + 0.5) + (random.nextFloat() - 0.5) * 0.1D * 20; + double d1 = ((y + 0.7) + (random.nextFloat() - 0.5) * 0.1D) + 0.5; + double d2 = (z + 0.5) + (random.nextFloat() - 0.5) * 0.1D * 20; + world.addParticle(LilyPadParticlesParticle.particle, d0, d1, d2, 0, 0, 0); + } + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BulbFlowerPlantRightClickedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BloomedMuncherBlock.java b/src/main/java/studio/halbear/hem/block/BloomedMuncherBlock.java new file mode 100644 index 0000000..6b01e87 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BloomedMuncherBlock.java @@ -0,0 +1,405 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.BloomedMuncherUpdateTickProcedure; +import studio.halbear.hem.procedures.BloomedMuncherEntityCollidesInTheBlockProcedure; +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.items.wrapper.SidedInvWrapper; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.NonNullList; +import net.minecraft.util.Mirror; +import net.minecraft.util.Direction; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.LockableLootTileEntity; +import net.minecraft.state.StateContainer; +import net.minecraft.state.DirectionProperty; +import net.minecraft.network.play.server.SUpdateTileEntityPacket; +import net.minecraft.network.NetworkManager; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.inventory.container.INamedContainerProvider; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.ChestContainer; +import net.minecraft.inventory.ItemStackHelper; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.stream.IntStream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BloomedMuncherBlock extends HemModElements.ModElement { + @ObjectHolder("hem:bloomed_muncher") + public static final Block block = null; + @ObjectHolder("hem:bloomed_muncher") + public static final TileEntityType tileEntityType = null; + + public BloomedMuncherBlock(HemModElements instance) { + super(instance, 31); + FMLJavaModLoadingContext.get().getModEventBus().register(new TileEntityRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + private static class TileEntityRegisterHandler { + @SubscribeEvent + public void registerTileEntity(RegistryEvent.Register> event) { + event.getRegistry().register(TileEntityType.Builder.create(CustomTileEntity::new, block).build(null).setRegistryName("bloomed_muncher")); + } + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block { + public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; + + public CustomBlock() { + super(Block.Properties.create(Material.PLANTS).sound(SoundType.PLANT).hardnessAndResistance(1f, 1f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.HOE).doesNotBlockMovement().notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); + setRegistryName("bloomed_muncher"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + switch ((Direction) state.get(FACING)) { + case SOUTH : + default : + return VoxelShapes.or(makeCuboidShape(21, 0, 21, -5, 3, -5)) + + .withOffset(offset.x, offset.y, offset.z); + case NORTH : + return VoxelShapes.or(makeCuboidShape(-5, 0, -5, 21, 3, 21)) + + .withOffset(offset.x, offset.y, offset.z); + case EAST : + return VoxelShapes.or(makeCuboidShape(21, 0, -5, -5, 3, 21)) + + .withOffset(offset.x, offset.y, offset.z); + case WEST : + return VoxelShapes.or(makeCuboidShape(-5, 0, 21, 21, 3, -5)) + + .withOffset(offset.x, offset.y, offset.z); + } + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); + } + + public BlockState rotate(BlockState state, Rotation rot) { + return state.with(FACING, rot.rotate(state.get(FACING))); + } + + public BlockState mirror(BlockState state, Mirror mirrorIn) { + return state.rotate(mirrorIn.toRotation(state.get(FACING))); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public void onBlockAdded(BlockState blockstate, World world, BlockPos pos, BlockState oldState, boolean moving) { + super.onBlockAdded(blockstate, world, pos, oldState, moving); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + world.getPendingBlockTicks().scheduleTick(pos, this, 1); + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + super.tick(blockstate, world, pos, random); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BloomedMuncherUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + world.getPendingBlockTicks().scheduleTick(pos, this, 1); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (true) + for (int l = 0; l < 1; ++l) { + double d0 = (x + 0.5) + (random.nextFloat() - 0.5) * 0.1D * 20; + double d1 = ((y + 0.7) + (random.nextFloat() - 0.5) * 0.1D) + 0.5; + double d2 = (z + 0.5) + (random.nextFloat() - 0.5) * 0.1D * 20; + world.addParticle(LilyPadParticlesParticle.particle, d0, d1, d2, 0, 0, 0); + } + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BloomedMuncherEntityCollidesInTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public INamedContainerProvider getContainer(BlockState state, World worldIn, BlockPos pos) { + TileEntity tileEntity = worldIn.getTileEntity(pos); + return tileEntity instanceof INamedContainerProvider ? (INamedContainerProvider) tileEntity : null; + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new CustomTileEntity(); + } + + @Override + public boolean eventReceived(BlockState state, World world, BlockPos pos, int eventID, int eventParam) { + super.eventReceived(state, world, pos, eventID, eventParam); + TileEntity tileentity = world.getTileEntity(pos); + return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); + } + + @Override + public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { + if (state.getBlock() != newState.getBlock()) { + TileEntity tileentity = world.getTileEntity(pos); + if (tileentity instanceof CustomTileEntity) { + InventoryHelper.dropInventoryItems(world, pos, (CustomTileEntity) tileentity); + world.updateComparatorOutputLevel(pos, this); + } + + super.onReplaced(state, world, pos, newState, isMoving); + } + } + + @Override + public boolean hasComparatorInputOverride(BlockState state) { + return true; + } + + @Override + public int getComparatorInputOverride(BlockState blockState, World world, BlockPos pos) { + TileEntity tileentity = world.getTileEntity(pos); + if (tileentity instanceof CustomTileEntity) + return Container.calcRedstoneFromInventory((CustomTileEntity) tileentity); + else + return 0; + } + } + + public static class CustomTileEntity extends LockableLootTileEntity implements ISidedInventory { + private NonNullList stacks = NonNullList.withSize(0, ItemStack.EMPTY); + + protected CustomTileEntity() { + super(tileEntityType); + } + + @Override + public void read(BlockState blockState, CompoundNBT compound) { + super.read(blockState, compound); + if (!this.checkLootAndRead(compound)) { + this.stacks = NonNullList.withSize(this.getSizeInventory(), ItemStack.EMPTY); + } + ItemStackHelper.loadAllItems(compound, this.stacks); + } + + @Override + public CompoundNBT write(CompoundNBT compound) { + super.write(compound); + if (!this.checkLootAndWrite(compound)) { + ItemStackHelper.saveAllItems(compound, this.stacks); + } + return compound; + } + + @Override + public SUpdateTileEntityPacket getUpdatePacket() { + return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag()); + } + + @Override + public CompoundNBT getUpdateTag() { + return this.write(new CompoundNBT()); + } + + @Override + public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { + this.read(this.getBlockState(), pkt.getNbtCompound()); + } + + @Override + public int getSizeInventory() { + return stacks.size(); + } + + @Override + public boolean isEmpty() { + for (ItemStack itemstack : this.stacks) + if (!itemstack.isEmpty()) + return false; + return true; + } + + @Override + public ITextComponent getDefaultName() { + return new StringTextComponent("bloomed_muncher"); + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public Container createMenu(int id, PlayerInventory player) { + return ChestContainer.createGeneric9X3(id, player, this); + } + + @Override + public ITextComponent getDisplayName() { + return new StringTextComponent("Bloomed Muncher 'Flower'"); + } + + @Override + protected NonNullList getItems() { + return this.stacks; + } + + @Override + protected void setItems(NonNullList stacks) { + this.stacks = stacks; + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) { + return true; + } + + @Override + public int[] getSlotsForFace(Direction side) { + return IntStream.range(0, this.getSizeInventory()).toArray(); + } + + @Override + public boolean canInsertItem(int index, ItemStack stack, @Nullable Direction direction) { + return this.isItemValidForSlot(index, stack); + } + + @Override + public boolean canExtractItem(int index, ItemStack stack, Direction direction) { + return true; + } + + private final LazyOptional[] handlers = SidedInvWrapper.create(this, Direction.values()); + + @Override + public LazyOptional getCapability(Capability capability, @Nullable Direction facing) { + if (!this.removed && facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + return handlers[facing.ordinal()].cast(); + return super.getCapability(capability, facing); + } + + @Override + public void remove() { + super.remove(); + for (LazyOptional handler : handlers) + handler.invalidate(); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafBlossomerBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafBlossomerBlock.java new file mode 100644 index 0000000..12b1518 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafBlossomerBlock.java @@ -0,0 +1,157 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafBlossomerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_blossomer") + public static final Block block = null; + + public BlueleafBlossomerBlock(HemModElements instance) { + super(instance, 30); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(64).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_blossomer")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_blossomer"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.JUMP_BOOST, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_blossomer"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafBrownCapBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafBrownCapBlock.java new file mode 100644 index 0000000..77c302e --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafBrownCapBlock.java @@ -0,0 +1,161 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafBrownCapBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_brown_cap") + public static final Block block = null; + + public BlueleafBrownCapBlock(HemModElements instance) { + super(instance, 50); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(16).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_brown_cap")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_brown_cap"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.REGENERATION, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_brown_cap"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafButterSlumpBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafButterSlumpBlock.java new file mode 100644 index 0000000..4e4ef99 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafButterSlumpBlock.java @@ -0,0 +1,159 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafButterSlumpBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_butter_slump") + public static final Block block = null; + + public BlueleafButterSlumpBlock(HemModElements instance) { + super(instance, 49); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(64).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_butter_slump")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_butter_slump"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.JUMP_BOOST, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_butter_slump"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafCabbageFlowerBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafCabbageFlowerBlock.java new file mode 100644 index 0000000..2af1b71 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafCabbageFlowerBlock.java @@ -0,0 +1,155 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafCabbageFlowerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_cabbage_flower") + public static final Block block = null; + + public BlueleafCabbageFlowerBlock(HemModElements instance) { + super(instance, 46); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(64).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_cabbage_flower")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_cabbage_flower"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.RESISTANCE, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_cabbage_flower"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneBlock.java new file mode 100644 index 0000000..4446060 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneBlock.java @@ -0,0 +1,130 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.feature.template.RuleTest; +import net.minecraft.world.gen.feature.template.IRuleTestType; +import net.minecraft.world.gen.feature.OreFeatureConfig; +import net.minecraft.world.gen.feature.OreFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafCobblestoneBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_cobblestone") + public static final Block block = null; + + public BlueleafCobblestoneBlock(HemModElements instance) { + super(instance, 10); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(0.75f, 10f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_cobblestone"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + private static IRuleTestType CUSTOM_MATCH = null; + + private static class CustomRuleTest extends RuleTest { + static final CustomRuleTest INSTANCE = new CustomRuleTest(); + static final com.mojang.serialization.Codec codec = com.mojang.serialization.Codec.unit(() -> INSTANCE); + + public boolean test(BlockState blockAt, Random random) { + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafStoneBlock.block) + blockCriteria = true; + return blockCriteria; + } + + protected IRuleTestType getType() { + return CUSTOM_MATCH; + } + } + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + CUSTOM_MATCH = Registry.register(Registry.RULE_TEST, new ResourceLocation("hem:blueleaf_cobblestone_match"), () -> CustomRuleTest.codec); + feature = new OreFeature(OreFeatureConfig.CODEC) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random rand, BlockPos pos, OreFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, rand, pos, config); + } + }; + configuredFeature = feature.withConfiguration(new OreFeatureConfig(CustomRuleTest.INSTANCE, block.getDefaultState(), 26)).range(256) + .square().func_242731_b(24); + event.getRegistry().register(feature.setRegistryName("blueleaf_cobblestone")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_cobblestone"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneSlabBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneSlabBlock.java new file mode 100644 index 0000000..e348152 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneSlabBlock.java @@ -0,0 +1,55 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.state.properties.SlabType; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.SlabBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafCobblestoneSlabBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_cobblestone_slab") + public static final Block block = null; + + public BlueleafCobblestoneSlabBlock(HemModElements instance) { + super(instance, 12); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends SlabBlock { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(0.75f, 10f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_cobblestone_slab"); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, state.get(TYPE) == SlabType.DOUBLE ? 2 : 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneStairsBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneStairsBlock.java new file mode 100644 index 0000000..693f82e --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneStairsBlock.java @@ -0,0 +1,56 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.StairsBlock; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafCobblestoneStairsBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_cobblestone_stairs") + public static final Block block = null; + + public BlueleafCobblestoneStairsBlock(HemModElements instance) { + super(instance, 11); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends StairsBlock { + public CustomBlock() { + super(() -> new Block(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(0.75f, 10f) + .setLightLevel(s -> 0).harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()).getDefaultState(), + Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(0.75f, 10f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_cobblestone_stairs"); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneWallBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneWallBlock.java new file mode 100644 index 0000000..034a174 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafCobblestoneWallBlock.java @@ -0,0 +1,207 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.world.IWorldReader; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.IBooleanFunction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.tags.BlockTags; +import net.minecraft.state.Property; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.block.material.Material; +import net.minecraft.block.WallHeight; +import net.minecraft.block.WallBlock; +import net.minecraft.block.SoundType; +import net.minecraft.block.FenceGateBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafCobblestoneWallBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_cobblestone_wall") + public static final Block block = null; + + public BlueleafCobblestoneWallBlock(HemModElements instance) { + super(instance, 13); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends WallBlock { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(0.75f, 10f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_cobblestone_wall"); + } + + private static final VoxelShape CENTER_POLE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 7.0D, 9.0D, 16.0D, 9.0D); + private static final VoxelShape WALL_CONNECTION_NORTH_SIDE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 0.0D, 9.0D, 16.0D, 9.0D); + private static final VoxelShape WALL_CONNECTION_SOUTH_SIDE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 7.0D, 9.0D, 16.0D, 16.0D); + private static final VoxelShape WALL_CONNECTION_WEST_SIDE_SHAPE = Block.makeCuboidShape(0.0D, 0.0D, 7.0D, 9.0D, 16.0D, 9.0D); + private static final VoxelShape WALL_CONNECTION_EAST_SIDE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 7.0D, 16.0D, 16.0D, 9.0D); + + private boolean shouldConnect(BlockState state, boolean checkattach, Direction face) { + boolean flag = state.getBlock() instanceof WallBlock + || state.getBlock() instanceof FenceGateBlock && FenceGateBlock.isParallel(state, face); + return !cannotAttach(state.getBlock()) && checkattach || flag; + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + IWorldReader iworldreader = context.getWorld(); + BlockPos blockpos = context.getPos(); + FluidState fluidstate = context.getWorld().getFluidState(context.getPos()); + BlockPos blockpos1 = blockpos.north(); + BlockPos blockpos2 = blockpos.east(); + BlockPos blockpos3 = blockpos.south(); + BlockPos blockpos4 = blockpos.west(); + BlockPos blockpos5 = blockpos.up(); + BlockState blockstate = iworldreader.getBlockState(blockpos1); + BlockState blockstate1 = iworldreader.getBlockState(blockpos2); + BlockState blockstate2 = iworldreader.getBlockState(blockpos3); + BlockState blockstate3 = iworldreader.getBlockState(blockpos4); + BlockState blockstate4 = iworldreader.getBlockState(blockpos5); + boolean flag = this.shouldConnect(blockstate, blockstate.isSolidSide(iworldreader, blockpos1, Direction.SOUTH), Direction.SOUTH); + boolean flag1 = this.shouldConnect(blockstate1, blockstate1.isSolidSide(iworldreader, blockpos2, Direction.WEST), Direction.WEST); + boolean flag2 = this.shouldConnect(blockstate2, blockstate2.isSolidSide(iworldreader, blockpos3, Direction.NORTH), Direction.NORTH); + boolean flag3 = this.shouldConnect(blockstate3, blockstate3.isSolidSide(iworldreader, blockpos4, Direction.EAST), Direction.EAST); + BlockState blockstate5 = this.getDefaultState().with(WATERLOGGED, Boolean.valueOf(fluidstate.getFluid() == Fluids.WATER)); + return this.func_235626_a_(iworldreader, blockstate5, blockpos5, blockstate4, flag, flag1, flag2, flag3); + } + + @Override /** + * Update the provided state given the provided neighbor facing and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific face passed in. + */ + public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, + BlockPos facingPos) { + if (stateIn.get(WATERLOGGED)) { + worldIn.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn)); + } + if (facing == Direction.DOWN) { + return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos); + } else { + return facing == Direction.UP + ? this.func_235625_a_(worldIn, stateIn, facingPos, facingState) + : this.func_235627_a_(worldIn, currentPos, stateIn, facingPos, facingState, facing); + } + } + + private BlockState func_235625_a_(IWorldReader reader, BlockState state1, BlockPos pos, BlockState state2) { + boolean flag = hasHeightForProperty(state1, WALL_HEIGHT_NORTH); + boolean flag1 = hasHeightForProperty(state1, WALL_HEIGHT_EAST); + boolean flag2 = hasHeightForProperty(state1, WALL_HEIGHT_SOUTH); + boolean flag3 = hasHeightForProperty(state1, WALL_HEIGHT_WEST); + return this.func_235626_a_(reader, state1, pos, state2, flag, flag1, flag2, flag3); + } + + private BlockState func_235627_a_(IWorldReader reader, BlockPos p_235627_2_, BlockState p_235627_3_, BlockPos p_235627_4_, + BlockState p_235627_5_, Direction directionIn) { + Direction direction = directionIn.getOpposite(); + boolean flag = directionIn == Direction.NORTH + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_NORTH); + boolean flag1 = directionIn == Direction.EAST + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_EAST); + boolean flag2 = directionIn == Direction.SOUTH + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_SOUTH); + boolean flag3 = directionIn == Direction.WEST + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_WEST); + BlockPos blockpos = p_235627_2_.up(); + BlockState blockstate = reader.getBlockState(blockpos); + return this.func_235626_a_(reader, p_235627_3_, blockpos, blockstate, flag, flag1, flag2, flag3); + } + + private BlockState func_235626_a_(IWorldReader reader, BlockState state, BlockPos pos, BlockState collisionState, boolean connectedSouth, + boolean connectedWest, boolean connectedNorth, boolean connectedEast) { + VoxelShape voxelshape = collisionState.getCollisionShape(reader, pos).project(Direction.DOWN); + BlockState blockstate = this.func_235630_a_(state, connectedSouth, connectedWest, connectedNorth, connectedEast, voxelshape); + return blockstate.with(UP, Boolean.valueOf(this.func_235628_a_(blockstate, collisionState, voxelshape))); + } + + private BlockState func_235630_a_(BlockState state, boolean connectedSouth, boolean connectedWest, boolean connectedNorth, + boolean connectedEast, VoxelShape shape) { + return state.with(WALL_HEIGHT_NORTH, this.func_235633_a_(connectedSouth, shape, WALL_CONNECTION_NORTH_SIDE_SHAPE)) + .with(WALL_HEIGHT_EAST, this.func_235633_a_(connectedWest, shape, WALL_CONNECTION_EAST_SIDE_SHAPE)) + .with(WALL_HEIGHT_SOUTH, this.func_235633_a_(connectedNorth, shape, WALL_CONNECTION_SOUTH_SIDE_SHAPE)) + .with(WALL_HEIGHT_WEST, this.func_235633_a_(connectedEast, shape, WALL_CONNECTION_WEST_SIDE_SHAPE)); + } + + private WallHeight func_235633_a_(boolean p_235633_1_, VoxelShape p_235633_2_, VoxelShape p_235633_3_) { + if (p_235633_1_) { + return compareShapes(p_235633_2_, p_235633_3_) ? WallHeight.TALL : WallHeight.LOW; + } else { + return WallHeight.NONE; + } + } + + private boolean func_235628_a_(BlockState p_235628_1_, BlockState p_235628_2_, VoxelShape shape) { + boolean flag = p_235628_2_.getBlock() instanceof WallBlock && p_235628_2_.get(UP); + if (flag) { + return true; + } else { + WallHeight wallheight = p_235628_1_.get(WALL_HEIGHT_NORTH); + WallHeight wallheight1 = p_235628_1_.get(WALL_HEIGHT_SOUTH); + WallHeight wallheight2 = p_235628_1_.get(WALL_HEIGHT_EAST); + WallHeight wallheight3 = p_235628_1_.get(WALL_HEIGHT_WEST); + boolean flag1 = wallheight1 == WallHeight.NONE; + boolean flag2 = wallheight3 == WallHeight.NONE; + boolean flag3 = wallheight2 == WallHeight.NONE; + boolean flag4 = wallheight == WallHeight.NONE; + boolean flag5 = flag4 && flag1 && flag2 && flag3 || flag4 != flag1 || flag2 != flag3; + if (flag5) { + return true; + } else { + boolean flag6 = wallheight == WallHeight.TALL && wallheight1 == WallHeight.TALL + || wallheight2 == WallHeight.TALL && wallheight3 == WallHeight.TALL; + if (flag6) { + return false; + } else { + return p_235628_2_.getBlock().isIn(BlockTags.WALL_POST_OVERRIDE) || compareShapes(shape, CENTER_POLE_SHAPE); + } + } + } + } + + private static boolean hasHeightForProperty(BlockState state, Property heightProperty) { + return state.get(heightProperty) != WallHeight.NONE; + } + + private static boolean compareShapes(VoxelShape shape1, VoxelShape shape2) { + return !VoxelShapes.compare(shape2, shape1, IBooleanFunction.ONLY_FIRST); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafDeadLogBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafDeadLogBlock.java new file mode 100644 index 0000000..03991d7 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafDeadLogBlock.java @@ -0,0 +1,108 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.EnumProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafDeadLogBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_dead_log") + public static final Block block = null; + + public BlueleafDeadLogBlock(HemModElements instance) { + super(instance, 17); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block { + public static final EnumProperty AXIS = BlockStateProperties.AXIS; + + public CustomBlock() { + super(Block.Properties.create(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(0.5f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.AXE).speedFactor(0.8f).notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(AXIS, Direction.Axis.Y)); + setRegistryName("blueleaf_dead_log"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(AXIS); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(AXIS, context.getFace().getAxis()); + } + + @Override + public BlockState rotate(BlockState state, Rotation rot) { + if (rot == Rotation.CLOCKWISE_90 || rot == Rotation.COUNTERCLOCKWISE_90) { + if ((Direction.Axis) state.get(AXIS) == Direction.Axis.X) { + return state.with(AXIS, Direction.Axis.Z); + } else if ((Direction.Axis) state.get(AXIS) == Direction.Axis.Z) { + return state.with(AXIS, Direction.Axis.X); + } + } + return state; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafDirtBlockBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafDirtBlockBlock.java new file mode 100644 index 0000000..31bc565 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafDirtBlockBlock.java @@ -0,0 +1,146 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.gen.feature.template.RuleTest; +import net.minecraft.world.gen.feature.template.IRuleTestType; +import net.minecraft.world.gen.feature.OreFeatureConfig; +import net.minecraft.world.gen.feature.OreFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafDirtBlockBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_dirt_block") + public static final Block block = null; + + public BlueleafDirtBlockBlock(HemModElements instance) { + super(instance, 2); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.EARTH).sound(SoundType.GROUND).hardnessAndResistance(0.5f, 3f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.SHOVEL)); + setRegistryName("blueleaf_dirt_block"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + private static IRuleTestType CUSTOM_MATCH = null; + + private static class CustomRuleTest extends RuleTest { + static final CustomRuleTest INSTANCE = new CustomRuleTest(); + static final com.mojang.serialization.Codec codec = com.mojang.serialization.Codec.unit(() -> INSTANCE); + + public boolean test(BlockState blockAt, Random random) { + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafGravelMudBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafStoneGravelBlock.block) + blockCriteria = true; + return blockCriteria; + } + + protected IRuleTestType getType() { + return CUSTOM_MATCH; + } + } + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + CUSTOM_MATCH = Registry.register(Registry.RULE_TEST, new ResourceLocation("hem:blueleaf_dirt_block_match"), () -> CustomRuleTest.codec); + feature = new OreFeature(OreFeatureConfig.CODEC) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random rand, BlockPos pos, OreFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, rand, pos, config); + } + }; + configuredFeature = feature.withConfiguration(new OreFeatureConfig(CustomRuleTest.INSTANCE, block.getDefaultState(), 31)).range(256) + .square().func_242731_b(31); + event.getRegistry().register(feature.setRegistryName("blueleaf_dirt_block")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_dirt_block"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafDirtGrassBlockBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafDirtGrassBlockBlock.java new file mode 100644 index 0000000..0f6737c --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafDirtGrassBlockBlock.java @@ -0,0 +1,67 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafDirtGrassBlockBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_dirt_grass_block") + public static final Block block = null; + + public BlueleafDirtGrassBlockBlock(HemModElements instance) { + super(instance, 2); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.ORGANIC).sound(SoundType.PLANT).hardnessAndResistance(0.5f, 3f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.SHOVEL)); + setRegistryName("blueleaf_dirt_grass_block"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(BlueleafDirtBlockBlock.block)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafFluorescentLeavesBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafFluorescentLeavesBlock.java new file mode 100644 index 0000000..e80e776 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafFluorescentLeavesBlock.java @@ -0,0 +1,147 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.BlueleafFluorescentLeavesParticleSpawningConditionProcedure; +import studio.halbear.hem.particle.FluorescentLeavesParticlesParticle; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BlueleafFluorescentLeavesBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_fluorescent_leaves") + public static final Block block = null; + + public BlueleafFluorescentLeavesBlock(HemModElements instance) { + super(instance, 19); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.LEAVES).sound(SoundType.PLANT).hardnessAndResistance(0.3f, 1f).setLightLevel(s -> 7) + .harvestLevel(1).harvestTool(ToolType.HOE).slipperiness(0.7999999999999999f).speedFactor(0.6f).jumpFactor(0.6f).notSolid() + .setNeedsPostProcessing((bs, br, bp) -> true).setEmmisiveRendering((bs, br, bp) -> true).setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("blueleaf_fluorescent_leaves"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return state.getFluidState().isEmpty(); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(Blocks.CAVE_AIR)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (BlueleafFluorescentLeavesParticleSpawningConditionProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("world", world)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + for (int l = 0; l < 1; ++l) { + double d0 = (x + random.nextFloat()); + double d1 = (y + random.nextFloat()); + double d2 = (z + random.nextFloat()); + int i1 = random.nextInt(2) * 2 - 1; + double d3 = (random.nextFloat() - 0.5D) * 1D; + double d4 = (random.nextFloat() - 0.5D) * 1D; + double d5 = (random.nextFloat() - 0.5D) * 1D; + world.addParticle(FluorescentLeavesParticlesParticle.particle, d0, d1, d2, d3, d4, d5); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafGrassBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafGrassBlock.java new file mode 100644 index 0000000..7e77f3f --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafGrassBlock.java @@ -0,0 +1,174 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.NoiseDependant; +import net.minecraft.world.gen.feature.RandomPatchFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafGrassBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_grass") + public static final Block block = null; + + public BlueleafGrassBlock(HemModElements instance) { + super(instance, 19); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new RandomPatchFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature.withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())).tries(32) + .build()) + .withPlacement(Placement.COUNT_NOISE.configure(new NoiseDependant(-0.8, 0, 40))); + event.getRegistry().register(feature.setRegistryName("blueleaf_grass")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_grass"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.HASTE, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_grass"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 16, 16)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public boolean isReplaceable(BlockState state, BlockItemUseContext useContext) { + return useContext.getItem().getItem() != this.asItem(); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafGrassBlockBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafGrassBlockBlock.java new file mode 100644 index 0000000..8cf74ff --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafGrassBlockBlock.java @@ -0,0 +1,74 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.util.ForgeSoundType; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Direction; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafGrassBlockBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_grass_block") + public static final Block block = null; + + public BlueleafGrassBlockBlock(HemModElements instance) { + super(instance, 4); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.ORGANIC) + .sound(new ForgeSoundType(1.0f, 1.0f, () -> new SoundEvent(new ResourceLocation("block.stone.break")), + () -> new SoundEvent(new ResourceLocation("block.grass.step")), + () -> new SoundEvent(new ResourceLocation("block.stone.place")), + () -> new SoundEvent(new ResourceLocation("block.stone.hit")), + () -> new SoundEvent(new ResourceLocation("block.grass.fall")))) + .hardnessAndResistance(1f, 10f).setLightLevel(s -> 0).harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_grass_block"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(BlueleafStoneBlock.block)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafGravelMudBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafGravelMudBlock.java new file mode 100644 index 0000000..2ef9712 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafGravelMudBlock.java @@ -0,0 +1,76 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.util.ForgeSoundType; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundEvent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Direction; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.FallingBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafGravelMudBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_gravel_mud") + public static final Block block = null; + + public BlueleafGravelMudBlock(HemModElements instance) { + super(instance, 129); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends FallingBlock { + public CustomBlock() { + super(Block.Properties.create(Material.EARTH) + .sound(new ForgeSoundType(1.0f, 1.0f, () -> new SoundEvent(new ResourceLocation("block.soul_soil.break")), + () -> new SoundEvent(new ResourceLocation("block.gravel.step")), + () -> new SoundEvent(new ResourceLocation("block.soul_soil.place")), + () -> new SoundEvent(new ResourceLocation("block.soul_soil.hit")), + () -> new SoundEvent(new ResourceLocation("block.gravel.fall")))) + .hardnessAndResistance(0.35f, 3.5f).setLightLevel(s -> 0).harvestLevel(1).harvestTool(ToolType.SHOVEL) + .slipperiness(0.7999999999999999f)); + setRegistryName("blueleaf_gravel_mud"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafGreenCapBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafGreenCapBlock.java new file mode 100644 index 0000000..d84df98 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafGreenCapBlock.java @@ -0,0 +1,161 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafGreenCapBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_green_cap") + public static final Block block = null; + + public BlueleafGreenCapBlock(HemModElements instance) { + super(instance, 47); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(16).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_green_cap")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_green_cap"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.RESISTANCE, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_green_cap"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafLavenderBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafLavenderBlock.java new file mode 100644 index 0000000..b243f84 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafLavenderBlock.java @@ -0,0 +1,203 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.BlueleafLavenderUpdateTickProcedure; +import studio.halbear.hem.procedures.BlueleafLavenderMobplayerCollidesWithPlantProcedure; +import studio.halbear.hem.procedures.BlueleafLavenderConditionProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.NoiseDependant; +import net.minecraft.world.gen.feature.RandomPatchFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BlueleafLavenderBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_lavender") + public static final Block block = null; + + public BlueleafLavenderBlock(HemModElements instance) { + super(instance, 41); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new RandomPatchFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (!BlueleafLavenderConditionProcedure + .executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature.withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())).tries(256) + .build()) + .withPlacement(Placement.COUNT_NOISE.configure(new NoiseDependant(-0.8, 0, 40))); + event.getRegistry().register(feature.setRegistryName("blueleaf_lavender")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_lavender"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.REGENERATION, 100, Block.Properties.create(Material.PLANTS).tickRandomly().doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_lavender"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 32, 16)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BlueleafLavenderUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BlueleafLavenderMobplayerCollidesWithPlantProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafLeavesBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafLeavesBlock.java new file mode 100644 index 0000000..b47b111 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafLeavesBlock.java @@ -0,0 +1,115 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafLeavesBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_leaves") + public static final Block block = null; + + public BlueleafLeavesBlock(HemModElements instance) { + super(instance, 120); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.LEAVES).sound(SoundType.PLANT).hardnessAndResistance(0.3f, 1f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.HOE).slipperiness(0.7000000000000001f).speedFactor(0.7000000000000001f).jumpFactor(0.9f) + .notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("blueleaf_leaves"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return state.getFluidState().isEmpty(); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(Blocks.CAVE_AIR)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafLilyPadBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafLilyPadBlock.java new file mode 100644 index 0000000..b5dc546 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafLilyPadBlock.java @@ -0,0 +1,153 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.GiantLilyPadEntityCollidesInTheBlockProcedure; +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Mirror; +import net.minecraft.util.Direction; +import net.minecraft.state.StateContainer; +import net.minecraft.state.DirectionProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BlueleafLilyPadBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_lily_pad") + public static final Block block = null; + + public BlueleafLilyPadBlock(HemModElements instance) { + super(instance, 157); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block { + public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; + + public CustomBlock() { + super(Block.Properties.create(Material.PLANTS).sound(SoundType.LILY_PADS).hardnessAndResistance(0.1f, 0f).setLightLevel(s -> 1) + .harvestLevel(1).harvestTool(ToolType.HOE).slipperiness(1f).jumpFactor(1.5f).notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); + setRegistryName("blueleaf_lily_pad"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + return VoxelShapes.empty(); + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); + } + + public BlockState rotate(BlockState state, Rotation rot) { + return state.with(FACING, rot.rotate(state.get(FACING))); + } + + public BlockState mirror(BlockState state, Mirror mirrorIn) { + return state.rotate(mirrorIn.toRotation(state.get(FACING))); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (true) + for (int l = 0; l < 1; ++l) { + double d0 = (double) ((float) x + 0.5) + (double) (random.nextFloat() - 0.5) * 0.4D; + double d1 = ((double) ((float) y + 0.7) + (double) (random.nextFloat() - 0.5) * 0.4D) + 0.5; + double d2 = (double) ((float) z + 0.5) + (double) (random.nextFloat() - 0.5) * 0.4D; + world.addParticle(LilyPadParticlesParticle.particle, d0, d1, d2, 0, 0, 0); + } + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + GiantLilyPadEntityCollidesInTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafLogBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafLogBlock.java new file mode 100644 index 0000000..c39b34f --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafLogBlock.java @@ -0,0 +1,97 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.EnumProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafLogBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_log") + public static final Block block = null; + + public BlueleafLogBlock(HemModElements instance) { + super(instance, 15); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public static final EnumProperty AXIS = BlockStateProperties.AXIS; + + public CustomBlock() { + super(Block.Properties.create(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(0.5f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.AXE)); + this.setDefaultState(this.stateContainer.getBaseState().with(AXIS, Direction.Axis.Y)); + setRegistryName("blueleaf_log"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(AXIS); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(AXIS, context.getFace().getAxis()); + } + + @Override + public BlockState rotate(BlockState state, Rotation rot) { + if (rot == Rotation.CLOCKWISE_90 || rot == Rotation.COUNTERCLOCKWISE_90) { + if ((Direction.Axis) state.get(AXIS) == Direction.Axis.X) { + return state.with(AXIS, Direction.Axis.Z); + } else if ((Direction.Axis) state.get(AXIS) == Direction.Axis.Z) { + return state.with(AXIS, Direction.Axis.X); + } + } + return state; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafLushLeavesBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafLushLeavesBlock.java new file mode 100644 index 0000000..0ebd0e1 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafLushLeavesBlock.java @@ -0,0 +1,115 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafLushLeavesBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_lush_leaves") + public static final Block block = null; + + public BlueleafLushLeavesBlock(HemModElements instance) { + super(instance, 20); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.LEAVES).sound(SoundType.PLANT).hardnessAndResistance(0.3f, 1f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.HOE).slipperiness(0.7000000000000001f).speedFactor(0.7000000000000001f).jumpFactor(0.9f) + .notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("blueleaf_lush_leaves"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return state.getFluidState().isEmpty(); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(Blocks.CAVE_AIR)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafMatureBlossomerBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafMatureBlossomerBlock.java new file mode 100644 index 0000000..36b5d58 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafMatureBlossomerBlock.java @@ -0,0 +1,157 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafMatureBlossomerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_mature_blossomer") + public static final Block block = null; + + public BlueleafMatureBlossomerBlock(HemModElements instance) { + super(instance, 29); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(64).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(3); + event.getRegistry().register(feature.setRegistryName("blueleaf_mature_blossomer")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_mature_blossomer"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.JUMP_BOOST, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_mature_blossomer"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafMatureCabbageFlowerBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafMatureCabbageFlowerBlock.java new file mode 100644 index 0000000..579a499 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafMatureCabbageFlowerBlock.java @@ -0,0 +1,155 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafMatureCabbageFlowerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_mature_cabbage_flower") + public static final Block block = null; + + public BlueleafMatureCabbageFlowerBlock(HemModElements instance) { + super(instance, 48); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(64).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_mature_cabbage_flower")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_mature_cabbage_flower"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.WATER_BREATHING, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_mature_cabbage_flower"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafMudBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafMudBlock.java new file mode 100644 index 0000000..4ce212b --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafMudBlock.java @@ -0,0 +1,147 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.gen.feature.template.RuleTest; +import net.minecraft.world.gen.feature.template.IRuleTestType; +import net.minecraft.world.gen.feature.OreFeatureConfig; +import net.minecraft.world.gen.feature.OreFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FallingBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafMudBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_mud") + public static final Block block = null; + + public BlueleafMudBlock(HemModElements instance) { + super(instance, 130); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends FallingBlock { + public CustomBlock() { + super(Block.Properties.create(Material.EARTH).sound(SoundType.SOUL_SOIL).hardnessAndResistance(0.35f, 3.5f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.SHOVEL).slipperiness(0.7999999999999999f)); + setRegistryName("blueleaf_mud"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + private static IRuleTestType CUSTOM_MATCH = null; + + private static class CustomRuleTest extends RuleTest { + static final CustomRuleTest INSTANCE = new CustomRuleTest(); + static final com.mojang.serialization.Codec codec = com.mojang.serialization.Codec.unit(() -> INSTANCE); + + public boolean test(BlockState blockAt, Random random) { + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafGravelMudBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafStoneGravelBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + return blockCriteria; + } + + protected IRuleTestType getType() { + return CUSTOM_MATCH; + } + } + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + CUSTOM_MATCH = Registry.register(Registry.RULE_TEST, new ResourceLocation("hem:blueleaf_mud_match"), () -> CustomRuleTest.codec); + feature = new OreFeature(OreFeatureConfig.CODEC) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random rand, BlockPos pos, OreFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, rand, pos, config); + } + }; + configuredFeature = feature.withConfiguration(new OreFeatureConfig(CustomRuleTest.INSTANCE, block.getDefaultState(), 31)).range(256) + .square().func_242731_b(31); + event.getRegistry().register(feature.setRegistryName("blueleaf_mud")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_mud"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafRedCapBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafRedCapBlock.java new file mode 100644 index 0000000..8c6ba47 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafRedCapBlock.java @@ -0,0 +1,161 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafRedCapBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_red_cap") + public static final Block block = null; + + public BlueleafRedCapBlock(HemModElements instance) { + super(instance, 32); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(16).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(5); + event.getRegistry().register(feature.setRegistryName("blueleaf_red_cap")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_red_cap"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.INSTANT_DAMAGE, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_red_cap"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafRedwoodLeavesBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafRedwoodLeavesBlock.java new file mode 100644 index 0000000..3118a06 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafRedwoodLeavesBlock.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafRedwoodLeavesBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_redwood_leaves") + public static final Block block = null; + + public BlueleafRedwoodLeavesBlock(HemModElements instance) { + super(instance, 21); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.LEAVES).sound(SoundType.PLANT).hardnessAndResistance(0.3f, 1f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.HOE).slipperiness(0.7000000000000001f).speedFactor(0.7999999999999999f).notSolid() + .setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("blueleaf_redwood_leaves"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 1; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(Blocks.CAVE_AIR)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafRedwoodLogBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafRedwoodLogBlock.java new file mode 100644 index 0000000..341c6f6 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafRedwoodLogBlock.java @@ -0,0 +1,97 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.EnumProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafRedwoodLogBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_redwood_log") + public static final Block block = null; + + public BlueleafRedwoodLogBlock(HemModElements instance) { + super(instance, 18); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public static final EnumProperty AXIS = BlockStateProperties.AXIS; + + public CustomBlock() { + super(Block.Properties.create(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(0.5f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.AXE)); + this.setDefaultState(this.stateContainer.getBaseState().with(AXIS, Direction.Axis.Y)); + setRegistryName("blueleaf_redwood_log"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(AXIS); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(AXIS, context.getFace().getAxis()); + } + + @Override + public BlockState rotate(BlockState state, Rotation rot) { + if (rot == Rotation.CLOCKWISE_90 || rot == Rotation.COUNTERCLOCKWISE_90) { + if ((Direction.Axis) state.get(AXIS) == Direction.Axis.X) { + return state.with(AXIS, Direction.Axis.Z); + } else if ((Direction.Axis) state.get(AXIS) == Direction.Axis.Z) { + return state.with(AXIS, Direction.Axis.X); + } + } + return state; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafSeaGrassBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafSeaGrassBlock.java new file mode 100644 index 0000000..252cd50 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafSeaGrassBlock.java @@ -0,0 +1,148 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafSeaGrassBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_sea_grass") + public static final Block block = null; + + public BlueleafSeaGrassBlock(HemModElements instance) { + super(instance, 52); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.LEAVES).sound(SoundType.PLANT).hardnessAndResistance(0.1f, 0f).setLightLevel(s -> 1) + .doesNotBlockMovement().notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("blueleaf_sea_grass"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return state.getFluidState().isEmpty(); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public boolean isReplaceable(BlockState state, BlockItemUseContext context) { + return context.getItem().getItem() != this.asItem(); + } + + @Override + public Block.OffsetType getOffsetType() { + return Block.OffsetType.XZ; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (true) + for (int l = 0; l < 1; ++l) { + double d0 = (x + random.nextFloat()); + double d1 = (y + random.nextFloat()); + double d2 = (z + random.nextFloat()); + int i1 = random.nextInt(2) * 2 - 1; + double d3 = (random.nextFloat() - 0.5D) * 0.5D; + double d4 = (random.nextFloat() - 0.5D) * 0.5D; + double d5 = (random.nextFloat() - 0.5D) * 0.5D; + world.addParticle(ParticleTypes.BUBBLE, d0, d1, d2, d3, d4, d5); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafStoneBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafStoneBlock.java new file mode 100644 index 0000000..f60cfcb --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafStoneBlock.java @@ -0,0 +1,60 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafStoneBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_stone") + public static final Block block = null; + + public BlueleafStoneBlock(HemModElements instance) { + super(instance, 4); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_stone"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(BlueleafCobblestoneBlock.block)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafStoneGravelBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafStoneGravelBlock.java new file mode 100644 index 0000000..fe0257b --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafStoneGravelBlock.java @@ -0,0 +1,131 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.feature.template.RuleTest; +import net.minecraft.world.gen.feature.template.IRuleTestType; +import net.minecraft.world.gen.feature.OreFeatureConfig; +import net.minecraft.world.gen.feature.OreFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FallingBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafStoneGravelBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_stone_gravel") + public static final Block block = null; + + public BlueleafStoneGravelBlock(HemModElements instance) { + super(instance, 14); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends FallingBlock { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.GROUND).hardnessAndResistance(0.35f, 3.5f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.SHOVEL).slipperiness(0.7999999999999999f)); + setRegistryName("blueleaf_stone_gravel"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + private static IRuleTestType CUSTOM_MATCH = null; + + private static class CustomRuleTest extends RuleTest { + static final CustomRuleTest INSTANCE = new CustomRuleTest(); + static final com.mojang.serialization.Codec codec = com.mojang.serialization.Codec.unit(() -> INSTANCE); + + public boolean test(BlockState blockAt, Random random) { + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafStoneBlock.block) + blockCriteria = true; + return blockCriteria; + } + + protected IRuleTestType getType() { + return CUSTOM_MATCH; + } + } + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + CUSTOM_MATCH = Registry.register(Registry.RULE_TEST, new ResourceLocation("hem:blueleaf_stone_gravel_match"), () -> CustomRuleTest.codec); + feature = new OreFeature(OreFeatureConfig.CODEC) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random rand, BlockPos pos, OreFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, rand, pos, config); + } + }; + configuredFeature = feature.withConfiguration(new OreFeatureConfig(CustomRuleTest.INSTANCE, block.getDefaultState(), 30)).range(256) + .square().func_242731_b(30); + event.getRegistry().register(feature.setRegistryName("blueleaf_stone_gravel")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_stone_gravel"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + event.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafStoneSlabBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafStoneSlabBlock.java new file mode 100644 index 0000000..8352f44 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafStoneSlabBlock.java @@ -0,0 +1,55 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.state.properties.SlabType; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.SlabBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafStoneSlabBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_stone_slab") + public static final Block block = null; + + public BlueleafStoneSlabBlock(HemModElements instance) { + super(instance, 6); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends SlabBlock { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_stone_slab"); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, state.get(TYPE) == SlabType.DOUBLE ? 2 : 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafStoneStairBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafStoneStairBlock.java new file mode 100644 index 0000000..76f729b --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafStoneStairBlock.java @@ -0,0 +1,56 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.StairsBlock; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafStoneStairBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_stone_stair") + public static final Block block = null; + + public BlueleafStoneStairBlock(HemModElements instance) { + super(instance, 5); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends StairsBlock { + public CustomBlock() { + super(() -> new Block(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0) + .harvestLevel(1).harvestTool(ToolType.PICKAXE).setRequiresTool()).getDefaultState(), + Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_stone_stair"); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafStoneWallBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafStoneWallBlock.java new file mode 100644 index 0000000..5106ea2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafStoneWallBlock.java @@ -0,0 +1,213 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; + +import net.minecraft.world.IWorldReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.IBooleanFunction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.tags.BlockTags; +import net.minecraft.state.Property; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.block.material.Material; +import net.minecraft.block.WallHeight; +import net.minecraft.block.WallBlock; +import net.minecraft.block.SoundType; +import net.minecraft.block.FenceGateBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafStoneWallBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_stone_wall") + public static final Block block = null; + + public BlueleafStoneWallBlock(HemModElements instance) { + super(instance, 7); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends WallBlock { + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.PICKAXE).setRequiresTool()); + setRegistryName("blueleaf_stone_wall"); + } + + private static final VoxelShape CENTER_POLE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 7.0D, 9.0D, 16.0D, 9.0D); + private static final VoxelShape WALL_CONNECTION_NORTH_SIDE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 0.0D, 9.0D, 16.0D, 9.0D); + private static final VoxelShape WALL_CONNECTION_SOUTH_SIDE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 7.0D, 9.0D, 16.0D, 16.0D); + private static final VoxelShape WALL_CONNECTION_WEST_SIDE_SHAPE = Block.makeCuboidShape(0.0D, 0.0D, 7.0D, 9.0D, 16.0D, 9.0D); + private static final VoxelShape WALL_CONNECTION_EAST_SIDE_SHAPE = Block.makeCuboidShape(7.0D, 0.0D, 7.0D, 16.0D, 16.0D, 9.0D); + + private boolean shouldConnect(BlockState state, boolean checkattach, Direction face) { + boolean flag = state.getBlock() instanceof WallBlock + || state.getBlock() instanceof FenceGateBlock && FenceGateBlock.isParallel(state, face); + return !cannotAttach(state.getBlock()) && checkattach || flag; + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + IWorldReader iworldreader = context.getWorld(); + BlockPos blockpos = context.getPos(); + FluidState fluidstate = context.getWorld().getFluidState(context.getPos()); + BlockPos blockpos1 = blockpos.north(); + BlockPos blockpos2 = blockpos.east(); + BlockPos blockpos3 = blockpos.south(); + BlockPos blockpos4 = blockpos.west(); + BlockPos blockpos5 = blockpos.up(); + BlockState blockstate = iworldreader.getBlockState(blockpos1); + BlockState blockstate1 = iworldreader.getBlockState(blockpos2); + BlockState blockstate2 = iworldreader.getBlockState(blockpos3); + BlockState blockstate3 = iworldreader.getBlockState(blockpos4); + BlockState blockstate4 = iworldreader.getBlockState(blockpos5); + boolean flag = this.shouldConnect(blockstate, blockstate.isSolidSide(iworldreader, blockpos1, Direction.SOUTH), Direction.SOUTH); + boolean flag1 = this.shouldConnect(blockstate1, blockstate1.isSolidSide(iworldreader, blockpos2, Direction.WEST), Direction.WEST); + boolean flag2 = this.shouldConnect(blockstate2, blockstate2.isSolidSide(iworldreader, blockpos3, Direction.NORTH), Direction.NORTH); + boolean flag3 = this.shouldConnect(blockstate3, blockstate3.isSolidSide(iworldreader, blockpos4, Direction.EAST), Direction.EAST); + BlockState blockstate5 = this.getDefaultState().with(WATERLOGGED, Boolean.valueOf(fluidstate.getFluid() == Fluids.WATER)); + return this.func_235626_a_(iworldreader, blockstate5, blockpos5, blockstate4, flag, flag1, flag2, flag3); + } + + @Override /** + * Update the provided state given the provided neighbor facing and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific face passed in. + */ + public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, + BlockPos facingPos) { + if (stateIn.get(WATERLOGGED)) { + worldIn.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(worldIn)); + } + if (facing == Direction.DOWN) { + return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos); + } else { + return facing == Direction.UP + ? this.func_235625_a_(worldIn, stateIn, facingPos, facingState) + : this.func_235627_a_(worldIn, currentPos, stateIn, facingPos, facingState, facing); + } + } + + private BlockState func_235625_a_(IWorldReader reader, BlockState state1, BlockPos pos, BlockState state2) { + boolean flag = hasHeightForProperty(state1, WALL_HEIGHT_NORTH); + boolean flag1 = hasHeightForProperty(state1, WALL_HEIGHT_EAST); + boolean flag2 = hasHeightForProperty(state1, WALL_HEIGHT_SOUTH); + boolean flag3 = hasHeightForProperty(state1, WALL_HEIGHT_WEST); + return this.func_235626_a_(reader, state1, pos, state2, flag, flag1, flag2, flag3); + } + + private BlockState func_235627_a_(IWorldReader reader, BlockPos p_235627_2_, BlockState p_235627_3_, BlockPos p_235627_4_, + BlockState p_235627_5_, Direction directionIn) { + Direction direction = directionIn.getOpposite(); + boolean flag = directionIn == Direction.NORTH + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_NORTH); + boolean flag1 = directionIn == Direction.EAST + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_EAST); + boolean flag2 = directionIn == Direction.SOUTH + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_SOUTH); + boolean flag3 = directionIn == Direction.WEST + ? this.shouldConnect(p_235627_5_, p_235627_5_.isSolidSide(reader, p_235627_4_, direction), direction) + : hasHeightForProperty(p_235627_3_, WALL_HEIGHT_WEST); + BlockPos blockpos = p_235627_2_.up(); + BlockState blockstate = reader.getBlockState(blockpos); + return this.func_235626_a_(reader, p_235627_3_, blockpos, blockstate, flag, flag1, flag2, flag3); + } + + private BlockState func_235626_a_(IWorldReader reader, BlockState state, BlockPos pos, BlockState collisionState, boolean connectedSouth, + boolean connectedWest, boolean connectedNorth, boolean connectedEast) { + VoxelShape voxelshape = collisionState.getCollisionShape(reader, pos).project(Direction.DOWN); + BlockState blockstate = this.func_235630_a_(state, connectedSouth, connectedWest, connectedNorth, connectedEast, voxelshape); + return blockstate.with(UP, Boolean.valueOf(this.func_235628_a_(blockstate, collisionState, voxelshape))); + } + + private BlockState func_235630_a_(BlockState state, boolean connectedSouth, boolean connectedWest, boolean connectedNorth, + boolean connectedEast, VoxelShape shape) { + return state.with(WALL_HEIGHT_NORTH, this.func_235633_a_(connectedSouth, shape, WALL_CONNECTION_NORTH_SIDE_SHAPE)) + .with(WALL_HEIGHT_EAST, this.func_235633_a_(connectedWest, shape, WALL_CONNECTION_EAST_SIDE_SHAPE)) + .with(WALL_HEIGHT_SOUTH, this.func_235633_a_(connectedNorth, shape, WALL_CONNECTION_SOUTH_SIDE_SHAPE)) + .with(WALL_HEIGHT_WEST, this.func_235633_a_(connectedEast, shape, WALL_CONNECTION_WEST_SIDE_SHAPE)); + } + + private WallHeight func_235633_a_(boolean p_235633_1_, VoxelShape p_235633_2_, VoxelShape p_235633_3_) { + if (p_235633_1_) { + return compareShapes(p_235633_2_, p_235633_3_) ? WallHeight.TALL : WallHeight.LOW; + } else { + return WallHeight.NONE; + } + } + + private boolean func_235628_a_(BlockState p_235628_1_, BlockState p_235628_2_, VoxelShape shape) { + boolean flag = p_235628_2_.getBlock() instanceof WallBlock && p_235628_2_.get(UP); + if (flag) { + return true; + } else { + WallHeight wallheight = p_235628_1_.get(WALL_HEIGHT_NORTH); + WallHeight wallheight1 = p_235628_1_.get(WALL_HEIGHT_SOUTH); + WallHeight wallheight2 = p_235628_1_.get(WALL_HEIGHT_EAST); + WallHeight wallheight3 = p_235628_1_.get(WALL_HEIGHT_WEST); + boolean flag1 = wallheight1 == WallHeight.NONE; + boolean flag2 = wallheight3 == WallHeight.NONE; + boolean flag3 = wallheight2 == WallHeight.NONE; + boolean flag4 = wallheight == WallHeight.NONE; + boolean flag5 = flag4 && flag1 && flag2 && flag3 || flag4 != flag1 || flag2 != flag3; + if (flag5) { + return true; + } else { + boolean flag6 = wallheight == WallHeight.TALL && wallheight1 == WallHeight.TALL + || wallheight2 == WallHeight.TALL && wallheight3 == WallHeight.TALL; + if (flag6) { + return false; + } else { + return p_235628_2_.getBlock().isIn(BlockTags.WALL_POST_OVERRIDE) || compareShapes(shape, CENTER_POLE_SHAPE); + } + } + } + } + + private static boolean hasHeightForProperty(BlockState state, Property heightProperty) { + return state.get(heightProperty) != WallHeight.NONE; + } + + private static boolean compareShapes(VoxelShape shape1, VoxelShape shape2) { + return !VoxelShapes.compare(shape2, shape1, IBooleanFunction.ONLY_FIRST); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafTallBloomingFlowerBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafTallBloomingFlowerBlock.java new file mode 100644 index 0000000..d5ac144 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafTallBloomingFlowerBlock.java @@ -0,0 +1,149 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.feature.RandomPatchFeature; +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.DoublePlantBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.DoubleBlockHalf; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.loot.LootContext; +import net.minecraft.item.TallBlockItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.DoublePlantBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafTallBloomingFlowerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_tall_blooming_flower") + public static final Block block = null; + + public BlueleafTallBloomingFlowerBlock(HemModElements instance) { + super(instance, 28); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new TallBlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new RandomPatchFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature.withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new DoublePlantBlockPlacer())) + .tries(8).func_227317_b_().build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(12); + event.getRegistry().register(feature.setRegistryName("blueleaf_tall_blooming_flower")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_tall_blooming_flower"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends DoublePlantBlock { + public BlockCustomFlower() { + super(Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT).hardnessAndResistance(0f, 0f) + .setLightLevel(s -> 0)); + setRegistryName("blueleaf_tall_blooming_flower"); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + if (state.get(BlockStateProperties.DOUBLE_BLOCK_HALF) != DoubleBlockHalf.LOWER) + return Collections.emptyList(); + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafTallGrassBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafTallGrassBlock.java new file mode 100644 index 0000000..d99bb76 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafTallGrassBlock.java @@ -0,0 +1,160 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.NoiseDependant; +import net.minecraft.world.gen.feature.RandomPatchFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.DoublePlantBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.DoubleBlockHalf; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.loot.LootContext; +import net.minecraft.item.TallBlockItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.DoublePlantBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafTallGrassBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_tall_grass") + public static final Block block = null; + + public BlueleafTallGrassBlock(HemModElements instance) { + super(instance, 26); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new TallBlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new RandomPatchFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature.withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new DoublePlantBlockPlacer())) + .tries(12).build()) + .withPlacement(Placement.COUNT_NOISE.configure(new NoiseDependant(-0.8, 0, 15))); + event.getRegistry().register(feature.setRegistryName("blueleaf_tall_grass")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_tall_grass"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends DoublePlantBlock { + public BlockCustomFlower() { + super(Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT).hardnessAndResistance(0f, 0f) + .setLightLevel(s -> 0)); + setRegistryName("blueleaf_tall_grass"); + } + + @Override + public boolean isReplaceable(BlockState state, BlockItemUseContext useContext) { + return useContext.getItem().getItem() != this.asItem(); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + if (state.get(BlockStateProperties.DOUBLE_BLOCK_HALF) != DoubleBlockHalf.LOWER) + return Collections.emptyList(); + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafTallSproutBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafTallSproutBlock.java new file mode 100644 index 0000000..45dbf4b --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafTallSproutBlock.java @@ -0,0 +1,150 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.NoiseDependant; +import net.minecraft.world.gen.feature.RandomPatchFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.DoublePlantBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.DoubleBlockHalf; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.loot.LootContext; +import net.minecraft.item.TallBlockItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.DoublePlantBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Random; +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafTallSproutBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_tall_sprout") + public static final Block block = null; + + public BlueleafTallSproutBlock(HemModElements instance) { + super(instance, 27); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new TallBlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new RandomPatchFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature.withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new DoublePlantBlockPlacer())) + .tries(12).build()) + .withPlacement(Placement.COUNT_NOISE.configure(new NoiseDependant(-0.8, 0, 15))); + event.getRegistry().register(feature.setRegistryName("blueleaf_tall_sprout")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_tall_sprout"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends DoublePlantBlock { + public BlockCustomFlower() { + super(Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT).hardnessAndResistance(0f, 0f) + .setLightLevel(s -> 0)); + setRegistryName("blueleaf_tall_sprout"); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + if (state.get(BlockStateProperties.DOUBLE_BLOCK_HALF) != DoubleBlockHalf.LOWER) + return Collections.emptyList(); + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafWheatBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafWheatBlock.java new file mode 100644 index 0000000..ac5ae8e --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafWheatBlock.java @@ -0,0 +1,174 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.BlueleafWheatAdditionalGenerationConditionProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.NoiseDependant; +import net.minecraft.world.gen.feature.RandomPatchFeature; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BlueleafWheatBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_wheat") + public static final Block block = null; + + public BlueleafWheatBlock(HemModElements instance) { + super(instance, 42); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new RandomPatchFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (!BlueleafWheatAdditionalGenerationConditionProcedure + .executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature.withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())).tries(256) + .build()) + .withPlacement(Placement.COUNT_NOISE.configure(new NoiseDependant(-0.8, 0, 40))); + event.getRegistry().register(feature.setRegistryName("blueleaf_wheat")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:blueleaf_wheat"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.REGENERATION, 100, Block.Properties.create(Material.PLANTS).doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("blueleaf_wheat"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 32, 16)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BlueleafWoodBlock.java b/src/main/java/studio/halbear/hem/block/BlueleafWoodBlock.java new file mode 100644 index 0000000..5421d11 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BlueleafWoodBlock.java @@ -0,0 +1,97 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.common.IPlantable; + +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.EnumProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.List; +import java.util.Collections; + +@HemModElements.ModElement.Tag +public class BlueleafWoodBlock extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_wood") + public static final Block block = null; + + public BlueleafWoodBlock(HemModElements instance) { + super(instance, 16); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + public static class CustomBlock extends Block { + public static final EnumProperty AXIS = BlockStateProperties.AXIS; + + public CustomBlock() { + super(Block.Properties.create(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(0.5f, 10f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.AXE)); + this.setDefaultState(this.stateContainer.getBaseState().with(AXIS, Direction.Axis.Y)); + setRegistryName("blueleaf_wood"); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 15; + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(AXIS); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(AXIS, context.getFace().getAxis()); + } + + @Override + public BlockState rotate(BlockState state, Rotation rot) { + if (rot == Rotation.CLOCKWISE_90 || rot == Rotation.COUNTERCLOCKWISE_90) { + if ((Direction.Axis) state.get(AXIS) == Direction.Axis.X) { + return state.with(AXIS, Direction.Axis.Z); + } else if ((Direction.Axis) state.get(AXIS) == Direction.Axis.Z) { + return state.with(AXIS, Direction.Axis.X); + } + } + return state; + } + + @Override + public boolean canSustainPlant(BlockState state, IBlockReader world, BlockPos pos, Direction direction, IPlantable plantable) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(BlueleafLogBlock.block)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/BulbFlowerBlock.java b/src/main/java/studio/halbear/hem/block/BulbFlowerBlock.java new file mode 100644 index 0000000..bfe8910 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/BulbFlowerBlock.java @@ -0,0 +1,212 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.BulbFlowerUpdateTickProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Hand; +import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class BulbFlowerBlock extends HemModElements.ModElement { + @ObjectHolder("hem:bulb_flower") + public static final Block block = null; + + public BulbFlowerBlock(HemModElements instance) { + super(instance, 40); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(7).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(15); + event.getRegistry().register(feature.setRegistryName("bulb_flower")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:bulb_flower"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.HASTE, 100, Block.Properties.create(Material.PLANTS).tickRandomly().doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).speedFactor(0.5f).setLightLevel(s -> 1)); + setRegistryName("bulb_flower"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 32, 16)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + BulbFlowerUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public ActionResultType onBlockActivated(BlockState blockstate, World world, BlockPos pos, PlayerEntity entity, Hand hand, + BlockRayTraceResult hit) { + super.onBlockActivated(blockstate, world, pos, entity, hand, hit); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + double hitX = hit.getHitVec().x; + double hitY = hit.getHitVec().y; + double hitZ = hit.getHitVec().z; + Direction direction = hit.getFace(); + + BulbFlowerUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return ActionResultType.SUCCESS; + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/DanglingFluorescentLeavesBlock.java b/src/main/java/studio/halbear/hem/block/DanglingFluorescentLeavesBlock.java new file mode 100644 index 0000000..3c39876 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/DanglingFluorescentLeavesBlock.java @@ -0,0 +1,198 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.DanglingFluorescentLeavesNeighbourBlockChangesProcedure; +import studio.halbear.hem.procedures.DanglingFluorescentLeavesBlockValidPlacementConditionProcedure; +import studio.halbear.hem.particle.FluorescentLeavesParticlesParticle; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IWorldReader; +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class DanglingFluorescentLeavesBlock extends HemModElements.ModElement { + @ObjectHolder("hem:dangling_fluorescent_leaves") + public static final Block block = null; + + public DanglingFluorescentLeavesBlock(HemModElements instance) { + super(instance, 23); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.ROCK).sound(SoundType.GROUND).hardnessAndResistance(1f, 10f).setLightLevel(s -> 10) + .doesNotBlockMovement().notSolid().tickRandomly().setNeedsPostProcessing((bs, br, bp) -> true) + .setEmmisiveRendering((bs, br, bp) -> true).setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("dangling_fluorescent_leaves"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return state.getFluidState().isEmpty(); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(2, 0, 2, 14, 16, 14)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public boolean isValidPosition(BlockState blockstate, IWorldReader worldIn, BlockPos pos) { + if (worldIn instanceof IWorld) { + IWorld world = (IWorld) worldIn; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + return DanglingFluorescentLeavesBlockValidPlacementConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + return super.isValidPosition(blockstate, worldIn, pos); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return !state.isValidPosition(world, currentPos) + ? Blocks.AIR.getDefaultState() + : super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public boolean isLadder(BlockState state, IWorldReader world, BlockPos pos, LivingEntity entity) { + return true; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public void neighborChanged(BlockState blockstate, World world, BlockPos pos, Block neighborBlock, BlockPos fromPos, boolean moving) { + super.neighborChanged(blockstate, world, pos, neighborBlock, fromPos, moving); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (world.getRedstonePowerFromNeighbors(new BlockPos(x, y, z)) > 0) { + } else { + } + + DanglingFluorescentLeavesNeighbourBlockChangesProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (true) + for (int l = 0; l < 1; ++l) { + double d0 = (x + random.nextFloat()); + double d1 = (y + random.nextFloat()); + double d2 = (z + random.nextFloat()); + int i1 = random.nextInt(2) * 2 - 1; + double d3 = (random.nextFloat() - 0.5D) * 0.5D; + double d4 = (random.nextFloat() - 0.5D) * 0.5D; + double d5 = (random.nextFloat() - 0.5D) * 0.5D; + world.addParticle(FluorescentLeavesParticlesParticle.particle, d0, d1, d2, d3, d4, d5); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/FallenLeavesBlock.java b/src/main/java/studio/halbear/hem/block/FallenLeavesBlock.java new file mode 100644 index 0000000..54e9405 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/FallenLeavesBlock.java @@ -0,0 +1,154 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.FallenLeavesEntityCollidesInTheBlockProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.state.StateContainer; +import net.minecraft.state.BooleanProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.fluid.Fluids; +import net.minecraft.fluid.FluidState; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.IWaterLoggable; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class FallenLeavesBlock extends HemModElements.ModElement { + @ObjectHolder("hem:fallen_leaves") + public static final Block block = null; + + public FallenLeavesBlock(HemModElements instance) { + super(instance, 24); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block implements IWaterLoggable { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + + public CustomBlock() { + super(Block.Properties.create(Material.LEAVES).sound(SoundType.PLANT).hardnessAndResistance(1f, 10f).setLightLevel(s -> 0) + .doesNotBlockMovement().slipperiness(0.7999999999999999f).notSolid().tickRandomly().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(WATERLOGGED, false)); + setRegistryName("fallen_leaves"); + } + + @OnlyIn(Dist.CLIENT) + public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) { + return adjacentBlockState.getBlock() == this ? true : super.isSideInvisible(state, adjacentBlockState, side); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return state.getFluidState().isEmpty(); + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 1, 16)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(WATERLOGGED); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + boolean flag = context.getWorld().getFluidState(context.getPos()).getFluid() == Fluids.WATER; + return this.getDefaultState().with(WATERLOGGED, flag); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state); + } + + @Override + public BlockState updatePostPlacement(BlockState state, Direction facing, BlockState facingState, IWorld world, BlockPos currentPos, + BlockPos facingPos) { + if (state.get(WATERLOGGED)) { + world.getPendingFluidTicks().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } + return super.updatePostPlacement(state, facing, facingState, world, currentPos, facingPos); + } + + @Override + public boolean isReplaceable(BlockState state, BlockItemUseContext context) { + return context.getItem().getItem() != this.asItem(); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + FallenLeavesEntityCollidesInTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/GiantLilyPadBlock.java b/src/main/java/studio/halbear/hem/block/GiantLilyPadBlock.java new file mode 100644 index 0000000..97205b7 --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/GiantLilyPadBlock.java @@ -0,0 +1,173 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.GiantLilyPadEntityCollidesInTheBlockProcedure; +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.Mirror; +import net.minecraft.util.Direction; +import net.minecraft.state.StateContainer; +import net.minecraft.state.DirectionProperty; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class GiantLilyPadBlock extends HemModElements.ModElement { + @ObjectHolder("hem:giant_lily_pad") + public static final Block block = null; + + public GiantLilyPadBlock(HemModElements instance) { + super(instance, 38); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block { + public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; + + public CustomBlock() { + super(Block.Properties.create(Material.PLANTS).sound(SoundType.LILY_PADS).hardnessAndResistance(0.1f, 0f).setLightLevel(s -> 1) + .harvestLevel(1).harvestTool(ToolType.HOE).slipperiness(1f).jumpFactor(1.5f).notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); + setRegistryName("giant_lily_pad"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + switch ((Direction) state.get(FACING)) { + case SOUTH : + default : + return VoxelShapes.or(makeCuboidShape(22, 0, 22, -6, 1, -6)) + + .withOffset(offset.x, offset.y, offset.z); + case NORTH : + return VoxelShapes.or(makeCuboidShape(-6, 0, -6, 22, 1, 22)) + + .withOffset(offset.x, offset.y, offset.z); + case EAST : + return VoxelShapes.or(makeCuboidShape(22, 0, -6, -6, 1, 22)) + + .withOffset(offset.x, offset.y, offset.z); + case WEST : + return VoxelShapes.or(makeCuboidShape(-6, 0, 22, 22, 1, -6)) + + .withOffset(offset.x, offset.y, offset.z); + } + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); + } + + public BlockState rotate(BlockState state, Rotation rot) { + return state.with(FACING, rot.rotate(state.get(FACING))); + } + + public BlockState mirror(BlockState state, Mirror mirrorIn) { + return state.rotate(mirrorIn.toRotation(state.get(FACING))); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (true) + for (int l = 0; l < 1; ++l) { + double d0 = (double) ((float) x + 0.5) + (double) (random.nextFloat() - 0.5) * 0.4D; + double d1 = ((double) ((float) y + 0.7) + (double) (random.nextFloat() - 0.5) * 0.4D) + 0.5; + double d2 = (double) ((float) z + 0.5) + (double) (random.nextFloat() - 0.5) * 0.4D; + world.addParticle(LilyPadParticlesParticle.particle, d0, d1, d2, 0, 0, 0); + } + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + GiantLilyPadEntityCollidesInTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/MuncherBlock.java b/src/main/java/studio/halbear/hem/block/MuncherBlock.java new file mode 100644 index 0000000..0623bef --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/MuncherBlock.java @@ -0,0 +1,410 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.MuncherUpdateTickProcedure; +import studio.halbear.hem.procedures.MuncherPlantAddedProcedure; +import studio.halbear.hem.procedures.MuncherBlockDestroyedByPlayerProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.items.wrapper.SidedInvWrapper; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.util.LazyOptional; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.common.ToolType; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.NonNullList; +import net.minecraft.util.Mirror; +import net.minecraft.util.Hand; +import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; +import net.minecraft.tileentity.TileEntityType; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.LockableLootTileEntity; +import net.minecraft.state.StateContainer; +import net.minecraft.state.DirectionProperty; +import net.minecraft.network.play.server.SUpdateTileEntityPacket; +import net.minecraft.network.NetworkManager; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItemUseContext; +import net.minecraft.item.BlockItem; +import net.minecraft.inventory.container.INamedContainerProvider; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.ChestContainer; +import net.minecraft.inventory.ItemStackHelper; +import net.minecraft.inventory.InventoryHelper; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.fluid.FluidState; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.HorizontalBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.stream.IntStream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class MuncherBlock extends HemModElements.ModElement { + @ObjectHolder("hem:muncher") + public static final Block block = null; + @ObjectHolder("hem:muncher") + public static final TileEntityType tileEntityType = null; + + public MuncherBlock(HemModElements instance) { + super(instance, 33); + FMLJavaModLoadingContext.get().getModEventBus().register(new TileEntityRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomBlock()); + elements.items + .add(() -> new BlockItem(block, new Item.Properties().group(BlueleafTabItemGroup.tab)).setRegistryName(block.getRegistryName())); + } + + private static class TileEntityRegisterHandler { + @SubscribeEvent + public void registerTileEntity(RegistryEvent.Register> event) { + event.getRegistry().register(TileEntityType.Builder.create(CustomTileEntity::new, block).build(null).setRegistryName("muncher")); + } + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutoutMipped()); + } + + public static class CustomBlock extends Block { + public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; + + public CustomBlock() { + super(Block.Properties.create(Material.PLANTS).sound(SoundType.PLANT).hardnessAndResistance(1f, 1f).setLightLevel(s -> 0).harvestLevel(1) + .harvestTool(ToolType.HOE).doesNotBlockMovement().notSolid().setOpaque((bs, br, bp) -> false)); + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); + setRegistryName("muncher"); + } + + @Override + public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) { + return true; + } + + @Override + public int getOpacity(BlockState state, IBlockReader worldIn, BlockPos pos) { + return 0; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + switch ((Direction) state.get(FACING)) { + case SOUTH : + default : + return VoxelShapes.or(makeCuboidShape(16, 0, 16, 0, 32, 0)) + + .withOffset(offset.x, offset.y, offset.z); + case NORTH : + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 32, 16)) + + .withOffset(offset.x, offset.y, offset.z); + case EAST : + return VoxelShapes.or(makeCuboidShape(16, 0, 0, 0, 32, 16)) + + .withOffset(offset.x, offset.y, offset.z); + case WEST : + return VoxelShapes.or(makeCuboidShape(0, 0, 16, 16, 32, 0)) + + .withOffset(offset.x, offset.y, offset.z); + } + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); + } + + @Override + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); + } + + public BlockState rotate(BlockState state, Rotation rot) { + return state.with(FACING, rot.rotate(state.get(FACING))); + } + + public BlockState mirror(BlockState state, Mirror mirrorIn) { + return state.rotate(mirrorIn.toRotation(state.get(FACING))); + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(this, 1)); + } + + @Override + public void onBlockAdded(BlockState blockstate, World world, BlockPos pos, BlockState oldState, boolean moving) { + super.onBlockAdded(blockstate, world, pos, oldState, moving); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + world.getPendingBlockTicks().scheduleTick(pos, this, 2); + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + super.tick(blockstate, world, pos, random); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + MuncherUpdateTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + world.getPendingBlockTicks().scheduleTick(pos, this, 2); + } + + @Override + public boolean removedByPlayer(BlockState blockstate, World world, BlockPos pos, PlayerEntity entity, boolean willHarvest, FluidState fluid) { + boolean retval = super.removedByPlayer(blockstate, world, pos, entity, willHarvest, fluid); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + MuncherBlockDestroyedByPlayerProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public ActionResultType onBlockActivated(BlockState blockstate, World world, BlockPos pos, PlayerEntity entity, Hand hand, + BlockRayTraceResult hit) { + super.onBlockActivated(blockstate, world, pos, entity, hand, hit); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + double hitX = hit.getHitVec().x; + double hitY = hit.getHitVec().y; + double hitZ = hit.getHitVec().z; + Direction direction = hit.getFace(); + + MuncherPlantAddedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return ActionResultType.SUCCESS; + } + + @Override + public INamedContainerProvider getContainer(BlockState state, World worldIn, BlockPos pos) { + TileEntity tileEntity = worldIn.getTileEntity(pos); + return tileEntity instanceof INamedContainerProvider ? (INamedContainerProvider) tileEntity : null; + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return new CustomTileEntity(); + } + + @Override + public boolean eventReceived(BlockState state, World world, BlockPos pos, int eventID, int eventParam) { + super.eventReceived(state, world, pos, eventID, eventParam); + TileEntity tileentity = world.getTileEntity(pos); + return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam); + } + + @Override + public void onReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean isMoving) { + if (state.getBlock() != newState.getBlock()) { + TileEntity tileentity = world.getTileEntity(pos); + if (tileentity instanceof CustomTileEntity) { + InventoryHelper.dropInventoryItems(world, pos, (CustomTileEntity) tileentity); + world.updateComparatorOutputLevel(pos, this); + } + + super.onReplaced(state, world, pos, newState, isMoving); + } + } + + @Override + public boolean hasComparatorInputOverride(BlockState state) { + return true; + } + + @Override + public int getComparatorInputOverride(BlockState blockState, World world, BlockPos pos) { + TileEntity tileentity = world.getTileEntity(pos); + if (tileentity instanceof CustomTileEntity) + return Container.calcRedstoneFromInventory((CustomTileEntity) tileentity); + else + return 0; + } + } + + public static class CustomTileEntity extends LockableLootTileEntity implements ISidedInventory { + private NonNullList stacks = NonNullList.withSize(0, ItemStack.EMPTY); + + protected CustomTileEntity() { + super(tileEntityType); + } + + @Override + public void read(BlockState blockState, CompoundNBT compound) { + super.read(blockState, compound); + if (!this.checkLootAndRead(compound)) { + this.stacks = NonNullList.withSize(this.getSizeInventory(), ItemStack.EMPTY); + } + ItemStackHelper.loadAllItems(compound, this.stacks); + } + + @Override + public CompoundNBT write(CompoundNBT compound) { + super.write(compound); + if (!this.checkLootAndWrite(compound)) { + ItemStackHelper.saveAllItems(compound, this.stacks); + } + return compound; + } + + @Override + public SUpdateTileEntityPacket getUpdatePacket() { + return new SUpdateTileEntityPacket(this.pos, 0, this.getUpdateTag()); + } + + @Override + public CompoundNBT getUpdateTag() { + return this.write(new CompoundNBT()); + } + + @Override + public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) { + this.read(this.getBlockState(), pkt.getNbtCompound()); + } + + @Override + public int getSizeInventory() { + return stacks.size(); + } + + @Override + public boolean isEmpty() { + for (ItemStack itemstack : this.stacks) + if (!itemstack.isEmpty()) + return false; + return true; + } + + @Override + public ITextComponent getDefaultName() { + return new StringTextComponent("muncher"); + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public Container createMenu(int id, PlayerInventory player) { + return ChestContainer.createGeneric9X3(id, player, this); + } + + @Override + public ITextComponent getDisplayName() { + return new StringTextComponent("Muncher 'Flower'"); + } + + @Override + protected NonNullList getItems() { + return this.stacks; + } + + @Override + protected void setItems(NonNullList stacks) { + this.stacks = stacks; + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) { + return true; + } + + @Override + public int[] getSlotsForFace(Direction side) { + return IntStream.range(0, this.getSizeInventory()).toArray(); + } + + @Override + public boolean canInsertItem(int index, ItemStack stack, @Nullable Direction direction) { + return this.isItemValidForSlot(index, stack); + } + + @Override + public boolean canExtractItem(int index, ItemStack stack, Direction direction) { + return true; + } + + private final LazyOptional[] handlers = SidedInvWrapper.create(this, Direction.values()); + + @Override + public LazyOptional getCapability(Capability capability, @Nullable Direction facing) { + if (!this.removed && facing != null && capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) + return handlers[facing.ordinal()].cast(); + return super.getCapability(capability, facing); + } + + @Override + public void remove() { + super.remove(); + for (LazyOptional handler : handlers) + handler.invalidate(); + } + } +} diff --git a/src/main/java/studio/halbear/hem/block/MuncherSproutBlock.java b/src/main/java/studio/halbear/hem/block/MuncherSproutBlock.java new file mode 100644 index 0000000..b9c1eff --- /dev/null +++ b/src/main/java/studio/halbear/hem/block/MuncherSproutBlock.java @@ -0,0 +1,241 @@ + +package studio.halbear.hem.block; + +import studio.halbear.hem.procedures.MuncherSproutClientDisplayRandomTickProcedure; +import studio.halbear.hem.procedures.MuncherSproutAdditionalGenerationConditionProcedure; +import studio.halbear.hem.procedures.MuncherGenerationOnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.PlantType; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.gen.feature.Features; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.DefaultFlowersFeature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.feature.BlockClusterFeatureConfig; +import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider; +import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.world.IBlockReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.VoxelShape; +import net.minecraft.util.math.shapes.ISelectionContext; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.potion.Effects; +import net.minecraft.loot.LootContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.BlockItem; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.Minecraft; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.FlowerBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class MuncherSproutBlock extends HemModElements.ModElement { + @ObjectHolder("hem:muncher_sprout") + public static final Block block = null; + + public MuncherSproutBlock(HemModElements instance) { + super(instance, 105); + MinecraftForge.EVENT_BUS.register(this); + FMLJavaModLoadingContext.get().getModEventBus().register(new FeatureRegisterHandler()); + } + + @Override + public void initElements() { + elements.blocks.add(() -> new BlockCustomFlower()); + elements.items.add(() -> new BlockItem(block, new Item.Properties().group(null)).setRegistryName(block.getRegistryName())); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + RenderTypeLookup.setRenderLayer(block, RenderType.getCutout()); + } + + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + private static class FeatureRegisterHandler { + @SubscribeEvent + public void registerFeature(RegistryEvent.Register> event) { + feature = new DefaultFlowersFeature(BlockClusterFeatureConfig.field_236587_a_) { + @Override + public BlockState getFlowerToPlace(Random random, BlockPos bp, BlockClusterFeatureConfig fc) { + return block.getDefaultState(); + } + + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, BlockClusterFeatureConfig config) { + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + if (!MuncherSproutAdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + return false; + return super.generate(world, generator, random, pos, config); + } + }; + configuredFeature = feature + .withConfiguration( + (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(block.getDefaultState()), new SimpleBlockPlacer())) + .tries(5).build()) + .withPlacement(Features.Placements.VEGETATION_PLACEMENT).withPlacement(Features.Placements.HEIGHTMAP_PLACEMENT).func_242731_b(10); + event.getRegistry().register(feature.setRegistryName("muncher_sprout")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:muncher_sprout"), configuredFeature); + } + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.VEGETAL_DECORATION).add(() -> configuredFeature); + } + + public static class BlockCustomFlower extends FlowerBlock { + public BlockCustomFlower() { + super(Effects.NAUSEA, 100, Block.Properties.create(Material.PLANTS).tickRandomly().doesNotBlockMovement().sound(SoundType.PLANT) + .hardnessAndResistance(0f, 0f).setLightLevel(s -> 0)); + setRegistryName("muncher_sprout"); + } + + @Override + public int getStewEffectDuration() { + return 100; + } + + @Override + public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext context) { + Vector3d offset = state.getOffset(world, pos); + return VoxelShapes.or(makeCuboidShape(0, 0, 0, 16, 16, 16)) + + .withOffset(offset.x, offset.y, offset.z); + } + + @Override + public int getFlammability(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 100; + } + + @Override + public int getFireSpreadSpeed(BlockState state, IBlockReader world, BlockPos pos, Direction face) { + return 60; + } + + @Override + public List getDrops(BlockState state, LootContext.Builder builder) { + List dropsOriginal = super.getDrops(state, builder); + if (!dropsOriginal.isEmpty()) + return dropsOriginal; + return Collections.singletonList(new ItemStack(MuncherBlock.block)); + } + + @Override + public PlantType getPlantType(IBlockReader world, BlockPos pos) { + return PlantType.PLAINS; + } + + @Override + public void onBlockAdded(BlockState blockstate, World world, BlockPos pos, BlockState oldState, boolean moving) { + super.onBlockAdded(blockstate, world, pos, oldState, moving); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + MuncherGenerationOnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + MuncherGenerationOnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState blockstate, World world, BlockPos pos, Random random) { + super.animateTick(blockstate, world, pos, random); + PlayerEntity entity = Minecraft.getInstance().player; + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + MuncherSproutClientDisplayRandomTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void onEntityCollision(BlockState blockstate, World world, BlockPos pos, Entity entity) { + super.onEntityCollision(blockstate, world, pos, entity); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + + MuncherGenerationOnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/AirboatEntity.java b/src/main/java/studio/halbear/hem/entity/AirboatEntity.java new file mode 100644 index 0000000..ef68243 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/AirboatEntity.java @@ -0,0 +1,226 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.AirboatRightClickedOnEntityProcedure; +import studio.halbear.hem.procedures.AirboatOnInitialEntitySpawnProcedure; +import studio.halbear.hem.procedures.AirboatOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.AirboatRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IServerWorld; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Hand; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ActionResultType; +import net.minecraft.pathfinding.FlyingPathNavigator; +import net.minecraft.network.IPacket; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.ai.controller.FlyingMovementController; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; +import net.minecraft.block.BlockState; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class AirboatEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.MONSTER) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).size(5f, 9f)) + .build("airboat").setRegistryName("airboat"); + + public AirboatEntity(HemModElements instance) { + super(instance, 292); + FMLJavaModLoadingContext.get().getModEventBus().register(new AirboatRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)).setRegistryName("airboat_spawn_egg")); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 100); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 3); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + ammma = ammma.createMutableAttribute(Attributes.FLYING_SPEED, 0.3); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + enablePersistence(); + this.moveController = new FlyingMovementController(this, 10, true); + this.navigator = new FlyingPathNavigator(this, this.world); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public boolean canDespawn(double distanceToClosestPlayer) { + return false; + } + + @Override + public double getMountedYOffset() { + return super.getMountedYOffset() + -7.2; + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); + } + + @Override + public boolean onLivingFall(float l, float d) { + return false; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.DROWN) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ILivingEntityData onInitialSpawn(IServerWorld world, DifficultyInstance difficulty, SpawnReason reason, + @Nullable ILivingEntityData livingdata, @Nullable CompoundNBT tag) { + ILivingEntityData retval = super.onInitialSpawn(world, difficulty, reason, livingdata, tag); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + AirboatOnInitialEntitySpawnProcedure + .executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { + ItemStack itemstack = sourceentity.getHeldItem(hand); + ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); + super.func_230254_b_(sourceentity, hand); + sourceentity.startRiding(this); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + AirboatRightClickedOnEntityProcedure.executeProcedure( + Stream.of(new AbstractMap.SimpleEntry<>("entity", entity), new AbstractMap.SimpleEntry<>("sourceentity", sourceentity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + AirboatOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + protected void updateFallState(double y, boolean onGroundIn, BlockState state, BlockPos pos) { + } + + @Override + public void setNoGravity(boolean ignored) { + super.setNoGravity(true); + } + + public void livingTick() { + super.livingTick(); + this.setNoGravity(true); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/DormantAgedEmberleafMilitaryBotEntity.java b/src/main/java/studio/halbear/hem/entity/DormantAgedEmberleafMilitaryBotEntity.java new file mode 100644 index 0000000..f01135f --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/DormantAgedEmberleafMilitaryBotEntity.java @@ -0,0 +1,200 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.EmberleafMilitaryBotEntityIsHurtProcedure; +import studio.halbear.hem.procedures.EmberleafMilitaryBotEntityDiesProcedure; +import studio.halbear.hem.procedures.DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.DormantAgedEmberleafMilitaryBotRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.network.IPacket; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.monster.MonsterEntity; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class DormantAgedEmberleafMilitaryBotEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.AMBIENT) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(128).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).immuneToFire() + .size(1f, 3f)).build("dormant_aged_emberleaf_military_bot").setRegistryName("dormant_aged_emberleaf_military_bot"); + + public DormantAgedEmberleafMilitaryBotEntity(HemModElements instance) { + super(instance, 58); + FMLJavaModLoadingContext.get().getModEventBus().register(new DormantAgedEmberleafMilitaryBotRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)) + .setRegistryName("dormant_aged_emberleaf_military_bot_spawn_egg")); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.AMBIENT).add(new MobSpawnInfo.Spawners(entity, 3, 1, 1)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.NO_RESTRICTIONS, + Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MobEntity::canSpawnOn); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 40); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 6); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 32); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 5); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_KNOCKBACK, 1.5); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends MonsterEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 10; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.anvil.land")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.large_blast")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + Entity sourceentity = source.getTrueSource(); + + EmberleafMilitaryBotEntityIsHurtProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void onDeath(DamageSource source) { + super.onDeath(source); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity sourceentity = source.getTrueSource(); + Entity entity = this; + + EmberleafMilitaryBotEntityDiesProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/DormantEmberleafMilitaryBotEntity.java b/src/main/java/studio/halbear/hem/entity/DormantEmberleafMilitaryBotEntity.java new file mode 100644 index 0000000..636575d --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/DormantEmberleafMilitaryBotEntity.java @@ -0,0 +1,200 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.EmberleafMilitaryBotEntityIsHurtProcedure; +import studio.halbear.hem.procedures.EmberleafMilitaryBotEntityDiesProcedure; +import studio.halbear.hem.procedures.DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.DormantEmberleafMilitaryBotRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.network.IPacket; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.monster.MonsterEntity; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class DormantEmberleafMilitaryBotEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.AMBIENT) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(128).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).immuneToFire() + .size(1f, 3f)).build("dormant_emberleaf_military_bot").setRegistryName("dormant_emberleaf_military_bot"); + + public DormantEmberleafMilitaryBotEntity(HemModElements instance) { + super(instance, 59); + FMLJavaModLoadingContext.get().getModEventBus().register(new DormantEmberleafMilitaryBotRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)) + .setRegistryName("dormant_emberleaf_military_bot_spawn_egg")); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.AMBIENT).add(new MobSpawnInfo.Spawners(entity, 3, 1, 1)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.NO_RESTRICTIONS, + Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MobEntity::canSpawnOn); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 40); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 6); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 32); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 5); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_KNOCKBACK, 1.5); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends MonsterEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 10; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.anvil.land")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.large_blast")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + Entity sourceentity = source.getTrueSource(); + + EmberleafMilitaryBotEntityIsHurtProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void onDeath(DamageSource source) { + super.onDeath(source); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity sourceentity = source.getTrueSource(); + Entity entity = this; + + EmberleafMilitaryBotEntityDiesProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryBotEntity.java b/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryBotEntity.java new file mode 100644 index 0000000..3188004 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryBotEntity.java @@ -0,0 +1,206 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.EmberleafMilitaryBotOnEntityTickUpdateProcedure; +import studio.halbear.hem.procedures.EmberleafMilitaryBotEntityIsHurtProcedure; +import studio.halbear.hem.procedures.EmberleafMilitaryBotEntityDiesProcedure; +import studio.halbear.hem.entity.renderer.EmberleafMilitaryBotRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.network.IPacket; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.monster.MonsterEntity; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal; +import net.minecraft.entity.ai.goal.MeleeAttackGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.LookAtGoal; +import net.minecraft.entity.ai.goal.HurtByTargetGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class EmberleafMilitaryBotEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.AMBIENT) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(128).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).immuneToFire() + .size(1f, 3f)).build("emberleaf_military_bot").setRegistryName("emberleaf_military_bot"); + + public EmberleafMilitaryBotEntity(HemModElements instance) { + super(instance, 60); + FMLJavaModLoadingContext.get().getModEventBus().register(new EmberleafMilitaryBotRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)) + .setRegistryName("emberleaf_military_bot_spawn_egg")); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 40); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 6); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 32); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 5); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_KNOCKBACK, 1.5); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends MonsterEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 10; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2, true) { + @Override + protected double getAttackReachSqr(LivingEntity entity) { + return (double) (4.0 + entity.getWidth() * entity.getWidth()); + } + }); + this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, ServerPlayerEntity.class, false, false)); + this.targetSelector.addGoal(3, new NearestAttackableTargetGoal(this, PlayerEntity.class, false, false)); + this.targetSelector.addGoal(4, new HurtByTargetGoal(this).setCallsForHelp()); + this.goalSelector.addGoal(5, new RandomWalkingGoal(this, 0.8)); + this.goalSelector.addGoal(6, new LookAtGoal(this, ServerPlayerEntity.class, (float) 32)); + this.goalSelector.addGoal(7, new LookRandomlyGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.fire.extinguish")); + } + + @Override + public void playStepSound(BlockPos pos, BlockState blockIn) { + this.playSound((net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.anvil.step")), 0.15f, 1); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.anvil.land")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.large_blast")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + Entity sourceentity = source.getTrueSource(); + + EmberleafMilitaryBotEntityIsHurtProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void onDeath(DamageSource source) { + super.onDeath(source); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity sourceentity = source.getTrueSource(); + Entity entity = this; + + EmberleafMilitaryBotEntityDiesProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + EmberleafMilitaryBotOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryRobotLowerHalfEntity.java b/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryRobotLowerHalfEntity.java new file mode 100644 index 0000000..1b1da04 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryRobotLowerHalfEntity.java @@ -0,0 +1,176 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure; +import studio.halbear.hem.procedures.EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.EmberleafMilitaryRobotLowerHalfRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IServerWorld; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.network.IPacket; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class EmberleafMilitaryRobotLowerHalfEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.MONSTER) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).immuneToFire() + .size(0.6f, 1.8f)).build("emberleaf_military_robot_lower_half").setRegistryName("emberleaf_military_robot_lower_half"); + + public EmberleafMilitaryRobotLowerHalfEntity(HemModElements instance) { + super(instance, 61); + FMLJavaModLoadingContext.get().getModEventBus().register(new EmberleafMilitaryRobotLowerHalfRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)) + .setRegistryName("emberleaf_military_robot_lower_half_spawn_egg")); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.4); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 10); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 3); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new WaterAvoidingRandomWalkingGoal(this, 0.7)); + this.goalSelector.addGoal(2, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 16, 1, 1.2)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.blast")); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.anvil.land")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.explode")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ILivingEntityData onInitialSpawn(IServerWorld world, DifficultyInstance difficulty, SpawnReason reason, + @Nullable ILivingEntityData livingdata, @Nullable CompoundNBT tag) { + ILivingEntityData retval = super.onInitialSpawn(world, difficulty, reason, livingdata, tag); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryRobotUpperHalfEntity.java b/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryRobotUpperHalfEntity.java new file mode 100644 index 0000000..9279a90 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/EmberleafMilitaryRobotUpperHalfEntity.java @@ -0,0 +1,190 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure; +import studio.halbear.hem.procedures.EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.EmberleafMilitaryRobotUpperHalfRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IServerWorld; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.network.IPacket; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.projectile.AbstractArrowEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class EmberleafMilitaryRobotUpperHalfEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.MONSTER) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).immuneToFire() + .size(1.2f, 1.5f)).build("emberleaf_military_robot_upper_half").setRegistryName("emberleaf_military_robot_upper_half"); + + public EmberleafMilitaryRobotUpperHalfEntity(HemModElements instance) { + super(instance, 62); + FMLJavaModLoadingContext.get().getModEventBus().register(new EmberleafMilitaryRobotUpperHalfRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)) + .setRegistryName("emberleaf_military_robot_upper_half_spawn_egg")); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.4); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 10); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 3); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new WaterAvoidingRandomWalkingGoal(this, 0.7)); + this.goalSelector.addGoal(2, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 16, 1, 1.2)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.firework_rocket.blast")); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.anvil.land")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.explode")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof AbstractArrowEntity) + return false; + if (source.getImmediateSource() instanceof PlayerEntity) + return false; + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.DROWN) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source.isExplosion()) + return false; + if (source.getDamageType().equals("trident")) + return false; + if (source == DamageSource.ANVIL) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ILivingEntityData onInitialSpawn(IServerWorld world, DifficultyInstance difficulty, SpawnReason reason, + @Nullable ILivingEntityData livingdata, @Nullable CompoundNBT tag) { + ILivingEntityData retval = super.onInitialSpawn(world, difficulty, reason, livingdata, tag); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/FluffaloEntity.java b/src/main/java/studio/halbear/hem/entity/FluffaloEntity.java new file mode 100644 index 0000000..ce46b07 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/FluffaloEntity.java @@ -0,0 +1,195 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.FluffaloRightClickedOnEntityProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.entity.renderer.FluffaloRenderer; +import studio.halbear.hem.block.BlueleafWheatBlock; +import studio.halbear.hem.block.BlueleafLavenderBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Hand; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ActionResultType; +import net.minecraft.network.IPacket; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.entity.projectile.AbstractArrowEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.monster.MonsterEntity; +import net.minecraft.entity.ai.goal.TemptGoal; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.MeleeAttackGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.HurtByTargetGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.block.material.Material; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class FluffaloEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).size(2f, 2f)) + .build("fluffalo").setRegistryName("fluffalo"); + + public FluffaloEntity(HemModElements instance) { + super(instance, 162); + FMLJavaModLoadingContext.get().getModEventBus().register(new FluffaloRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items.add(() -> new SpawnEggItem(entity, -10079488, -3381760, new Item.Properties().group(BlueleafTabItemGroup.tab)) + .setRegistryName("fluffalo_spawn_egg")); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.CREATURE).add(new MobSpawnInfo.Spawners(entity, 10, 1, 3)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, + (entityType, world, reason, pos, + random) -> (world.getBlockState(pos.down()).getMaterial() == Material.ORGANIC && world.getLightSubtracted(pos, 0) > 8)); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.35); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 50); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 3); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends MonsterEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 5; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new RandomWalkingGoal(this, 0.5)); + this.goalSelector.addGoal(2, new TemptGoal(this, 0.4, Ingredient.fromItems(BlueleafLavenderBlock.block.asItem()), false)); + this.goalSelector.addGoal(3, new TemptGoal(this, 0.4, Ingredient.fromItems(BlueleafWheatBlock.block.asItem()), false)); + this.targetSelector.addGoal(4, new HurtByTargetGoal(this).setCallsForHelp()); + this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1, false) { + @Override + protected double getAttackReachSqr(LivingEntity entity) { + return (double) (4.0 + entity.getWidth() * entity.getWidth()); + } + }); + this.goalSelector.addGoal(7, new LookRandomlyGoal(this)); + this.goalSelector.addGoal(8, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.cow.ambient")); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.cow.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.cow.death")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof AbstractArrowEntity) + return false; + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.ANVIL) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { + ItemStack itemstack = sourceentity.getHeldItem(hand); + ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); + super.func_230254_b_(sourceentity, hand); + sourceentity.startRiding(this); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + FluffaloRightClickedOnEntityProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity), + new AbstractMap.SimpleEntry<>("sourceentity", sourceentity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/FluffaloShavedEntity.java b/src/main/java/studio/halbear/hem/entity/FluffaloShavedEntity.java new file mode 100644 index 0000000..8f6066c --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/FluffaloShavedEntity.java @@ -0,0 +1,189 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.FluffaloShavedOnInitialEntitySpawnProcedure; +import studio.halbear.hem.procedures.FluffaloShavedOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.FluffaloShavedRenderer; +import studio.halbear.hem.block.BlueleafWheatBlock; +import studio.halbear.hem.block.BlueleafLavenderBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IServerWorld; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Hand; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ActionResultType; +import net.minecraft.network.IPacket; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.monster.MonsterEntity; +import net.minecraft.entity.ai.goal.TemptGoal; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.MeleeAttackGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.HurtByTargetGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureAttribute; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class FluffaloShavedEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).size(2f, 2f)) + .build("fluffalo_shaved").setRegistryName("fluffalo_shaved"); + + public FluffaloShavedEntity(HemModElements instance) { + super(instance, 268); + FMLJavaModLoadingContext.get().getModEventBus().register(new FluffaloShavedRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.35); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 25); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 0); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends MonsterEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 5; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new RandomWalkingGoal(this, 0.5)); + this.goalSelector.addGoal(2, new TemptGoal(this, 0.4, Ingredient.fromItems(BlueleafLavenderBlock.block.asItem()), false)); + this.goalSelector.addGoal(3, new TemptGoal(this, 0.4, Ingredient.fromItems(BlueleafWheatBlock.block.asItem()), false)); + this.targetSelector.addGoal(4, new HurtByTargetGoal(this).setCallsForHelp()); + this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1, false) { + @Override + protected double getAttackReachSqr(LivingEntity entity) { + return (double) (4.0 + entity.getWidth() * entity.getWidth()); + } + }); + this.goalSelector.addGoal(7, new LookRandomlyGoal(this)); + this.goalSelector.addGoal(8, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.cow.ambient")); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.cow.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.cow.death")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.ANVIL) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ILivingEntityData onInitialSpawn(IServerWorld world, DifficultyInstance difficulty, SpawnReason reason, + @Nullable ILivingEntityData livingdata, @Nullable CompoundNBT tag) { + ILivingEntityData retval = super.onInitialSpawn(world, difficulty, reason, livingdata, tag); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + FluffaloShavedOnInitialEntitySpawnProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { + ItemStack itemstack = sourceentity.getHeldItem(hand); + ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); + super.func_230254_b_(sourceentity, hand); + sourceentity.startRiding(this); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + FluffaloShavedOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/GiantButterflyEntity.java b/src/main/java/studio/halbear/hem/entity/GiantButterflyEntity.java new file mode 100644 index 0000000..7756689 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/GiantButterflyEntity.java @@ -0,0 +1,236 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.GiantButterflyOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.GiantButterflyRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Hand; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ActionResultType; +import net.minecraft.pathfinding.FlyingPathNavigator; +import net.minecraft.network.IPacket; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.HurtByTargetGoal; +import net.minecraft.entity.ai.goal.Goal; +import net.minecraft.entity.ai.controller.FlyingMovementController; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumSet; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class GiantButterflyEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).size(1f, 1f)) + .build("giant_butterfly").setRegistryName("giant_butterfly"); + + public GiantButterflyEntity(HemModElements instance) { + super(instance, 44); + FMLJavaModLoadingContext.get().getModEventBus().register(new GiantButterflyRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.4); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 35); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 4); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + ammma = ammma.createMutableAttribute(Attributes.FLYING_SPEED, 0.4); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 1; + setNoAI(false); + this.moveController = new FlyingMovementController(this, 10, true); + this.navigator = new FlyingPathNavigator(this, this.world); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setCallsForHelp()); + this.targetSelector.addGoal(2, new NearestAttackableTargetGoal(this, LadyBugInFlightEntity.CustomEntity.class, false, false)); + this.goalSelector.addGoal(3, new Goal() { + { + this.setMutexFlags(EnumSet.of(Goal.Flag.MOVE)); + } + + public boolean shouldExecute() { + if (CustomEntity.this.getAttackTarget() != null && !CustomEntity.this.getMoveHelper().isUpdating()) { + return true; + } else { + return false; + } + } + + @Override + public boolean shouldContinueExecuting() { + return CustomEntity.this.getMoveHelper().isUpdating() && CustomEntity.this.getAttackTarget() != null + && CustomEntity.this.getAttackTarget().isAlive(); + } + + @Override + public void startExecuting() { + LivingEntity livingentity = CustomEntity.this.getAttackTarget(); + Vector3d vec3d = livingentity.getEyePosition(1); + CustomEntity.this.moveController.setMoveTo(vec3d.x, vec3d.y, vec3d.z, 1); + } + + @Override + public void tick() { + LivingEntity livingentity = CustomEntity.this.getAttackTarget(); + if (CustomEntity.this.getBoundingBox().intersects(livingentity.getBoundingBox())) { + CustomEntity.this.attackEntityAsMob(livingentity); + } else { + double d0 = CustomEntity.this.getDistanceSq(livingentity); + if (d0 < 16) { + Vector3d vec3d = livingentity.getEyePosition(1); + CustomEntity.this.moveController.setMoveTo(vec3d.x, vec3d.y, vec3d.z, 1); + } + } + } + }); + this.goalSelector.addGoal(4, new RandomWalkingGoal(this, 1, 20) { + @Override + protected Vector3d getPosition() { + Random random = CustomEntity.this.getRNG(); + double dir_x = CustomEntity.this.getPosX() + ((random.nextFloat() * 2 - 1) * 16); + double dir_y = CustomEntity.this.getPosY() + ((random.nextFloat() * 2 - 1) * 16); + double dir_z = CustomEntity.this.getPosZ() + ((random.nextFloat() * 2 - 1) * 16); + return new Vector3d(dir_x, dir_y, dir_z); + } + }); + this.goalSelector.addGoal(5, new LookRandomlyGoal(this)); + this.goalSelector.addGoal(6, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); + } + + @Override + public boolean onLivingFall(float l, float d) { + return false; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { + ItemStack itemstack = sourceentity.getHeldItem(hand); + ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); + super.func_230254_b_(sourceentity, hand); + sourceentity.startRiding(this); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + GiantButterflyOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + protected void updateFallState(double y, boolean onGroundIn, BlockState state, BlockPos pos) { + } + + @Override + public void setNoGravity(boolean ignored) { + super.setNoGravity(true); + } + + public void livingTick() { + super.livingTick(); + this.setNoGravity(true); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/GiantButterflyWalkingEntity.java b/src/main/java/studio/halbear/hem/entity/GiantButterflyWalkingEntity.java new file mode 100644 index 0000000..12e0bcd --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/GiantButterflyWalkingEntity.java @@ -0,0 +1,192 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.GiantButterflyWalkingOnEntityTickUpdateProcedure; +import studio.halbear.hem.procedures.GiantButterflyWalkingNaturalEntitySpawningConditionProcedure; +import studio.halbear.hem.entity.renderer.GiantButterflyWalkingRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Hand; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ActionResultType; +import net.minecraft.network.IPacket; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.LookAtGoal; +import net.minecraft.entity.ai.goal.HurtByTargetGoal; +import net.minecraft.entity.ai.goal.FollowMobGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class GiantButterflyWalkingEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new) + .size(1f, 1.2000000000000002f)).build("giant_butterfly_walking").setRegistryName("giant_butterfly_walking"); + + public GiantButterflyWalkingEntity(HemModElements instance) { + super(instance, 45); + FMLJavaModLoadingContext.get().getModEventBus().register(new GiantButterflyWalkingRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.CREATURE).add(new MobSpawnInfo.Spawners(entity, 5, 1, 2)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, + (entityType, world, reason, pos, random) -> { + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + return GiantButterflyWalkingNaturalEntitySpawningConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + }); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.2); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 35); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 4); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 1; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setCallsForHelp()); + this.goalSelector.addGoal(2, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 6, 1, 1)); + this.goalSelector.addGoal(3, new FollowMobGoal(this, (float) 1, 10, 5)); + this.goalSelector.addGoal(4, new LookAtGoal(this, LadybugEntity.CustomEntity.class, (float) 6)); + this.goalSelector.addGoal(5, new RandomWalkingGoal(this, 1)); + this.goalSelector.addGoal(6, new LookRandomlyGoal(this)); + this.goalSelector.addGoal(7, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { + ItemStack itemstack = sourceentity.getHeldItem(hand); + ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); + super.func_230254_b_(sourceentity, hand); + sourceentity.startRiding(this); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + GiantButterflyWalkingOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/GoldFishEntity.java b/src/main/java/studio/halbear/hem/entity/GoldFishEntity.java new file mode 100644 index 0000000..1ad8b2f --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/GoldFishEntity.java @@ -0,0 +1,242 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.TigerFishOnEntityTickUpdateProcedure; +import studio.halbear.hem.item.TigerFishItemItem; +import studio.halbear.hem.entity.renderer.GoldFishRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.ForgeMod; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.world.IWorldReader; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.pathfinding.SwimmerPathNavigator; +import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.network.IPacket; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.passive.SquidEntity; +import net.minecraft.entity.ai.goal.RandomSwimmingGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.controller.MovementController; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class GoldFishEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.WATER_CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new) + .size(0.3f, 0.4f)).build("gold_fish").setRegistryName("gold_fish"); + + public GoldFishEntity(HemModElements instance) { + super(instance, 132); + FMLJavaModLoadingContext.get().getModEventBus().register(new GoldFishRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items + .add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)).setRegistryName("gold_fish_spawn_egg")); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.WATER_CREATURE).add(new MobSpawnInfo.Spawners(entity, 15, 1, 4)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.IN_WATER, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, + SquidEntity::func_223365_b); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 10); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 3); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 0); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 0.5); + ammma = ammma.createMutableAttribute(ForgeMod.SWIM_SPEED.get(), 0.7); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + this.setPathPriority(PathNodeType.WATER, 0); + this.moveController = new MovementController(this) { + @Override + public void tick() { + if (CustomEntity.this.isInWater()) + CustomEntity.this.setMotion(CustomEntity.this.getMotion().add(0, 0.005, 0)); + if (this.action == MovementController.Action.MOVE_TO && !CustomEntity.this.getNavigator().noPath()) { + double dx = this.posX - CustomEntity.this.getPosX(); + double dy = this.posY - CustomEntity.this.getPosY(); + double dz = this.posZ - CustomEntity.this.getPosZ(); + float f = (float) (MathHelper.atan2(dz, dx) * (double) (180 / Math.PI)) - 90; + float f1 = (float) (this.speed * CustomEntity.this.getAttribute(Attributes.MOVEMENT_SPEED).getValue()); + CustomEntity.this.rotationYaw = this.limitAngle(CustomEntity.this.rotationYaw, f, 10); + CustomEntity.this.renderYawOffset = CustomEntity.this.rotationYaw; + CustomEntity.this.rotationYawHead = CustomEntity.this.rotationYaw; + if (CustomEntity.this.isInWater()) { + CustomEntity.this.setAIMoveSpeed((float) CustomEntity.this.getAttribute(Attributes.MOVEMENT_SPEED).getValue()); + float f2 = -(float) (MathHelper.atan2(dy, MathHelper.sqrt(dx * dx + dz * dz)) * (180F / Math.PI)); + f2 = MathHelper.clamp(MathHelper.wrapDegrees(f2), -85, 85); + CustomEntity.this.rotationPitch = this.limitAngle(CustomEntity.this.rotationPitch, f2, 5); + float f3 = MathHelper.cos(CustomEntity.this.rotationPitch * (float) (Math.PI / 180.0)); + CustomEntity.this.setMoveForward(f3 * f1); + CustomEntity.this.setMoveVertical((float) (f1 * dy)); + } else { + CustomEntity.this.setAIMoveSpeed(f1 * 0.05F); + } + } else { + CustomEntity.this.setAIMoveSpeed(0); + CustomEntity.this.setMoveVertical(0); + CustomEntity.this.setMoveForward(0); + } + } + }; + this.navigator = new SwimmerPathNavigator(this, this.world); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new RandomSwimmingGoal(this, 12, 40)); + this.goalSelector.addGoal(2, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 6, 16, 12)); + this.goalSelector.addGoal(3, new AvoidEntityGoal(this, TigerFishEntity.CustomEntity.class, (float) 6, 12, 12)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.WATER; + } + + protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn) { + super.dropSpecialItems(source, looting, recentlyHitIn); + this.entityDropItem(new ItemStack(TigerFishItemItem.block)); + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.bubble_column.bubble_pop")); + } + + @Override + public void playStepSound(BlockPos pos, BlockState blockIn) { + this.playSound((net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("ambient.underwater.loop.additions.ultra_rare")), 0.15f, 1); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.DROWN) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + TigerFishOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public boolean canBreatheUnderwater() { + return true; + } + + @Override + public boolean isNotColliding(IWorldReader world) { + return world.checkNoEntityCollision(this); + } + + @Override + public boolean isPushedByWater() { + return false; + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/HotAirBalloonEntity.java b/src/main/java/studio/halbear/hem/entity/HotAirBalloonEntity.java new file mode 100644 index 0000000..c0b0f7e --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/HotAirBalloonEntity.java @@ -0,0 +1,219 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.HotAirBalloonRightClickedOnEntityProcedure; +import studio.halbear.hem.procedures.HotAirBalloonOnInitialEntitySpawnProcedure; +import studio.halbear.hem.procedures.HotAirBalloonOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.HotAirBalloonRenderer; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IServerWorld; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Hand; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ActionResultType; +import net.minecraft.pathfinding.FlyingPathNavigator; +import net.minecraft.network.IPacket; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.controller.FlyingMovementController; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; +import net.minecraft.block.BlockState; + +import javax.annotation.Nullable; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class HotAirBalloonEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.MONSTER) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).size(3f, 8f)) + .build("hot_air_balloon").setRegistryName("hot_air_balloon"); + + public HotAirBalloonEntity(HemModElements instance) { + super(instance, 163); + FMLJavaModLoadingContext.get().getModEventBus().register(new HotAirBalloonRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 10); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 3); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + ammma = ammma.createMutableAttribute(Attributes.FLYING_SPEED, 0.3); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + enablePersistence(); + this.moveController = new FlyingMovementController(this, 10, true); + this.navigator = new FlyingPathNavigator(this, this.world); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public boolean canDespawn(double distanceToClosestPlayer) { + return false; + } + + @Override + public double getMountedYOffset() { + return super.getMountedYOffset() + -5.8; + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); + } + + @Override + public boolean onLivingFall(float l, float d) { + return false; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.DROWN) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + if (source == DamageSource.WITHER) + return false; + if (source.getDamageType().equals("witherSkull")) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public ILivingEntityData onInitialSpawn(IServerWorld world, DifficultyInstance difficulty, SpawnReason reason, + @Nullable ILivingEntityData livingdata, @Nullable CompoundNBT tag) { + ILivingEntityData retval = super.onInitialSpawn(world, difficulty, reason, livingdata, tag); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + HotAirBalloonOnInitialEntitySpawnProcedure + .executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { + ItemStack itemstack = sourceentity.getHeldItem(hand); + ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); + super.func_230254_b_(sourceentity, hand); + sourceentity.startRiding(this); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + HotAirBalloonRightClickedOnEntityProcedure.executeProcedure( + Stream.of(new AbstractMap.SimpleEntry<>("entity", entity), new AbstractMap.SimpleEntry<>("sourceentity", sourceentity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + HotAirBalloonOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + protected void updateFallState(double y, boolean onGroundIn, BlockState state, BlockPos pos) { + } + + @Override + public void setNoGravity(boolean ignored) { + super.setNoGravity(true); + } + + public void livingTick() { + super.livingTick(); + this.setNoGravity(true); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/LadyBugInFlightEntity.java b/src/main/java/studio/halbear/hem/entity/LadyBugInFlightEntity.java new file mode 100644 index 0000000..ae363f7 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/LadyBugInFlightEntity.java @@ -0,0 +1,185 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.LadyBugInFlightOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.LadyBugInFlightRenderer; +import studio.halbear.hem.block.BlueleafWheatBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; + +import net.minecraft.world.World; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.pathfinding.FlyingPathNavigator; +import net.minecraft.network.IPacket; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.BreakBlockGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.controller.FlyingMovementController; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class LadyBugInFlightEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.AMBIENT) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(32).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new) + .size(0.4f, 0.3f)).build("lady_bug_in_flight").setRegistryName("lady_bug_in_flight"); + + public LadyBugInFlightEntity(HemModElements instance) { + super(instance, 38); + FMLJavaModLoadingContext.get().getModEventBus().register(new LadyBugInFlightRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + } + + @Override + public void init(FMLCommonSetupEvent event) { + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.5); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 2); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 1); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 0); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 8); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 5); + ammma = ammma.createMutableAttribute(Attributes.FLYING_SPEED, 0.5); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + this.moveController = new FlyingMovementController(this, 10, true); + this.navigator = new FlyingPathNavigator(this, this.world); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new AvoidEntityGoal(this, GiantButterflyEntity.CustomEntity.class, (float) 6, 1.3, 1)); + this.goalSelector.addGoal(2, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 6, 1, 0.6)); + this.goalSelector.addGoal(3, new RandomWalkingGoal(this, 0.8, 20) { + @Override + protected Vector3d getPosition() { + Random random = CustomEntity.this.getRNG(); + double dir_x = CustomEntity.this.getPosX() + ((random.nextFloat() * 2 - 1) * 16); + double dir_y = CustomEntity.this.getPosY() + ((random.nextFloat() * 2 - 1) * 16); + double dir_z = CustomEntity.this.getPosZ() + ((random.nextFloat() * 2 - 1) * 16); + return new Vector3d(dir_x, dir_y, dir_z); + } + }); + this.goalSelector.addGoal(4, new BreakBlockGoal(BlueleafWheatBlock.block, this, 1, (int) 3)); + this.goalSelector.addGoal(5, new LookRandomlyGoal(this)); + this.goalSelector.addGoal(6, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.pollinate")); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.death")); + } + + @Override + public boolean onLivingFall(float l, float d) { + return false; + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + LadyBugInFlightOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + protected void updateFallState(double y, boolean onGroundIn, BlockState state, BlockPos pos) { + } + + @Override + public void setNoGravity(boolean ignored) { + super.setNoGravity(true); + } + + public void livingTick() { + super.livingTick(); + this.setNoGravity(true); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/LadybugEntity.java b/src/main/java/studio/halbear/hem/entity/LadybugEntity.java new file mode 100644 index 0000000..9ec8595 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/LadybugEntity.java @@ -0,0 +1,173 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.LadybugOnEntityTickUpdateProcedure; +import studio.halbear.hem.entity.renderer.LadybugRenderer; +import studio.halbear.hem.block.AntsBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.network.IPacket; +import net.minecraft.entity.projectile.PotionEntity; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal; +import net.minecraft.entity.ai.goal.SwimGoal; +import net.minecraft.entity.ai.goal.RandomWalkingGoal; +import net.minecraft.entity.ai.goal.LookRandomlyGoal; +import net.minecraft.entity.ai.goal.BreakBlockGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureEntity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AreaEffectCloudEntity; +import net.minecraft.block.material.Material; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class LadybugEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(32).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new) + .size(0.4f, 0.3f)).build("ladybug").setRegistryName("ladybug"); + + public LadybugEntity(HemModElements instance) { + super(instance, 37); + FMLJavaModLoadingContext.get().getModEventBus().register(new LadybugRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.CREATURE).add(new MobSpawnInfo.Spawners(entity, 20, 1, 3)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, + (entityType, world, reason, pos, + random) -> (world.getBlockState(pos.down()).getMaterial() == Material.ORGANIC && world.getLightSubtracted(pos, 0) > 8)); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.4); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 2); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 1); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 0); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 8); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 5); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends CreatureEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.goalSelector.addGoal(1, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 6, 1, 0.6)); + this.goalSelector.addGoal(2, new BreakBlockGoal(AntsBlock.block, this, 1, (int) 3)); + this.goalSelector.addGoal(3, new WaterAvoidingRandomWalkingGoal(this, 0.4)); + this.goalSelector.addGoal(4, new RandomWalkingGoal(this, 0.4)); + this.goalSelector.addGoal(5, new LookRandomlyGoal(this)); + this.goalSelector.addGoal(6, new SwimGoal(this)); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.UNDEFINED; + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.pollinate")); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.death")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source.getImmediateSource() instanceof PotionEntity || source.getImmediateSource() instanceof AreaEffectCloudEntity) + return false; + if (source == DamageSource.FALL) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + LadybugOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/TigerFishEntity.java b/src/main/java/studio/halbear/hem/entity/TigerFishEntity.java new file mode 100644 index 0000000..eb40e16 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/TigerFishEntity.java @@ -0,0 +1,274 @@ + +package studio.halbear.hem.entity; + +import studio.halbear.hem.procedures.TigerFishOnEntityTickUpdateProcedure; +import studio.halbear.hem.item.TigerFishItemItem; +import studio.halbear.hem.entity.renderer.TigerFishRenderer; +import studio.halbear.hem.block.GiantLilyPadBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.network.NetworkHooks; +import net.minecraftforge.fml.network.FMLPlayMessages; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.entity.EntityAttributeCreationEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.ForgeMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.World; +import net.minecraft.world.IWorldReader; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.pathfinding.SwimmerPathNavigator; +import net.minecraft.pathfinding.PathNodeType; +import net.minecraft.network.IPacket; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.crafting.Ingredient; +import net.minecraft.item.SpawnEggItem; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.passive.SquidEntity; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.ai.goal.TemptGoal; +import net.minecraft.entity.ai.goal.RestrictSunGoal; +import net.minecraft.entity.ai.goal.RandomSwimmingGoal; +import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal; +import net.minecraft.entity.ai.goal.HurtByTargetGoal; +import net.minecraft.entity.ai.goal.BreedGoal; +import net.minecraft.entity.ai.goal.AvoidEntityGoal; +import net.minecraft.entity.ai.controller.MovementController; +import net.minecraft.entity.ai.attributes.Attributes; +import net.minecraft.entity.ai.attributes.AttributeModifierMap; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.Entity; +import net.minecraft.entity.CreatureAttribute; +import net.minecraft.entity.AgeableEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class TigerFishEntity extends HemModElements.ModElement { + public static EntityType entity = (EntityType.Builder.create(CustomEntity::new, EntityClassification.WATER_CREATURE) + .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new).size(1f, 0.4f)) + .build("tiger_fish").setRegistryName("tiger_fish"); + + public TigerFishEntity(HemModElements instance) { + super(instance, 122); + FMLJavaModLoadingContext.get().getModEventBus().register(new TigerFishRenderer.ModelRegisterHandler()); + FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public void initElements() { + elements.entities.add(() -> entity); + elements.items + .add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)).setRegistryName("tiger_fish_spawn_egg")); + } + + @SubscribeEvent + public void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getSpawns().getSpawner(EntityClassification.WATER_CREATURE).add(new MobSpawnInfo.Spawners(entity, 15, 1, 4)); + } + + @Override + public void init(FMLCommonSetupEvent event) { + EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.IN_WATER, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, + SquidEntity::func_223365_b); + } + + private static class EntityAttributesRegisterHandler { + @SubscribeEvent + public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { + AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); + ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.3); + ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 20); + ammma = ammma.createMutableAttribute(Attributes.ARMOR, 3); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 6); + ammma = ammma.createMutableAttribute(Attributes.FOLLOW_RANGE, 16); + ammma = ammma.createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE, 0.5); + ammma = ammma.createMutableAttribute(Attributes.ATTACK_KNOCKBACK, 0.3); + ammma = ammma.createMutableAttribute(ForgeMod.SWIM_SPEED.get(), 0.5); + event.put(entity, ammma.create()); + } + } + + public static class CustomEntity extends AnimalEntity { + public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { + this(entity, world); + } + + public CustomEntity(EntityType type, World world) { + super(type, world); + experienceValue = 0; + setNoAI(false); + this.setPathPriority(PathNodeType.WATER, 0); + this.moveController = new MovementController(this) { + @Override + public void tick() { + if (CustomEntity.this.isInWater()) + CustomEntity.this.setMotion(CustomEntity.this.getMotion().add(0, 0.005, 0)); + if (this.action == MovementController.Action.MOVE_TO && !CustomEntity.this.getNavigator().noPath()) { + double dx = this.posX - CustomEntity.this.getPosX(); + double dy = this.posY - CustomEntity.this.getPosY(); + double dz = this.posZ - CustomEntity.this.getPosZ(); + float f = (float) (MathHelper.atan2(dz, dx) * (double) (180 / Math.PI)) - 90; + float f1 = (float) (this.speed * CustomEntity.this.getAttribute(Attributes.MOVEMENT_SPEED).getValue()); + CustomEntity.this.rotationYaw = this.limitAngle(CustomEntity.this.rotationYaw, f, 10); + CustomEntity.this.renderYawOffset = CustomEntity.this.rotationYaw; + CustomEntity.this.rotationYawHead = CustomEntity.this.rotationYaw; + if (CustomEntity.this.isInWater()) { + CustomEntity.this.setAIMoveSpeed((float) CustomEntity.this.getAttribute(Attributes.MOVEMENT_SPEED).getValue()); + float f2 = -(float) (MathHelper.atan2(dy, MathHelper.sqrt(dx * dx + dz * dz)) * (180F / Math.PI)); + f2 = MathHelper.clamp(MathHelper.wrapDegrees(f2), -85, 85); + CustomEntity.this.rotationPitch = this.limitAngle(CustomEntity.this.rotationPitch, f2, 5); + float f3 = MathHelper.cos(CustomEntity.this.rotationPitch * (float) (Math.PI / 180.0)); + CustomEntity.this.setMoveForward(f3 * f1); + CustomEntity.this.setMoveVertical((float) (f1 * dy)); + } else { + CustomEntity.this.setAIMoveSpeed(f1 * 0.05F); + } + } else { + CustomEntity.this.setAIMoveSpeed(0); + CustomEntity.this.setMoveVertical(0); + CustomEntity.this.setMoveForward(0); + } + } + }; + this.navigator = new SwimmerPathNavigator(this, this.world); + } + + @Override + public IPacket createSpawnPacket() { + return NetworkHooks.getEntitySpawningPacket(this); + } + + @Override + protected void registerGoals() { + super.registerGoals(); + this.targetSelector.addGoal(1, new NearestAttackableTargetGoal(this, GoldFishEntity.CustomEntity.class, false, true)); + this.goalSelector.addGoal(2, new TemptGoal(this, 8, Ingredient.fromItems(GiantLilyPadBlock.block.asItem()), true)); + this.goalSelector.addGoal(3, new AvoidEntityGoal(this, ServerPlayerEntity.class, (float) 6, 8, 8)); + this.goalSelector.addGoal(4, new RandomSwimmingGoal(this, 8, 40)); + this.goalSelector.addGoal(5, new RestrictSunGoal(this)); + this.goalSelector.addGoal(6, new BreedGoal(this, 1)); + this.targetSelector.addGoal(7, new HurtByTargetGoal(this).setCallsForHelp()); + } + + @Override + public CreatureAttribute getCreatureAttribute() { + return CreatureAttribute.WATER; + } + + protected void dropSpecialItems(DamageSource source, int looting, boolean recentlyHitIn) { + super.dropSpecialItems(source, looting, recentlyHitIn); + this.entityDropItem(new ItemStack(TigerFishItemItem.block)); + } + + @Override + public net.minecraft.util.SoundEvent getAmbientSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.bubble_column.bubble_pop")); + } + + @Override + public void playStepSound(BlockPos pos, BlockState blockIn) { + this.playSound((net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("ambient.underwater.loop.additions.ultra_rare")), 0.15f, 1); + } + + @Override + public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); + } + + @Override + public net.minecraft.util.SoundEvent getDeathSound() { + return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if (source == DamageSource.FALL) + return false; + if (source == DamageSource.CACTUS) + return false; + if (source == DamageSource.DROWN) + return false; + if (source == DamageSource.LIGHTNING_BOLT) + return false; + if (source == DamageSource.DRAGON_BREATH) + return false; + return super.attackEntityFrom(source, amount); + } + + @Override + public void baseTick() { + super.baseTick(); + double x = this.getPosX(); + double y = this.getPosY(); + double z = this.getPosZ(); + Entity entity = this; + + TigerFishOnEntityTickUpdateProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public AgeableEntity func_241840_a(ServerWorld serverWorld, AgeableEntity ageable) { + CustomEntity retval = (CustomEntity) entity.create(serverWorld); + retval.onInitialSpawn(serverWorld, serverWorld.getDifficultyForLocation(new BlockPos(retval.getPosition())), SpawnReason.BREEDING, + (ILivingEntityData) null, (CompoundNBT) null); + return retval; + } + + @Override + public boolean isBreedingItem(ItemStack stack) { + if (stack == null) + return false; + if (GiantLilyPadBlock.block.asItem() == stack.getItem()) + return true; + return false; + } + + @Override + public boolean canBreatheUnderwater() { + return true; + } + + @Override + public boolean isNotColliding(IWorldReader world) { + return world.checkNoEntityCollision(this); + } + + @Override + public boolean isPushedByWater() { + return false; + } + } +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/AirboatRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/AirboatRenderer.java new file mode 100644 index 0000000..3682040 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/AirboatRenderer.java @@ -0,0 +1,2675 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.AirboatEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class AirboatRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(AirboatEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelAirboat(), 5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/airboat.png"); + } + }; + }); + } + } + + // Made with Blockbench 5.0.7 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelAirboat extends EntityModel { + private final ModelRenderer bone; + private final ModelRenderer cube_r1; + private final ModelRenderer cube_r2; + private final ModelRenderer cube_r3; + private final ModelRenderer cube_r4; + private final ModelRenderer cube_r5; + private final ModelRenderer cube_r6; + private final ModelRenderer cube_r7; + private final ModelRenderer cube_r8; + private final ModelRenderer cube_r9; + private final ModelRenderer cube_r10; + private final ModelRenderer cube_r11; + private final ModelRenderer cube_r12; + private final ModelRenderer cube_r13; + private final ModelRenderer cube_r14; + private final ModelRenderer cube_r15; + private final ModelRenderer cube_r16; + private final ModelRenderer bone5; + private final ModelRenderer cube_r17; + private final ModelRenderer cube_r18; + private final ModelRenderer cube_r19; + private final ModelRenderer cube_r20; + private final ModelRenderer cube_r21; + private final ModelRenderer cube_r22; + private final ModelRenderer cube_r23; + private final ModelRenderer cube_r24; + private final ModelRenderer cube_r25; + private final ModelRenderer cube_r26; + private final ModelRenderer cube_r27; + private final ModelRenderer cube_r28; + private final ModelRenderer cube_r29; + private final ModelRenderer cube_r30; + private final ModelRenderer cube_r31; + private final ModelRenderer cube_r32; + private final ModelRenderer bone6; + private final ModelRenderer cube_r33; + private final ModelRenderer cube_r34; + private final ModelRenderer cube_r35; + private final ModelRenderer cube_r36; + private final ModelRenderer cube_r37; + private final ModelRenderer cube_r38; + private final ModelRenderer cube_r39; + private final ModelRenderer cube_r40; + private final ModelRenderer cube_r41; + private final ModelRenderer cube_r42; + private final ModelRenderer cube_r43; + private final ModelRenderer cube_r44; + private final ModelRenderer cube_r45; + private final ModelRenderer cube_r46; + private final ModelRenderer cube_r47; + private final ModelRenderer cube_r48; + private final ModelRenderer bone7; + private final ModelRenderer cube_r49; + private final ModelRenderer cube_r50; + private final ModelRenderer cube_r51; + private final ModelRenderer cube_r52; + private final ModelRenderer cube_r53; + private final ModelRenderer cube_r54; + private final ModelRenderer cube_r55; + private final ModelRenderer cube_r56; + private final ModelRenderer cube_r57; + private final ModelRenderer cube_r58; + private final ModelRenderer cube_r59; + private final ModelRenderer cube_r60; + private final ModelRenderer cube_r61; + private final ModelRenderer cube_r62; + private final ModelRenderer cube_r63; + private final ModelRenderer cube_r64; + private final ModelRenderer bone8; + private final ModelRenderer cube_r65; + private final ModelRenderer cube_r66; + private final ModelRenderer cube_r67; + private final ModelRenderer cube_r68; + private final ModelRenderer cube_r69; + private final ModelRenderer cube_r70; + private final ModelRenderer cube_r71; + private final ModelRenderer cube_r72; + private final ModelRenderer cube_r73; + private final ModelRenderer cube_r74; + private final ModelRenderer cube_r75; + private final ModelRenderer cube_r76; + private final ModelRenderer cube_r77; + private final ModelRenderer cube_r78; + private final ModelRenderer cube_r79; + private final ModelRenderer cube_r80; + private final ModelRenderer bone9; + private final ModelRenderer cube_r81; + private final ModelRenderer cube_r82; + private final ModelRenderer cube_r83; + private final ModelRenderer cube_r84; + private final ModelRenderer cube_r85; + private final ModelRenderer cube_r86; + private final ModelRenderer cube_r87; + private final ModelRenderer cube_r88; + private final ModelRenderer cube_r89; + private final ModelRenderer cube_r90; + private final ModelRenderer cube_r91; + private final ModelRenderer cube_r92; + private final ModelRenderer cube_r93; + private final ModelRenderer cube_r94; + private final ModelRenderer cube_r95; + private final ModelRenderer cube_r96; + private final ModelRenderer bone10; + private final ModelRenderer cube_r97; + private final ModelRenderer cube_r98; + private final ModelRenderer cube_r99; + private final ModelRenderer cube_r100; + private final ModelRenderer cube_r101; + private final ModelRenderer cube_r102; + private final ModelRenderer cube_r103; + private final ModelRenderer cube_r104; + private final ModelRenderer cube_r105; + private final ModelRenderer cube_r106; + private final ModelRenderer cube_r107; + private final ModelRenderer cube_r108; + private final ModelRenderer cube_r109; + private final ModelRenderer cube_r110; + private final ModelRenderer cube_r111; + private final ModelRenderer cube_r112; + private final ModelRenderer bone11; + private final ModelRenderer cube_r113; + private final ModelRenderer cube_r114; + private final ModelRenderer cube_r115; + private final ModelRenderer cube_r116; + private final ModelRenderer cube_r117; + private final ModelRenderer cube_r118; + private final ModelRenderer cube_r119; + private final ModelRenderer cube_r120; + private final ModelRenderer cube_r121; + private final ModelRenderer cube_r122; + private final ModelRenderer cube_r123; + private final ModelRenderer cube_r124; + private final ModelRenderer cube_r125; + private final ModelRenderer cube_r126; + private final ModelRenderer cube_r127; + private final ModelRenderer cube_r128; + private final ModelRenderer TailFin; + private final ModelRenderer cube_r129; + private final ModelRenderer cube_r130; + private final ModelRenderer cube_r131; + private final ModelRenderer cube_r132; + private final ModelRenderer cube_r133; + private final ModelRenderer cube_r134; + private final ModelRenderer cube_r135; + private final ModelRenderer TailFin4; + private final ModelRenderer cube_r136; + private final ModelRenderer cube_r137; + private final ModelRenderer cube_r138; + private final ModelRenderer cube_r139; + private final ModelRenderer cube_r140; + private final ModelRenderer cube_r141; + private final ModelRenderer cube_r142; + private final ModelRenderer TailFin2; + private final ModelRenderer cube_r143; + private final ModelRenderer cube_r144; + private final ModelRenderer cube_r145; + private final ModelRenderer cube_r146; + private final ModelRenderer cube_r147; + private final ModelRenderer cube_r148; + private final ModelRenderer cube_r149; + private final ModelRenderer cube_r150; + private final ModelRenderer TailFin3; + private final ModelRenderer cube_r151; + private final ModelRenderer cube_r152; + private final ModelRenderer cube_r153; + private final ModelRenderer cube_r154; + private final ModelRenderer cube_r155; + private final ModelRenderer cube_r156; + private final ModelRenderer cube_r157; + private final ModelRenderer cube_r158; + private final ModelRenderer bone2; + private final ModelRenderer bone31; + private final ModelRenderer bone35; + private final ModelRenderer cube_r159; + private final ModelRenderer bone36; + private final ModelRenderer cube_r160; + private final ModelRenderer cube_r161; + private final ModelRenderer cube_r162; + private final ModelRenderer bone37; + private final ModelRenderer cube_r163; + private final ModelRenderer bone23; + private final ModelRenderer bone24; + private final ModelRenderer cube_r164; + private final ModelRenderer bone78; + private final ModelRenderer cube_r165; + private final ModelRenderer cube_r166; + private final ModelRenderer cube_r167; + private final ModelRenderer bone79; + private final ModelRenderer cube_r168; + private final ModelRenderer bone14; + private final ModelRenderer bone15; + private final ModelRenderer cube_r169; + private final ModelRenderer bone16; + private final ModelRenderer cube_r170; + private final ModelRenderer cube_r171; + private final ModelRenderer cube_r172; + private final ModelRenderer bone22; + private final ModelRenderer cube_r173; + private final ModelRenderer bone70; + private final ModelRenderer bone71; + private final ModelRenderer bone77; + private final ModelRenderer cube_r174; + private final ModelRenderer bone80; + private final ModelRenderer cube_r175; + private final ModelRenderer cube_r176; + private final ModelRenderer cube_r177; + private final ModelRenderer bone81; + private final ModelRenderer cube_r178; + private final ModelRenderer bone82; + private final ModelRenderer bone83; + private final ModelRenderer cube_r179; + private final ModelRenderer bone84; + private final ModelRenderer cube_r180; + private final ModelRenderer cube_r181; + private final ModelRenderer cube_r182; + private final ModelRenderer bone85; + private final ModelRenderer cube_r183; + private final ModelRenderer bone86; + private final ModelRenderer bone87; + private final ModelRenderer cube_r184; + private final ModelRenderer bone88; + private final ModelRenderer cube_r185; + private final ModelRenderer cube_r186; + private final ModelRenderer cube_r187; + private final ModelRenderer bone89; + private final ModelRenderer cube_r188; + private final ModelRenderer bone55; + private final ModelRenderer bone56; + private final ModelRenderer bone57; + private final ModelRenderer cube_r189; + private final ModelRenderer bone58; + private final ModelRenderer cube_r190; + private final ModelRenderer cube_r191; + private final ModelRenderer cube_r192; + private final ModelRenderer bone59; + private final ModelRenderer cube_r193; + private final ModelRenderer bone60; + private final ModelRenderer bone61; + private final ModelRenderer cube_r194; + private final ModelRenderer bone62; + private final ModelRenderer cube_r195; + private final ModelRenderer cube_r196; + private final ModelRenderer cube_r197; + private final ModelRenderer bone63; + private final ModelRenderer cube_r198; + private final ModelRenderer bone64; + private final ModelRenderer bone65; + private final ModelRenderer cube_r199; + private final ModelRenderer bone66; + private final ModelRenderer cube_r200; + private final ModelRenderer cube_r201; + private final ModelRenderer cube_r202; + private final ModelRenderer bone69; + private final ModelRenderer cube_r203; + private final ModelRenderer bone20; + private final ModelRenderer bone33; + private final ModelRenderer bone34; + private final ModelRenderer cube_r204; + private final ModelRenderer bone38; + private final ModelRenderer cube_r205; + private final ModelRenderer cube_r206; + private final ModelRenderer cube_r207; + private final ModelRenderer bone39; + private final ModelRenderer cube_r208; + private final ModelRenderer bone52; + private final ModelRenderer cube_r209; + private final ModelRenderer bone51; + private final ModelRenderer cube_r210; + private final ModelRenderer cube_r211; + private final ModelRenderer cube_r212; + private final ModelRenderer bone50; + private final ModelRenderer cube_r213; + private final ModelRenderer bone28; + private final ModelRenderer cube_r214; + private final ModelRenderer bone29; + private final ModelRenderer cube_r215; + private final ModelRenderer cube_r216; + private final ModelRenderer cube_r217; + private final ModelRenderer bone30; + private final ModelRenderer cube_r218; + private final ModelRenderer bone27; + private final ModelRenderer cube_r219; + private final ModelRenderer bone44; + private final ModelRenderer cube_r220; + private final ModelRenderer cube_r221; + private final ModelRenderer cube_r222; + private final ModelRenderer bone67; + private final ModelRenderer cube_r223; + private final ModelRenderer bone68; + private final ModelRenderer cube_r224; + private final ModelRenderer bone49; + private final ModelRenderer bone17; + private final ModelRenderer bone18; + private final ModelRenderer bone21; + private final ModelRenderer cube_r225; + private final ModelRenderer bone25; + private final ModelRenderer cube_r226; + private final ModelRenderer cube_r227; + private final ModelRenderer cube_r228; + private final ModelRenderer bone26; + private final ModelRenderer cube_r229; + private final ModelRenderer bone32; + private final ModelRenderer cube_r230; + private final ModelRenderer bone40; + private final ModelRenderer cube_r231; + private final ModelRenderer cube_r232; + private final ModelRenderer cube_r233; + private final ModelRenderer bone41; + private final ModelRenderer cube_r234; + private final ModelRenderer bone42; + private final ModelRenderer cube_r235; + private final ModelRenderer bone43; + private final ModelRenderer cube_r236; + private final ModelRenderer cube_r237; + private final ModelRenderer cube_r238; + private final ModelRenderer bone45; + private final ModelRenderer cube_r239; + private final ModelRenderer bone46; + private final ModelRenderer cube_r240; + private final ModelRenderer bone47; + private final ModelRenderer cube_r241; + private final ModelRenderer cube_r242; + private final ModelRenderer cube_r243; + private final ModelRenderer bone48; + private final ModelRenderer cube_r244; + private final ModelRenderer bone53; + private final ModelRenderer bone54; + private final ModelRenderer bone3; + private final ModelRenderer cube_r245; + private final ModelRenderer cube_r246; + private final ModelRenderer cube_r247; + private final ModelRenderer cube_r248; + private final ModelRenderer cube_r249; + private final ModelRenderer cube_r250; + private final ModelRenderer cube_r251; + private final ModelRenderer cube_r252; + private final ModelRenderer cube_r253; + private final ModelRenderer bone12; + private final ModelRenderer cube_r254; + private final ModelRenderer cube_r255; + private final ModelRenderer cube_r256; + private final ModelRenderer cube_r257; + private final ModelRenderer cube_r258; + private final ModelRenderer cube_r259; + private final ModelRenderer cube_r260; + private final ModelRenderer bone13; + private final ModelRenderer cube_r261; + private final ModelRenderer cube_r262; + private final ModelRenderer cube_r263; + private final ModelRenderer cube_r264; + private final ModelRenderer cube_r265; + private final ModelRenderer cube_r266; + private final ModelRenderer cube_r267; + private final ModelRenderer bone19; + private final ModelRenderer cube_r268; + private final ModelRenderer cube_r269; + private final ModelRenderer cube_r270; + private final ModelRenderer cube_r271; + private final ModelRenderer cube_r272; + private final ModelRenderer cube_r273; + private final ModelRenderer cube_r274; + private final ModelRenderer bone4; + private final ModelRenderer cube_r275; + private final ModelRenderer cube_r276; + private final ModelRenderer Engine; + private final ModelRenderer cube_r277; + private final ModelRenderer Propeller; + private final ModelRenderer cube_r278; + private final ModelRenderer Engine2; + private final ModelRenderer cube_r279; + private final ModelRenderer Propeller2; + private final ModelRenderer cube_r280; + private final ModelRenderer SteeringWheel; + private final ModelRenderer bb_main; + private final ModelRenderer cube_r281; + private final ModelRenderer cube_r282; + private final ModelRenderer cube_r283; + private final ModelRenderer cube_r284; + private final ModelRenderer cube_r285; + private final ModelRenderer cube_r286; + private final ModelRenderer cube_r287; + private final ModelRenderer cube_r288; + private final ModelRenderer cube_r289; + private final ModelRenderer cube_r290; + private final ModelRenderer cube_r291; + private final ModelRenderer cube_r292; + private final ModelRenderer cube_r293; + private final ModelRenderer cube_r294; + private final ModelRenderer cube_r295; + private final ModelRenderer cube_r296; + private final ModelRenderer cube_r297; + private final ModelRenderer cube_r298; + private final ModelRenderer cube_r299; + private final ModelRenderer cube_r300; + private final ModelRenderer cube_r301; + private final ModelRenderer cube_r302; + private final ModelRenderer cube_r303; + private final ModelRenderer cube_r304; + private final ModelRenderer cube_r305; + private final ModelRenderer cube_r306; + private final ModelRenderer cube_r307; + private final ModelRenderer cube_r308; + private final ModelRenderer cube_r309; + private final ModelRenderer cube_r310; + private final ModelRenderer cube_r311; + private final ModelRenderer cube_r312; + private final ModelRenderer cube_r313; + private final ModelRenderer cube_r314; + private final ModelRenderer cube_r315; + private final ModelRenderer cube_r316; + private final ModelRenderer cube_r317; + private final ModelRenderer cube_r318; + private final ModelRenderer cube_r319; + private final ModelRenderer cube_r320; + private final ModelRenderer cube_r321; + private final ModelRenderer cube_r322; + private final ModelRenderer cube_r323; + private final ModelRenderer cube_r324; + private final ModelRenderer cube_r325; + private final ModelRenderer cube_r326; + private final ModelRenderer cube_r327; + private final ModelRenderer cube_r328; + private final ModelRenderer cube_r329; + private final ModelRenderer cube_r330; + private final ModelRenderer cube_r331; + private final ModelRenderer cube_r332; + private final ModelRenderer cube_r333; + private final ModelRenderer cube_r334; + private final ModelRenderer cube_r335; + private final ModelRenderer cube_r336; + private final ModelRenderer cube_r337; + private final ModelRenderer cube_r338; + private final ModelRenderer cube_r339; + private final ModelRenderer cube_r340; + private final ModelRenderer cube_r341; + private final ModelRenderer cube_r342; + private final ModelRenderer cube_r343; + private final ModelRenderer cube_r344; + private final ModelRenderer cube_r345; + private final ModelRenderer cube_r346; + private final ModelRenderer cube_r347; + private final ModelRenderer cube_r348; + private final ModelRenderer cube_r349; + private final ModelRenderer cube_r350; + private final ModelRenderer cube_r351; + + public ModelAirboat() { + textureWidth = 1024; + textureHeight = 1024; + bone = new ModelRenderer(this); + bone.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone, -1.5708F, 0.0F, 1.5708F); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone.addChild(cube_r1); + setRotationAngle(cube_r1, -1.0472F, 1.1781F, 0.0F); + cube_r1.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone.addChild(cube_r2); + setRotationAngle(cube_r2, -0.829F, 1.1781F, 0.0F); + cube_r2.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone.addChild(cube_r3); + setRotationAngle(cube_r3, -0.5672F, 1.1781F, 0.0F); + cube_r3.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r4 = new ModelRenderer(this); + cube_r4.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone.addChild(cube_r4); + setRotationAngle(cube_r4, -0.3054F, 1.1781F, 0.0F); + cube_r4.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r5 = new ModelRenderer(this); + cube_r5.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone.addChild(cube_r5); + setRotationAngle(cube_r5, 0.3927F, 1.1781F, 0.0F); + cube_r5.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r6 = new ModelRenderer(this); + cube_r6.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone.addChild(cube_r6); + setRotationAngle(cube_r6, 0.2618F, 1.1781F, 0.0F); + cube_r6.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r7 = new ModelRenderer(this); + cube_r7.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone.addChild(cube_r7); + setRotationAngle(cube_r7, 0.1309F, 1.1781F, 0.0F); + cube_r7.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r8 = new ModelRenderer(this); + cube_r8.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone.addChild(cube_r8); + setRotationAngle(cube_r8, 0.0F, 1.1781F, 0.0F); + cube_r8.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r9 = new ModelRenderer(this); + cube_r9.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone.addChild(cube_r9); + setRotationAngle(cube_r9, 3.1416F, 0.0F, 3.0194F); + cube_r9.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r10 = new ModelRenderer(this); + cube_r10.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone.addChild(cube_r10); + setRotationAngle(cube_r10, 3.1416F, 0.0F, 2.9016F); + cube_r10.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r11 = new ModelRenderer(this); + cube_r11.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone.addChild(cube_r11); + setRotationAngle(cube_r11, 3.1416F, 0.0F, 2.7794F); + cube_r11.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r12 = new ModelRenderer(this); + cube_r12.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone.addChild(cube_r12); + setRotationAngle(cube_r12, -3.1416F, 0.0F, -2.8362F); + cube_r12.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r13 = new ModelRenderer(this); + cube_r13.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone.addChild(cube_r13); + setRotationAngle(cube_r13, 3.1416F, 0.0F, -2.618F); + cube_r13.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r14 = new ModelRenderer(this); + cube_r14.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone.addChild(cube_r14); + setRotationAngle(cube_r14, 3.1416F, 0.0F, -2.3562F); + cube_r14.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r15 = new ModelRenderer(this); + cube_r15.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone.addChild(cube_r15); + setRotationAngle(cube_r15, 3.1416F, 0.0F, -2.2253F); + cube_r15.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r16 = new ModelRenderer(this); + cube_r16.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone.addChild(cube_r16); + setRotationAngle(cube_r16, 0.0F, 3.1416F, 0.0F); + cube_r16.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone5 = new ModelRenderer(this); + bone5.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone5, -1.5708F, 0.0F, 0.7854F); + cube_r17 = new ModelRenderer(this); + cube_r17.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone5.addChild(cube_r17); + setRotationAngle(cube_r17, -1.0472F, 1.1781F, 0.0F); + cube_r17.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r18 = new ModelRenderer(this); + cube_r18.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone5.addChild(cube_r18); + setRotationAngle(cube_r18, -0.829F, 1.1781F, 0.0F); + cube_r18.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r19 = new ModelRenderer(this); + cube_r19.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone5.addChild(cube_r19); + setRotationAngle(cube_r19, -0.5672F, 1.1781F, 0.0F); + cube_r19.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r20 = new ModelRenderer(this); + cube_r20.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone5.addChild(cube_r20); + setRotationAngle(cube_r20, -0.3054F, 1.1781F, 0.0F); + cube_r20.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r21 = new ModelRenderer(this); + cube_r21.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone5.addChild(cube_r21); + setRotationAngle(cube_r21, 0.3927F, 1.1781F, 0.0F); + cube_r21.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r22 = new ModelRenderer(this); + cube_r22.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone5.addChild(cube_r22); + setRotationAngle(cube_r22, 0.2618F, 1.1781F, 0.0F); + cube_r22.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r23 = new ModelRenderer(this); + cube_r23.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone5.addChild(cube_r23); + setRotationAngle(cube_r23, 0.1309F, 1.1781F, 0.0F); + cube_r23.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r24 = new ModelRenderer(this); + cube_r24.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone5.addChild(cube_r24); + setRotationAngle(cube_r24, 0.0F, 1.1781F, 0.0F); + cube_r24.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r25 = new ModelRenderer(this); + cube_r25.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone5.addChild(cube_r25); + setRotationAngle(cube_r25, 3.1416F, 0.0F, 3.0194F); + cube_r25.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r26 = new ModelRenderer(this); + cube_r26.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone5.addChild(cube_r26); + setRotationAngle(cube_r26, 3.1416F, 0.0F, 2.9016F); + cube_r26.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r27 = new ModelRenderer(this); + cube_r27.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone5.addChild(cube_r27); + setRotationAngle(cube_r27, 3.1416F, 0.0F, 2.7794F); + cube_r27.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r28 = new ModelRenderer(this); + cube_r28.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone5.addChild(cube_r28); + setRotationAngle(cube_r28, -3.1416F, 0.0F, -2.8362F); + cube_r28.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r29 = new ModelRenderer(this); + cube_r29.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone5.addChild(cube_r29); + setRotationAngle(cube_r29, 3.1416F, 0.0F, -2.618F); + cube_r29.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r30 = new ModelRenderer(this); + cube_r30.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone5.addChild(cube_r30); + setRotationAngle(cube_r30, 3.1416F, 0.0F, -2.3562F); + cube_r30.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r31 = new ModelRenderer(this); + cube_r31.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone5.addChild(cube_r31); + setRotationAngle(cube_r31, 3.1416F, 0.0F, -2.2253F); + cube_r31.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r32 = new ModelRenderer(this); + cube_r32.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone5.addChild(cube_r32); + setRotationAngle(cube_r32, 0.0F, 3.1416F, 0.0F); + cube_r32.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone6 = new ModelRenderer(this); + bone6.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone6, -1.5708F, 0.0F, 0.0F); + cube_r33 = new ModelRenderer(this); + cube_r33.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone6.addChild(cube_r33); + setRotationAngle(cube_r33, -1.0472F, 1.1781F, 0.0F); + cube_r33.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r34 = new ModelRenderer(this); + cube_r34.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone6.addChild(cube_r34); + setRotationAngle(cube_r34, -0.829F, 1.1781F, 0.0F); + cube_r34.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r35 = new ModelRenderer(this); + cube_r35.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone6.addChild(cube_r35); + setRotationAngle(cube_r35, -0.5672F, 1.1781F, 0.0F); + cube_r35.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r36 = new ModelRenderer(this); + cube_r36.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone6.addChild(cube_r36); + setRotationAngle(cube_r36, -0.3054F, 1.1781F, 0.0F); + cube_r36.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r37 = new ModelRenderer(this); + cube_r37.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone6.addChild(cube_r37); + setRotationAngle(cube_r37, 0.3927F, 1.1781F, 0.0F); + cube_r37.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r38 = new ModelRenderer(this); + cube_r38.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone6.addChild(cube_r38); + setRotationAngle(cube_r38, 0.2618F, 1.1781F, 0.0F); + cube_r38.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r39 = new ModelRenderer(this); + cube_r39.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone6.addChild(cube_r39); + setRotationAngle(cube_r39, 0.1309F, 1.1781F, 0.0F); + cube_r39.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r40 = new ModelRenderer(this); + cube_r40.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone6.addChild(cube_r40); + setRotationAngle(cube_r40, 0.0F, 1.1781F, 0.0F); + cube_r40.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r41 = new ModelRenderer(this); + cube_r41.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone6.addChild(cube_r41); + setRotationAngle(cube_r41, 3.1416F, 0.0F, 3.0194F); + cube_r41.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r42 = new ModelRenderer(this); + cube_r42.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone6.addChild(cube_r42); + setRotationAngle(cube_r42, 3.1416F, 0.0F, 2.9016F); + cube_r42.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r43 = new ModelRenderer(this); + cube_r43.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone6.addChild(cube_r43); + setRotationAngle(cube_r43, 3.1416F, 0.0F, 2.7794F); + cube_r43.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r44 = new ModelRenderer(this); + cube_r44.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone6.addChild(cube_r44); + setRotationAngle(cube_r44, -3.1416F, 0.0F, -2.8362F); + cube_r44.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r45 = new ModelRenderer(this); + cube_r45.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone6.addChild(cube_r45); + setRotationAngle(cube_r45, 3.1416F, 0.0F, -2.618F); + cube_r45.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r46 = new ModelRenderer(this); + cube_r46.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone6.addChild(cube_r46); + setRotationAngle(cube_r46, 3.1416F, 0.0F, -2.3562F); + cube_r46.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r47 = new ModelRenderer(this); + cube_r47.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone6.addChild(cube_r47); + setRotationAngle(cube_r47, 3.1416F, 0.0F, -2.2253F); + cube_r47.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r48 = new ModelRenderer(this); + cube_r48.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone6.addChild(cube_r48); + setRotationAngle(cube_r48, 0.0F, 3.1416F, 0.0F); + cube_r48.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone7 = new ModelRenderer(this); + bone7.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone7, -1.5708F, 0.0F, -0.7854F); + cube_r49 = new ModelRenderer(this); + cube_r49.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone7.addChild(cube_r49); + setRotationAngle(cube_r49, -1.0472F, 1.1781F, 0.0F); + cube_r49.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r50 = new ModelRenderer(this); + cube_r50.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone7.addChild(cube_r50); + setRotationAngle(cube_r50, -0.829F, 1.1781F, 0.0F); + cube_r50.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r51 = new ModelRenderer(this); + cube_r51.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone7.addChild(cube_r51); + setRotationAngle(cube_r51, -0.5672F, 1.1781F, 0.0F); + cube_r51.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r52 = new ModelRenderer(this); + cube_r52.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone7.addChild(cube_r52); + setRotationAngle(cube_r52, -0.3054F, 1.1781F, 0.0F); + cube_r52.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r53 = new ModelRenderer(this); + cube_r53.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone7.addChild(cube_r53); + setRotationAngle(cube_r53, 0.3927F, 1.1781F, 0.0F); + cube_r53.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r54 = new ModelRenderer(this); + cube_r54.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone7.addChild(cube_r54); + setRotationAngle(cube_r54, 0.2618F, 1.1781F, 0.0F); + cube_r54.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r55 = new ModelRenderer(this); + cube_r55.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone7.addChild(cube_r55); + setRotationAngle(cube_r55, 0.1309F, 1.1781F, 0.0F); + cube_r55.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r56 = new ModelRenderer(this); + cube_r56.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone7.addChild(cube_r56); + setRotationAngle(cube_r56, 0.0F, 1.1781F, 0.0F); + cube_r56.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r57 = new ModelRenderer(this); + cube_r57.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone7.addChild(cube_r57); + setRotationAngle(cube_r57, 3.1416F, 0.0F, 3.0194F); + cube_r57.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r58 = new ModelRenderer(this); + cube_r58.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone7.addChild(cube_r58); + setRotationAngle(cube_r58, 3.1416F, 0.0F, 2.9016F); + cube_r58.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r59 = new ModelRenderer(this); + cube_r59.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone7.addChild(cube_r59); + setRotationAngle(cube_r59, 3.1416F, 0.0F, 2.7794F); + cube_r59.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r60 = new ModelRenderer(this); + cube_r60.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone7.addChild(cube_r60); + setRotationAngle(cube_r60, -3.1416F, 0.0F, -2.8362F); + cube_r60.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r61 = new ModelRenderer(this); + cube_r61.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone7.addChild(cube_r61); + setRotationAngle(cube_r61, 3.1416F, 0.0F, -2.618F); + cube_r61.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r62 = new ModelRenderer(this); + cube_r62.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone7.addChild(cube_r62); + setRotationAngle(cube_r62, 3.1416F, 0.0F, -2.3562F); + cube_r62.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r63 = new ModelRenderer(this); + cube_r63.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone7.addChild(cube_r63); + setRotationAngle(cube_r63, 3.1416F, 0.0F, -2.2253F); + cube_r63.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r64 = new ModelRenderer(this); + cube_r64.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone7.addChild(cube_r64); + setRotationAngle(cube_r64, 0.0F, 3.1416F, 0.0F); + cube_r64.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone8 = new ModelRenderer(this); + bone8.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone8, -1.5708F, 0.0F, -1.5708F); + cube_r65 = new ModelRenderer(this); + cube_r65.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone8.addChild(cube_r65); + setRotationAngle(cube_r65, -1.0472F, 1.1781F, 0.0F); + cube_r65.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r66 = new ModelRenderer(this); + cube_r66.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone8.addChild(cube_r66); + setRotationAngle(cube_r66, -0.829F, 1.1781F, 0.0F); + cube_r66.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r67 = new ModelRenderer(this); + cube_r67.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone8.addChild(cube_r67); + setRotationAngle(cube_r67, -0.5672F, 1.1781F, 0.0F); + cube_r67.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r68 = new ModelRenderer(this); + cube_r68.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone8.addChild(cube_r68); + setRotationAngle(cube_r68, -0.3054F, 1.1781F, 0.0F); + cube_r68.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r69 = new ModelRenderer(this); + cube_r69.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone8.addChild(cube_r69); + setRotationAngle(cube_r69, 0.3927F, 1.1781F, 0.0F); + cube_r69.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r70 = new ModelRenderer(this); + cube_r70.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone8.addChild(cube_r70); + setRotationAngle(cube_r70, 0.2618F, 1.1781F, 0.0F); + cube_r70.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r71 = new ModelRenderer(this); + cube_r71.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone8.addChild(cube_r71); + setRotationAngle(cube_r71, 0.1309F, 1.1781F, 0.0F); + cube_r71.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r72 = new ModelRenderer(this); + cube_r72.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone8.addChild(cube_r72); + setRotationAngle(cube_r72, 0.0F, 1.1781F, 0.0F); + cube_r72.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r73 = new ModelRenderer(this); + cube_r73.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone8.addChild(cube_r73); + setRotationAngle(cube_r73, 3.1416F, 0.0F, 3.0194F); + cube_r73.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r74 = new ModelRenderer(this); + cube_r74.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone8.addChild(cube_r74); + setRotationAngle(cube_r74, 3.1416F, 0.0F, 2.9016F); + cube_r74.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r75 = new ModelRenderer(this); + cube_r75.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone8.addChild(cube_r75); + setRotationAngle(cube_r75, 3.1416F, 0.0F, 2.7794F); + cube_r75.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r76 = new ModelRenderer(this); + cube_r76.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone8.addChild(cube_r76); + setRotationAngle(cube_r76, -3.1416F, 0.0F, -2.8362F); + cube_r76.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r77 = new ModelRenderer(this); + cube_r77.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone8.addChild(cube_r77); + setRotationAngle(cube_r77, 3.1416F, 0.0F, -2.618F); + cube_r77.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r78 = new ModelRenderer(this); + cube_r78.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone8.addChild(cube_r78); + setRotationAngle(cube_r78, 3.1416F, 0.0F, -2.3562F); + cube_r78.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r79 = new ModelRenderer(this); + cube_r79.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone8.addChild(cube_r79); + setRotationAngle(cube_r79, 3.1416F, 0.0F, -2.2253F); + cube_r79.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r80 = new ModelRenderer(this); + cube_r80.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone8.addChild(cube_r80); + setRotationAngle(cube_r80, 0.0F, 3.1416F, 0.0F); + cube_r80.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone9 = new ModelRenderer(this); + bone9.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone9, -1.5708F, 0.0F, -2.3562F); + cube_r81 = new ModelRenderer(this); + cube_r81.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone9.addChild(cube_r81); + setRotationAngle(cube_r81, -1.0472F, 1.1781F, 0.0F); + cube_r81.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r82 = new ModelRenderer(this); + cube_r82.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone9.addChild(cube_r82); + setRotationAngle(cube_r82, -0.829F, 1.1781F, 0.0F); + cube_r82.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r83 = new ModelRenderer(this); + cube_r83.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone9.addChild(cube_r83); + setRotationAngle(cube_r83, -0.5672F, 1.1781F, 0.0F); + cube_r83.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r84 = new ModelRenderer(this); + cube_r84.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone9.addChild(cube_r84); + setRotationAngle(cube_r84, -0.3054F, 1.1781F, 0.0F); + cube_r84.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r85 = new ModelRenderer(this); + cube_r85.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone9.addChild(cube_r85); + setRotationAngle(cube_r85, 0.3927F, 1.1781F, 0.0F); + cube_r85.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r86 = new ModelRenderer(this); + cube_r86.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone9.addChild(cube_r86); + setRotationAngle(cube_r86, 0.2618F, 1.1781F, 0.0F); + cube_r86.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r87 = new ModelRenderer(this); + cube_r87.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone9.addChild(cube_r87); + setRotationAngle(cube_r87, 0.1309F, 1.1781F, 0.0F); + cube_r87.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r88 = new ModelRenderer(this); + cube_r88.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone9.addChild(cube_r88); + setRotationAngle(cube_r88, 0.0F, 1.1781F, 0.0F); + cube_r88.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r89 = new ModelRenderer(this); + cube_r89.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone9.addChild(cube_r89); + setRotationAngle(cube_r89, 3.1416F, 0.0F, 3.0194F); + cube_r89.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r90 = new ModelRenderer(this); + cube_r90.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone9.addChild(cube_r90); + setRotationAngle(cube_r90, 3.1416F, 0.0F, 2.9016F); + cube_r90.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r91 = new ModelRenderer(this); + cube_r91.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone9.addChild(cube_r91); + setRotationAngle(cube_r91, 3.1416F, 0.0F, 2.7794F); + cube_r91.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r92 = new ModelRenderer(this); + cube_r92.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone9.addChild(cube_r92); + setRotationAngle(cube_r92, -3.1416F, 0.0F, -2.8362F); + cube_r92.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r93 = new ModelRenderer(this); + cube_r93.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone9.addChild(cube_r93); + setRotationAngle(cube_r93, 3.1416F, 0.0F, -2.618F); + cube_r93.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r94 = new ModelRenderer(this); + cube_r94.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone9.addChild(cube_r94); + setRotationAngle(cube_r94, 3.1416F, 0.0F, -2.3562F); + cube_r94.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r95 = new ModelRenderer(this); + cube_r95.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone9.addChild(cube_r95); + setRotationAngle(cube_r95, 3.1416F, 0.0F, -2.2253F); + cube_r95.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r96 = new ModelRenderer(this); + cube_r96.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone9.addChild(cube_r96); + setRotationAngle(cube_r96, 0.0F, 3.1416F, 0.0F); + cube_r96.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone10 = new ModelRenderer(this); + bone10.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone10, -1.5708F, 0.0F, -3.1416F); + cube_r97 = new ModelRenderer(this); + cube_r97.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone10.addChild(cube_r97); + setRotationAngle(cube_r97, -1.0472F, 1.1781F, 0.0F); + cube_r97.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r98 = new ModelRenderer(this); + cube_r98.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone10.addChild(cube_r98); + setRotationAngle(cube_r98, -0.829F, 1.1781F, 0.0F); + cube_r98.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r99 = new ModelRenderer(this); + cube_r99.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone10.addChild(cube_r99); + setRotationAngle(cube_r99, -0.5672F, 1.1781F, 0.0F); + cube_r99.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r100 = new ModelRenderer(this); + cube_r100.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone10.addChild(cube_r100); + setRotationAngle(cube_r100, -0.3054F, 1.1781F, 0.0F); + cube_r100.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r101 = new ModelRenderer(this); + cube_r101.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone10.addChild(cube_r101); + setRotationAngle(cube_r101, 0.3927F, 1.1781F, 0.0F); + cube_r101.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r102 = new ModelRenderer(this); + cube_r102.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone10.addChild(cube_r102); + setRotationAngle(cube_r102, 0.2618F, 1.1781F, 0.0F); + cube_r102.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r103 = new ModelRenderer(this); + cube_r103.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone10.addChild(cube_r103); + setRotationAngle(cube_r103, 0.1309F, 1.1781F, 0.0F); + cube_r103.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r104 = new ModelRenderer(this); + cube_r104.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone10.addChild(cube_r104); + setRotationAngle(cube_r104, 0.0F, 1.1781F, 0.0F); + cube_r104.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r105 = new ModelRenderer(this); + cube_r105.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone10.addChild(cube_r105); + setRotationAngle(cube_r105, 3.1416F, 0.0F, 3.0194F); + cube_r105.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r106 = new ModelRenderer(this); + cube_r106.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone10.addChild(cube_r106); + setRotationAngle(cube_r106, 3.1416F, 0.0F, 2.9016F); + cube_r106.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r107 = new ModelRenderer(this); + cube_r107.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone10.addChild(cube_r107); + setRotationAngle(cube_r107, 3.1416F, 0.0F, 2.7794F); + cube_r107.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r108 = new ModelRenderer(this); + cube_r108.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone10.addChild(cube_r108); + setRotationAngle(cube_r108, -3.1416F, 0.0F, -2.8362F); + cube_r108.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r109 = new ModelRenderer(this); + cube_r109.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone10.addChild(cube_r109); + setRotationAngle(cube_r109, 3.1416F, 0.0F, -2.618F); + cube_r109.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r110 = new ModelRenderer(this); + cube_r110.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone10.addChild(cube_r110); + setRotationAngle(cube_r110, 3.1416F, 0.0F, -2.3562F); + cube_r110.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r111 = new ModelRenderer(this); + cube_r111.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone10.addChild(cube_r111); + setRotationAngle(cube_r111, 3.1416F, 0.0F, -2.2253F); + cube_r111.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r112 = new ModelRenderer(this); + cube_r112.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone10.addChild(cube_r112); + setRotationAngle(cube_r112, 0.0F, 3.1416F, 0.0F); + cube_r112.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + bone11 = new ModelRenderer(this); + bone11.setRotationPoint(0.0F, -55.0F, 3.4526F); + setRotationAngle(bone11, -1.5708F, 0.0F, 2.3562F); + cube_r113 = new ModelRenderer(this); + cube_r113.setRotationPoint(6.8889F, 121.1344F, 2.6991F); + bone11.addChild(cube_r113); + setRotationAngle(cube_r113, -1.0472F, 1.1781F, 0.0F); + cube_r113.setTextureOffset(367, 938).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 9.0F, 2.0F, 0.0F, false); + cube_r114 = new ModelRenderer(this); + cube_r114.setRotationPoint(24.5989F, 103.5691F, 10.0349F); + bone11.addChild(cube_r114); + setRotationAngle(cube_r114, -0.829F, 1.1781F, 0.0F); + cube_r114.setTextureOffset(453, 925).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 26.0F, 2.0F, 0.0F, false); + cube_r115 = new ModelRenderer(this); + cube_r115.setRotationPoint(33.5341F, 88.388F, 13.736F); + bone11.addChild(cube_r115); + setRotationAngle(cube_r115, -0.5672F, 1.1781F, 0.0F); + cube_r115.setTextureOffset(745, 870).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 18.0F, 2.0F, 0.0F, false); + cube_r116 = new ModelRenderer(this); + cube_r116.setRotationPoint(39.9239F, 66.4526F, 16.3827F); + bone11.addChild(cube_r116); + setRotationAngle(cube_r116, -0.3054F, 1.1781F, 0.0F); + cube_r116.setTextureOffset(324, 711).addBox(-1.0F, 0.0F, -2.0F, 2.0F, 23.0F, 2.0F, 0.0F, false); + cube_r117 = new ModelRenderer(this); + cube_r117.setRotationPoint(20.9799F, -162.2966F, 8.5358F); + bone11.addChild(cube_r117); + setRotationAngle(cube_r117, 0.3927F, 1.1781F, 0.0F); + cube_r117.setTextureOffset(406, 883).addBox(-1.0F, -57.0F, -2.0F, 2.0F, 57.0F, 2.0F, 0.0F, false); + cube_r118 = new ModelRenderer(this); + cube_r118.setRotationPoint(33.6532F, -111.1026F, 13.7853F); + bone11.addChild(cube_r118); + setRotationAngle(cube_r118, 0.2618F, 1.1781F, 0.0F); + cube_r118.setTextureOffset(307, 891).addBox(-1.0F, -53.0F, -2.0F, 2.0F, 53.0F, 2.0F, 0.0F, false); + cube_r119 = new ModelRenderer(this); + cube_r119.setRotationPoint(39.9239F, -59.5474F, 16.3827F); + bone11.addChild(cube_r119); + setRotationAngle(cube_r119, 0.1309F, 1.1781F, 0.0F); + cube_r119.setTextureOffset(316, 891).addBox(-1.0F, -52.0F, -2.0F, 2.0F, 52.0F, 2.0F, 0.0F, false); + cube_r120 = new ModelRenderer(this); + cube_r120.setRotationPoint(0.0F, 3.4526F, 0.0F); + bone11.addChild(cube_r120); + setRotationAngle(cube_r120, 0.0F, 1.1781F, 0.0F); + cube_r120.setTextureOffset(677, 870).addBox(-0.8574F, -63.0F, 41.1542F, 2.0F, 126.0F, 2.0F, 0.0F, false); + cube_r121 = new ModelRenderer(this); + cube_r121.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone11.addChild(cube_r121); + setRotationAngle(cube_r121, 3.1416F, 0.0F, 3.0194F); + cube_r121.setTextureOffset(555, 828).addBox(-29.407F, 29.5137F, -16.0F, 0.0F, 51.0F, 32.0F, 0.0F, false); + cube_r122 = new ModelRenderer(this); + cube_r122.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone11.addChild(cube_r122); + setRotationAngle(cube_r122, 3.1416F, 0.0F, 2.9016F); + cube_r122.setTextureOffset(620, 870).addBox(-25.7342F, -20.2344F, -14.0F, 0.0F, 53.0F, 28.0F, 0.0F, false); + cube_r123 = new ModelRenderer(this); + cube_r123.setRotationPoint(0.0F, -135.8772F, 0.0F); + bone11.addChild(cube_r123); + setRotationAngle(cube_r123, 3.1416F, 0.0F, 2.7794F); + cube_r123.setTextureOffset(697, 870).addBox(-28.0084F, -70.9474F, -9.0F, 0.0F, 54.0F, 18.0F, 0.0F, false); + cube_r124 = new ModelRenderer(this); + cube_r124.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone11.addChild(cube_r124); + setRotationAngle(cube_r124, -3.1416F, 0.0F, -2.8362F); + cube_r124.setTextureOffset(326, 883).addBox(-27.3317F, -43.0098F, -16.0F, 0.0F, 22.0F, 32.0F, 0.0F, false); + cube_r125 = new ModelRenderer(this); + cube_r125.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone11.addChild(cube_r125); + setRotationAngle(cube_r125, 3.1416F, 0.0F, -2.618F); + cube_r125.setTextureOffset(0, 902).addBox(-22.1365F, -26.4274F, -13.0F, 0.0F, 17.0F, 26.0F, 0.0F, false); + cube_r126 = new ModelRenderer(this); + cube_r126.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone11.addChild(cube_r126); + setRotationAngle(cube_r126, 3.1416F, 0.0F, -2.3562F); + cube_r126.setTextureOffset(812, 894).addBox(-18.9422F, -14.8355F, -10.0F, 0.0F, 24.0F, 20.0F, 0.0F, false); + cube_r127 = new ModelRenderer(this); + cube_r127.setRotationPoint(0.0F, 99.2529F, 0.0F); + bone11.addChild(cube_r127); + setRotationAngle(cube_r127, 3.1416F, 0.0F, -2.2253F); + cube_r127.setTextureOffset(358, 938).addBox(-19.9764F, 6.6136F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + cube_r128 = new ModelRenderer(this); + cube_r128.setRotationPoint(39.0F, 4.4526F, 0.0F); + bone11.addChild(cube_r128); + setRotationAngle(cube_r128, 0.0F, 3.1416F, 0.0F); + cube_r128.setTextureOffset(133, 773).addBox(0.0F, -64.0F, -16.0F, 0.0F, 126.0F, 32.0F, 0.0F, false); + TailFin = new ModelRenderer(this); + TailFin.setRotationPoint(0.0F, -104.5815F, 120.9657F); + cube_r129 = new ModelRenderer(this); + cube_r129.setRotationPoint(0.0F, -45.5826F, 91.2868F); + TailFin.addChild(cube_r129); + setRotationAngle(cube_r129, -1.789F, 0.0F, 0.0F); + cube_r129.setTextureOffset(102, 902).addBox(-2.0F, -44.0F, 0.0F, 4.0F, 44.0F, 3.0F, 0.0F, false); + cube_r130 = new ModelRenderer(this); + cube_r130.setRotationPoint(0.0F, -23.7554F, 16.6337F); + TailFin.addChild(cube_r130); + setRotationAngle(cube_r130, -1.0036F, 0.0F, 0.0F); + cube_r130.setTextureOffset(117, 902).addBox(-2.0F, -33.0F, 0.0F, 4.0F, 33.0F, 3.0F, 0.0F, false); + cube_r131 = new ModelRenderer(this); + cube_r131.setRotationPoint(0.0F, -41.4863F, 44.4656F); + TailFin.addChild(cube_r131); + setRotationAngle(cube_r131, -1.4835F, 0.0F, 0.0F); + cube_r131.setTextureOffset(292, 891).addBox(-2.0F, -47.0F, 0.0F, 4.0F, 47.0F, 3.0F, 0.0F, false); + cube_r132 = new ModelRenderer(this); + cube_r132.setRotationPoint(0.0F, -39.0F, 41.0F); + TailFin.addChild(cube_r132); + setRotationAngle(cube_r132, -1.8326F, 0.0F, 0.0F); + cube_r132.setTextureOffset(734, 870).addBox(-1.0F, -91.0F, 0.0F, 2.0F, 91.0F, 3.0F, 0.0F, false); + cube_r132.setTextureOffset(642, 607).addBox(-0.5F, -90.0F, -22.0F, 1.0F, 120.0F, 73.0F, 0.0F, false); + cube_r133 = new ModelRenderer(this); + cube_r133.setRotationPoint(0.0F, -20.0F, 16.0F); + TailFin.addChild(cube_r133); + setRotationAngle(cube_r133, -1.8326F, 0.0F, 0.0F); + cube_r133.setTextureOffset(686, 870).addBox(-1.0F, -111.0F, 0.0F, 2.0F, 111.0F, 3.0F, 0.0F, false); + cube_r134 = new ModelRenderer(this); + cube_r134.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin.addChild(cube_r134); + setRotationAngle(cube_r134, -1.8326F, 0.0F, 0.0F); + cube_r134.setTextureOffset(924, 604).addBox(-3.0F, -5.0F, -1.0F, 6.0F, 7.0F, 11.0F, 0.0F, false); + cube_r134.setTextureOffset(855, 845).addBox(-2.0F, -121.0F, 0.0F, 4.0F, 121.0F, 3.0F, 0.0F, false); + cube_r135 = new ModelRenderer(this); + cube_r135.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin.addChild(cube_r135); + setRotationAngle(cube_r135, -0.6109F, 0.0F, 0.0F); + cube_r135.setTextureOffset(589, 912).addBox(-2.0F, -29.0F, 0.0F, 4.0F, 29.0F, 3.0F, 0.0F, false); + TailFin4 = new ModelRenderer(this); + TailFin4.setRotationPoint(0.0F, -55.0F, 176.4869F); + setRotationAngle(TailFin4, 0.0F, 0.0F, -1.5708F); + cube_r136 = new ModelRenderer(this); + cube_r136.setRotationPoint(0.0F, -95.1641F, 35.7656F); + TailFin4.addChild(cube_r136); + setRotationAngle(cube_r136, -1.789F, 0.0F, 0.0F); + cube_r136.setTextureOffset(102, 902).addBox(-2.0F, -44.0F, 0.0F, 4.0F, 44.0F, 3.0F, 0.0F, false); + cube_r137 = new ModelRenderer(this); + cube_r137.setRotationPoint(0.0F, -73.3369F, -38.8874F); + TailFin4.addChild(cube_r137); + setRotationAngle(cube_r137, -1.0036F, 0.0F, 0.0F); + cube_r137.setTextureOffset(117, 902).addBox(-2.0F, -33.0F, 0.0F, 4.0F, 33.0F, 3.0F, 0.0F, false); + cube_r138 = new ModelRenderer(this); + cube_r138.setRotationPoint(0.0F, -91.0678F, -11.0555F); + TailFin4.addChild(cube_r138); + setRotationAngle(cube_r138, -1.4835F, 0.0F, 0.0F); + cube_r138.setTextureOffset(292, 891).addBox(-2.0F, -47.0F, 0.0F, 4.0F, 47.0F, 3.0F, 0.0F, false); + cube_r139 = new ModelRenderer(this); + cube_r139.setRotationPoint(0.0F, -88.5815F, -14.5211F); + TailFin4.addChild(cube_r139); + setRotationAngle(cube_r139, -1.8326F, 0.0F, 0.0F); + cube_r139.setTextureOffset(734, 870).addBox(-1.0F, -91.0F, 0.0F, 2.0F, 91.0F, 3.0F, 0.0F, false); + cube_r139.setTextureOffset(642, 607).addBox(-0.5F, -90.0F, -22.0F, 1.0F, 120.0F, 73.0F, 0.0F, false); + cube_r140 = new ModelRenderer(this); + cube_r140.setRotationPoint(0.0F, -69.5815F, -39.5211F); + TailFin4.addChild(cube_r140); + setRotationAngle(cube_r140, -1.8326F, 0.0F, 0.0F); + cube_r140.setTextureOffset(686, 870).addBox(-1.0F, -111.0F, 0.0F, 2.0F, 111.0F, 3.0F, 0.0F, false); + cube_r141 = new ModelRenderer(this); + cube_r141.setRotationPoint(0.0F, -49.5815F, -55.5211F); + TailFin4.addChild(cube_r141); + setRotationAngle(cube_r141, -1.8326F, 0.0F, 0.0F); + cube_r141.setTextureOffset(924, 604).addBox(-3.0F, -5.0F, -1.0F, 6.0F, 7.0F, 11.0F, 0.0F, false); + cube_r141.setTextureOffset(855, 845).addBox(-2.0F, -121.0F, 0.0F, 4.0F, 121.0F, 3.0F, 0.0F, false); + cube_r142 = new ModelRenderer(this); + cube_r142.setRotationPoint(0.0F, -49.5815F, -55.5211F); + TailFin4.addChild(cube_r142); + setRotationAngle(cube_r142, -0.6109F, 0.0F, 0.0F); + cube_r142.setTextureOffset(589, 912).addBox(-2.0F, -29.0F, 0.0F, 4.0F, 29.0F, 3.0F, 0.0F, false); + TailFin2 = new ModelRenderer(this); + TailFin2.setRotationPoint(0.0F, -5.4185F, 120.9657F); + cube_r143 = new ModelRenderer(this); + cube_r143.setRotationPoint(0.0F, 45.5826F, 91.2868F); + TailFin2.addChild(cube_r143); + setRotationAngle(cube_r143, 1.789F, 0.0F, 0.0F); + cube_r143.setTextureOffset(102, 902).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 44.0F, 3.0F, 0.0F, false); + cube_r144 = new ModelRenderer(this); + cube_r144.setRotationPoint(0.0F, 23.7554F, 16.6337F); + TailFin2.addChild(cube_r144); + setRotationAngle(cube_r144, 1.0036F, 0.0F, 0.0F); + cube_r144.setTextureOffset(117, 902).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 33.0F, 3.0F, 0.0F, false); + cube_r145 = new ModelRenderer(this); + cube_r145.setRotationPoint(0.0F, 41.4863F, 44.4656F); + TailFin2.addChild(cube_r145); + setRotationAngle(cube_r145, 1.4835F, 0.0F, 0.0F); + cube_r145.setTextureOffset(292, 891).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 47.0F, 3.0F, 0.0F, false); + cube_r146 = new ModelRenderer(this); + cube_r146.setRotationPoint(0.0F, 39.0F, 41.0F); + TailFin2.addChild(cube_r146); + setRotationAngle(cube_r146, 1.8326F, 0.0F, 0.0F); + cube_r146.setTextureOffset(734, 870).addBox(-1.0F, 0.0F, 0.0F, 2.0F, 91.0F, 3.0F, 0.0F, false); + cube_r147 = new ModelRenderer(this); + cube_r147.setRotationPoint(0.0F, 17.2295F, 66.2249F); + TailFin2.addChild(cube_r147); + setRotationAngle(cube_r147, -1.8326F, 0.0F, 3.1416F); + cube_r147.setTextureOffset(642, 607).addBox(-0.5F, -60.0F, -36.5F, 1.0F, 120.0F, 73.0F, 0.0F, false); + cube_r148 = new ModelRenderer(this); + cube_r148.setRotationPoint(0.0F, 20.0F, 16.0F); + TailFin2.addChild(cube_r148); + setRotationAngle(cube_r148, 1.8326F, 0.0F, 0.0F); + cube_r148.setTextureOffset(686, 870).addBox(-1.0F, 0.0F, 0.0F, 2.0F, 111.0F, 3.0F, 0.0F, false); + cube_r149 = new ModelRenderer(this); + cube_r149.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin2.addChild(cube_r149); + setRotationAngle(cube_r149, 1.8326F, 0.0F, 0.0F); + cube_r149.setTextureOffset(924, 604).addBox(-3.0F, -2.0F, -1.0F, 6.0F, 7.0F, 11.0F, 0.0F, false); + cube_r149.setTextureOffset(855, 845).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 121.0F, 3.0F, 0.0F, false); + cube_r150 = new ModelRenderer(this); + cube_r150.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin2.addChild(cube_r150); + setRotationAngle(cube_r150, 0.6109F, 0.0F, 0.0F); + cube_r150.setTextureOffset(589, 912).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 29.0F, 3.0F, 0.0F, false); + TailFin3 = new ModelRenderer(this); + TailFin3.setRotationPoint(0.0F, -55.0F, 176.4869F); + setRotationAngle(TailFin3, 0.0F, 0.0F, -1.5708F); + cube_r151 = new ModelRenderer(this); + cube_r151.setRotationPoint(0.0F, 95.1641F, 35.7656F); + TailFin3.addChild(cube_r151); + setRotationAngle(cube_r151, 1.789F, 0.0F, 0.0F); + cube_r151.setTextureOffset(102, 902).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 44.0F, 3.0F, 0.0F, false); + cube_r152 = new ModelRenderer(this); + cube_r152.setRotationPoint(0.0F, 73.3369F, -38.8874F); + TailFin3.addChild(cube_r152); + setRotationAngle(cube_r152, 1.0036F, 0.0F, 0.0F); + cube_r152.setTextureOffset(117, 902).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 33.0F, 3.0F, 0.0F, false); + cube_r153 = new ModelRenderer(this); + cube_r153.setRotationPoint(0.0F, 91.0678F, -11.0555F); + TailFin3.addChild(cube_r153); + setRotationAngle(cube_r153, 1.4835F, 0.0F, 0.0F); + cube_r153.setTextureOffset(292, 891).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 47.0F, 3.0F, 0.0F, false); + cube_r154 = new ModelRenderer(this); + cube_r154.setRotationPoint(0.0F, 88.5815F, -14.5211F); + TailFin3.addChild(cube_r154); + setRotationAngle(cube_r154, 1.8326F, 0.0F, 0.0F); + cube_r154.setTextureOffset(734, 870).addBox(-1.0F, 0.0F, 0.0F, 2.0F, 91.0F, 3.0F, 0.0F, false); + cube_r155 = new ModelRenderer(this); + cube_r155.setRotationPoint(0.0F, 66.811F, 10.7038F); + TailFin3.addChild(cube_r155); + setRotationAngle(cube_r155, -1.8326F, 0.0F, 3.1416F); + cube_r155.setTextureOffset(642, 607).addBox(-0.5F, -60.0F, -36.5F, 1.0F, 120.0F, 73.0F, 0.0F, false); + cube_r156 = new ModelRenderer(this); + cube_r156.setRotationPoint(0.0F, 69.5815F, -39.5211F); + TailFin3.addChild(cube_r156); + setRotationAngle(cube_r156, 1.8326F, 0.0F, 0.0F); + cube_r156.setTextureOffset(686, 870).addBox(-1.0F, 0.0F, 0.0F, 2.0F, 111.0F, 3.0F, 0.0F, false); + cube_r157 = new ModelRenderer(this); + cube_r157.setRotationPoint(0.0F, 49.5815F, -55.5211F); + TailFin3.addChild(cube_r157); + setRotationAngle(cube_r157, 1.8326F, 0.0F, 0.0F); + cube_r157.setTextureOffset(924, 604).addBox(-3.0F, -2.0F, -1.0F, 6.0F, 7.0F, 11.0F, 0.0F, false); + cube_r157.setTextureOffset(855, 845).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 121.0F, 3.0F, 0.0F, false); + cube_r158 = new ModelRenderer(this); + cube_r158.setRotationPoint(0.0F, 49.5815F, -55.5211F); + TailFin3.addChild(cube_r158); + setRotationAngle(cube_r158, 0.6109F, 0.0F, 0.0F); + cube_r158.setTextureOffset(589, 912).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 29.0F, 3.0F, 0.0F, false); + bone2 = new ModelRenderer(this); + bone2.setRotationPoint(0.0F, -55.0F, 2.5F); + setRotationAngle(bone2, 0.0F, 0.0F, -1.5708F); + bone31 = new ModelRenderer(this); + bone31.setRotationPoint(0.0F, 0.0F, 104.5F); + bone2.addChild(bone31); + bone35 = new ModelRenderer(this); + bone35.setRotationPoint(0.0F, 0.0F, 0.0F); + bone31.addChild(bone35); + setRotationAngle(bone35, 0.0F, 0.0F, -3.1416F); + cube_r159 = new ModelRenderer(this); + cube_r159.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone35.addChild(cube_r159); + setRotationAngle(cube_r159, -1.5708F, 0.0F, 0.3491F); + cube_r159.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone36 = new ModelRenderer(this); + bone36.setRotationPoint(0.0F, 0.0F, 0.0F); + bone35.addChild(bone36); + setRotationAngle(bone36, 0.0F, 0.0F, 1.5708F); + cube_r160 = new ModelRenderer(this); + cube_r160.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone36.addChild(cube_r160); + setRotationAngle(cube_r160, -1.5708F, 0.0F, -0.9119F); + cube_r160.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r161 = new ModelRenderer(this); + cube_r161.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone36.addChild(cube_r161); + setRotationAngle(cube_r161, -1.5708F, 0.0F, -0.7854F); + cube_r161.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r162 = new ModelRenderer(this); + cube_r162.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone36.addChild(cube_r162); + setRotationAngle(cube_r162, -1.5708F, 0.0F, -0.3491F); + cube_r162.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone37 = new ModelRenderer(this); + bone37.setRotationPoint(0.0F, 0.0F, 0.0F); + bone36.addChild(bone37); + setRotationAngle(bone37, 0.0F, 0.0F, -1.5708F); + cube_r163 = new ModelRenderer(this); + cube_r163.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone37.addChild(cube_r163); + setRotationAngle(cube_r163, -1.5708F, 0.0F, 0.9119F); + cube_r163.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone23 = new ModelRenderer(this); + bone23.setRotationPoint(0.0F, 0.0F, 44.5F); + bone2.addChild(bone23); + bone24 = new ModelRenderer(this); + bone24.setRotationPoint(0.0F, 0.0F, 2.0F); + bone23.addChild(bone24); + setRotationAngle(bone24, 0.0F, 0.0F, -3.1416F); + cube_r164 = new ModelRenderer(this); + cube_r164.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone24.addChild(cube_r164); + setRotationAngle(cube_r164, -1.5708F, 0.0F, 0.3491F); + cube_r164.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone78 = new ModelRenderer(this); + bone78.setRotationPoint(0.0F, 0.0F, 0.0F); + bone24.addChild(bone78); + setRotationAngle(bone78, 0.0F, 0.0F, 1.5708F); + cube_r165 = new ModelRenderer(this); + cube_r165.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone78.addChild(cube_r165); + setRotationAngle(cube_r165, -1.5708F, 0.0F, -0.9119F); + cube_r165.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r166 = new ModelRenderer(this); + cube_r166.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone78.addChild(cube_r166); + setRotationAngle(cube_r166, -1.5708F, 0.0F, -0.7854F); + cube_r166.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r167 = new ModelRenderer(this); + cube_r167.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone78.addChild(cube_r167); + setRotationAngle(cube_r167, -1.5708F, 0.0F, -0.3491F); + cube_r167.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone79 = new ModelRenderer(this); + bone79.setRotationPoint(0.0F, 0.0F, 0.0F); + bone78.addChild(bone79); + setRotationAngle(bone79, 0.0F, 0.0F, -1.5708F); + cube_r168 = new ModelRenderer(this); + cube_r168.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone79.addChild(cube_r168); + setRotationAngle(cube_r168, -1.5708F, 0.0F, 0.9119F); + cube_r168.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone14 = new ModelRenderer(this); + bone14.setRotationPoint(0.0F, 0.0F, 164.5F); + bone2.addChild(bone14); + bone15 = new ModelRenderer(this); + bone15.setRotationPoint(0.0F, 0.0F, -2.0F); + bone14.addChild(bone15); + setRotationAngle(bone15, 0.0F, 0.0F, -3.1416F); + cube_r169 = new ModelRenderer(this); + cube_r169.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone15.addChild(cube_r169); + setRotationAngle(cube_r169, -1.5708F, 0.0F, 0.3491F); + cube_r169.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone16 = new ModelRenderer(this); + bone16.setRotationPoint(0.0F, 0.0F, 0.0F); + bone15.addChild(bone16); + setRotationAngle(bone16, 0.0F, 0.0F, 1.5708F); + cube_r170 = new ModelRenderer(this); + cube_r170.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone16.addChild(cube_r170); + setRotationAngle(cube_r170, -1.5708F, 0.0F, -0.9119F); + cube_r170.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r171 = new ModelRenderer(this); + cube_r171.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone16.addChild(cube_r171); + setRotationAngle(cube_r171, -1.5708F, 0.0F, -0.7854F); + cube_r171.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r172 = new ModelRenderer(this); + cube_r172.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone16.addChild(cube_r172); + setRotationAngle(cube_r172, -1.5708F, 0.0F, -0.3491F); + cube_r172.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone22 = new ModelRenderer(this); + bone22.setRotationPoint(0.0F, 0.0F, 0.0F); + bone16.addChild(bone22); + setRotationAngle(bone22, 0.0F, 0.0F, -1.5708F); + cube_r173 = new ModelRenderer(this); + cube_r173.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone22.addChild(cube_r173); + setRotationAngle(cube_r173, -1.5708F, 0.0F, 0.9119F); + cube_r173.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone70 = new ModelRenderer(this); + bone70.setRotationPoint(0.0F, -55.0F, 2.25F); + setRotationAngle(bone70, 3.1416F, 0.0F, -1.5708F); + bone71 = new ModelRenderer(this); + bone71.setRotationPoint(0.0F, 0.0F, 104.5F); + bone70.addChild(bone71); + bone77 = new ModelRenderer(this); + bone77.setRotationPoint(0.0F, 0.0F, 0.0F); + bone71.addChild(bone77); + setRotationAngle(bone77, 0.0F, 0.0F, -3.1416F); + cube_r174 = new ModelRenderer(this); + cube_r174.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone77.addChild(cube_r174); + setRotationAngle(cube_r174, -1.5708F, 0.0F, 0.3491F); + cube_r174.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone80 = new ModelRenderer(this); + bone80.setRotationPoint(0.0F, 0.0F, 0.0F); + bone77.addChild(bone80); + setRotationAngle(bone80, 0.0F, 0.0F, 1.5708F); + cube_r175 = new ModelRenderer(this); + cube_r175.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone80.addChild(cube_r175); + setRotationAngle(cube_r175, -1.5708F, 0.0F, -0.9119F); + cube_r175.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r176 = new ModelRenderer(this); + cube_r176.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone80.addChild(cube_r176); + setRotationAngle(cube_r176, -1.5708F, 0.0F, -0.7854F); + cube_r176.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r177 = new ModelRenderer(this); + cube_r177.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone80.addChild(cube_r177); + setRotationAngle(cube_r177, -1.5708F, 0.0F, -0.3491F); + cube_r177.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone81 = new ModelRenderer(this); + bone81.setRotationPoint(0.0F, 0.0F, 0.0F); + bone80.addChild(bone81); + setRotationAngle(bone81, 0.0F, 0.0F, -1.5708F); + cube_r178 = new ModelRenderer(this); + cube_r178.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone81.addChild(cube_r178); + setRotationAngle(cube_r178, -1.5708F, 0.0F, 0.9119F); + cube_r178.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone82 = new ModelRenderer(this); + bone82.setRotationPoint(0.0F, 0.0F, 44.5F); + bone70.addChild(bone82); + bone83 = new ModelRenderer(this); + bone83.setRotationPoint(0.0F, 0.0F, 2.0F); + bone82.addChild(bone83); + setRotationAngle(bone83, 0.0F, 0.0F, -3.1416F); + cube_r179 = new ModelRenderer(this); + cube_r179.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone83.addChild(cube_r179); + setRotationAngle(cube_r179, -1.5708F, 0.0F, 0.3491F); + cube_r179.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone84 = new ModelRenderer(this); + bone84.setRotationPoint(0.0F, 0.0F, 0.0F); + bone83.addChild(bone84); + setRotationAngle(bone84, 0.0F, 0.0F, 1.5708F); + cube_r180 = new ModelRenderer(this); + cube_r180.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone84.addChild(cube_r180); + setRotationAngle(cube_r180, -1.5708F, 0.0F, -0.9119F); + cube_r180.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r181 = new ModelRenderer(this); + cube_r181.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone84.addChild(cube_r181); + setRotationAngle(cube_r181, -1.5708F, 0.0F, -0.7854F); + cube_r181.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r182 = new ModelRenderer(this); + cube_r182.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone84.addChild(cube_r182); + setRotationAngle(cube_r182, -1.5708F, 0.0F, -0.3491F); + cube_r182.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone85 = new ModelRenderer(this); + bone85.setRotationPoint(0.0F, 0.0F, 0.0F); + bone84.addChild(bone85); + setRotationAngle(bone85, 0.0F, 0.0F, -1.5708F); + cube_r183 = new ModelRenderer(this); + cube_r183.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone85.addChild(cube_r183); + setRotationAngle(cube_r183, -1.5708F, 0.0F, 0.9119F); + cube_r183.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone86 = new ModelRenderer(this); + bone86.setRotationPoint(0.0F, 0.0F, 164.5F); + bone70.addChild(bone86); + bone87 = new ModelRenderer(this); + bone87.setRotationPoint(0.0F, 0.0F, -2.0F); + bone86.addChild(bone87); + setRotationAngle(bone87, 0.0F, 0.0F, -3.1416F); + cube_r184 = new ModelRenderer(this); + cube_r184.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone87.addChild(cube_r184); + setRotationAngle(cube_r184, -1.5708F, 0.0F, 0.3491F); + cube_r184.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone88 = new ModelRenderer(this); + bone88.setRotationPoint(0.0F, 0.0F, 0.0F); + bone87.addChild(bone88); + setRotationAngle(bone88, 0.0F, 0.0F, 1.5708F); + cube_r185 = new ModelRenderer(this); + cube_r185.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone88.addChild(cube_r185); + setRotationAngle(cube_r185, -1.5708F, 0.0F, -0.9119F); + cube_r185.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r186 = new ModelRenderer(this); + cube_r186.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone88.addChild(cube_r186); + setRotationAngle(cube_r186, -1.5708F, 0.0F, -0.7854F); + cube_r186.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r187 = new ModelRenderer(this); + cube_r187.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone88.addChild(cube_r187); + setRotationAngle(cube_r187, -1.5708F, 0.0F, -0.3491F); + cube_r187.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone89 = new ModelRenderer(this); + bone89.setRotationPoint(0.0F, 0.0F, 0.0F); + bone88.addChild(bone89); + setRotationAngle(bone89, 0.0F, 0.0F, -1.5708F); + cube_r188 = new ModelRenderer(this); + cube_r188.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone89.addChild(cube_r188); + setRotationAngle(cube_r188, -1.5708F, 0.0F, 0.9119F); + cube_r188.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone55 = new ModelRenderer(this); + bone55.setRotationPoint(0.0F, -55.0F, 107.0F); + setRotationAngle(bone55, 0.0F, 0.0F, -1.5708F); + bone56 = new ModelRenderer(this); + bone56.setRotationPoint(0.0F, 0.0F, 0.0F); + bone55.addChild(bone56); + bone57 = new ModelRenderer(this); + bone57.setRotationPoint(0.0F, 0.0F, 0.0F); + bone56.addChild(bone57); + setRotationAngle(bone57, 0.0F, 0.0F, -3.1416F); + cube_r189 = new ModelRenderer(this); + cube_r189.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone57.addChild(cube_r189); + setRotationAngle(cube_r189, -1.5708F, 0.0F, 0.3491F); + cube_r189.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone58 = new ModelRenderer(this); + bone58.setRotationPoint(0.0F, 0.0F, 0.0F); + bone57.addChild(bone58); + setRotationAngle(bone58, 0.0F, 0.0F, 1.5708F); + cube_r190 = new ModelRenderer(this); + cube_r190.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone58.addChild(cube_r190); + setRotationAngle(cube_r190, -1.5708F, 0.0F, -0.9119F); + cube_r190.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r191 = new ModelRenderer(this); + cube_r191.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone58.addChild(cube_r191); + setRotationAngle(cube_r191, -1.5708F, 0.0F, -0.7854F); + cube_r191.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r192 = new ModelRenderer(this); + cube_r192.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone58.addChild(cube_r192); + setRotationAngle(cube_r192, -1.5708F, 0.0F, -0.3491F); + cube_r192.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone59 = new ModelRenderer(this); + bone59.setRotationPoint(0.0F, 0.0F, 0.0F); + bone58.addChild(bone59); + setRotationAngle(bone59, 0.0F, 0.0F, -1.5708F); + cube_r193 = new ModelRenderer(this); + cube_r193.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone59.addChild(cube_r193); + setRotationAngle(cube_r193, -1.5708F, 0.0F, 0.9119F); + cube_r193.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone60 = new ModelRenderer(this); + bone60.setRotationPoint(0.0F, 0.0F, -60.0F); + bone55.addChild(bone60); + bone61 = new ModelRenderer(this); + bone61.setRotationPoint(0.0F, 0.0F, 2.0F); + bone60.addChild(bone61); + setRotationAngle(bone61, 0.0F, 0.0F, -3.1416F); + cube_r194 = new ModelRenderer(this); + cube_r194.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone61.addChild(cube_r194); + setRotationAngle(cube_r194, -1.5708F, 0.0F, 0.3491F); + cube_r194.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone62 = new ModelRenderer(this); + bone62.setRotationPoint(0.0F, 0.0F, 0.0F); + bone61.addChild(bone62); + setRotationAngle(bone62, 0.0F, 0.0F, 1.5708F); + cube_r195 = new ModelRenderer(this); + cube_r195.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone62.addChild(cube_r195); + setRotationAngle(cube_r195, -1.5708F, 0.0F, -0.9119F); + cube_r195.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r196 = new ModelRenderer(this); + cube_r196.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone62.addChild(cube_r196); + setRotationAngle(cube_r196, -1.5708F, 0.0F, -0.7854F); + cube_r196.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r197 = new ModelRenderer(this); + cube_r197.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone62.addChild(cube_r197); + setRotationAngle(cube_r197, -1.5708F, 0.0F, -0.3491F); + cube_r197.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone63 = new ModelRenderer(this); + bone63.setRotationPoint(0.0F, 0.0F, 0.0F); + bone62.addChild(bone63); + setRotationAngle(bone63, 0.0F, 0.0F, -1.5708F); + cube_r198 = new ModelRenderer(this); + cube_r198.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone63.addChild(cube_r198); + setRotationAngle(cube_r198, -1.5708F, 0.0F, 0.9119F); + cube_r198.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone64 = new ModelRenderer(this); + bone64.setRotationPoint(0.0F, 0.0F, 60.0F); + bone55.addChild(bone64); + bone65 = new ModelRenderer(this); + bone65.setRotationPoint(0.0F, 0.0F, -2.0F); + bone64.addChild(bone65); + setRotationAngle(bone65, 0.0F, 0.0F, -3.1416F); + cube_r199 = new ModelRenderer(this); + cube_r199.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone65.addChild(cube_r199); + setRotationAngle(cube_r199, -1.5708F, 0.0F, 0.3491F); + cube_r199.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone66 = new ModelRenderer(this); + bone66.setRotationPoint(0.0F, 0.0F, 0.0F); + bone65.addChild(bone66); + setRotationAngle(bone66, 0.0F, 0.0F, 1.5708F); + cube_r200 = new ModelRenderer(this); + cube_r200.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone66.addChild(cube_r200); + setRotationAngle(cube_r200, -1.5708F, 0.0F, -0.9119F); + cube_r200.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r201 = new ModelRenderer(this); + cube_r201.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone66.addChild(cube_r201); + setRotationAngle(cube_r201, -1.5708F, 0.0F, -0.7854F); + cube_r201.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r202 = new ModelRenderer(this); + cube_r202.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone66.addChild(cube_r202); + setRotationAngle(cube_r202, -1.5708F, 0.0F, -0.3491F); + cube_r202.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone69 = new ModelRenderer(this); + bone69.setRotationPoint(0.0F, 0.0F, 0.0F); + bone66.addChild(bone69); + setRotationAngle(bone69, 0.0F, 0.0F, -1.5708F); + cube_r203 = new ModelRenderer(this); + cube_r203.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone69.addChild(cube_r203); + setRotationAngle(cube_r203, -1.5708F, 0.0F, 0.9119F); + cube_r203.setTextureOffset(132, 932).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone20 = new ModelRenderer(this); + bone20.setRotationPoint(0.0F, -55.0F, 49.5F); + setRotationAngle(bone20, 0.0F, 0.0F, -3.1416F); + bone33 = new ModelRenderer(this); + bone33.setRotationPoint(0.0F, 0.0F, 57.5F); + bone20.addChild(bone33); + bone34 = new ModelRenderer(this); + bone34.setRotationPoint(-3.628F, 15.426F, -34.8688F); + bone33.addChild(bone34); + setRotationAngle(bone34, 0.0F, 0.0F, -3.1416F); + cube_r204 = new ModelRenderer(this); + cube_r204.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone34.addChild(cube_r204); + setRotationAngle(cube_r204, -1.5708F, 0.0F, 0.3491F); + cube_r204.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone38 = new ModelRenderer(this); + bone38.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone34.addChild(bone38); + setRotationAngle(bone38, 0.0F, 0.0F, 1.5708F); + cube_r205 = new ModelRenderer(this); + cube_r205.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone38.addChild(cube_r205); + setRotationAngle(cube_r205, -1.5708F, 0.0F, -0.9119F); + cube_r205.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r206 = new ModelRenderer(this); + cube_r206.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone38.addChild(cube_r206); + setRotationAngle(cube_r206, -1.5708F, 0.0F, -0.7854F); + cube_r206.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r207 = new ModelRenderer(this); + cube_r207.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone38.addChild(cube_r207); + setRotationAngle(cube_r207, -1.5708F, 0.0F, -0.3491F); + cube_r207.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone39 = new ModelRenderer(this); + bone39.setRotationPoint(0.0F, 0.0F, 0.0F); + bone38.addChild(bone39); + setRotationAngle(bone39, 0.0F, 0.0F, -1.5708F); + cube_r208 = new ModelRenderer(this); + cube_r208.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone39.addChild(cube_r208); + setRotationAngle(cube_r208, -1.5708F, 0.0F, 0.9119F); + cube_r208.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone52 = new ModelRenderer(this); + bone52.setRotationPoint(0.0F, 0.0F, 0.0F); + bone38.addChild(bone52); + setRotationAngle(bone52, 0.0F, 0.0F, -1.5708F); + cube_r209 = new ModelRenderer(this); + cube_r209.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone52.addChild(cube_r209); + setRotationAngle(cube_r209, -1.5708F, 0.0F, 0.9119F); + cube_r209.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone51 = new ModelRenderer(this); + bone51.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone34.addChild(bone51); + setRotationAngle(bone51, 0.0F, 0.0F, 1.5708F); + cube_r210 = new ModelRenderer(this); + cube_r210.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone51.addChild(cube_r210); + setRotationAngle(cube_r210, -1.5708F, 0.0F, -0.9119F); + cube_r210.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r211 = new ModelRenderer(this); + cube_r211.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone51.addChild(cube_r211); + setRotationAngle(cube_r211, -1.5708F, 0.0F, -0.7854F); + cube_r211.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r212 = new ModelRenderer(this); + cube_r212.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone51.addChild(cube_r212); + setRotationAngle(cube_r212, -1.5708F, 0.0F, -0.3491F); + cube_r212.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone50 = new ModelRenderer(this); + bone50.setRotationPoint(-3.628F, 15.426F, -34.8688F); + bone33.addChild(bone50); + setRotationAngle(bone50, 0.0F, 0.0F, -3.1416F); + cube_r213 = new ModelRenderer(this); + cube_r213.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone50.addChild(cube_r213); + setRotationAngle(cube_r213, -1.5708F, 0.0F, 0.3491F); + cube_r213.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone28 = new ModelRenderer(this); + bone28.setRotationPoint(-3.628F, 15.426F, 23.1312F); + bone33.addChild(bone28); + setRotationAngle(bone28, 0.0F, 0.0F, -3.1416F); + cube_r214 = new ModelRenderer(this); + cube_r214.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone28.addChild(cube_r214); + setRotationAngle(cube_r214, -1.5708F, 0.0F, 0.3491F); + cube_r214.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone29 = new ModelRenderer(this); + bone29.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone28.addChild(bone29); + setRotationAngle(bone29, 0.0F, 0.0F, 1.5708F); + cube_r215 = new ModelRenderer(this); + cube_r215.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone29.addChild(cube_r215); + setRotationAngle(cube_r215, -1.5708F, 0.0F, -0.9119F); + cube_r215.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r216 = new ModelRenderer(this); + cube_r216.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone29.addChild(cube_r216); + setRotationAngle(cube_r216, -1.5708F, 0.0F, -0.7854F); + cube_r216.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r217 = new ModelRenderer(this); + cube_r217.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone29.addChild(cube_r217); + setRotationAngle(cube_r217, -1.5708F, 0.0F, -0.3491F); + cube_r217.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone30 = new ModelRenderer(this); + bone30.setRotationPoint(0.0F, 0.0F, 0.0F); + bone29.addChild(bone30); + setRotationAngle(bone30, 0.0F, 0.0F, -1.5708F); + cube_r218 = new ModelRenderer(this); + cube_r218.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone30.addChild(cube_r218); + setRotationAngle(cube_r218, -1.5708F, 0.0F, 0.9119F); + cube_r218.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone27 = new ModelRenderer(this); + bone27.setRotationPoint(-3.628F, 15.426F, -92.8688F); + bone33.addChild(bone27); + setRotationAngle(bone27, 0.0F, 0.0F, -3.1416F); + cube_r219 = new ModelRenderer(this); + cube_r219.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone27.addChild(cube_r219); + setRotationAngle(cube_r219, -1.5708F, 0.0F, 0.3491F); + cube_r219.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone44 = new ModelRenderer(this); + bone44.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone27.addChild(bone44); + setRotationAngle(bone44, 0.0F, 0.0F, 1.5708F); + cube_r220 = new ModelRenderer(this); + cube_r220.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone44.addChild(cube_r220); + setRotationAngle(cube_r220, -1.5708F, 0.0F, -0.9119F); + cube_r220.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r221 = new ModelRenderer(this); + cube_r221.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone44.addChild(cube_r221); + setRotationAngle(cube_r221, -1.5708F, 0.0F, -0.7854F); + cube_r221.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r222 = new ModelRenderer(this); + cube_r222.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone44.addChild(cube_r222); + setRotationAngle(cube_r222, -1.5708F, 0.0F, -0.3491F); + cube_r222.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone67 = new ModelRenderer(this); + bone67.setRotationPoint(0.0F, 0.0F, 0.0F); + bone44.addChild(bone67); + setRotationAngle(bone67, 0.0F, 0.0F, -1.5708F); + cube_r223 = new ModelRenderer(this); + cube_r223.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone67.addChild(cube_r223); + setRotationAngle(cube_r223, -1.5708F, 0.0F, 0.9119F); + cube_r223.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone68 = new ModelRenderer(this); + bone68.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone27.addChild(bone68); + setRotationAngle(bone68, 0.0F, 0.0F, -3.1416F); + cube_r224 = new ModelRenderer(this); + cube_r224.setRotationPoint(2.0F, -51.1078F, -104.6065F); + bone68.addChild(cube_r224); + setRotationAngle(cube_r224, -1.5708F, 0.0F, 0.3491F); + cube_r224.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone49 = new ModelRenderer(this); + bone49.setRotationPoint(0.0F, 0.0F, 57.5F); + bone20.addChild(bone49); + bone17 = new ModelRenderer(this); + bone17.setRotationPoint(0.0F, -55.0F, -44.25F); + setRotationAngle(bone17, 3.1416F, 0.0F, 0.0F); + bone18 = new ModelRenderer(this); + bone18.setRotationPoint(0.0F, 0.0F, 58.0F); + bone17.addChild(bone18); + bone21 = new ModelRenderer(this); + bone21.setRotationPoint(-3.628F, 15.426F, -34.8688F); + bone18.addChild(bone21); + setRotationAngle(bone21, 0.0F, 0.0F, -3.1416F); + cube_r225 = new ModelRenderer(this); + cube_r225.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone21.addChild(cube_r225); + setRotationAngle(cube_r225, -1.5708F, 0.0F, 0.3491F); + cube_r225.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone25 = new ModelRenderer(this); + bone25.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone21.addChild(bone25); + setRotationAngle(bone25, 0.0F, 0.0F, 1.5708F); + cube_r226 = new ModelRenderer(this); + cube_r226.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone25.addChild(cube_r226); + setRotationAngle(cube_r226, -1.5708F, 0.0F, -0.9119F); + cube_r226.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r227 = new ModelRenderer(this); + cube_r227.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone25.addChild(cube_r227); + setRotationAngle(cube_r227, -1.5708F, 0.0F, -0.7854F); + cube_r227.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r228 = new ModelRenderer(this); + cube_r228.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone25.addChild(cube_r228); + setRotationAngle(cube_r228, -1.5708F, 0.0F, -0.3491F); + cube_r228.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone26 = new ModelRenderer(this); + bone26.setRotationPoint(0.0F, 0.0F, 0.0F); + bone25.addChild(bone26); + setRotationAngle(bone26, 0.0F, 0.0F, -1.5708F); + cube_r229 = new ModelRenderer(this); + cube_r229.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone26.addChild(cube_r229); + setRotationAngle(cube_r229, -1.5708F, 0.0F, 0.9119F); + cube_r229.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone32 = new ModelRenderer(this); + bone32.setRotationPoint(0.0F, 0.0F, 0.0F); + bone25.addChild(bone32); + setRotationAngle(bone32, 0.0F, 0.0F, -1.5708F); + cube_r230 = new ModelRenderer(this); + cube_r230.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone32.addChild(cube_r230); + setRotationAngle(cube_r230, -1.5708F, 0.0F, 0.9119F); + cube_r230.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone40 = new ModelRenderer(this); + bone40.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone21.addChild(bone40); + setRotationAngle(bone40, 0.0F, 0.0F, 1.5708F); + cube_r231 = new ModelRenderer(this); + cube_r231.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone40.addChild(cube_r231); + setRotationAngle(cube_r231, -1.5708F, 0.0F, -0.9119F); + cube_r231.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r232 = new ModelRenderer(this); + cube_r232.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone40.addChild(cube_r232); + setRotationAngle(cube_r232, -1.5708F, 0.0F, -0.7854F); + cube_r232.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r233 = new ModelRenderer(this); + cube_r233.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone40.addChild(cube_r233); + setRotationAngle(cube_r233, -1.5708F, 0.0F, -0.3491F); + cube_r233.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone41 = new ModelRenderer(this); + bone41.setRotationPoint(-3.628F, 15.426F, -34.8688F); + bone18.addChild(bone41); + setRotationAngle(bone41, 0.0F, 0.0F, -3.1416F); + cube_r234 = new ModelRenderer(this); + cube_r234.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone41.addChild(cube_r234); + setRotationAngle(cube_r234, -1.5708F, 0.0F, 0.3491F); + cube_r234.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone42 = new ModelRenderer(this); + bone42.setRotationPoint(-3.628F, 15.426F, 23.1312F); + bone18.addChild(bone42); + setRotationAngle(bone42, 0.0F, 0.0F, -3.1416F); + cube_r235 = new ModelRenderer(this); + cube_r235.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone42.addChild(cube_r235); + setRotationAngle(cube_r235, -1.5708F, 0.0F, 0.3491F); + cube_r235.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone43 = new ModelRenderer(this); + bone43.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone42.addChild(bone43); + setRotationAngle(bone43, 0.0F, 0.0F, 1.5708F); + cube_r236 = new ModelRenderer(this); + cube_r236.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone43.addChild(cube_r236); + setRotationAngle(cube_r236, -1.5708F, 0.0F, -0.9119F); + cube_r236.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r237 = new ModelRenderer(this); + cube_r237.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone43.addChild(cube_r237); + setRotationAngle(cube_r237, -1.5708F, 0.0F, -0.7854F); + cube_r237.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r238 = new ModelRenderer(this); + cube_r238.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone43.addChild(cube_r238); + setRotationAngle(cube_r238, -1.5708F, 0.0F, -0.3491F); + cube_r238.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone45 = new ModelRenderer(this); + bone45.setRotationPoint(0.0F, 0.0F, 0.0F); + bone43.addChild(bone45); + setRotationAngle(bone45, 0.0F, 0.0F, -1.5708F); + cube_r239 = new ModelRenderer(this); + cube_r239.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone45.addChild(cube_r239); + setRotationAngle(cube_r239, -1.5708F, 0.0F, 0.9119F); + cube_r239.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone46 = new ModelRenderer(this); + bone46.setRotationPoint(-3.628F, 15.426F, -92.8688F); + bone18.addChild(bone46); + setRotationAngle(bone46, 0.0F, 0.0F, -3.1416F); + cube_r240 = new ModelRenderer(this); + cube_r240.setRotationPoint(-1.628F, -35.6818F, -69.7377F); + bone46.addChild(cube_r240); + setRotationAngle(cube_r240, -1.5708F, 0.0F, 0.3491F); + cube_r240.setTextureOffset(924, 364).addBox(0.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone47 = new ModelRenderer(this); + bone47.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone46.addChild(bone47); + setRotationAngle(bone47, 0.0F, 0.0F, 1.5708F); + cube_r241 = new ModelRenderer(this); + cube_r241.setRotationPoint(-43.4213F, -19.5186F, -104.6065F); + bone47.addChild(cube_r241); + setRotationAngle(cube_r241, -1.5708F, 0.0F, -0.9119F); + cube_r241.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + cube_r242 = new ModelRenderer(this); + cube_r242.setRotationPoint(-20.7938F, -44.2674F, -104.6065F); + bone47.addChild(cube_r242); + setRotationAngle(cube_r242, -1.5708F, 0.0F, -0.7854F); + cube_r242.setTextureOffset(251, 727).addBox(-33.0F, -2.0F, 0.0F, 33.0F, 4.0F, 3.0F, 0.0F, false); + cube_r243 = new ModelRenderer(this); + cube_r243.setRotationPoint(-2.0F, -51.1078F, -104.6065F); + bone47.addChild(cube_r243); + setRotationAngle(cube_r243, -1.5708F, 0.0F, -0.3491F); + cube_r243.setTextureOffset(924, 372).addBox(-20.0F, -2.0F, 0.0F, 20.0F, 4.0F, 3.0F, 0.0F, false); + bone48 = new ModelRenderer(this); + bone48.setRotationPoint(0.0F, 0.0F, 0.0F); + bone47.addChild(bone48); + setRotationAngle(bone48, 0.0F, 0.0F, -1.5708F); + cube_r244 = new ModelRenderer(this); + cube_r244.setRotationPoint(43.4213F, -19.5186F, -104.6065F); + bone48.addChild(cube_r244); + setRotationAngle(cube_r244, -1.5708F, 0.0F, 0.9119F); + cube_r244.setTextureOffset(230, 931).addBox(-1.5F, -2.0F, -0.5F, 3.0F, 4.0F, 7.0F, 1.0F, false); + bone53 = new ModelRenderer(this); + bone53.setRotationPoint(-3.628F, 15.426F, 34.8688F); + bone46.addChild(bone53); + setRotationAngle(bone53, 0.0F, 0.0F, -3.1416F); + bone54 = new ModelRenderer(this); + bone54.setRotationPoint(0.0F, 0.0F, 58.0F); + bone17.addChild(bone54); + bone3 = new ModelRenderer(this); + bone3.setRotationPoint(0.0F, -55.0F, 49.5F); + setRotationAngle(bone3, 0.0F, 0.0F, -3.1416F); + cube_r245 = new ModelRenderer(this); + cube_r245.setRotationPoint(2.0F, -51.1078F, -85.6065F); + bone3.addChild(cube_r245); + setRotationAngle(cube_r245, -1.5708F, 0.0F, -1.4835F); + cube_r245.setTextureOffset(215, 834).addBox(-3.0F, -20.5F, 0.0F, 3.0F, 4.0F, 52.0F, 0.0F, true); + cube_r245.setTextureOffset(215, 834).addBox(-3.0F, -2.5F, 0.0F, 3.0F, 4.0F, 52.0F, 0.0F, true); + cube_r246 = new ModelRenderer(this); + cube_r246.setRotationPoint(-2.0F, -51.1078F, -85.6065F); + bone3.addChild(cube_r246); + setRotationAngle(cube_r246, -1.5708F, 0.0F, 1.4835F); + cube_r246.setTextureOffset(215, 834).addBox(0.0F, -20.5F, 0.0F, 3.0F, 4.0F, 52.0F, 0.0F, false); + cube_r246.setTextureOffset(215, 834).addBox(0.0F, -2.5F, 0.0F, 3.0F, 4.0F, 52.0F, 0.0F, false); + cube_r247 = new ModelRenderer(this); + cube_r247.setRotationPoint(0.0F, -4.0F, -190.5F); + bone3.addChild(cube_r247); + setRotationAngle(cube_r247, -0.8727F, 0.0F, 0.0F); + cube_r247.setTextureOffset(215, 773).addBox(-2.0F, -53.0F, 0.0F, 4.0F, 53.0F, 3.0F, 0.0F, false); + cube_r248 = new ModelRenderer(this); + cube_r248.setRotationPoint(0.0F, -38.0677F, -149.8996F); + bone3.addChild(cube_r248); + setRotationAngle(cube_r248, -1.1781F, 0.0F, 0.0F); + cube_r248.setTextureOffset(604, 912).addBox(-2.0F, -25.0F, 0.0F, 4.0F, 25.0F, 3.0F, 0.0F, false); + cube_r249 = new ModelRenderer(this); + cube_r249.setRotationPoint(0.0F, -47.6348F, -126.8027F); + bone3.addChild(cube_r249); + setRotationAngle(cube_r249, -1.3963F, 0.0F, 0.0F); + cube_r249.setTextureOffset(438, 925).addBox(-2.0F, -20.0F, 0.0F, 4.0F, 20.0F, 3.0F, 0.0F, false); + cube_r250 = new ModelRenderer(this); + cube_r250.setRotationPoint(0.0F, -51.1078F, -107.1065F); + bone3.addChild(cube_r250); + setRotationAngle(cube_r250, -1.5708F, 0.0F, 0.0F); + cube_r250.setTextureOffset(821, 522).addBox(-3.0F, -78.0F, -32.0F, 6.0F, 6.0F, 55.0F, 0.0F, false); + cube_r250.setTextureOffset(423, 834).addBox(-2.0F, -123.0F, 0.0F, 4.0F, 123.0F, 3.0F, 0.0F, false); + cube_r251 = new ModelRenderer(this); + cube_r251.setRotationPoint(0.0F, -51.1078F, 15.8935F); + bone3.addChild(cube_r251); + setRotationAngle(cube_r251, -1.7017F, 0.0F, 0.0F); + cube_r251.setTextureOffset(230, 773).addBox(-2.0F, -50.0F, 0.0F, 4.0F, 50.0F, 3.0F, 0.0F, false); + cube_r252 = new ModelRenderer(this); + cube_r252.setRotationPoint(0.0F, -44.5815F, 65.4657F); + bone3.addChild(cube_r252); + setRotationAngle(cube_r252, -1.8326F, 0.0F, 0.0F); + cube_r252.setTextureOffset(391, 883).addBox(-2.0F, -68.0F, 0.0F, 4.0F, 68.0F, 3.0F, 0.0F, false); + cube_r253 = new ModelRenderer(this); + cube_r253.setRotationPoint(0.0F, -26.9818F, 131.1487F); + bone3.addChild(cube_r253); + setRotationAngle(cube_r253, -2.0508F, 0.0F, 0.0F); + cube_r253.setTextureOffset(621, 737).addBox(-2.0F, -54.0F, 0.0F, 4.0F, 54.0F, 3.0F, 0.0F, false); + bone12 = new ModelRenderer(this); + bone12.setRotationPoint(0.0F, -55.0F, 49.5F); + setRotationAngle(bone12, 0.0F, 0.0F, 1.5708F); + cube_r254 = new ModelRenderer(this); + cube_r254.setRotationPoint(0.0F, -4.0F, -190.5F); + bone12.addChild(cube_r254); + setRotationAngle(cube_r254, -0.8727F, 0.0F, 0.0F); + cube_r254.setTextureOffset(215, 773).addBox(-2.0F, -53.0F, 0.0F, 4.0F, 53.0F, 3.0F, 0.0F, false); + cube_r255 = new ModelRenderer(this); + cube_r255.setRotationPoint(0.0F, -38.0677F, -149.8996F); + bone12.addChild(cube_r255); + setRotationAngle(cube_r255, -1.1781F, 0.0F, 0.0F); + cube_r255.setTextureOffset(604, 912).addBox(-2.0F, -25.0F, 0.0F, 4.0F, 25.0F, 3.0F, 0.0F, false); + cube_r256 = new ModelRenderer(this); + cube_r256.setRotationPoint(0.0F, -47.6348F, -126.8027F); + bone12.addChild(cube_r256); + setRotationAngle(cube_r256, -1.3963F, 0.0F, 0.0F); + cube_r256.setTextureOffset(438, 925).addBox(-2.0F, -20.0F, 0.0F, 4.0F, 20.0F, 3.0F, 0.0F, false); + cube_r257 = new ModelRenderer(this); + cube_r257.setRotationPoint(0.0F, -51.1078F, -107.1065F); + bone12.addChild(cube_r257); + setRotationAngle(cube_r257, -1.5708F, 0.0F, 0.0F); + cube_r257.setTextureOffset(423, 834).addBox(-2.0F, -123.0F, 0.0F, 4.0F, 123.0F, 3.0F, 0.0F, false); + cube_r258 = new ModelRenderer(this); + cube_r258.setRotationPoint(0.0F, -51.1078F, 15.8935F); + bone12.addChild(cube_r258); + setRotationAngle(cube_r258, -1.7017F, 0.0F, 0.0F); + cube_r258.setTextureOffset(230, 773).addBox(-2.0F, -50.0F, 0.0F, 4.0F, 50.0F, 3.0F, 0.0F, false); + cube_r259 = new ModelRenderer(this); + cube_r259.setRotationPoint(0.0F, -44.5815F, 65.4657F); + bone12.addChild(cube_r259); + setRotationAngle(cube_r259, -1.8326F, 0.0F, 0.0F); + cube_r259.setTextureOffset(391, 883).addBox(-2.0F, -68.0F, 0.0F, 4.0F, 68.0F, 3.0F, 0.0F, false); + cube_r260 = new ModelRenderer(this); + cube_r260.setRotationPoint(0.0F, -26.9818F, 131.1487F); + bone12.addChild(cube_r260); + setRotationAngle(cube_r260, -2.0508F, 0.0F, 0.0F); + cube_r260.setTextureOffset(621, 737).addBox(-2.0F, -54.0F, 0.0F, 4.0F, 54.0F, 3.0F, 0.0F, false); + bone13 = new ModelRenderer(this); + bone13.setRotationPoint(0.0F, -55.0F, 49.5F); + cube_r261 = new ModelRenderer(this); + cube_r261.setRotationPoint(0.0F, -4.0F, -190.5F); + bone13.addChild(cube_r261); + setRotationAngle(cube_r261, -0.8727F, 0.0F, 0.0F); + cube_r261.setTextureOffset(215, 773).addBox(-2.0F, -53.0F, 0.0F, 4.0F, 53.0F, 3.0F, 0.0F, false); + cube_r262 = new ModelRenderer(this); + cube_r262.setRotationPoint(0.0F, -38.0677F, -149.8996F); + bone13.addChild(cube_r262); + setRotationAngle(cube_r262, -1.1781F, 0.0F, 0.0F); + cube_r262.setTextureOffset(604, 912).addBox(-2.0F, -25.0F, 0.0F, 4.0F, 25.0F, 3.0F, 0.0F, false); + cube_r263 = new ModelRenderer(this); + cube_r263.setRotationPoint(0.0F, -47.6348F, -126.8027F); + bone13.addChild(cube_r263); + setRotationAngle(cube_r263, -1.3963F, 0.0F, 0.0F); + cube_r263.setTextureOffset(438, 925).addBox(-2.0F, -20.0F, 0.0F, 4.0F, 20.0F, 3.0F, 0.0F, false); + cube_r264 = new ModelRenderer(this); + cube_r264.setRotationPoint(0.0F, -51.1078F, -107.1065F); + bone13.addChild(cube_r264); + setRotationAngle(cube_r264, -1.5708F, 0.0F, 0.0F); + cube_r264.setTextureOffset(423, 834).addBox(-2.0F, -123.0F, 0.0F, 4.0F, 123.0F, 3.0F, 0.0F, false); + cube_r265 = new ModelRenderer(this); + cube_r265.setRotationPoint(0.0F, -51.1078F, 15.8935F); + bone13.addChild(cube_r265); + setRotationAngle(cube_r265, -1.7017F, 0.0F, 0.0F); + cube_r265.setTextureOffset(230, 773).addBox(-2.0F, -50.0F, 0.0F, 4.0F, 50.0F, 3.0F, 0.0F, false); + cube_r266 = new ModelRenderer(this); + cube_r266.setRotationPoint(0.0F, -44.5815F, 65.4657F); + bone13.addChild(cube_r266); + setRotationAngle(cube_r266, -1.8326F, 0.0F, 0.0F); + cube_r266.setTextureOffset(391, 883).addBox(-2.0F, -68.0F, 0.0F, 4.0F, 68.0F, 3.0F, 0.0F, false); + cube_r267 = new ModelRenderer(this); + cube_r267.setRotationPoint(0.0F, -26.9818F, 131.1487F); + bone13.addChild(cube_r267); + setRotationAngle(cube_r267, -2.0508F, 0.0F, 0.0F); + cube_r267.setTextureOffset(621, 737).addBox(-2.0F, -54.0F, 0.0F, 4.0F, 54.0F, 3.0F, 0.0F, false); + bone19 = new ModelRenderer(this); + bone19.setRotationPoint(0.0F, -55.0F, 49.5F); + setRotationAngle(bone19, 0.0F, 0.0F, -1.5708F); + cube_r268 = new ModelRenderer(this); + cube_r268.setRotationPoint(0.0F, -4.0F, -190.5F); + bone19.addChild(cube_r268); + setRotationAngle(cube_r268, -0.8727F, 0.0F, 0.0F); + cube_r268.setTextureOffset(215, 773).addBox(-2.0F, -53.0F, 0.0F, 4.0F, 53.0F, 3.0F, 0.0F, false); + cube_r269 = new ModelRenderer(this); + cube_r269.setRotationPoint(0.0F, -38.0677F, -149.8996F); + bone19.addChild(cube_r269); + setRotationAngle(cube_r269, -1.1781F, 0.0F, 0.0F); + cube_r269.setTextureOffset(604, 912).addBox(-2.0F, -25.0F, 0.0F, 4.0F, 25.0F, 3.0F, 0.0F, false); + cube_r270 = new ModelRenderer(this); + cube_r270.setRotationPoint(0.0F, -47.6348F, -126.8027F); + bone19.addChild(cube_r270); + setRotationAngle(cube_r270, -1.3963F, 0.0F, 0.0F); + cube_r270.setTextureOffset(438, 925).addBox(-2.0F, -20.0F, 0.0F, 4.0F, 20.0F, 3.0F, 0.0F, false); + cube_r271 = new ModelRenderer(this); + cube_r271.setRotationPoint(0.0F, -51.1078F, -107.1065F); + bone19.addChild(cube_r271); + setRotationAngle(cube_r271, -1.5708F, 0.0F, 0.0F); + cube_r271.setTextureOffset(423, 834).addBox(-2.0F, -123.0F, 0.0F, 4.0F, 123.0F, 3.0F, 0.0F, false); + cube_r272 = new ModelRenderer(this); + cube_r272.setRotationPoint(0.0F, -51.1078F, 15.8935F); + bone19.addChild(cube_r272); + setRotationAngle(cube_r272, -1.7017F, 0.0F, 0.0F); + cube_r272.setTextureOffset(230, 773).addBox(-2.0F, -50.0F, 0.0F, 4.0F, 50.0F, 3.0F, 0.0F, false); + cube_r273 = new ModelRenderer(this); + cube_r273.setRotationPoint(0.0F, -44.5815F, 65.4657F); + bone19.addChild(cube_r273); + setRotationAngle(cube_r273, -1.8326F, 0.0F, 0.0F); + cube_r273.setTextureOffset(391, 883).addBox(-2.0F, -68.0F, 0.0F, 4.0F, 68.0F, 3.0F, 0.0F, false); + cube_r274 = new ModelRenderer(this); + cube_r274.setRotationPoint(0.0F, -26.9818F, 131.1487F); + bone19.addChild(cube_r274); + setRotationAngle(cube_r274, -2.0508F, 0.0F, 0.0F); + cube_r274.setTextureOffset(621, 737).addBox(-2.0F, -54.0F, 0.0F, 4.0F, 54.0F, 3.0F, 0.0F, false); + bone4 = new ModelRenderer(this); + bone4.setRotationPoint(0.0F, -55.0F, 49.5F); + setRotationAngle(bone4, 0.0F, 0.0F, 1.5708F); + cube_r275 = new ModelRenderer(this); + cube_r275.setRotationPoint(-2.0F, 51.1078F, -85.1065F); + bone4.addChild(cube_r275); + setRotationAngle(cube_r275, 1.5708F, 0.0F, -1.3963F); + cube_r275.setTextureOffset(215, 891).addBox(0.0F, 16.0F, -35.0F, 3.0F, 4.0F, 35.0F, 0.0F, false); + cube_r275.setTextureOffset(215, 891).addBox(0.0F, -2.0F, -35.0F, 3.0F, 4.0F, 35.0F, 0.0F, false); + cube_r276 = new ModelRenderer(this); + cube_r276.setRotationPoint(-2.0F, -51.1078F, -85.1065F); + bone4.addChild(cube_r276); + setRotationAngle(cube_r276, -1.5708F, 0.0F, 1.3963F); + cube_r276.setTextureOffset(215, 891).addBox(0.0F, -20.0F, -35.0F, 3.0F, 4.0F, 35.0F, 0.0F, false); + cube_r276.setTextureOffset(215, 891).addBox(0.0F, -2.0F, -35.0F, 3.0F, 4.0F, 35.0F, 0.0F, false); + Engine = new ModelRenderer(this); + Engine.setRotationPoint(51.0F, -17.0F, -41.5F); + cube_r277 = new ModelRenderer(this); + cube_r277.setRotationPoint(0.0F, 0.0F, 14.5F); + Engine.addChild(cube_r277); + setRotationAngle(cube_r277, 0.0F, 0.0F, 0.4363F); + cube_r277.setTextureOffset(53, 902).addBox(-9.0F, -9.0F, -18.0F, 18.0F, 18.0F, 6.0F, 0.0F, false); + cube_r277.setTextureOffset(758, 845).addBox(-8.0F, -8.0F, -16.0F, 16.0F, 16.0F, 32.0F, 0.5F, false); + cube_r277.setTextureOffset(326, 834).addBox(-8.0F, -8.0F, -16.0F, 16.0F, 16.0F, 32.0F, 0.0F, false); + Propeller = new ModelRenderer(this); + Propeller.setRotationPoint(0.0F, 0.0F, -3.75F); + Engine.addChild(Propeller); + cube_r278 = new ModelRenderer(this); + cube_r278.setRotationPoint(0.0F, 0.0F, 1.75F); + Propeller.addChild(cube_r278); + setRotationAngle(cube_r278, 0.0F, 0.0F, 0.4363F); + cube_r278.setTextureOffset(924, 623).addBox(-2.0F, -2.0F, -6.5F, 4.0F, 4.0F, 13.0F, 0.0F, false); + cube_r278.setTextureOffset(870, 891).addBox(-18.0F, -18.0F, -3.5F, 36.0F, 36.0F, 0.0F, 0.0F, false); + Engine2 = new ModelRenderer(this); + Engine2.setRotationPoint(-51.0F, -17.0F, -41.5F); + cube_r279 = new ModelRenderer(this); + cube_r279.setRotationPoint(0.0F, 0.0F, 14.5F); + Engine2.addChild(cube_r279); + setRotationAngle(cube_r279, 0.0F, 0.0F, -0.4363F); + cube_r279.setTextureOffset(53, 902).addBox(-9.0F, -9.0F, -18.0F, 18.0F, 18.0F, 6.0F, 0.0F, true); + cube_r279.setTextureOffset(758, 845).addBox(-8.0F, -8.0F, -16.0F, 16.0F, 16.0F, 32.0F, 0.5F, true); + cube_r279.setTextureOffset(326, 834).addBox(-8.0F, -8.0F, -16.0F, 16.0F, 16.0F, 32.0F, 0.0F, true); + Propeller2 = new ModelRenderer(this); + Propeller2.setRotationPoint(0.0F, 0.0F, -3.75F); + Engine2.addChild(Propeller2); + cube_r280 = new ModelRenderer(this); + cube_r280.setRotationPoint(0.0F, 0.0F, 3.75F); + Propeller2.addChild(cube_r280); + setRotationAngle(cube_r280, 0.0F, 0.0F, -0.4363F); + cube_r280.setTextureOffset(870, 891).addBox(-18.0F, -18.0F, -5.5F, 36.0F, 36.0F, 0.0F, 0.0F, true); + cube_r280.setTextureOffset(924, 623).addBox(-2.0F, -2.0F, -8.5F, 4.0F, 4.0F, 13.0F, 0.0F, true); + SteeringWheel = new ModelRenderer(this); + SteeringWheel.setRotationPoint(0.0F, 19.0F, -17.5F); + SteeringWheel.setTextureOffset(924, 675).addBox(-7.0F, -7.0F, 0.0F, 14.0F, 14.0F, 0.0F, 0.0F, false); + bb_main = new ModelRenderer(this); + bb_main.setRotationPoint(0.0F, 24.0F, 0.0F); + bb_main.setTextureOffset(903, 584).addBox(-5.0F, -84.0F, -123.0F, 10.0F, 10.0F, 9.0F, 0.0F, false); + bb_main.setTextureOffset(462, 925).addBox(-4.0F, -83.0F, -141.0F, 8.0F, 8.0F, 4.0F, 0.0F, false); + bb_main.setTextureOffset(487, 925).addBox(-4.0F, -83.0F, 225.0F, 8.0F, 8.0F, 4.0F, 0.0F, false); + bb_main.setTextureOffset(821, 460).addBox(-1.0F, -140.0F, 4.0F, 2.0F, 2.0F, 59.0F, 0.0F, false); + bb_main.setTextureOffset(745, 894).addBox(-1.0F, -158.0F, 4.0F, 2.0F, 2.0F, 31.0F, 0.0F, false); + bb_main.setTextureOffset(791, 0).addBox(-38.0F, -117.0F, -99.0F, 76.0F, 76.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(870, 845).addBox(-23.0F, -102.0F, 190.0F, 46.0F, 45.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(251, 737).addBox(-48.0F, -127.0F, 102.0F, 96.0F, 96.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(335, 607).addBox(-12.0F, 4.0F, -65.0F, 24.0F, 0.0F, 129.0F, 0.0F, false); + bb_main.setTextureOffset(791, 702).addBox(12.0F, 3.0F, -33.0F, 2.0F, 3.0F, 66.0F, 0.0F, false); + bb_main.setTextureOffset(621, 801).addBox(12.0F, -4.0F, -33.0F, 2.0F, 2.0F, 66.0F, 0.0F, false); + bb_main.setTextureOffset(444, 737).addBox(-1.0F, 16.0F, -43.0F, 2.0F, 4.0F, 86.0F, 0.0F, false); + bb_main.setTextureOffset(349, 938).addBox(-1.0F, -6.0F, -20.0F, 2.0F, 11.0F, 2.0F, 0.0F, false); + bb_main.setTextureOffset(791, 388).addBox(-1.0F, -6.0F, -18.0F, 2.0F, 2.0F, 1.0F, 0.0F, false); + bb_main.setTextureOffset(515, 885).addBox(9.0F, -12.0F, -28.5F, 0.0F, 18.0F, 18.0F, 0.0F, false); + bb_main.setTextureOffset(552, 912).addBox(-9.0F, -12.0F, -28.5F, 0.0F, 18.0F, 18.0F, 0.0F, false); + bb_main.setTextureOffset(791, 154).addBox(-38.0F, -41.0F, -55.0F, 76.0F, 76.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(791, 231).addBox(-38.0F, -41.0F, 62.0F, 76.0F, 76.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(791, 702).addBox(-14.0F, 3.0F, -33.0F, 2.0F, 3.0F, 66.0F, 0.0F, true); + bb_main.setTextureOffset(621, 801).addBox(-14.0F, -4.0F, -33.0F, 2.0F, 2.0F, 66.0F, 0.0F, true); + bb_main.setTextureOffset(791, 0).addBox(-38.0F, -117.0F, 140.0F, 76.0F, 76.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(0, 0).addBox(-53.0F, -132.0F, -26.0F, 106.0F, 106.0F, 0.0F, 0.0F, false); + bb_main.setTextureOffset(0, 0).addBox(-53.0F, -132.0F, 32.0F, 106.0F, 106.0F, 0.0F, 0.0F, false); + cube_r281 = new ModelRenderer(this); + cube_r281.setRotationPoint(-7.5355F, -16.4182F, 0.0F); + bb_main.addChild(cube_r281); + setRotationAngle(cube_r281, -3.1416F, 0.0F, -2.6616F); + cube_r281.setTextureOffset(791, 607).addBox(0.0F, -14.0F, -33.0F, 0.0F, 28.0F, 66.0F, 0.0F, true); + cube_r282 = new ModelRenderer(this); + cube_r282.setRotationPoint(-28.3142F, -31.4973F, 0.0F); + bb_main.addChild(cube_r282); + setRotationAngle(cube_r282, -3.1416F, 0.0F, 2.6616F); + cube_r282.setTextureOffset(0, 773).addBox(0.0F, -31.0F, -33.0F, 0.0F, 62.0F, 66.0F, 0.0F, true); + cube_r283 = new ModelRenderer(this); + cube_r283.setRotationPoint(-13.0F, 0.5F, 0.0F); + bb_main.addChild(cube_r283); + setRotationAngle(cube_r283, 0.0F, 0.0F, 3.1416F); + cube_r283.setTextureOffset(821, 388).addBox(0.0F, -2.5F, -33.0F, 0.0F, 5.0F, 66.0F, 0.0F, true); + cube_r284 = new ModelRenderer(this); + cube_r284.setRotationPoint(-12.3559F, 0.5F, -37.8267F); + bb_main.addChild(cube_r284); + setRotationAngle(cube_r284, 0.0F, 0.1309F, 3.1416F); + cube_r284.setTextureOffset(78, 927).addBox(0.0F, -2.5F, -5.0F, 0.0F, 5.0F, 10.0F, 0.0F, true); + cube_r285 = new ModelRenderer(this); + cube_r285.setRotationPoint(-4.6215F, 0.5F, -56.5455F); + bb_main.addChild(cube_r285); + setRotationAngle(cube_r285, 0.0F, 0.5672F, -3.1416F); + cube_r285.setTextureOffset(515, 922).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, true); + cube_r286 = new ModelRenderer(this); + cube_r286.setRotationPoint(-10.558F, 0.5F, -45.8614F); + bb_main.addChild(cube_r286); + setRotationAngle(cube_r286, 0.0F, 0.3491F, 3.1416F); + cube_r286.setTextureOffset(325, 938).addBox(0.0F, -2.5F, -3.5F, 0.0F, 5.0F, 7.0F, 0.0F, true); + cube_r287 = new ModelRenderer(this); + cube_r287.setRotationPoint(-12.3559F, 0.5F, 37.8267F); + bb_main.addChild(cube_r287); + setRotationAngle(cube_r287, 0.0F, -0.1309F, 3.1416F); + cube_r287.setTextureOffset(78, 927).addBox(0.0F, -2.5F, -5.0F, 0.0F, 5.0F, 10.0F, 0.0F, true); + cube_r288 = new ModelRenderer(this); + cube_r288.setRotationPoint(-10.558F, 0.5F, 45.8614F); + bb_main.addChild(cube_r288); + setRotationAngle(cube_r288, 0.0F, -0.3491F, 3.1416F); + cube_r288.setTextureOffset(325, 943).addBox(0.0F, -2.5F, -3.5F, 0.0F, 5.0F, 7.0F, 0.0F, true); + cube_r289 = new ModelRenderer(this); + cube_r289.setRotationPoint(-4.6215F, 0.5F, 56.5455F); + bb_main.addChild(cube_r289); + setRotationAngle(cube_r289, 0.0F, -0.5672F, 3.1416F); + cube_r289.setTextureOffset(515, 927).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, true); + cube_r290 = new ModelRenderer(this); + cube_r290.setRotationPoint(-10.3006F, -2.5F, 49.4923F); + bb_main.addChild(cube_r290); + setRotationAngle(cube_r290, 0.0F, 0.5672F, 0.0F); + cube_r290.setTextureOffset(862, 584).addBox(0.0F, -1.5F, 0.0F, 2.0F, 2.0F, 18.0F, 0.0F, true); + cube_r290.setTextureOffset(821, 584).addBox(0.0F, 5.5F, 0.0F, 2.0F, 3.0F, 18.0F, 0.0F, true); + cube_r291 = new ModelRenderer(this); + cube_r291.setRotationPoint(-12.6947F, -2.5F, 42.9145F); + bb_main.addChild(cube_r291); + setRotationAngle(cube_r291, 0.0F, 0.3491F, 0.0F); + cube_r291.setTextureOffset(172, 932).addBox(0.0F, -1.5F, 0.0F, 2.0F, 2.0F, 7.0F, 0.0F, true); + cube_r291.setTextureOffset(272, 931).addBox(0.0F, 5.5F, 0.0F, 2.0F, 3.0F, 7.0F, 0.0F, true); + cube_r292 = new ModelRenderer(this); + cube_r292.setRotationPoint(-14.0F, -2.5F, 33.0F); + bb_main.addChild(cube_r292); + setRotationAngle(cube_r292, 0.0F, 0.1309F, 0.0F); + cube_r292.setTextureOffset(53, 927).addBox(0.0F, -1.5F, 0.0F, 2.0F, 2.0F, 10.0F, 0.0F, true); + cube_r292.setTextureOffset(924, 829).addBox(0.0F, 5.5F, 0.0F, 2.0F, 3.0F, 10.0F, 0.0F, true); + cube_r293 = new ModelRenderer(this); + cube_r293.setRotationPoint(-14.0F, -2.5F, -33.0F); + bb_main.addChild(cube_r293); + setRotationAngle(cube_r293, 0.0F, -0.1309F, 0.0F); + cube_r293.setTextureOffset(53, 927).addBox(0.0F, -1.5F, -10.0F, 2.0F, 2.0F, 10.0F, 0.0F, true); + cube_r293.setTextureOffset(924, 829).addBox(0.0F, 5.5F, -10.0F, 2.0F, 3.0F, 10.0F, 0.0F, true); + cube_r294 = new ModelRenderer(this); + cube_r294.setRotationPoint(-12.6947F, -2.5F, -42.9145F); + bb_main.addChild(cube_r294); + setRotationAngle(cube_r294, 0.0F, -0.3491F, 0.0F); + cube_r294.setTextureOffset(172, 932).addBox(0.0F, -1.5F, -7.0F, 2.0F, 2.0F, 7.0F, 0.0F, true); + cube_r294.setTextureOffset(272, 931).addBox(0.0F, 5.5F, -7.0F, 2.0F, 3.0F, 7.0F, 0.0F, true); + cube_r295 = new ModelRenderer(this); + cube_r295.setRotationPoint(-10.3006F, -2.5F, -49.4923F); + bb_main.addChild(cube_r295); + setRotationAngle(cube_r295, 0.0F, -0.5672F, 0.0F); + cube_r295.setTextureOffset(862, 584).addBox(0.0F, -1.5F, -18.0F, 2.0F, 2.0F, 18.0F, 0.0F, true); + cube_r295.setTextureOffset(821, 584).addBox(0.0F, 5.5F, -18.0F, 2.0F, 3.0F, 18.0F, 0.0F, true); + cube_r296 = new ModelRenderer(this); + cube_r296.setRotationPoint(-4.2544F, 6.642F, 56.3345F); + bb_main.addChild(cube_r296); + setRotationAngle(cube_r296, 0.0892F, -0.4798F, 2.701F); + cube_r296.setTextureOffset(924, 303).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, true); + cube_r297 = new ModelRenderer(this); + cube_r297.setRotationPoint(0.0F, 12.0912F, 0.0F); + bb_main.addChild(cube_r297); + setRotationAngle(cube_r297, -2.8379F, -0.4002F, 2.246F); + cube_r297.setTextureOffset(758, 801).addBox(21.4806F, -19.9108F, -54.4612F, 0.0F, 9.0F, 15.0F, 0.0F, true); + cube_r298 = new ModelRenderer(this); + cube_r298.setRotationPoint(-3.9541F, 14.2522F, 44.4667F); + bb_main.addChild(cube_r298); + setRotationAngle(cube_r298, 0.1326F, -0.3053F, 2.261F); + cube_r298.setTextureOffset(198, 928).addBox(0.0F, -6.0F, -3.5F, 0.0F, 12.0F, 7.0F, 0.0F, true); + cube_r299 = new ModelRenderer(this); + cube_r299.setRotationPoint(-9.5826F, 7.7165F, 45.2119F); + bb_main.addChild(cube_r299); + setRotationAngle(cube_r299, 0.0F, -0.3491F, 2.7053F); + cube_r299.setTextureOffset(796, 934).addBox(0.0F, -3.0F, -3.5F, 0.0F, 6.0F, 7.0F, 0.0F, true); + cube_r300 = new ModelRenderer(this); + cube_r300.setRotationPoint(-4.986F, 15.317F, 37.1762F); + bb_main.addChild(cube_r300); + setRotationAngle(cube_r300, 0.0436F, -0.1309F, 2.2689F); + cube_r300.setTextureOffset(924, 806).addBox(0.0F, -6.5F, -4.5F, 0.0F, 13.0F, 9.0F, 0.0F, true); + cube_r301 = new ModelRenderer(this); + cube_r301.setRotationPoint(-11.1998F, 8.4707F, 37.4615F); + bb_main.addChild(cube_r301); + setRotationAngle(cube_r301, 0.0F, -0.1309F, 2.7053F); + cube_r301.setTextureOffset(928, 741).addBox(0.0F, -3.0F, -4.5F, 0.0F, 6.0F, 9.0F, 0.0F, true); + cube_r302 = new ModelRenderer(this); + cube_r302.setRotationPoint(-11.7322F, 8.7189F, 0.0F); + bb_main.addChild(cube_r302); + setRotationAngle(cube_r302, 0.0F, -3.1416F, -0.4363F); + cube_r302.setTextureOffset(791, 772).addBox(0.0F, -3.0F, -33.0F, 0.0F, 6.0F, 66.0F, 0.0F, true); + cube_r303 = new ModelRenderer(this); + cube_r303.setRotationPoint(-5.485F, 15.616F, 0.0F); + bb_main.addChild(cube_r303); + setRotationAngle(cube_r303, 0.0F, -3.1416F, -0.8727F); + cube_r303.setTextureOffset(791, 308).addBox(0.0F, -6.5F, -33.0F, 0.0F, 13.0F, 66.0F, 0.0F, true); + cube_r304 = new ModelRenderer(this); + cube_r304.setRotationPoint(-11.1998F, 8.4707F, -37.4615F); + bb_main.addChild(cube_r304); + setRotationAngle(cube_r304, 0.0F, 0.1309F, 2.7053F); + cube_r304.setTextureOffset(928, 741).addBox(0.0F, -3.0F, -4.5F, 0.0F, 6.0F, 9.0F, 0.0F, true); + cube_r305 = new ModelRenderer(this); + cube_r305.setRotationPoint(-4.986F, 15.317F, -37.1762F); + bb_main.addChild(cube_r305); + setRotationAngle(cube_r305, -0.0436F, 0.1309F, 2.2689F); + cube_r305.setTextureOffset(924, 806).addBox(0.0F, -6.5F, -4.5F, 0.0F, 13.0F, 9.0F, 0.0F, true); + cube_r306 = new ModelRenderer(this); + cube_r306.setRotationPoint(-0.8502F, 12.0912F, -53.8845F); + bb_main.addChild(cube_r306); + setRotationAngle(cube_r306, 2.8379F, 0.4002F, 2.246F); + cube_r306.setTextureOffset(758, 792).addBox(0.0F, -4.5F, -7.5F, 0.0F, 9.0F, 15.0F, 0.0F, true); + cube_r307 = new ModelRenderer(this); + cube_r307.setRotationPoint(-3.9541F, 14.2522F, -44.4667F); + bb_main.addChild(cube_r307); + setRotationAngle(cube_r307, -0.1326F, 0.3053F, 2.261F); + cube_r307.setTextureOffset(198, 928).addBox(0.0F, -6.0F, -3.5F, 0.0F, 12.0F, 7.0F, 0.0F, true); + cube_r308 = new ModelRenderer(this); + cube_r308.setRotationPoint(-9.5826F, 7.7165F, -45.2119F); + bb_main.addChild(cube_r308); + setRotationAngle(cube_r308, 0.0F, 0.3491F, 2.7053F); + cube_r308.setTextureOffset(796, 928).addBox(0.0F, -3.0F, -3.5F, 0.0F, 6.0F, 7.0F, 0.0F, true); + cube_r309 = new ModelRenderer(this); + cube_r309.setRotationPoint(-4.2544F, 6.642F, -56.3345F); + bb_main.addChild(cube_r309); + setRotationAngle(cube_r309, -0.0892F, 0.4798F, 2.701F); + cube_r309.setTextureOffset(924, 308).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, true); + cube_r310 = new ModelRenderer(this); + cube_r310.setRotationPoint(4.2544F, 6.642F, 56.3345F); + bb_main.addChild(cube_r310); + setRotationAngle(cube_r310, 0.0892F, 0.4798F, -2.701F); + cube_r310.setTextureOffset(924, 303).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, false); + cube_r311 = new ModelRenderer(this); + cube_r311.setRotationPoint(4.6215F, 0.5F, 56.5455F); + bb_main.addChild(cube_r311); + setRotationAngle(cube_r311, 0.0F, 0.5672F, -3.1416F); + cube_r311.setTextureOffset(515, 927).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, false); + cube_r312 = new ModelRenderer(this); + cube_r312.setRotationPoint(11.7322F, 8.7189F, 0.0F); + bb_main.addChild(cube_r312); + setRotationAngle(cube_r312, 0.0F, 3.1416F, 0.4363F); + cube_r312.setTextureOffset(791, 772).addBox(0.0F, -3.0F, -33.0F, 0.0F, 6.0F, 66.0F, 0.0F, false); + cube_r313 = new ModelRenderer(this); + cube_r313.setRotationPoint(5.485F, 15.616F, 0.0F); + bb_main.addChild(cube_r313); + setRotationAngle(cube_r313, 0.0F, 3.1416F, 0.8727F); + cube_r313.setTextureOffset(791, 308).addBox(0.0F, -6.5F, -33.0F, 0.0F, 13.0F, 66.0F, 0.0F, false); + cube_r314 = new ModelRenderer(this); + cube_r314.setRotationPoint(14.0F, 4.5F, 33.0F); + bb_main.addChild(cube_r314); + setRotationAngle(cube_r314, 0.0F, -0.1309F, 0.0F); + cube_r314.setTextureOffset(924, 829).addBox(-2.0F, -1.5F, 0.0F, 2.0F, 3.0F, 10.0F, 0.0F, false); + cube_r314.setTextureOffset(53, 927).addBox(-2.0F, -8.5F, 0.0F, 2.0F, 2.0F, 10.0F, 0.0F, false); + cube_r315 = new ModelRenderer(this); + cube_r315.setRotationPoint(12.6947F, 4.5F, 42.9145F); + bb_main.addChild(cube_r315); + setRotationAngle(cube_r315, 0.0F, -0.3491F, 0.0F); + cube_r315.setTextureOffset(272, 931).addBox(-2.0F, -1.5F, 0.0F, 2.0F, 3.0F, 7.0F, 0.0F, false); + cube_r315.setTextureOffset(172, 932).addBox(-2.0F, -8.5F, 0.0F, 2.0F, 2.0F, 7.0F, 0.0F, false); + cube_r316 = new ModelRenderer(this); + cube_r316.setRotationPoint(10.3006F, 4.5F, 49.4923F); + bb_main.addChild(cube_r316); + setRotationAngle(cube_r316, 0.0F, -0.5672F, 0.0F); + cube_r316.setTextureOffset(821, 584).addBox(-2.0F, -1.5F, 0.0F, 2.0F, 3.0F, 18.0F, 0.0F, false); + cube_r316.setTextureOffset(862, 584).addBox(-2.0F, -8.5F, 0.0F, 2.0F, 2.0F, 18.0F, 0.0F, false); + cube_r317 = new ModelRenderer(this); + cube_r317.setRotationPoint(0.0F, 20.0F, 43.0F); + bb_main.addChild(cube_r317); + setRotationAngle(cube_r317, 0.3054F, 0.0F, 0.0F); + cube_r317.setTextureOffset(928, 757).addBox(-1.0F, -4.0F, 0.0F, 2.0F, 4.0F, 8.0F, 0.0F, false); + cube_r318 = new ModelRenderer(this); + cube_r318.setRotationPoint(0.0F, 17.5943F, 50.6297F); + bb_main.addChild(cube_r318); + setRotationAngle(cube_r318, 0.5236F, 0.0F, 0.0F); + cube_r318.setTextureOffset(757, 846).addBox(-1.0F, -4.0F, 0.0F, 2.0F, 4.0F, 14.0F, 0.0F, false); + cube_r319 = new ModelRenderer(this); + cube_r319.setRotationPoint(0.0F, 10.5944F, 62.7541F); + bb_main.addChild(cube_r319); + setRotationAngle(cube_r319, 1.1345F, 0.0F, 0.0F); + cube_r319.setTextureOffset(153, 932).addBox(-1.0F, -3.0F, 0.0F, 2.0F, 3.0F, 7.0F, 0.0F, false); + cube_r320 = new ModelRenderer(this); + cube_r320.setRotationPoint(0.0F, 4.2502F, 65.7124F); + bb_main.addChild(cube_r320); + setRotationAngle(cube_r320, 1.5708F, 0.0F, 0.0F); + cube_r320.setTextureOffset(928, 729).addBox(-1.0F, -2.0F, 0.0F, 2.0F, 2.0F, 9.0F, 0.0F, false); + cube_r321 = new ModelRenderer(this); + cube_r321.setRotationPoint(11.1998F, 8.4707F, 37.4615F); + bb_main.addChild(cube_r321); + setRotationAngle(cube_r321, 0.0F, 0.1309F, -2.7053F); + cube_r321.setTextureOffset(928, 741).addBox(0.0F, -3.0F, -4.5F, 0.0F, 6.0F, 9.0F, 0.0F, false); + cube_r322 = new ModelRenderer(this); + cube_r322.setRotationPoint(9.5826F, 7.7165F, 45.2119F); + bb_main.addChild(cube_r322); + setRotationAngle(cube_r322, 0.0F, 0.3491F, -2.7053F); + cube_r322.setTextureOffset(796, 934).addBox(0.0F, -3.0F, -3.5F, 0.0F, 6.0F, 7.0F, 0.0F, false); + cube_r323 = new ModelRenderer(this); + cube_r323.setRotationPoint(4.986F, 15.317F, 37.1762F); + bb_main.addChild(cube_r323); + setRotationAngle(cube_r323, 0.0436F, 0.1309F, -2.2689F); + cube_r323.setTextureOffset(924, 806).addBox(0.0F, -6.5F, -4.5F, 0.0F, 13.0F, 9.0F, 0.0F, false); + cube_r324 = new ModelRenderer(this); + cube_r324.setRotationPoint(3.9541F, 14.2522F, 44.4667F); + bb_main.addChild(cube_r324); + setRotationAngle(cube_r324, 0.1326F, 0.3053F, -2.261F); + cube_r324.setTextureOffset(198, 928).addBox(0.0F, -6.0F, -3.5F, 0.0F, 12.0F, 7.0F, 0.0F, false); + cube_r325 = new ModelRenderer(this); + cube_r325.setRotationPoint(0.0F, 12.0912F, 0.0F); + bb_main.addChild(cube_r325); + setRotationAngle(cube_r325, -2.8379F, 0.4002F, -2.246F); + cube_r325.setTextureOffset(758, 801).addBox(-21.4806F, -19.9108F, -54.4612F, 0.0F, 9.0F, 15.0F, 0.0F, false); + cube_r326 = new ModelRenderer(this); + cube_r326.setRotationPoint(12.3559F, 0.5F, 37.8267F); + bb_main.addChild(cube_r326); + setRotationAngle(cube_r326, 0.0F, 0.1309F, -3.1416F); + cube_r326.setTextureOffset(78, 927).addBox(0.0F, -2.5F, -5.0F, 0.0F, 5.0F, 10.0F, 0.0F, false); + cube_r327 = new ModelRenderer(this); + cube_r327.setRotationPoint(10.558F, 0.5F, 45.8614F); + bb_main.addChild(cube_r327); + setRotationAngle(cube_r327, 0.0F, 0.3491F, -3.1416F); + cube_r327.setTextureOffset(325, 943).addBox(0.0F, -2.5F, -3.5F, 0.0F, 5.0F, 7.0F, 0.0F, false); + cube_r328 = new ModelRenderer(this); + cube_r328.setRotationPoint(0.0F, -4.7498F, 65.7124F); + bb_main.addChild(cube_r328); + setRotationAngle(cube_r328, 0.5672F, 0.0F, 0.0F); + cube_r328.setTextureOffset(0, 711).addBox(-32.0F, 0.0F, 0.0F, 64.0F, 0.0F, 61.0F, 0.0F, false); + cube_r329 = new ModelRenderer(this); + cube_r329.setRotationPoint(0.0F, -4.7498F, -65.7124F); + bb_main.addChild(cube_r329); + setRotationAngle(cube_r329, -0.7854F, 0.0F, 0.0F); + cube_r329.setTextureOffset(0, 607).addBox(-32.0F, 0.0F, -103.0F, 64.0F, 0.0F, 103.0F, 0.0F, false); + cube_r330 = new ModelRenderer(this); + cube_r330.setRotationPoint(28.3142F, -31.4973F, 0.0F); + bb_main.addChild(cube_r330); + setRotationAngle(cube_r330, -3.1416F, 0.0F, -2.6616F); + cube_r330.setTextureOffset(0, 773).addBox(0.0F, -31.0F, -33.0F, 0.0F, 62.0F, 66.0F, 0.0F, false); + cube_r331 = new ModelRenderer(this); + cube_r331.setRotationPoint(7.5355F, -16.4182F, 0.0F); + bb_main.addChild(cube_r331); + setRotationAngle(cube_r331, -3.1416F, 0.0F, 2.6616F); + cube_r331.setTextureOffset(791, 607).addBox(0.0F, -14.0F, -33.0F, 0.0F, 28.0F, 66.0F, 0.0F, false); + cube_r332 = new ModelRenderer(this); + cube_r332.setRotationPoint(10.558F, 0.5F, -45.8614F); + bb_main.addChild(cube_r332); + setRotationAngle(cube_r332, 0.0F, -0.3491F, -3.1416F); + cube_r332.setTextureOffset(325, 938).addBox(0.0F, -2.5F, -3.5F, 0.0F, 5.0F, 7.0F, 0.0F, false); + cube_r333 = new ModelRenderer(this); + cube_r333.setRotationPoint(13.0F, 0.5F, 0.0F); + bb_main.addChild(cube_r333); + setRotationAngle(cube_r333, 0.0F, 0.0F, -3.1416F); + cube_r333.setTextureOffset(821, 388).addBox(0.0F, -2.5F, -33.0F, 0.0F, 5.0F, 66.0F, 0.0F, false); + cube_r334 = new ModelRenderer(this); + cube_r334.setRotationPoint(12.3559F, 0.5F, -37.8267F); + bb_main.addChild(cube_r334); + setRotationAngle(cube_r334, 0.0F, -0.1309F, -3.1416F); + cube_r334.setTextureOffset(78, 927).addBox(0.0F, -2.5F, -5.0F, 0.0F, 5.0F, 10.0F, 0.0F, false); + cube_r335 = new ModelRenderer(this); + cube_r335.setRotationPoint(4.6215F, 0.5F, -56.5455F); + bb_main.addChild(cube_r335); + setRotationAngle(cube_r335, 0.0F, -0.5672F, 3.1416F); + cube_r335.setTextureOffset(515, 922).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, false); + cube_r336 = new ModelRenderer(this); + cube_r336.setRotationPoint(0.8502F, 12.0912F, -53.8845F); + bb_main.addChild(cube_r336); + setRotationAngle(cube_r336, 2.8379F, -0.4002F, -2.246F); + cube_r336.setTextureOffset(758, 792).addBox(0.0F, -4.5F, -7.5F, 0.0F, 9.0F, 15.0F, 0.0F, false); + cube_r337 = new ModelRenderer(this); + cube_r337.setRotationPoint(3.9541F, 14.2522F, -44.4667F); + bb_main.addChild(cube_r337); + setRotationAngle(cube_r337, -0.1326F, -0.3053F, -2.261F); + cube_r337.setTextureOffset(198, 928).addBox(0.0F, -6.0F, -3.5F, 0.0F, 12.0F, 7.0F, 0.0F, false); + cube_r338 = new ModelRenderer(this); + cube_r338.setRotationPoint(4.986F, 15.317F, -37.1762F); + bb_main.addChild(cube_r338); + setRotationAngle(cube_r338, -0.0436F, -0.1309F, -2.2689F); + cube_r338.setTextureOffset(924, 806).addBox(0.0F, -6.5F, -4.5F, 0.0F, 13.0F, 9.0F, 0.0F, false); + cube_r339 = new ModelRenderer(this); + cube_r339.setRotationPoint(4.2544F, 6.642F, -56.3345F); + bb_main.addChild(cube_r339); + setRotationAngle(cube_r339, -0.0892F, -0.4798F, -2.701F); + cube_r339.setTextureOffset(924, 308).addBox(0.0F, -2.5F, -9.0F, 0.0F, 5.0F, 18.0F, 0.0F, false); + cube_r340 = new ModelRenderer(this); + cube_r340.setRotationPoint(9.5826F, 7.7165F, -45.2119F); + bb_main.addChild(cube_r340); + setRotationAngle(cube_r340, 0.0F, -0.3491F, -2.7053F); + cube_r340.setTextureOffset(796, 928).addBox(0.0F, -3.0F, -3.5F, 0.0F, 6.0F, 7.0F, 0.0F, false); + cube_r341 = new ModelRenderer(this); + cube_r341.setRotationPoint(11.1998F, 8.4707F, -37.4615F); + bb_main.addChild(cube_r341); + setRotationAngle(cube_r341, 0.0F, -0.1309F, -2.7053F); + cube_r341.setTextureOffset(928, 741).addBox(0.0F, -3.0F, -4.5F, 0.0F, 6.0F, 9.0F, 0.0F, false); + cube_r342 = new ModelRenderer(this); + cube_r342.setRotationPoint(14.0F, -2.5F, -33.0F); + bb_main.addChild(cube_r342); + setRotationAngle(cube_r342, 0.0F, 0.1309F, 0.0F); + cube_r342.setTextureOffset(53, 927).addBox(-2.0F, -1.5F, -10.0F, 2.0F, 2.0F, 10.0F, 0.0F, false); + cube_r342.setTextureOffset(924, 829).addBox(-2.0F, 5.5F, -10.0F, 2.0F, 3.0F, 10.0F, 0.0F, false); + cube_r343 = new ModelRenderer(this); + cube_r343.setRotationPoint(10.3006F, -2.5F, -49.4923F); + bb_main.addChild(cube_r343); + setRotationAngle(cube_r343, 0.0F, 0.5672F, 0.0F); + cube_r343.setTextureOffset(862, 584).addBox(-2.0F, -1.5F, -18.0F, 2.0F, 2.0F, 18.0F, 0.0F, false); + cube_r343.setTextureOffset(821, 584).addBox(-2.0F, 5.5F, -18.0F, 2.0F, 3.0F, 18.0F, 0.0F, false); + cube_r344 = new ModelRenderer(this); + cube_r344.setRotationPoint(12.6947F, -2.5F, -42.9145F); + bb_main.addChild(cube_r344); + setRotationAngle(cube_r344, 0.0F, 0.3491F, 0.0F); + cube_r344.setTextureOffset(172, 932).addBox(-2.0F, -1.5F, -7.0F, 2.0F, 2.0F, 7.0F, 0.0F, false); + cube_r344.setTextureOffset(272, 931).addBox(-2.0F, 5.5F, -7.0F, 2.0F, 3.0F, 7.0F, 0.0F, false); + cube_r345 = new ModelRenderer(this); + cube_r345.setRotationPoint(0.0F, 4.2502F, -65.7124F); + bb_main.addChild(cube_r345); + setRotationAngle(cube_r345, -1.5708F, 0.0F, 0.0F); + cube_r345.setTextureOffset(928, 729).addBox(-1.0F, -2.0F, -9.0F, 2.0F, 2.0F, 9.0F, 0.0F, false); + cube_r346 = new ModelRenderer(this); + cube_r346.setRotationPoint(0.0F, 10.5944F, -62.7541F); + bb_main.addChild(cube_r346); + setRotationAngle(cube_r346, -1.1345F, 0.0F, 0.0F); + cube_r346.setTextureOffset(153, 932).addBox(-1.0F, -3.0F, -7.0F, 2.0F, 3.0F, 7.0F, 0.0F, false); + cube_r347 = new ModelRenderer(this); + cube_r347.setRotationPoint(0.0F, 17.5943F, -50.6297F); + bb_main.addChild(cube_r347); + setRotationAngle(cube_r347, -0.5236F, 0.0F, 0.0F); + cube_r347.setTextureOffset(758, 826).addBox(-1.0F, -4.0F, -14.0F, 2.0F, 4.0F, 14.0F, 0.0F, false); + cube_r348 = new ModelRenderer(this); + cube_r348.setRotationPoint(0.0F, 20.0F, -43.0F); + bb_main.addChild(cube_r348); + setRotationAngle(cube_r348, -0.3054F, 0.0F, 0.0F); + cube_r348.setTextureOffset(928, 757).addBox(-1.0F, -4.0F, -8.0F, 2.0F, 4.0F, 8.0F, 0.0F, false); + cube_r349 = new ModelRenderer(this); + cube_r349.setRotationPoint(0.0F, -88.0F, 104.0F); + bb_main.addChild(cube_r349); + setRotationAngle(cube_r349, 0.0F, -1.5708F, 0.0F); + cube_r349.setTextureOffset(924, 380).addBox(-101.0F, -107.0F, 0.0F, 21.0F, 7.0F, 0.0F, 0.0F, false); + cube_r349.setTextureOffset(0, 396).addBox(-259.0F, -98.0F, 0.0F, 410.0F, 210.0F, 0.0F, 0.0F, false); + cube_r350 = new ModelRenderer(this); + cube_r350.setRotationPoint(0.0F, -106.0F, 2.0F); + bb_main.addChild(cube_r350); + setRotationAngle(cube_r350, 0.0F, -0.7854F, 0.0F); + cube_r350.setTextureOffset(340, 938).addBox(-1.0F, -90.0F, -1.0F, 2.0F, 15.0F, 2.0F, 0.0F, false); + cube_r350.setTextureOffset(198, 773).addBox(-2.0F, -75.0F, -2.0F, 4.0F, 150.0F, 4.0F, 0.0F, false); + cube_r351 = new ModelRenderer(this); + cube_r351.setRotationPoint(0.0F, -79.0F, 49.5F); + bb_main.addChild(cube_r351); + setRotationAngle(cube_r351, 0.0F, 0.0F, 0.7854F); + cube_r351.setTextureOffset(0, 0).addBox(-2.0F, -2.0F, -199.5F, 4.0F, 4.0F, 391.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + bone.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone5.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone6.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone7.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone8.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone9.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone10.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone11.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + TailFin.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + TailFin4.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + TailFin2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + TailFin3.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone70.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone55.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone20.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone17.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone3.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone12.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone13.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone19.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone4.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Engine.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Engine2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + SteeringWheel.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.Propeller2.rotateAngleZ = f2; + this.Propeller.rotateAngleZ = f2; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/DormantAgedEmberleafMilitaryBotRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/DormantAgedEmberleafMilitaryBotRenderer.java new file mode 100644 index 0000000..0cf2e2e --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/DormantAgedEmberleafMilitaryBotRenderer.java @@ -0,0 +1,151 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.procedures.DormantAgedEmberleafMilitaryBotEntityShakingConditionProcedure; +import studio.halbear.hem.entity.DormantAgedEmberleafMilitaryBotEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class DormantAgedEmberleafMilitaryBotRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(DormantAgedEmberleafMilitaryBotEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelEmberleafMilitaryBotAgedDormant(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/emberleafmilitaryrobotaged.png"); + } + + @Override + protected boolean func_230495_a_(LivingEntity _ent) { + Entity entity = _ent; + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + return DormantAgedEmberleafMilitaryBotEntityShakingConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + }; + }); + } + } + + // Made with Blockbench 4.12.5 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelEmberleafMilitaryBotAgedDormant extends EntityModel { + private final ModelRenderer bone; + private final ModelRenderer cube_r1; + private final ModelRenderer LeftLeg; + private final ModelRenderer RightLeg; + private final ModelRenderer UpperBody; + private final ModelRenderer leftArm; + private final ModelRenderer rightArm; + private final ModelRenderer HeadX; + private final ModelRenderer cube_r2; + + public ModelEmberleafMilitaryBotAgedDormant() { + textureWidth = 128; + textureHeight = 128; + bone = new ModelRenderer(this); + bone.setRotationPoint(0.0F, 24.25F, 0.0F); + setRotationAngle(bone, 0.0F, 0.0F, 0.0436F); + bone.setTextureOffset(17, 75).addBox(-4.0F, -28.0F, -2.0F, 8.0F, 6.0F, 4.0F, 0.0F, false); + bone.setTextureOffset(76, 0).addBox(-2.0F, -22.0F, -2.0F, 4.0F, 5.0F, 4.0F, 0.0F, false); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, -31.0F, 0.0F); + bone.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, 0.0F, -3.1416F); + cube_r1.setTextureOffset(17, 76).addBox(-4.0F, -3.0F, -2.0F, 8.0F, 3.0F, 4.0F, 0.0F, false); + LeftLeg = new ModelRenderer(this); + LeftLeg.setRotationPoint(-1.75F, -19.25F, 0.0F); + bone.addChild(LeftLeg); + LeftLeg.setTextureOffset(24, 47).addBox(-5.25F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, false); + LeftLeg.setTextureOffset(0, 75).addBox(-4.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, false); + RightLeg = new ModelRenderer(this); + RightLeg.setRotationPoint(1.75F, -19.25F, 0.0F); + bone.addChild(RightLeg); + setRotationAngle(RightLeg, 0.0F, 0.0F, -0.0873F); + RightLeg.setTextureOffset(24, 47).addBox(-0.75F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, true); + RightLeg.setTextureOffset(0, 75).addBox(0.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, true); + UpperBody = new ModelRenderer(this); + UpperBody.setRotationPoint(0.0F, -29.5F, 0.0F); + bone.addChild(UpperBody); + setRotationAngle(UpperBody, 0.5672F, 0.0F, 0.0F); + UpperBody.setTextureOffset(48, 90).addBox(-11.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, false); + UpperBody.setTextureOffset(48, 90).addBox(8.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, true); + UpperBody.setTextureOffset(68, 38).addBox(4.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(0, 111).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.25F, false); + UpperBody.setTextureOffset(0, 0).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.0F, false); + UpperBody.setTextureOffset(56, 27).addBox(-13.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(44, 0).addBox(-1.5F, -16.5F, -1.5F, 3.0F, 7.0F, 3.0F, 0.0F, false); + leftArm = new ModelRenderer(this); + leftArm.setRotationPoint(-10.0F, -7.5F, 0.0F); + UpperBody.addChild(leftArm); + setRotationAngle(leftArm, -0.5655F, -0.0468F, -0.0737F); + leftArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, false); + leftArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, false); + leftArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, false); + rightArm = new ModelRenderer(this); + rightArm.setRotationPoint(10.0F, -7.5F, 0.0F); + UpperBody.addChild(rightArm); + setRotationAngle(rightArm, -0.6091F, -0.05F, -0.0715F); + rightArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, true); + rightArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, true); + rightArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, true); + HeadX = new ModelRenderer(this); + HeadX.setRotationPoint(0.0F, -13.0F, 0.0F); + UpperBody.addChild(HeadX); + setRotationAngle(HeadX, 0.0F, 0.1309F, 0.0F); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, 0.0F, 0.0F); + HeadX.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0F, -0.7854F, 0.0F); + cube_r2.setTextureOffset(68, 49).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.0F, false); + cube_r2.setTextureOffset(68, 64).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.25F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + bone.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/DormantEmberleafMilitaryBotRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/DormantEmberleafMilitaryBotRenderer.java new file mode 100644 index 0000000..9fc4fa2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/DormantEmberleafMilitaryBotRenderer.java @@ -0,0 +1,128 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.DormantEmberleafMilitaryBotEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class DormantEmberleafMilitaryBotRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(DormantEmberleafMilitaryBotEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelEmberleafMilitaryBotDormant(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/emberleafmilitaryrobot.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.5 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelEmberleafMilitaryBotDormant extends EntityModel { + private final ModelRenderer LeftLeg; + private final ModelRenderer RightLeg; + private final ModelRenderer UpperBody; + private final ModelRenderer leftArm; + private final ModelRenderer rightArm; + private final ModelRenderer HeadX; + private final ModelRenderer cube_r1; + private final ModelRenderer bb_main; + private final ModelRenderer UpperAbdomine_r1; + + public ModelEmberleafMilitaryBotDormant() { + textureWidth = 128; + textureHeight = 128; + LeftLeg = new ModelRenderer(this); + LeftLeg.setRotationPoint(-1.75F, 5.0F, 0.0F); + LeftLeg.setTextureOffset(24, 47).addBox(-5.25F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, false); + LeftLeg.setTextureOffset(0, 75).addBox(-4.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, false); + RightLeg = new ModelRenderer(this); + RightLeg.setRotationPoint(1.75F, 5.0F, 0.0F); + RightLeg.setTextureOffset(24, 47).addBox(-0.75F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, true); + RightLeg.setTextureOffset(0, 75).addBox(0.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, true); + UpperBody = new ModelRenderer(this); + UpperBody.setRotationPoint(0.0F, -5.25F, 0.0F); + setRotationAngle(UpperBody, -0.7854F, 0.0F, 0.0F); + UpperBody.setTextureOffset(48, 90).addBox(-11.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, false); + UpperBody.setTextureOffset(48, 90).addBox(8.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, true); + UpperBody.setTextureOffset(68, 38).addBox(4.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(0, 111).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.25F, false); + UpperBody.setTextureOffset(0, 0).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.0F, false); + UpperBody.setTextureOffset(56, 27).addBox(-13.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(44, 0).addBox(-1.5F, -16.5F, -1.5F, 3.0F, 7.0F, 3.0F, 0.0F, false); + leftArm = new ModelRenderer(this); + leftArm.setRotationPoint(-10.0F, -7.5F, 0.0F); + UpperBody.addChild(leftArm); + setRotationAngle(leftArm, 0.8727F, 0.0F, 0.0F); + leftArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, false); + leftArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, false); + leftArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, false); + rightArm = new ModelRenderer(this); + rightArm.setRotationPoint(10.0F, -7.5F, 0.0F); + UpperBody.addChild(rightArm); + setRotationAngle(rightArm, 0.8727F, 0.0F, 0.0F); + rightArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, true); + rightArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, true); + rightArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, true); + HeadX = new ModelRenderer(this); + HeadX.setRotationPoint(0.0F, -13.0F, 0.0F); + UpperBody.addChild(HeadX); + setRotationAngle(HeadX, 0.0F, -0.3491F, 0.0F); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + HeadX.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, -0.7854F, 0.0F); + cube_r1.setTextureOffset(68, 49).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.0F, false); + cube_r1.setTextureOffset(68, 64).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.25F, false); + bb_main = new ModelRenderer(this); + bb_main.setRotationPoint(0.0F, 24.0F, 0.0F); + bb_main.setTextureOffset(17, 75).addBox(-4.0F, -27.75F, -2.0F, 8.0F, 6.0F, 4.0F, 0.0F, false); + bb_main.setTextureOffset(76, 0).addBox(-2.0F, -21.75F, -2.0F, 4.0F, 5.0F, 4.0F, 0.0F, false); + UpperAbdomine_r1 = new ModelRenderer(this); + UpperAbdomine_r1.setRotationPoint(0.0F, -30.75F, 0.0F); + bb_main.addChild(UpperAbdomine_r1); + setRotationAngle(UpperAbdomine_r1, 0.0F, 0.0F, -3.1416F); + UpperAbdomine_r1.setTextureOffset(17, 76).addBox(-4.0F, -3.0F, -2.0F, 8.0F, 3.0F, 4.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + LeftLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + UpperBody.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryBotRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryBotRenderer.java new file mode 100644 index 0000000..7f93975 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryBotRenderer.java @@ -0,0 +1,131 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.EmberleafMilitaryBotEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class EmberleafMilitaryBotRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(EmberleafMilitaryBotEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelEmberleafMilitaryBot(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/emberleafmilitaryrobotawake.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.5 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelEmberleafMilitaryBot extends EntityModel { + private final ModelRenderer LeftLeg; + private final ModelRenderer RightLeg; + private final ModelRenderer UpperBody; + private final ModelRenderer leftArm; + private final ModelRenderer rightArm; + private final ModelRenderer HeadX; + private final ModelRenderer cube_r1; + private final ModelRenderer bb_main; + private final ModelRenderer cube_r2; + + public ModelEmberleafMilitaryBot() { + textureWidth = 128; + textureHeight = 128; + LeftLeg = new ModelRenderer(this); + LeftLeg.setRotationPoint(-1.75F, 5.0F, 0.0F); + LeftLeg.setTextureOffset(24, 47).addBox(-5.25F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, false); + LeftLeg.setTextureOffset(0, 75).addBox(-4.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, false); + RightLeg = new ModelRenderer(this); + RightLeg.setRotationPoint(1.75F, 5.0F, 0.0F); + RightLeg.setTextureOffset(24, 47).addBox(-0.75F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, true); + RightLeg.setTextureOffset(0, 75).addBox(0.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, true); + UpperBody = new ModelRenderer(this); + UpperBody.setRotationPoint(0.0F, -5.25F, 0.0F); + UpperBody.setTextureOffset(48, 90).addBox(-11.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, false); + UpperBody.setTextureOffset(48, 90).addBox(8.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, true); + UpperBody.setTextureOffset(68, 38).addBox(4.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(0, 111).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.25F, false); + UpperBody.setTextureOffset(0, 0).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.0F, false); + UpperBody.setTextureOffset(56, 27).addBox(-13.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(44, 0).addBox(-1.5F, -16.5F, -1.5F, 3.0F, 7.0F, 3.0F, 0.0F, false); + leftArm = new ModelRenderer(this); + leftArm.setRotationPoint(-10.0F, -7.5F, 0.0F); + UpperBody.addChild(leftArm); + leftArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, false); + leftArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, false); + leftArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, false); + rightArm = new ModelRenderer(this); + rightArm.setRotationPoint(10.0F, -7.5F, 0.0F); + UpperBody.addChild(rightArm); + rightArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, true); + rightArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, true); + rightArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, true); + HeadX = new ModelRenderer(this); + HeadX.setRotationPoint(0.0F, -13.0F, 0.0F); + UpperBody.addChild(HeadX); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + HeadX.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, -0.7854F, 0.0F); + cube_r1.setTextureOffset(68, 49).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.0F, false); + cube_r1.setTextureOffset(68, 64).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.25F, false); + bb_main = new ModelRenderer(this); + bb_main.setRotationPoint(0.0F, 24.0F, 0.0F); + bb_main.setTextureOffset(17, 75).addBox(-4.0F, -27.75F, -2.0F, 8.0F, 6.0F, 4.0F, 0.0F, false); + bb_main.setTextureOffset(76, 0).addBox(-2.0F, -21.75F, -2.0F, 4.0F, 5.0F, 4.0F, 0.0F, false); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, -30.75F, 0.0F); + bb_main.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0F, 0.0F, -3.1416F); + cube_r2.setTextureOffset(17, 76).addBox(-4.0F, -3.0F, -2.0F, 8.0F, 3.0F, 4.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + LeftLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + UpperBody.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.LeftLeg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.UpperBody.rotateAngleX = f4 / (180F / (float) Math.PI); + this.RightLeg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.rightArm.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 0.6662F) * f1; + this.HeadX.rotateAngleY = f3 / (180F / (float) Math.PI); + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryRobotLowerHalfRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryRobotLowerHalfRenderer.java new file mode 100644 index 0000000..8bae446 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryRobotLowerHalfRenderer.java @@ -0,0 +1,114 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.EmberleafMilitaryRobotLowerHalfEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class EmberleafMilitaryRobotLowerHalfRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(EmberleafMilitaryRobotLowerHalfEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelEmberleafMilitaryBotLowerHalf(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/emberleafmilitaryrobotdestroyed.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.5 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelEmberleafMilitaryBotLowerHalf extends EntityModel { + private final ModelRenderer LeftLeg; + private final ModelRenderer RightLeg; + private final ModelRenderer UpperHalf; + private final ModelRenderer cube_r1; + private final ModelRenderer cube_r2; + private final ModelRenderer Spine; + private final ModelRenderer cube_r3; + private final ModelRenderer bb_main; + + public ModelEmberleafMilitaryBotLowerHalf() { + textureWidth = 128; + textureHeight = 128; + LeftLeg = new ModelRenderer(this); + LeftLeg.setRotationPoint(-1.75F, 5.0F, 0.0F); + LeftLeg.setTextureOffset(24, 47).addBox(-5.25F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, false); + LeftLeg.setTextureOffset(0, 75).addBox(-4.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, false); + RightLeg = new ModelRenderer(this); + RightLeg.setRotationPoint(1.75F, 5.0F, 0.0F); + RightLeg.setTextureOffset(24, 47).addBox(-0.75F, -2.75F, -3.0F, 6.0F, 22.0F, 6.0F, -0.25F, true); + RightLeg.setTextureOffset(0, 75).addBox(0.25F, -1.75F, -2.0F, 4.0F, 21.0F, 4.0F, 0.25F, true); + UpperHalf = new ModelRenderer(this); + UpperHalf.setRotationPoint(0.025F, 2.2F, 2.025F); + setRotationAngle(UpperHalf, 0.0F, 0.0F, 0.0873F); + UpperHalf.setTextureOffset(61, 14).addBox(-2.025F, -16.2F, -2.025F, 4.0F, 9.0F, 0.0F, 0.0F, false); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, -5.6F, -4.55F); + UpperHalf.addChild(cube_r1); + setRotationAngle(cube_r1, 0.2182F, 0.0F, -3.1416F); + cube_r1.setTextureOffset(17, 76).addBox(-4.0F, 0.0F, 0.0F, 8.0F, 3.0F, 4.0F, 0.0F, false); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(-0.025F, 0.05F, -0.025F); + UpperHalf.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0873F, 0.0F, 0.0F); + cube_r2.setTextureOffset(17, 75).addBox(-4.0F, -6.0F, -4.0F, 8.0F, 6.0F, 4.0F, 0.0F, false); + Spine = new ModelRenderer(this); + Spine.setRotationPoint(-0.025F, -15.7F, -1.9375F); + UpperHalf.addChild(Spine); + setRotationAngle(Spine, 0.0F, 0.0F, 0.1309F); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(0.0F, 0.0F, 0.0F); + Spine.addChild(cube_r3); + setRotationAngle(cube_r3, 0.0F, 0.0F, 2.0071F); + cube_r3.setTextureOffset(61, 14).addBox(-2.0305F, -7.8824F, 0.0F, 4.0F, 9.0F, 0.0F, 0.0F, false); + bb_main = new ModelRenderer(this); + bb_main.setRotationPoint(0.0F, 24.0F, 0.0F); + bb_main.setTextureOffset(76, 0).addBox(-2.0F, -21.75F, -2.0F, 4.0F, 5.0F, 4.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + LeftLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + UpperHalf.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.LeftLeg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightLeg.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.Spine.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryRobotUpperHalfRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryRobotUpperHalfRenderer.java new file mode 100644 index 0000000..c3b2714 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/EmberleafMilitaryRobotUpperHalfRenderer.java @@ -0,0 +1,104 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.EmberleafMilitaryRobotUpperHalfEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class EmberleafMilitaryRobotUpperHalfRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(EmberleafMilitaryRobotUpperHalfEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelEmberleafMilitaryBotUpperHalf(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/emberleafmilitaryrobotdestroyed.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.5 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelEmberleafMilitaryBotUpperHalf extends EntityModel { + private final ModelRenderer UpperBody; + private final ModelRenderer leftArm; + private final ModelRenderer rightArm; + private final ModelRenderer HeadX; + private final ModelRenderer cube_r1; + + public ModelEmberleafMilitaryBotUpperHalf() { + textureWidth = 128; + textureHeight = 128; + UpperBody = new ModelRenderer(this); + UpperBody.setRotationPoint(0.0F, 9.75F, 0.0F); + UpperBody.setTextureOffset(48, 90).addBox(-11.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, false); + UpperBody.setTextureOffset(48, 90).addBox(8.5F, -7.6F, -2.0F, 3.0F, 4.0F, 4.0F, 0.0F, true); + UpperBody.setTextureOffset(68, 38).addBox(4.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(0, 111).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.25F, false); + UpperBody.setTextureOffset(0, 0).addBox(-8.0F, -9.5F, -3.0F, 16.0F, 11.0F, 6.0F, 0.0F, false); + UpperBody.setTextureOffset(56, 27).addBox(-13.0F, -10.5F, -4.0F, 9.0F, 3.0F, 8.0F, 0.0F, false); + UpperBody.setTextureOffset(44, 0).addBox(-1.5F, -16.5F, -1.5F, 3.0F, 7.0F, 3.0F, 0.0F, false); + leftArm = new ModelRenderer(this); + leftArm.setRotationPoint(-10.0F, -7.5F, 0.0F); + UpperBody.addChild(leftArm); + leftArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, false); + leftArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, false); + leftArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, false); + rightArm = new ModelRenderer(this); + rightArm.setRotationPoint(10.0F, -7.5F, 0.0F); + UpperBody.addChild(rightArm); + rightArm.setTextureOffset(28, 20).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, 0.0F, true); + rightArm.setTextureOffset(48, 47).addBox(-2.0F, 0.0F, -3.0F, 4.0F, 21.0F, 6.0F, -0.24F, true); + rightArm.setTextureOffset(0, 17).addBox(-3.0F, 0.0F, -4.0F, 6.0F, 22.0F, 8.0F, -0.25F, true); + HeadX = new ModelRenderer(this); + HeadX.setRotationPoint(0.0F, -13.0F, 0.0F); + UpperBody.addChild(HeadX); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + HeadX.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, -0.7854F, 0.0F); + cube_r1.setTextureOffset(68, 49).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.0F, false); + cube_r1.setTextureOffset(68, 64).addBox(-3.5F, -6.5F, -3.5F, 7.0F, 8.0F, 7.0F, 0.25F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + UpperBody.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.rightArm.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.leftArm.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.HeadX.rotateAngleY = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/FluffaloRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/FluffaloRenderer.java new file mode 100644 index 0000000..fefd277 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/FluffaloRenderer.java @@ -0,0 +1,152 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.FluffaloEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class FluffaloRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(FluffaloEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelFluffalo(), 1.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/fluffalo.png"); + } + }; + }); + } + } + + // Made with Blockbench 5.0.3 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelFluffalo extends EntityModel { + private final ModelRenderer Body; + private final ModelRenderer Tail2; + private final ModelRenderer Tail; + private final ModelRenderer cube_r1; + private final ModelRenderer Head; + private final ModelRenderer horn; + private final ModelRenderer cube_r2; + private final ModelRenderer LeftFoot1; + private final ModelRenderer RightFoot1; + private final ModelRenderer LeftFoot2; + private final ModelRenderer RightFoot2; + private final ModelRenderer LeftFoot3; + private final ModelRenderer RightFoot3; + + public ModelFluffalo() { + textureWidth = 256; + textureHeight = 256; + Body = new ModelRenderer(this); + Body.setRotationPoint(-0.5F, 11.0F, -3.25F); + Body.setTextureOffset(0, 0).addBox(-11.5F, -15.0F, -14.75F, 24.0F, 21.0F, 36.0F, 0.0F, false); + Body.setTextureOffset(0, 114).addBox(-11.5F, 6.0F, -14.75F, 24.0F, 7.0F, 36.0F, 0.0F, false); + Body.setTextureOffset(120, 0).addBox(0.5F, -22.0F, -21.75F, 0.0F, 16.0F, 47.0F, 0.0F, false); + Tail2 = new ModelRenderer(this); + Tail2.setRotationPoint(0.5F, -7.0F, 21.75F); + Body.addChild(Tail2); + Tail = new ModelRenderer(this); + Tail.setRotationPoint(0.0F, 0.0F, 0.0F); + Tail2.addChild(Tail); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + Tail.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0873F, 0.0F, 0.0F); + cube_r1.setTextureOffset(148, 131).addBox(-3.0F, -2.0F, 0.0F, 6.0F, 21.0F, 0.0F, 0.0F, false); + Head = new ModelRenderer(this); + Head.setRotationPoint(0.0F, -2.0F, -15.0F); + Body.addChild(Head); + Head.setTextureOffset(120, 83).addBox(-5.5F, -6.0F, -8.75F, 11.0F, 11.0F, 9.0F, 0.25F, false); + Head.setTextureOffset(148, 152).addBox(-3.5F, -1.0F, -10.75F, 7.0F, 6.0F, 2.0F, 0.0F, false); + Head.setTextureOffset(120, 103).addBox(-5.5F, 5.5F, -8.75F, 11.0F, 8.0F, 9.0F, 0.25F, false); + Head.setTextureOffset(120, 63).addBox(-5.5F, -6.0F, -8.75F, 11.0F, 11.0F, 9.0F, 0.0F, false); + horn = new ModelRenderer(this); + horn.setRotationPoint(0.0F, 2.0F, -11.0F); + Head.addChild(horn); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, 0.0F, 0.0F); + horn.addChild(cube_r2); + setRotationAngle(cube_r2, -0.4363F, 0.0F, 0.0F); + cube_r2.setTextureOffset(120, 120).addBox(-8.5F, -2.0F, 0.0F, 17.0F, 11.0F, 0.0F, 0.0F, false); + LeftFoot1 = new ModelRenderer(this); + LeftFoot1.setRotationPoint(7.0F, 17.0F, -12.0F); + LeftFoot1.setTextureOffset(120, 131).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, false); + LeftFoot1.setTextureOffset(120, 145).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, false); + RightFoot1 = new ModelRenderer(this); + RightFoot1.setRotationPoint(-7.0F, 17.0F, -12.0F); + RightFoot1.setTextureOffset(120, 131).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, true); + RightFoot1.setTextureOffset(120, 145).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, true); + LeftFoot2 = new ModelRenderer(this); + LeftFoot2.setRotationPoint(7.0F, 17.0F, 0.0F); + LeftFoot2.setTextureOffset(120, 131).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, false); + LeftFoot2.setTextureOffset(120, 145).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, false); + RightFoot2 = new ModelRenderer(this); + RightFoot2.setRotationPoint(-7.0F, 17.0F, 0.0F); + RightFoot2.setTextureOffset(120, 131).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, true); + RightFoot2.setTextureOffset(120, 145).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, true); + LeftFoot3 = new ModelRenderer(this); + LeftFoot3.setRotationPoint(7.0F, 17.0F, 11.0F); + LeftFoot3.setTextureOffset(120, 131).addBox(-4.0F, 0.0F, -3.0F, 7.0F, 7.0F, 7.0F, 0.0F, false); + LeftFoot3.setTextureOffset(120, 145).addBox(-4.0F, 0.0F, -3.0F, 7.0F, 7.0F, 7.0F, 0.25F, false); + RightFoot3 = new ModelRenderer(this); + RightFoot3.setRotationPoint(-7.0F, 17.0F, 12.0F); + RightFoot3.setTextureOffset(120, 131).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, true); + RightFoot3.setTextureOffset(120, 145).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, true); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Body.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftFoot1.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightFoot1.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftFoot2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightFoot2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftFoot3.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightFoot3.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.Head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.Tail2.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.RightFoot3.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.RightFoot2.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.horn.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.Tail.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.Body.rotateAngleZ = MathHelper.cos(f * 0.6662F) * f1; + this.LeftFoot3.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightFoot1.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftFoot2.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftFoot1.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/FluffaloShavedRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/FluffaloShavedRenderer.java new file mode 100644 index 0000000..ad9ae03 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/FluffaloShavedRenderer.java @@ -0,0 +1,163 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.procedures.FluffaloShavedEntityShakingConditionProcedure; +import studio.halbear.hem.entity.FluffaloShavedEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import java.util.Collections; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class FluffaloShavedRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(FluffaloShavedEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelFluffaloShaved(), 1.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/fluffalo.png"); + } + + @Override + protected boolean func_230495_a_(LivingEntity _ent) { + Entity entity = _ent; + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + return FluffaloShavedEntityShakingConditionProcedure.executeProcedure(Collections.emptyMap()); + } + }; + }); + } + } + + // Made with Blockbench 5.0.3 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelFluffaloShaved extends EntityModel { + private final ModelRenderer Body; + private final ModelRenderer Tail2; + private final ModelRenderer Tail; + private final ModelRenderer cube_r1; + private final ModelRenderer Head; + private final ModelRenderer horn; + private final ModelRenderer cube_r2; + private final ModelRenderer LeftFoot1; + private final ModelRenderer RightFoot1; + private final ModelRenderer LeftFoot2; + private final ModelRenderer RightFoot2; + private final ModelRenderer LeftFoot3; + private final ModelRenderer RightFoot3; + + public ModelFluffaloShaved() { + textureWidth = 256; + textureHeight = 256; + Body = new ModelRenderer(this); + Body.setRotationPoint(-0.5F, 12.0F, -3.25F); + Body.setTextureOffset(0, 199).addBox(-11.5F, -14.0F, -15.75F, 24.0F, 21.0F, 36.0F, -0.5F, false); + Tail2 = new ModelRenderer(this); + Tail2.setRotationPoint(0.5F, -7.0F, 21.75F); + Body.addChild(Tail2); + Tail = new ModelRenderer(this); + Tail.setRotationPoint(0.0F, 0.0F, 0.0F); + Tail2.addChild(Tail); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 0.0F, -2.0F); + Tail.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0873F, 0.0F, 0.0F); + cube_r1.setTextureOffset(148, 131).addBox(-3.0F, -2.0F, 0.0F, 6.0F, 21.0F, 0.0F, 0.0F, false); + Head = new ModelRenderer(this); + Head.setRotationPoint(0.0F, -2.0F, -15.0F); + Body.addChild(Head); + Head.setTextureOffset(148, 160).addBox(-3.5F, -1.0F, -10.75F, 7.0F, 6.0F, 2.0F, 0.0F, false); + Head.setTextureOffset(120, 63).addBox(-5.5F, -6.0F, -8.75F, 11.0F, 11.0F, 9.0F, 0.0F, false); + horn = new ModelRenderer(this); + horn.setRotationPoint(0.0F, 2.0F, -11.0F); + Head.addChild(horn); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, 0.0F, 0.0F); + horn.addChild(cube_r2); + setRotationAngle(cube_r2, -0.4363F, 0.0F, 0.0F); + cube_r2.setTextureOffset(120, 120).addBox(-8.5F, -2.0F, 0.0F, 17.0F, 11.0F, 0.0F, 0.0F, false); + LeftFoot1 = new ModelRenderer(this); + LeftFoot1.setRotationPoint(7.0F, 17.0F, -12.0F); + LeftFoot1.setTextureOffset(120, 131).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, false); + LeftFoot1.setTextureOffset(120, 145).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, false); + RightFoot1 = new ModelRenderer(this); + RightFoot1.setRotationPoint(-7.0F, 17.0F, -12.0F); + RightFoot1.setTextureOffset(120, 131).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, true); + RightFoot1.setTextureOffset(120, 145).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, true); + LeftFoot2 = new ModelRenderer(this); + LeftFoot2.setRotationPoint(7.0F, 17.0F, 0.0F); + LeftFoot2.setTextureOffset(120, 131).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, false); + LeftFoot2.setTextureOffset(120, 145).addBox(-4.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, false); + RightFoot2 = new ModelRenderer(this); + RightFoot2.setRotationPoint(-7.0F, 17.0F, 0.0F); + RightFoot2.setTextureOffset(120, 131).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, true); + RightFoot2.setTextureOffset(120, 145).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, true); + LeftFoot3 = new ModelRenderer(this); + LeftFoot3.setRotationPoint(7.0F, 17.0F, 11.0F); + LeftFoot3.setTextureOffset(120, 131).addBox(-4.0F, 0.0F, -3.0F, 7.0F, 7.0F, 7.0F, 0.0F, false); + LeftFoot3.setTextureOffset(120, 145).addBox(-4.0F, 0.0F, -3.0F, 7.0F, 7.0F, 7.0F, 0.25F, false); + RightFoot3 = new ModelRenderer(this); + RightFoot3.setRotationPoint(-7.0F, 17.0F, 12.0F); + RightFoot3.setTextureOffset(120, 131).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.0F, true); + RightFoot3.setTextureOffset(120, 145).addBox(-3.0F, 0.0F, -4.0F, 7.0F, 7.0F, 7.0F, 0.25F, true); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Body.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftFoot1.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightFoot1.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftFoot2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightFoot2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftFoot3.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightFoot3.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.Head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.Tail2.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightFoot3.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.RightFoot2.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.horn.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.Tail.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.Body.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftFoot3.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightFoot1.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftFoot2.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftFoot1.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/GiantButterflyRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/GiantButterflyRenderer.java new file mode 100644 index 0000000..51a260f --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/GiantButterflyRenderer.java @@ -0,0 +1,201 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.GiantButterflyEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class GiantButterflyRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(GiantButterflyEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelGiantButterfly(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/giantbutterfly.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.4 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelGiantButterfly extends EntityModel { + private final ModelRenderer Head; + private final ModelRenderer antenna2; + private final ModelRenderer antenna_r1; + private final ModelRenderer antenna; + private final ModelRenderer antenna_r2; + private final ModelRenderer Body; + private final ModelRenderer cube_r1; + private final ModelRenderer cube_r2; + private final ModelRenderer RightLowerWingOuter1; + private final ModelRenderer RightLowerWing; + private final ModelRenderer RightLowerWing_r1; + private final ModelRenderer RightUpperWingOuter1; + private final ModelRenderer RightUpperWIng; + private final ModelRenderer RightUpperWIng_r1; + private final ModelRenderer LeftUpperWIngouter1; + private final ModelRenderer LeftUpperWIng; + private final ModelRenderer LeftUpperWIng_r1; + private final ModelRenderer LeftLowerWIngouter1; + private final ModelRenderer LeftLowerWing; + private final ModelRenderer LeftLowerWing_r1; + private final ModelRenderer RightLegs; + private final ModelRenderer cube_r3; + private final ModelRenderer LeftLegs; + private final ModelRenderer cube_r4; + + public ModelGiantButterfly() { + textureWidth = 256; + textureHeight = 256; + Head = new ModelRenderer(this); + Head.setRotationPoint(0.0F, 8.0F, -5.0F); + Head.setTextureOffset(138, 135).addBox(-4.0F, -4.0F, -9.0F, 8.0F, 9.0F, 9.0F, 0.0F, false); + Head.setTextureOffset(0, 142).addBox(0.0F, -2.0F, -16.0F, 0.0F, 18.0F, 10.0F, 0.0F, false); + antenna2 = new ModelRenderer(this); + antenna2.setRotationPoint(2.0F, -4.0F, -4.0F); + Head.addChild(antenna2); + antenna_r1 = new ModelRenderer(this); + antenna_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + antenna2.addChild(antenna_r1); + setRotationAngle(antenna_r1, 1.5708F, 1.1345F, 1.9635F); + antenna_r1.setTextureOffset(91, 135).addBox(0.0F, -18.0F, -3.0F, 0.0F, 22.0F, 12.0F, 0.0F, false); + antenna = new ModelRenderer(this); + antenna.setRotationPoint(-2.0F, -4.0F, -4.0F); + Head.addChild(antenna); + antenna_r2 = new ModelRenderer(this); + antenna_r2.setRotationPoint(0.0F, 0.0F, 0.0F); + antenna.addChild(antenna_r2); + setRotationAngle(antenna_r2, 1.5708F, -1.1345F, -1.9635F); + antenna_r2.setTextureOffset(114, 135).addBox(0.0F, -18.0F, -3.0F, 0.0F, 22.0F, 12.0F, 0.0F, false); + Body = new ModelRenderer(this); + Body.setRotationPoint(0.0F, 8.0F, -5.0F); + setRotationAngle(Body, -0.3927F, 0.0F, 0.0F); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 19.363F, 26.4211F); + Body.addChild(cube_r1); + setRotationAngle(cube_r1, 0.7854F, 0.0F, 0.0F); + cube_r1.setTextureOffset(54, 135).addBox(-4.0F, -21.0F, -5.0F, 8.0F, 21.0F, 10.0F, 0.0F, false); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, 4.563F, 14.5211F); + Body.addChild(cube_r2); + setRotationAngle(cube_r2, 1.3963F, 0.0F, 0.0F); + cube_r2.setTextureOffset(0, 111).addBox(-6.0F, -16.0F, -9.0F, 12.0F, 16.0F, 15.0F, 0.0F, false); + RightLowerWingOuter1 = new ModelRenderer(this); + RightLowerWingOuter1.setRotationPoint(-6.05F, -2.037F, 10.7711F); + Body.addChild(RightLowerWingOuter1); + RightLowerWing = new ModelRenderer(this); + RightLowerWing.setRotationPoint(0.0F, 0.0F, 0.0F); + RightLowerWingOuter1.addChild(RightLowerWing); + RightLowerWing_r1 = new ModelRenderer(this); + RightLowerWing_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + RightLowerWing.addChild(RightLowerWing_r1); + setRotationAngle(RightLowerWing_r1, 1.4319F, -0.2446F, -0.7479F); + RightLowerWing_r1.setTextureOffset(97, 3).addBox(-0.1134F, -15.1127F, -2.2365F, 0.0F, 59.0F, 46.0F, 0.0F, true); + RightUpperWingOuter1 = new ModelRenderer(this); + RightUpperWingOuter1.setRotationPoint(-6.0F, -2.637F, 8.5211F); + Body.addChild(RightUpperWingOuter1); + RightUpperWIng = new ModelRenderer(this); + RightUpperWIng.setRotationPoint(0.0F, 0.0F, 0.0F); + RightUpperWingOuter1.addChild(RightUpperWIng); + RightUpperWIng_r1 = new ModelRenderer(this); + RightUpperWIng_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + RightUpperWIng.addChild(RightUpperWIng_r1); + setRotationAngle(RightUpperWIng_r1, 1.44F, -0.0768F, -0.7941F); + RightUpperWIng_r1.setTextureOffset(2, 2).addBox(0.0F, -23.8409F, -2.0487F, 0.0F, 63.0F, 46.0F, 0.0F, true); + LeftUpperWIngouter1 = new ModelRenderer(this); + LeftUpperWIngouter1.setRotationPoint(6.0F, -2.637F, 8.5211F); + Body.addChild(LeftUpperWIngouter1); + LeftUpperWIng = new ModelRenderer(this); + LeftUpperWIng.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftUpperWIngouter1.addChild(LeftUpperWIng); + LeftUpperWIng_r1 = new ModelRenderer(this); + LeftUpperWIng_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftUpperWIng.addChild(LeftUpperWIng_r1); + setRotationAngle(LeftUpperWIng_r1, 1.44F, 0.0768F, 0.7941F); + LeftUpperWIng_r1.setTextureOffset(2, 2).addBox(0.0F, -23.8409F, -2.0487F, 0.0F, 63.0F, 46.0F, 0.0F, false); + LeftLowerWIngouter1 = new ModelRenderer(this); + LeftLowerWIngouter1.setRotationPoint(6.0F, -2.0F, 10.0F); + Body.addChild(LeftLowerWIngouter1); + LeftLowerWing = new ModelRenderer(this); + LeftLowerWing.setRotationPoint(0.05F, -0.037F, 0.7711F); + LeftLowerWIngouter1.addChild(LeftLowerWing); + LeftLowerWing_r1 = new ModelRenderer(this); + LeftLowerWing_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftLowerWing.addChild(LeftLowerWing_r1); + setRotationAngle(LeftLowerWing_r1, 1.4319F, 0.2446F, 0.7479F); + LeftLowerWing_r1.setTextureOffset(97, 3).addBox(0.1134F, -15.1127F, -2.2365F, 0.0F, 59.0F, 46.0F, 0.0F, false); + RightLegs = new ModelRenderer(this); + RightLegs.setRotationPoint(-6.0F, 7.063F, 5.5211F); + Body.addChild(RightLegs); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(0.0F, 0.0F, 0.0F); + RightLegs.addChild(cube_r3); + setRotationAngle(cube_r3, 1.4829F, -0.151F, -1.0405F); + cube_r3.setTextureOffset(98, 111).addBox(-22.0F, -11.5709F, 0.0248F, 22.0F, 24.0F, 0.0F, 0.0F, false); + LeftLegs = new ModelRenderer(this); + LeftLegs.setRotationPoint(6.0F, 7.063F, 5.5211F); + Body.addChild(LeftLegs); + cube_r4 = new ModelRenderer(this); + cube_r4.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftLegs.addChild(cube_r4); + setRotationAngle(cube_r4, 1.4829F, 0.151F, 1.0405F); + cube_r4.setTextureOffset(98, 111).addBox(0.0F, -11.5709F, 0.0248F, 22.0F, 24.0F, 0.0F, 0.0F, true); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Head.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Body.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.antenna.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.LeftLowerWIngouter1.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightUpperWIng.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftLowerWing.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.Head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.RightLowerWing.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftUpperWIng_r1.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.LeftUpperWIngouter1.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightLegs.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.LeftUpperWIng.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightLowerWingOuter1.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.RightUpperWingOuter1.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftLegs.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.RightUpperWIng_r1.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.antenna2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.Body.rotateAngleX = MathHelper.cos(f * 0.6662F) * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/GiantButterflyWalkingRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/GiantButterflyWalkingRenderer.java new file mode 100644 index 0000000..0492bf1 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/GiantButterflyWalkingRenderer.java @@ -0,0 +1,237 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.GiantButterflyWalkingEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class GiantButterflyWalkingRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(GiantButterflyWalkingEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelGiantButterflyWalking(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/giantbutterfly.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.4 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelGiantButterflyWalking extends EntityModel { + private final ModelRenderer Head; + private final ModelRenderer antenna2; + private final ModelRenderer antenna_r1; + private final ModelRenderer antenna; + private final ModelRenderer antenna_r2; + private final ModelRenderer Body; + private final ModelRenderer cube_r1; + private final ModelRenderer LeftUpperWIngouter1; + private final ModelRenderer LeftUpperWIng; + private final ModelRenderer LeftUpperWIng_r1; + private final ModelRenderer RightUpperWIngouter1; + private final ModelRenderer RightUpperWIng; + private final ModelRenderer RightUpperWIng_r1; + private final ModelRenderer LeftLowerWIngouter1; + private final ModelRenderer LeftLowerWing; + private final ModelRenderer LeftLowerWing_r1; + private final ModelRenderer RightLowerWIngouter1; + private final ModelRenderer RightLowerWing; + private final ModelRenderer RightLowerWing_r1; + private final ModelRenderer RightLegs; + private final ModelRenderer cube_r2; + private final ModelRenderer cube_r3; + private final ModelRenderer LeftLegs; + private final ModelRenderer cube_r4; + private final ModelRenderer cube_r5; + private final ModelRenderer RightLegs2; + private final ModelRenderer cube_r6; + private final ModelRenderer LeftLegs2; + private final ModelRenderer cube_r7; + private final ModelRenderer butt; + private final ModelRenderer cube_r8; + + public ModelGiantButterflyWalking() { + textureWidth = 256; + textureHeight = 256; + Head = new ModelRenderer(this); + Head.setRotationPoint(0.0F, 8.0F, -5.0F); + Head.setTextureOffset(138, 135).addBox(-4.0F, -4.0F, -9.0F, 8.0F, 9.0F, 9.0F, 0.0F, false); + Head.setTextureOffset(0, 142).addBox(0.0F, -2.0F, -16.0F, 0.0F, 18.0F, 10.0F, 0.0F, false); + antenna2 = new ModelRenderer(this); + antenna2.setRotationPoint(2.0F, -4.0F, -4.0F); + Head.addChild(antenna2); + antenna_r1 = new ModelRenderer(this); + antenna_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + antenna2.addChild(antenna_r1); + setRotationAngle(antenna_r1, 1.5708F, 1.1345F, 1.9635F); + antenna_r1.setTextureOffset(91, 135).addBox(0.0F, -18.0F, -3.0F, 0.0F, 22.0F, 12.0F, 0.0F, false); + antenna = new ModelRenderer(this); + antenna.setRotationPoint(-2.0F, -4.0F, -4.0F); + Head.addChild(antenna); + antenna_r2 = new ModelRenderer(this); + antenna_r2.setRotationPoint(0.0F, 0.0F, 0.0F); + antenna.addChild(antenna_r2); + setRotationAngle(antenna_r2, 1.5708F, -1.1345F, -1.9635F); + antenna_r2.setTextureOffset(114, 135).addBox(0.0F, -18.0F, -3.0F, 0.0F, 22.0F, 12.0F, 0.0F, false); + Body = new ModelRenderer(this); + Body.setRotationPoint(0.0F, 8.0F, -5.0F); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 4.563F, 14.5211F); + Body.addChild(cube_r1); + setRotationAngle(cube_r1, 1.3963F, 0.0F, 0.0F); + cube_r1.setTextureOffset(0, 111).addBox(-6.0F, -16.0F, -9.0F, 12.0F, 16.0F, 15.0F, 0.0F, false); + LeftUpperWIngouter1 = new ModelRenderer(this); + LeftUpperWIngouter1.setRotationPoint(6.0F, -2.637F, 8.5211F); + Body.addChild(LeftUpperWIngouter1); + setRotationAngle(LeftUpperWIngouter1, 0.0F, 0.0F, -0.6109F); + LeftUpperWIng = new ModelRenderer(this); + LeftUpperWIng.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftUpperWIngouter1.addChild(LeftUpperWIng); + LeftUpperWIng_r1 = new ModelRenderer(this); + LeftUpperWIng_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftUpperWIng.addChild(LeftUpperWIng_r1); + setRotationAngle(LeftUpperWIng_r1, 1.44F, 0.0768F, 0.7941F); + LeftUpperWIng_r1.setTextureOffset(2, 2).addBox(0.0F, -23.8409F, -2.0487F, 0.0F, 63.0F, 46.0F, 0.0F, false); + RightUpperWIngouter1 = new ModelRenderer(this); + RightUpperWIngouter1.setRotationPoint(-6.0F, -2.637F, 8.5211F); + Body.addChild(RightUpperWIngouter1); + setRotationAngle(RightUpperWIngouter1, 0.0F, 0.0F, 0.6109F); + RightUpperWIng = new ModelRenderer(this); + RightUpperWIng.setRotationPoint(0.0F, 0.0F, 0.0F); + RightUpperWIngouter1.addChild(RightUpperWIng); + RightUpperWIng_r1 = new ModelRenderer(this); + RightUpperWIng_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + RightUpperWIng.addChild(RightUpperWIng_r1); + setRotationAngle(RightUpperWIng_r1, 1.44F, -0.0768F, -0.7941F); + RightUpperWIng_r1.setTextureOffset(2, 2).addBox(0.0F, -23.8409F, -2.0487F, 0.0F, 63.0F, 46.0F, 0.0F, true); + LeftLowerWIngouter1 = new ModelRenderer(this); + LeftLowerWIngouter1.setRotationPoint(6.0F, -2.0F, 8.0F); + Body.addChild(LeftLowerWIngouter1); + setRotationAngle(LeftLowerWIngouter1, 0.0F, -0.2618F, -0.7854F); + LeftLowerWing = new ModelRenderer(this); + LeftLowerWing.setRotationPoint(0.05F, -0.037F, 2.7711F); + LeftLowerWIngouter1.addChild(LeftLowerWing); + LeftLowerWing_r1 = new ModelRenderer(this); + LeftLowerWing_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftLowerWing.addChild(LeftLowerWing_r1); + setRotationAngle(LeftLowerWing_r1, 1.4319F, 0.2446F, 0.7479F); + LeftLowerWing_r1.setTextureOffset(97, 3).addBox(0.1134F, -15.1127F, -2.2365F, 0.0F, 59.0F, 46.0F, 0.0F, false); + RightLowerWIngouter1 = new ModelRenderer(this); + RightLowerWIngouter1.setRotationPoint(-6.0F, -2.0F, 8.0F); + Body.addChild(RightLowerWIngouter1); + setRotationAngle(RightLowerWIngouter1, 0.0F, 0.2618F, 0.7854F); + RightLowerWing = new ModelRenderer(this); + RightLowerWing.setRotationPoint(-0.05F, -0.037F, 2.7711F); + RightLowerWIngouter1.addChild(RightLowerWing); + RightLowerWing_r1 = new ModelRenderer(this); + RightLowerWing_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + RightLowerWing.addChild(RightLowerWing_r1); + setRotationAngle(RightLowerWing_r1, 1.4319F, -0.2446F, -0.7479F); + RightLowerWing_r1.setTextureOffset(97, 3).addBox(-0.1134F, -15.1127F, -2.2365F, 0.0F, 59.0F, 46.0F, 0.0F, true); + RightLegs = new ModelRenderer(this); + RightLegs.setRotationPoint(-6.0F, 3.063F, 7.5211F); + Body.addChild(RightLegs); + setRotationAngle(RightLegs, 0.0F, 0.0F, 0.3491F); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, -0.063F, -3.5211F); + RightLegs.addChild(cube_r2); + setRotationAngle(cube_r2, 1.5708F, 0.0873F, -1.0472F); + cube_r2.setTextureOffset(139, 237).addBox(-22.0F, 3.0F, 0.0F, 22.0F, 10.0F, 0.0F, 0.0F, false); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(0.0F, -0.063F, -2.0211F); + RightLegs.addChild(cube_r3); + setRotationAngle(cube_r3, 1.5708F, -0.0873F, -1.0472F); + cube_r3.setTextureOffset(141, 187).addBox(-22.0F, -9.0F, 0.0F, 22.0F, 10.0F, 0.0F, 0.0F, false); + LeftLegs = new ModelRenderer(this); + LeftLegs.setRotationPoint(6.0F, 3.063F, 7.5211F); + Body.addChild(LeftLegs); + setRotationAngle(LeftLegs, 0.0F, 0.0F, -0.3491F); + cube_r4 = new ModelRenderer(this); + cube_r4.setRotationPoint(0.0F, -0.063F, -3.5211F); + LeftLegs.addChild(cube_r4); + setRotationAngle(cube_r4, 1.5708F, -0.0873F, 1.0472F); + cube_r4.setTextureOffset(139, 237).addBox(0.0F, 3.0F, 0.0F, 22.0F, 10.0F, 0.0F, 0.0F, true); + cube_r5 = new ModelRenderer(this); + cube_r5.setRotationPoint(0.0F, -0.063F, -2.0211F); + LeftLegs.addChild(cube_r5); + setRotationAngle(cube_r5, 1.5708F, 0.0873F, 1.0472F); + cube_r5.setTextureOffset(141, 187).addBox(0.0F, -9.0F, 0.0F, 22.0F, 10.0F, 0.0F, 0.0F, true); + RightLegs2 = new ModelRenderer(this); + RightLegs2.setRotationPoint(-6.0F, 3.063F, 5.5211F); + Body.addChild(RightLegs2); + setRotationAngle(RightLegs2, 0.0F, 0.0F, 0.3491F); + cube_r6 = new ModelRenderer(this); + cube_r6.setRotationPoint(0.0F, -0.063F, 0.4789F); + RightLegs2.addChild(cube_r6); + setRotationAngle(cube_r6, 1.4835F, 0.0F, -1.0472F); + cube_r6.setTextureOffset(139, 218).addBox(-22.0F, -4.0F, 0.0F, 22.0F, 10.0F, 0.0F, 0.0F, false); + LeftLegs2 = new ModelRenderer(this); + LeftLegs2.setRotationPoint(6.0F, 3.063F, 5.5211F); + Body.addChild(LeftLegs2); + setRotationAngle(LeftLegs2, 0.0F, 0.0F, -0.3491F); + cube_r7 = new ModelRenderer(this); + cube_r7.setRotationPoint(0.0F, -0.063F, 0.4789F); + LeftLegs2.addChild(cube_r7); + setRotationAngle(cube_r7, 1.4835F, 0.0F, 1.0472F); + cube_r7.setTextureOffset(139, 218).addBox(0.0F, -4.0F, 0.0F, 22.0F, 10.0F, 0.0F, 0.0F, true); + butt = new ModelRenderer(this); + butt.setRotationPoint(0.0F, 5.863F, 13.1711F); + Body.addChild(butt); + setRotationAngle(butt, -0.0436F, 0.0F, 0.0F); + cube_r8 = new ModelRenderer(this); + cube_r8.setRotationPoint(0.0F, -4.5F, 0.25F); + butt.addChild(cube_r8); + setRotationAngle(cube_r8, 1.2654F, 0.0F, 0.0F); + cube_r8.setTextureOffset(54, 135).addBox(-4.0F, 0.2132F, -9.2426F, 8.0F, 21.0F, 10.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Head.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Body.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.antenna.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.RightLegs2.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.Head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.RightLegs.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftLegs.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.LeftLegs2.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.antenna2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.butt.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/GoldFishRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/GoldFishRenderer.java new file mode 100644 index 0000000..c3f1d50 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/GoldFishRenderer.java @@ -0,0 +1,129 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.procedures.TigerFishEntityShakingConditionProcedure; +import studio.halbear.hem.entity.GoldFishEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class GoldFishRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(GoldFishEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new Modelgoldfish(), 0.2f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/goldfish.png"); + } + + @Override + protected boolean func_230495_a_(LivingEntity _ent) { + Entity entity = _ent; + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + return TigerFishEntityShakingConditionProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + }; + }); + } + } + + // Made with Blockbench 4.12.4 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class Modelgoldfish extends EntityModel { + private final ModelRenderer Head; + private final ModelRenderer Body; + private final ModelRenderer LeftFin; + private final ModelRenderer LeftFin_r1; + private final ModelRenderer RightFin; + private final ModelRenderer RightFin_r1; + private final ModelRenderer TailFin2; + private final ModelRenderer TailFin; + + public Modelgoldfish() { + textureWidth = 64; + textureHeight = 64; + Head = new ModelRenderer(this); + Head.setRotationPoint(0.0F, 21.0F, -1.0F); + Body = new ModelRenderer(this); + Body.setRotationPoint(0.0F, 1.0F, 4.0F); + Head.addChild(Body); + Body.setTextureOffset(24, 19).addBox(-1.0F, -2.0F, -6.0F, 2.0F, 4.0F, 6.0F, 0.0F, false); + Body.setTextureOffset(0, 0).addBox(0.0F, -5.0F, -9.0F, 0.0F, 10.0F, 9.0F, 0.0F, false); + LeftFin = new ModelRenderer(this); + LeftFin.setRotationPoint(1.0F, 0.0F, -3.0F); + Body.addChild(LeftFin); + LeftFin_r1 = new ModelRenderer(this); + LeftFin_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + LeftFin.addChild(LeftFin_r1); + setRotationAngle(LeftFin_r1, 0.0F, 0.0F, 0.5236F); + LeftFin_r1.setTextureOffset(0, 19).addBox(0.0F, 0.0F, -3.0F, 6.0F, 0.0F, 6.0F, 0.0F, false); + RightFin = new ModelRenderer(this); + RightFin.setRotationPoint(-1.0F, 0.0F, -3.0F); + Body.addChild(RightFin); + RightFin_r1 = new ModelRenderer(this); + RightFin_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + RightFin.addChild(RightFin_r1); + setRotationAngle(RightFin_r1, 0.0F, 0.0F, -0.5236F); + RightFin_r1.setTextureOffset(0, 19).addBox(-6.0F, 0.0F, -3.0F, 6.0F, 0.0F, 6.0F, 0.0F, true); + TailFin2 = new ModelRenderer(this); + TailFin2.setRotationPoint(0.0F, 0.0F, 0.0F); + Body.addChild(TailFin2); + TailFin = new ModelRenderer(this); + TailFin.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin2.addChild(TailFin); + TailFin.setTextureOffset(18, 0).addBox(0.0F, -5.0F, 0.0F, 0.0F, 10.0F, 9.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Head.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.TailFin.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.LeftFin.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.TailFin2.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.Body.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.RightFin.rotateAngleZ = MathHelper.cos(f * 0.6662F) * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/HotAirBalloonRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/HotAirBalloonRenderer.java new file mode 100644 index 0000000..7f0175f --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/HotAirBalloonRenderer.java @@ -0,0 +1,1114 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.HotAirBalloonEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class HotAirBalloonRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(HotAirBalloonEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelHotAirBalloon(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/hotairballoon.png"); + } + }; + }); + } + } + + // Made with Blockbench 5.0.3 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelHotAirBalloon extends EntityModel { + private final ModelRenderer Balloonstrip; + private final ModelRenderer cube_r1; + private final ModelRenderer cube_r2; + private final ModelRenderer bone8; + private final ModelRenderer cube_r3; + private final ModelRenderer cube_r4; + private final ModelRenderer bone16; + private final ModelRenderer cube_r5; + private final ModelRenderer cube_r6; + private final ModelRenderer bone18; + private final ModelRenderer cube_r7; + private final ModelRenderer cube_r8; + private final ModelRenderer cube_r9; + private final ModelRenderer cube_r10; + private final ModelRenderer cube_r11; + private final ModelRenderer Balloonstrip11; + private final ModelRenderer cube_r12; + private final ModelRenderer cube_r13; + private final ModelRenderer bone45; + private final ModelRenderer cube_r14; + private final ModelRenderer cube_r15; + private final ModelRenderer bone46; + private final ModelRenderer cube_r16; + private final ModelRenderer cube_r17; + private final ModelRenderer bone47; + private final ModelRenderer cube_r18; + private final ModelRenderer cube_r19; + private final ModelRenderer cube_r20; + private final ModelRenderer cube_r21; + private final ModelRenderer cube_r22; + private final ModelRenderer Balloonstrip12; + private final ModelRenderer cube_r23; + private final ModelRenderer cube_r24; + private final ModelRenderer bone48; + private final ModelRenderer cube_r25; + private final ModelRenderer cube_r26; + private final ModelRenderer bone49; + private final ModelRenderer cube_r27; + private final ModelRenderer cube_r28; + private final ModelRenderer bone50; + private final ModelRenderer cube_r29; + private final ModelRenderer cube_r30; + private final ModelRenderer cube_r31; + private final ModelRenderer cube_r32; + private final ModelRenderer cube_r33; + private final ModelRenderer Balloonstrip10; + private final ModelRenderer cube_r34; + private final ModelRenderer cube_r35; + private final ModelRenderer bone42; + private final ModelRenderer cube_r36; + private final ModelRenderer cube_r37; + private final ModelRenderer bone43; + private final ModelRenderer cube_r38; + private final ModelRenderer cube_r39; + private final ModelRenderer bone44; + private final ModelRenderer cube_r40; + private final ModelRenderer cube_r41; + private final ModelRenderer cube_r42; + private final ModelRenderer cube_r43; + private final ModelRenderer cube_r44; + private final ModelRenderer Balloonstrip2; + private final ModelRenderer cube_r45; + private final ModelRenderer cube_r46; + private final ModelRenderer bone2; + private final ModelRenderer cube_r47; + private final ModelRenderer cube_r48; + private final ModelRenderer bone27; + private final ModelRenderer cube_r49; + private final ModelRenderer cube_r50; + private final ModelRenderer bone28; + private final ModelRenderer cube_r51; + private final ModelRenderer cube_r52; + private final ModelRenderer cube_r53; + private final ModelRenderer cube_r54; + private final ModelRenderer cube_r55; + private final ModelRenderer Balloonstrip9; + private final ModelRenderer cube_r56; + private final ModelRenderer cube_r57; + private final ModelRenderer bone39; + private final ModelRenderer cube_r58; + private final ModelRenderer cube_r59; + private final ModelRenderer bone40; + private final ModelRenderer cube_r60; + private final ModelRenderer cube_r61; + private final ModelRenderer bone41; + private final ModelRenderer cube_r62; + private final ModelRenderer cube_r63; + private final ModelRenderer cube_r64; + private final ModelRenderer cube_r65; + private final ModelRenderer cube_r66; + private final ModelRenderer Balloonstrip7; + private final ModelRenderer cube_r67; + private final ModelRenderer cube_r68; + private final ModelRenderer bone30; + private final ModelRenderer cube_r69; + private final ModelRenderer cube_r70; + private final ModelRenderer bone31; + private final ModelRenderer cube_r71; + private final ModelRenderer cube_r72; + private final ModelRenderer bone35; + private final ModelRenderer cube_r73; + private final ModelRenderer cube_r74; + private final ModelRenderer cube_r75; + private final ModelRenderer cube_r76; + private final ModelRenderer cube_r77; + private final ModelRenderer Balloonstrip8; + private final ModelRenderer cube_r78; + private final ModelRenderer cube_r79; + private final ModelRenderer bone36; + private final ModelRenderer cube_r80; + private final ModelRenderer cube_r81; + private final ModelRenderer bone37; + private final ModelRenderer cube_r82; + private final ModelRenderer cube_r83; + private final ModelRenderer bone38; + private final ModelRenderer cube_r84; + private final ModelRenderer cube_r85; + private final ModelRenderer cube_r86; + private final ModelRenderer cube_r87; + private final ModelRenderer cube_r88; + private final ModelRenderer Engine; + private final ModelRenderer bone34; + private final ModelRenderer cube_r89; + private final ModelRenderer bone32; + private final ModelRenderer cube_r90; + private final ModelRenderer cube_r91; + private final ModelRenderer bone33; + private final ModelRenderer cube_r92; + private final ModelRenderer cube_r93; + private final ModelRenderer bone60; + private final ModelRenderer cube_r94; + private final ModelRenderer bone61; + private final ModelRenderer cube_r95; + private final ModelRenderer cube_r96; + private final ModelRenderer bone62; + private final ModelRenderer cube_r97; + private final ModelRenderer cube_r98; + private final ModelRenderer bone; + private final ModelRenderer cube_r99; + private final ModelRenderer cube_r100; + private final ModelRenderer cube_r101; + private final ModelRenderer bone29; + private final ModelRenderer cube_r102; + private final ModelRenderer cube_r103; + private final ModelRenderer bone25; + private final ModelRenderer cube_r104; + private final ModelRenderer cube_r105; + private final ModelRenderer bone51; + private final ModelRenderer cube_r106; + private final ModelRenderer cube_r107; + private final ModelRenderer cube_r108; + private final ModelRenderer bone52; + private final ModelRenderer cube_r109; + private final ModelRenderer cube_r110; + private final ModelRenderer bone53; + private final ModelRenderer cube_r111; + private final ModelRenderer cube_r112; + private final ModelRenderer bone54; + private final ModelRenderer cube_r113; + private final ModelRenderer cube_r114; + private final ModelRenderer cube_r115; + private final ModelRenderer bone55; + private final ModelRenderer cube_r116; + private final ModelRenderer cube_r117; + private final ModelRenderer bone56; + private final ModelRenderer cube_r118; + private final ModelRenderer cube_r119; + private final ModelRenderer bone57; + private final ModelRenderer cube_r120; + private final ModelRenderer cube_r121; + private final ModelRenderer cube_r122; + private final ModelRenderer bone58; + private final ModelRenderer cube_r123; + private final ModelRenderer cube_r124; + private final ModelRenderer bone59; + private final ModelRenderer cube_r125; + private final ModelRenderer cube_r126; + private final ModelRenderer bone26; + private final ModelRenderer cube_r127; + private final ModelRenderer cube_r128; + private final ModelRenderer bb_main; + + public ModelHotAirBalloon() { + textureWidth = 256; + textureHeight = 256; + Balloonstrip = new ModelRenderer(this); + Balloonstrip.setRotationPoint(0.0F, -91.4305F, 0.0F); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, 0.7854F, 0.0F); + cube_r1.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r1.setTextureOffset(143, 95).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0F, -0.7854F, 0.0F); + cube_r2.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone8 = new ModelRenderer(this); + bone8.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip.addChild(bone8); + setRotationAngle(bone8, 0.0F, 0.7854F, 0.0F); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone8.addChild(cube_r3); + setRotationAngle(cube_r3, -1.5708F, -1.1345F, 1.5708F); + cube_r3.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r4 = new ModelRenderer(this); + cube_r4.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone8.addChild(cube_r4); + setRotationAngle(cube_r4, -1.5708F, -0.5236F, 1.5708F); + cube_r4.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone16 = new ModelRenderer(this); + bone16.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip.addChild(bone16); + setRotationAngle(bone16, 0.0F, 0.7854F, 0.0F); + cube_r5 = new ModelRenderer(this); + cube_r5.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone16.addChild(cube_r5); + setRotationAngle(cube_r5, 1.5708F, -1.2217F, -1.5708F); + cube_r5.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r6 = new ModelRenderer(this); + cube_r6.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone16.addChild(cube_r6); + setRotationAngle(cube_r6, 1.5708F, -0.8727F, -1.5708F); + cube_r6.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone18 = new ModelRenderer(this); + bone18.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip.addChild(bone18); + setRotationAngle(bone18, 0.0F, 0.7854F, 0.0F); + cube_r7 = new ModelRenderer(this); + cube_r7.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone18.addChild(cube_r7); + setRotationAngle(cube_r7, 0.7148F, 0.4053F, 0.0127F); + cube_r7.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r8 = new ModelRenderer(this); + cube_r8.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone18.addChild(cube_r8); + setRotationAngle(cube_r8, 0.3622F, 0.4084F, 0.0038F); + cube_r8.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r9 = new ModelRenderer(this); + cube_r9.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone18.addChild(cube_r9); + setRotationAngle(cube_r9, 0.0F, 0.4084F, 0.0038F); + cube_r9.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r10 = new ModelRenderer(this); + cube_r10.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone18.addChild(cube_r10); + setRotationAngle(cube_r10, -0.48F, 0.4084F, 0.0038F); + cube_r10.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r11 = new ModelRenderer(this); + cube_r11.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone18.addChild(cube_r11); + setRotationAngle(cube_r11, -1.0997F, 0.3705F, -0.0196F); + cube_r11.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip11 = new ModelRenderer(this); + Balloonstrip11.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip11, 0.0F, 1.5708F, 0.0F); + cube_r12 = new ModelRenderer(this); + cube_r12.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip11.addChild(cube_r12); + setRotationAngle(cube_r12, 0.0F, 0.7854F, 0.0F); + cube_r12.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r12.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r13 = new ModelRenderer(this); + cube_r13.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip11.addChild(cube_r13); + setRotationAngle(cube_r13, 0.0F, -0.7854F, 0.0F); + cube_r13.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone45 = new ModelRenderer(this); + bone45.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip11.addChild(bone45); + setRotationAngle(bone45, 0.0F, 0.7854F, 0.0F); + cube_r14 = new ModelRenderer(this); + cube_r14.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone45.addChild(cube_r14); + setRotationAngle(cube_r14, -1.5708F, -1.1345F, 1.5708F); + cube_r14.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r15 = new ModelRenderer(this); + cube_r15.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone45.addChild(cube_r15); + setRotationAngle(cube_r15, -1.5708F, -0.5236F, 1.5708F); + cube_r15.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone46 = new ModelRenderer(this); + bone46.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip11.addChild(bone46); + setRotationAngle(bone46, 0.0F, 0.7854F, 0.0F); + cube_r16 = new ModelRenderer(this); + cube_r16.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone46.addChild(cube_r16); + setRotationAngle(cube_r16, 1.5708F, -1.2217F, -1.5708F); + cube_r16.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r17 = new ModelRenderer(this); + cube_r17.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone46.addChild(cube_r17); + setRotationAngle(cube_r17, 1.5708F, -0.8727F, -1.5708F); + cube_r17.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone47 = new ModelRenderer(this); + bone47.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip11.addChild(bone47); + setRotationAngle(bone47, 0.0F, 0.7854F, 0.0F); + cube_r18 = new ModelRenderer(this); + cube_r18.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone47.addChild(cube_r18); + setRotationAngle(cube_r18, 0.7148F, 0.4053F, 0.0127F); + cube_r18.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r19 = new ModelRenderer(this); + cube_r19.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone47.addChild(cube_r19); + setRotationAngle(cube_r19, 0.3622F, 0.4084F, 0.0038F); + cube_r19.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r20 = new ModelRenderer(this); + cube_r20.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone47.addChild(cube_r20); + setRotationAngle(cube_r20, 0.0F, 0.4084F, 0.0038F); + cube_r20.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r21 = new ModelRenderer(this); + cube_r21.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone47.addChild(cube_r21); + setRotationAngle(cube_r21, -0.48F, 0.4084F, 0.0038F); + cube_r21.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r22 = new ModelRenderer(this); + cube_r22.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone47.addChild(cube_r22); + setRotationAngle(cube_r22, -1.0997F, 0.3705F, -0.0196F); + cube_r22.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip12 = new ModelRenderer(this); + Balloonstrip12.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip12, 0.0F, 0.7854F, 0.0F); + cube_r23 = new ModelRenderer(this); + cube_r23.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip12.addChild(cube_r23); + setRotationAngle(cube_r23, 0.0F, 0.7854F, 0.0F); + cube_r23.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r23.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r24 = new ModelRenderer(this); + cube_r24.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip12.addChild(cube_r24); + setRotationAngle(cube_r24, 0.0F, -0.7854F, 0.0F); + cube_r24.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone48 = new ModelRenderer(this); + bone48.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip12.addChild(bone48); + setRotationAngle(bone48, 0.0F, 0.7854F, 0.0F); + cube_r25 = new ModelRenderer(this); + cube_r25.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone48.addChild(cube_r25); + setRotationAngle(cube_r25, -1.5708F, -1.1345F, 1.5708F); + cube_r25.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r26 = new ModelRenderer(this); + cube_r26.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone48.addChild(cube_r26); + setRotationAngle(cube_r26, -1.5708F, -0.5236F, 1.5708F); + cube_r26.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone49 = new ModelRenderer(this); + bone49.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip12.addChild(bone49); + setRotationAngle(bone49, 0.0F, 0.7854F, 0.0F); + cube_r27 = new ModelRenderer(this); + cube_r27.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone49.addChild(cube_r27); + setRotationAngle(cube_r27, 1.5708F, -1.2217F, -1.5708F); + cube_r27.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r28 = new ModelRenderer(this); + cube_r28.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone49.addChild(cube_r28); + setRotationAngle(cube_r28, 1.5708F, -0.8727F, -1.5708F); + cube_r28.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone50 = new ModelRenderer(this); + bone50.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip12.addChild(bone50); + setRotationAngle(bone50, 0.0F, 0.7854F, 0.0F); + cube_r29 = new ModelRenderer(this); + cube_r29.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone50.addChild(cube_r29); + setRotationAngle(cube_r29, 0.7148F, 0.4053F, 0.0127F); + cube_r29.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r30 = new ModelRenderer(this); + cube_r30.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone50.addChild(cube_r30); + setRotationAngle(cube_r30, 0.3622F, 0.4084F, 0.0038F); + cube_r30.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r31 = new ModelRenderer(this); + cube_r31.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone50.addChild(cube_r31); + setRotationAngle(cube_r31, 0.0F, 0.4084F, 0.0038F); + cube_r31.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r32 = new ModelRenderer(this); + cube_r32.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone50.addChild(cube_r32); + setRotationAngle(cube_r32, -0.48F, 0.4084F, 0.0038F); + cube_r32.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r33 = new ModelRenderer(this); + cube_r33.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone50.addChild(cube_r33); + setRotationAngle(cube_r33, -1.0997F, 0.3705F, -0.0196F); + cube_r33.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip10 = new ModelRenderer(this); + Balloonstrip10.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip10, 0.0F, -2.3562F, 0.0F); + cube_r34 = new ModelRenderer(this); + cube_r34.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip10.addChild(cube_r34); + setRotationAngle(cube_r34, 0.0F, 0.7854F, 0.0F); + cube_r34.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r34.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r35 = new ModelRenderer(this); + cube_r35.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip10.addChild(cube_r35); + setRotationAngle(cube_r35, 0.0F, -0.7854F, 0.0F); + cube_r35.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone42 = new ModelRenderer(this); + bone42.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip10.addChild(bone42); + setRotationAngle(bone42, 0.0F, 0.7854F, 0.0F); + cube_r36 = new ModelRenderer(this); + cube_r36.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone42.addChild(cube_r36); + setRotationAngle(cube_r36, -1.5708F, -1.1345F, 1.5708F); + cube_r36.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r37 = new ModelRenderer(this); + cube_r37.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone42.addChild(cube_r37); + setRotationAngle(cube_r37, -1.5708F, -0.5236F, 1.5708F); + cube_r37.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone43 = new ModelRenderer(this); + bone43.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip10.addChild(bone43); + setRotationAngle(bone43, 0.0F, 0.7854F, 0.0F); + cube_r38 = new ModelRenderer(this); + cube_r38.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone43.addChild(cube_r38); + setRotationAngle(cube_r38, 1.5708F, -1.2217F, -1.5708F); + cube_r38.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r39 = new ModelRenderer(this); + cube_r39.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone43.addChild(cube_r39); + setRotationAngle(cube_r39, 1.5708F, -0.8727F, -1.5708F); + cube_r39.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone44 = new ModelRenderer(this); + bone44.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip10.addChild(bone44); + setRotationAngle(bone44, 0.0F, 0.7854F, 0.0F); + cube_r40 = new ModelRenderer(this); + cube_r40.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone44.addChild(cube_r40); + setRotationAngle(cube_r40, 0.7148F, 0.4053F, 0.0127F); + cube_r40.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r41 = new ModelRenderer(this); + cube_r41.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone44.addChild(cube_r41); + setRotationAngle(cube_r41, 0.3622F, 0.4084F, 0.0038F); + cube_r41.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r42 = new ModelRenderer(this); + cube_r42.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone44.addChild(cube_r42); + setRotationAngle(cube_r42, 0.0F, 0.4084F, 0.0038F); + cube_r42.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r43 = new ModelRenderer(this); + cube_r43.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone44.addChild(cube_r43); + setRotationAngle(cube_r43, -0.48F, 0.4084F, 0.0038F); + cube_r43.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r44 = new ModelRenderer(this); + cube_r44.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone44.addChild(cube_r44); + setRotationAngle(cube_r44, -1.0997F, 0.3705F, -0.0196F); + cube_r44.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip2 = new ModelRenderer(this); + Balloonstrip2.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip2, 0.0F, -0.7854F, 0.0F); + cube_r45 = new ModelRenderer(this); + cube_r45.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip2.addChild(cube_r45); + setRotationAngle(cube_r45, 0.0F, 0.7854F, 0.0F); + cube_r45.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r45.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r46 = new ModelRenderer(this); + cube_r46.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip2.addChild(cube_r46); + setRotationAngle(cube_r46, 0.0F, -0.7854F, 0.0F); + cube_r46.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone2 = new ModelRenderer(this); + bone2.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip2.addChild(bone2); + setRotationAngle(bone2, 0.0F, 0.7854F, 0.0F); + cube_r47 = new ModelRenderer(this); + cube_r47.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone2.addChild(cube_r47); + setRotationAngle(cube_r47, -1.5708F, -1.1345F, 1.5708F); + cube_r47.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r48 = new ModelRenderer(this); + cube_r48.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone2.addChild(cube_r48); + setRotationAngle(cube_r48, -1.5708F, -0.5236F, 1.5708F); + cube_r48.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone27 = new ModelRenderer(this); + bone27.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip2.addChild(bone27); + setRotationAngle(bone27, 0.0F, 0.7854F, 0.0F); + cube_r49 = new ModelRenderer(this); + cube_r49.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone27.addChild(cube_r49); + setRotationAngle(cube_r49, 1.5708F, -1.2217F, -1.5708F); + cube_r49.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r50 = new ModelRenderer(this); + cube_r50.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone27.addChild(cube_r50); + setRotationAngle(cube_r50, 1.5708F, -0.8727F, -1.5708F); + cube_r50.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone28 = new ModelRenderer(this); + bone28.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip2.addChild(bone28); + setRotationAngle(bone28, 0.0F, 0.7854F, 0.0F); + cube_r51 = new ModelRenderer(this); + cube_r51.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone28.addChild(cube_r51); + setRotationAngle(cube_r51, 0.7148F, 0.4053F, 0.0127F); + cube_r51.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r52 = new ModelRenderer(this); + cube_r52.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone28.addChild(cube_r52); + setRotationAngle(cube_r52, 0.3622F, 0.4084F, 0.0038F); + cube_r52.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r53 = new ModelRenderer(this); + cube_r53.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone28.addChild(cube_r53); + setRotationAngle(cube_r53, 0.0F, 0.4084F, 0.0038F); + cube_r53.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r54 = new ModelRenderer(this); + cube_r54.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone28.addChild(cube_r54); + setRotationAngle(cube_r54, -0.48F, 0.4084F, 0.0038F); + cube_r54.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r55 = new ModelRenderer(this); + cube_r55.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone28.addChild(cube_r55); + setRotationAngle(cube_r55, -1.0997F, 0.3705F, -0.0196F); + cube_r55.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip9 = new ModelRenderer(this); + Balloonstrip9.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip9, 0.0F, 3.1416F, 0.0F); + cube_r56 = new ModelRenderer(this); + cube_r56.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip9.addChild(cube_r56); + setRotationAngle(cube_r56, 0.0F, 0.7854F, 0.0F); + cube_r56.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r56.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r57 = new ModelRenderer(this); + cube_r57.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip9.addChild(cube_r57); + setRotationAngle(cube_r57, 0.0F, -0.7854F, 0.0F); + cube_r57.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone39 = new ModelRenderer(this); + bone39.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip9.addChild(bone39); + setRotationAngle(bone39, 0.0F, 0.7854F, 0.0F); + cube_r58 = new ModelRenderer(this); + cube_r58.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone39.addChild(cube_r58); + setRotationAngle(cube_r58, -1.5708F, -1.1345F, 1.5708F); + cube_r58.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r59 = new ModelRenderer(this); + cube_r59.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone39.addChild(cube_r59); + setRotationAngle(cube_r59, -1.5708F, -0.5236F, 1.5708F); + cube_r59.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone40 = new ModelRenderer(this); + bone40.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip9.addChild(bone40); + setRotationAngle(bone40, 0.0F, 0.7854F, 0.0F); + cube_r60 = new ModelRenderer(this); + cube_r60.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone40.addChild(cube_r60); + setRotationAngle(cube_r60, 1.5708F, -1.2217F, -1.5708F); + cube_r60.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r61 = new ModelRenderer(this); + cube_r61.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone40.addChild(cube_r61); + setRotationAngle(cube_r61, 1.5708F, -0.8727F, -1.5708F); + cube_r61.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone41 = new ModelRenderer(this); + bone41.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip9.addChild(bone41); + setRotationAngle(bone41, 0.0F, 0.7854F, 0.0F); + cube_r62 = new ModelRenderer(this); + cube_r62.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone41.addChild(cube_r62); + setRotationAngle(cube_r62, 0.7148F, 0.4053F, 0.0127F); + cube_r62.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r63 = new ModelRenderer(this); + cube_r63.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone41.addChild(cube_r63); + setRotationAngle(cube_r63, 0.3622F, 0.4084F, 0.0038F); + cube_r63.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r64 = new ModelRenderer(this); + cube_r64.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone41.addChild(cube_r64); + setRotationAngle(cube_r64, 0.0F, 0.4084F, 0.0038F); + cube_r64.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r65 = new ModelRenderer(this); + cube_r65.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone41.addChild(cube_r65); + setRotationAngle(cube_r65, -0.48F, 0.4084F, 0.0038F); + cube_r65.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r66 = new ModelRenderer(this); + cube_r66.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone41.addChild(cube_r66); + setRotationAngle(cube_r66, -1.0997F, 0.3705F, -0.0196F); + cube_r66.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip7 = new ModelRenderer(this); + Balloonstrip7.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip7, 0.0F, -1.5708F, 0.0F); + cube_r67 = new ModelRenderer(this); + cube_r67.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip7.addChild(cube_r67); + setRotationAngle(cube_r67, 0.0F, 0.7854F, 0.0F); + cube_r67.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r67.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r68 = new ModelRenderer(this); + cube_r68.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip7.addChild(cube_r68); + setRotationAngle(cube_r68, 0.0F, -0.7854F, 0.0F); + cube_r68.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone30 = new ModelRenderer(this); + bone30.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip7.addChild(bone30); + setRotationAngle(bone30, 0.0F, 0.7854F, 0.0F); + cube_r69 = new ModelRenderer(this); + cube_r69.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone30.addChild(cube_r69); + setRotationAngle(cube_r69, -1.5708F, -1.1345F, 1.5708F); + cube_r69.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r70 = new ModelRenderer(this); + cube_r70.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone30.addChild(cube_r70); + setRotationAngle(cube_r70, -1.5708F, -0.5236F, 1.5708F); + cube_r70.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone31 = new ModelRenderer(this); + bone31.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip7.addChild(bone31); + setRotationAngle(bone31, 0.0F, 0.7854F, 0.0F); + cube_r71 = new ModelRenderer(this); + cube_r71.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone31.addChild(cube_r71); + setRotationAngle(cube_r71, 1.5708F, -1.2217F, -1.5708F); + cube_r71.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r72 = new ModelRenderer(this); + cube_r72.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone31.addChild(cube_r72); + setRotationAngle(cube_r72, 1.5708F, -0.8727F, -1.5708F); + cube_r72.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone35 = new ModelRenderer(this); + bone35.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip7.addChild(bone35); + setRotationAngle(bone35, 0.0F, 0.7854F, 0.0F); + cube_r73 = new ModelRenderer(this); + cube_r73.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone35.addChild(cube_r73); + setRotationAngle(cube_r73, 0.7148F, 0.4053F, 0.0127F); + cube_r73.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r74 = new ModelRenderer(this); + cube_r74.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone35.addChild(cube_r74); + setRotationAngle(cube_r74, 0.3622F, 0.4084F, 0.0038F); + cube_r74.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r75 = new ModelRenderer(this); + cube_r75.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone35.addChild(cube_r75); + setRotationAngle(cube_r75, 0.0F, 0.4084F, 0.0038F); + cube_r75.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r76 = new ModelRenderer(this); + cube_r76.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone35.addChild(cube_r76); + setRotationAngle(cube_r76, -0.48F, 0.4084F, 0.0038F); + cube_r76.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r77 = new ModelRenderer(this); + cube_r77.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone35.addChild(cube_r77); + setRotationAngle(cube_r77, -1.0997F, 0.3705F, -0.0196F); + cube_r77.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Balloonstrip8 = new ModelRenderer(this); + Balloonstrip8.setRotationPoint(0.0F, -91.4305F, 0.0F); + setRotationAngle(Balloonstrip8, 0.0F, 2.3562F, 0.0F); + cube_r78 = new ModelRenderer(this); + cube_r78.setRotationPoint(0.0F, -0.5695F, 0.0F); + Balloonstrip8.addChild(cube_r78); + setRotationAngle(cube_r78, 0.0F, 0.7854F, 0.0F); + cube_r78.setTextureOffset(143, 98).addBox(-3.5F, -9.0F, -8.5F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r78.setTextureOffset(80, 129).addBox(-3.5F, 65.0F, -9.0F, 7.0F, 1.0F, 1.0F, 0.0F, false); + cube_r79 = new ModelRenderer(this); + cube_r79.setRotationPoint(0.0F, 32.4305F, 0.0F); + Balloonstrip8.addChild(cube_r79); + setRotationAngle(cube_r79, 0.0F, -0.7854F, 0.0F); + cube_r79.setTextureOffset(53, 65).addBox(-26.75F, -19.0F, -11.0F, 0.0F, 20.0F, 22.0F, 0.0F, false); + bone36 = new ModelRenderer(this); + bone36.setRotationPoint(0.0F, 0.0F, 0.0F); + Balloonstrip8.addChild(bone36); + setRotationAngle(bone36, 0.0F, 0.7854F, 0.0F); + cube_r80 = new ModelRenderer(this); + cube_r80.setRotationPoint(0.0F, 13.4305F, -27.0F); + bone36.addChild(cube_r80); + setRotationAngle(cube_r80, -1.5708F, -1.1345F, 1.5708F); + cube_r80.setTextureOffset(98, 65).addBox(0.25F, -18.0F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r81 = new ModelRenderer(this); + cube_r81.setRotationPoint(0.0F, -2.757F, -19.1661F); + bone36.addChild(cube_r81); + setRotationAngle(cube_r81, -1.5708F, -0.5236F, 1.5708F); + cube_r81.setTextureOffset(0, 131).addBox(-0.0087F, -13.0183F, -8.0F, 0.0F, 13.0F, 16.0F, 0.0F, false); + bone37 = new ModelRenderer(this); + bone37.setRotationPoint(0.0F, 56.2431F, 0.0F); + Balloonstrip8.addChild(bone37); + setRotationAngle(bone37, 0.0F, 0.7854F, 0.0F); + cube_r82 = new ModelRenderer(this); + cube_r82.setRotationPoint(0.0F, -16.8126F, -27.0F); + bone37.addChild(cube_r82); + setRotationAngle(cube_r82, 1.5708F, -1.2217F, -1.5708F); + cube_r82.setTextureOffset(0, 66).addBox(2.3021F, -5.6382F, -11.0F, 0.0F, 18.0F, 22.0F, 0.0F, false); + cube_r83 = new ModelRenderer(this); + cube_r83.setRotationPoint(0.0F, 0.0F, -20.6161F); + bone37.addChild(cube_r83); + setRotationAngle(cube_r83, 1.5708F, -0.8727F, -1.5708F); + cube_r83.setTextureOffset(47, 108).addBox(3.848F, -4.5779F, -8.0F, 0.0F, 19.0F, 16.0F, 0.0F, false); + bone38 = new ModelRenderer(this); + bone38.setRotationPoint(0.0F, 1.9065F, 0.0F); + Balloonstrip8.addChild(bone38); + setRotationAngle(bone38, 0.0F, 0.7854F, 0.0F); + cube_r84 = new ModelRenderer(this); + cube_r84.setRotationPoint(-3.5F, 68.0241F, -8.5F); + bone38.addChild(cube_r84); + setRotationAngle(cube_r84, 0.7148F, 0.4053F, 0.0127F); + cube_r84.setTextureOffset(45, 66).addBox(-0.5584F, -24.2922F, 2.7582F, 1.0F, 21.0F, 1.0F, 0.0F, false); + cube_r85 = new ModelRenderer(this); + cube_r85.setRotationPoint(-8.7131F, 52.8042F, -21.201F); + bone38.addChild(cube_r85); + setRotationAngle(cube_r85, 0.3622F, 0.4084F, 0.0038F); + cube_r85.setTextureOffset(33, 131).addBox(-0.5577F, -22.6869F, 1.7572F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r86 = new ModelRenderer(this); + cube_r86.setRotationPoint(-11.1221F, 35.9524F, -27.0955F); + bone38.addChild(cube_r86); + setRotationAngle(cube_r86, 0.0F, 0.4084F, 0.0038F); + cube_r86.setTextureOffset(89, 0).addBox(-0.6286F, -24.9941F, -0.0064F, 1.0F, 20.0F, 1.0F, 0.0F, false); + cube_r87 = new ModelRenderer(this); + cube_r87.setRotationPoint(-11.1221F, 15.9524F, -27.0955F); + bone38.addChild(cube_r87); + setRotationAngle(cube_r87, -0.48F, 0.4084F, 0.0038F); + cube_r87.setTextureOffset(94, 0).addBox(-0.6286F, -22.4256F, -2.3143F, 1.0F, 18.0F, 1.0F, 0.0F, false); + cube_r88 = new ModelRenderer(this); + cube_r88.setRotationPoint(-7.7729F, 0.0F, -19.4636F); + bone38.addChild(cube_r88); + setRotationAngle(cube_r88, -1.0997F, 0.3705F, -0.0196F); + cube_r88.setTextureOffset(143, 64).addBox(-0.5062F, -16.2961F, -4.4365F, 1.0F, 14.0F, 1.0F, 0.0F, false); + Engine = new ModelRenderer(this); + Engine.setRotationPoint(0.0F, -6.0F, 0.0F); + Engine.setTextureOffset(38, 131).addBox(-2.0F, -3.0F, -2.0F, 0.0F, 8.0F, 4.0F, 0.0F, false); + Engine.setTextureOffset(80, 108).addBox(-2.0F, -16.75F, -2.0F, 4.0F, 4.0F, 4.0F, 0.0F, false); + Engine.setTextureOffset(80, 133).addBox(-3.0F, -13.0F, -3.0F, 6.0F, 10.0F, 6.0F, 0.0F, false); + bone34 = new ModelRenderer(this); + bone34.setRotationPoint(0.0667F, 17.5F, 0.0F); + setRotationAngle(bone34, 0.0F, 1.5708F, 0.0F); + cube_r89 = new ModelRenderer(this); + cube_r89.setRotationPoint(0.3333F, 5.5F, 0.0F); + bone34.addChild(cube_r89); + setRotationAngle(cube_r89, 0.0F, 1.5708F, 0.0F); + cube_r89.setTextureOffset(0, 24).addBox(13.0F, -15.0F, -13.0F, 0.0F, 15.0F, 26.0F, 0.0F, false); + bone32 = new ModelRenderer(this); + bone32.setRotationPoint(-3.1667F, 0.5F, -15.5F); + bone34.addChild(bone32); + setRotationAngle(bone32, -0.4305F, 0.0735F, 0.1585F); + cube_r90 = new ModelRenderer(this); + cube_r90.setRotationPoint(0.0F, -6.0F, 0.0F); + bone32.addChild(cube_r90); + setRotationAngle(cube_r90, 0.0F, 1.5708F, 0.0F); + cube_r90.setTextureOffset(143, 101).addBox(-1.5F, 2.0F, -1.5F, 3.0F, 1.0F, 3.0F, 0.0F, false); + cube_r90.setTextureOffset(105, 133).addBox(-2.5F, 3.0F, -2.5F, 5.0F, 5.0F, 5.0F, 0.0F, false); + cube_r91 = new ModelRenderer(this); + cube_r91.setRotationPoint(-0.5F, -7.0F, -0.5F); + bone32.addChild(cube_r91); + setRotationAngle(cube_r91, 0.0F, 1.5708F, 0.0F); + cube_r91.setTextureOffset(80, 117).addBox(-2.5F, 2.0F, -1.5F, 4.0F, 1.0F, 4.0F, 0.0F, false); + bone33 = new ModelRenderer(this); + bone33.setRotationPoint(2.8333F, 1.5F, -15.5F); + bone34.addChild(bone33); + setRotationAngle(bone33, -0.4185F, -0.1274F, -0.2783F); + cube_r92 = new ModelRenderer(this); + cube_r92.setRotationPoint(0.0F, -6.0F, 0.0F); + bone33.addChild(cube_r92); + setRotationAngle(cube_r92, 0.0F, 1.5708F, 0.0F); + cube_r92.setTextureOffset(43, 144).addBox(-1.5F, 2.0F, -1.5F, 3.0F, 1.0F, 3.0F, 0.0F, false); + cube_r92.setTextureOffset(126, 133).addBox(-2.5F, 3.0F, -2.5F, 5.0F, 5.0F, 5.0F, 0.0F, false); + cube_r93 = new ModelRenderer(this); + cube_r93.setRotationPoint(-0.5F, -7.0F, -0.5F); + bone33.addChild(cube_r93); + setRotationAngle(cube_r93, 0.0F, 1.5708F, 0.0F); + cube_r93.setTextureOffset(80, 123).addBox(-2.5F, 2.0F, -1.5F, 4.0F, 1.0F, 4.0F, 0.0F, false); + bone60 = new ModelRenderer(this); + bone60.setRotationPoint(-0.0667F, 17.5F, 0.0F); + setRotationAngle(bone60, 0.0F, -1.5708F, 0.0F); + cube_r94 = new ModelRenderer(this); + cube_r94.setRotationPoint(-0.3333F, 5.5F, 0.0F); + bone60.addChild(cube_r94); + setRotationAngle(cube_r94, 0.0F, -1.5708F, 0.0F); + cube_r94.setTextureOffset(0, 24).addBox(-13.0F, -15.0F, -13.0F, 0.0F, 15.0F, 26.0F, 0.0F, true); + bone61 = new ModelRenderer(this); + bone61.setRotationPoint(3.1667F, 0.5F, -15.5F); + bone60.addChild(bone61); + setRotationAngle(bone61, -0.4305F, -0.0735F, -0.1585F); + cube_r95 = new ModelRenderer(this); + cube_r95.setRotationPoint(0.0F, -6.0F, 0.0F); + bone61.addChild(cube_r95); + setRotationAngle(cube_r95, 0.0F, -1.5708F, 0.0F); + cube_r95.setTextureOffset(143, 101).addBox(-1.5F, 2.0F, -1.5F, 3.0F, 1.0F, 3.0F, 0.0F, true); + cube_r95.setTextureOffset(105, 133).addBox(-2.5F, 3.0F, -2.5F, 5.0F, 5.0F, 5.0F, 0.0F, true); + cube_r96 = new ModelRenderer(this); + cube_r96.setRotationPoint(0.5F, -7.0F, -0.5F); + bone61.addChild(cube_r96); + setRotationAngle(cube_r96, 0.0F, -1.5708F, 0.0F); + cube_r96.setTextureOffset(80, 117).addBox(-1.5F, 2.0F, -1.5F, 4.0F, 1.0F, 4.0F, 0.0F, true); + bone62 = new ModelRenderer(this); + bone62.setRotationPoint(-2.8333F, 1.5F, -15.5F); + bone60.addChild(bone62); + setRotationAngle(bone62, -0.4185F, 0.1274F, 0.2783F); + cube_r97 = new ModelRenderer(this); + cube_r97.setRotationPoint(0.0F, -6.0F, 0.0F); + bone62.addChild(cube_r97); + setRotationAngle(cube_r97, 0.0F, -1.5708F, 0.0F); + cube_r97.setTextureOffset(43, 144).addBox(-1.5F, 2.0F, -1.5F, 3.0F, 1.0F, 3.0F, 0.0F, true); + cube_r97.setTextureOffset(126, 133).addBox(-2.5F, 3.0F, -2.5F, 5.0F, 5.0F, 5.0F, 0.0F, true); + cube_r98 = new ModelRenderer(this); + cube_r98.setRotationPoint(0.5F, -7.0F, -0.5F); + bone62.addChild(cube_r98); + setRotationAngle(cube_r98, 0.0F, -1.5708F, 0.0F); + cube_r98.setTextureOffset(80, 123).addBox(-1.5F, 2.0F, -1.5F, 4.0F, 1.0F, 4.0F, 0.0F, true); + bone = new ModelRenderer(this); + bone.setRotationPoint(0.0F, -17.0F, 0.0F); + bone.setTextureOffset(53, 24).addBox(-12.0F, 24.0F, -11.0F, 1.0F, 17.0F, 23.0F, 0.0F, false); + cube_r99 = new ModelRenderer(this); + cube_r99.setRotationPoint(-22.0F, 33.0F, -23.0F); + bone.addChild(cube_r99); + setRotationAngle(cube_r99, 0.0F, -1.5708F, 0.0F); + cube_r99.setTextureOffset(45, 89).addBox(11.0F, -30.0F, -11.0F, 1.0F, 15.0F, 1.0F, 0.0F, false); + cube_r100 = new ModelRenderer(this); + cube_r100.setRotationPoint(-22.5F, 19.0F, -22.5F); + bone.addChild(cube_r100); + setRotationAngle(cube_r100, 0.0F, -1.5708F, 0.0F); + cube_r100.setTextureOffset(65, 144).addBox(10.0F, -19.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r100.setTextureOffset(56, 144).addBox(10.0F, -1.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r101 = new ModelRenderer(this); + cube_r101.setRotationPoint(0.0F, 40.0F, 0.0F); + bone.addChild(cube_r101); + setRotationAngle(cube_r101, 0.0F, 3.1416F, 0.0F); + cube_r101.setTextureOffset(98, 106).addBox(10.0F, -18.0F, -13.0F, 3.0F, 3.0F, 23.0F, 0.0F, false); + bone29 = new ModelRenderer(this); + bone29.setRotationPoint(0.0F, 0.0F, 0.0F); + bone.addChild(bone29); + setRotationAngle(bone29, 0.0F, -1.5708F, 0.0F); + cube_r102 = new ModelRenderer(this); + cube_r102.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone29.addChild(cube_r102); + setRotationAngle(cube_r102, 1.0021F, -0.7255F, -0.4941F); + cube_r102.setTextureOffset(38, 144).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + cube_r103 = new ModelRenderer(this); + cube_r103.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone29.addChild(cube_r103); + setRotationAngle(cube_r103, 0.2707F, -0.5082F, 0.5615F); + cube_r103.setTextureOffset(143, 80).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + bone25 = new ModelRenderer(this); + bone25.setRotationPoint(0.0F, 0.5F, -9.5F); + bone.addChild(bone25); + cube_r104 = new ModelRenderer(this); + cube_r104.setRotationPoint(1.0F, 32.5F, -13.5F); + bone25.addChild(cube_r104); + setRotationAngle(cube_r104, 0.0F, -1.5708F, 0.0F); + cube_r104.setTextureOffset(102, 40).addBox(11.0F, -33.0F, -10.0F, 1.0F, 1.0F, 22.0F, 0.0F, false); + cube_r105 = new ModelRenderer(this); + cube_r105.setRotationPoint(1.0F, 32.5F, -14.0F); + bone25.addChild(cube_r105); + setRotationAngle(cube_r105, 0.0F, -1.5708F, 0.0F); + cube_r105.setTextureOffset(102, 0).addBox(12.0F, -32.0F, -10.0F, 0.0F, 17.0F, 22.0F, 0.0F, false); + bone51 = new ModelRenderer(this); + bone51.setRotationPoint(0.0F, -17.0F, 0.0F); + setRotationAngle(bone51, 0.0F, -1.5708F, 0.0F); + bone51.setTextureOffset(53, 24).addBox(-12.0F, 24.0F, -11.0F, 1.0F, 17.0F, 23.0F, 0.0F, false); + cube_r106 = new ModelRenderer(this); + cube_r106.setRotationPoint(-22.0F, 33.0F, -23.0F); + bone51.addChild(cube_r106); + setRotationAngle(cube_r106, 0.0F, -1.5708F, 0.0F); + cube_r106.setTextureOffset(45, 89).addBox(11.0F, -30.0F, -11.0F, 1.0F, 15.0F, 1.0F, 0.0F, false); + cube_r107 = new ModelRenderer(this); + cube_r107.setRotationPoint(-22.5F, 19.0F, -22.5F); + bone51.addChild(cube_r107); + setRotationAngle(cube_r107, 0.0F, -1.5708F, 0.0F); + cube_r107.setTextureOffset(65, 144).addBox(10.0F, -19.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r107.setTextureOffset(56, 144).addBox(10.0F, -1.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r108 = new ModelRenderer(this); + cube_r108.setRotationPoint(0.0F, 40.0F, 0.0F); + bone51.addChild(cube_r108); + setRotationAngle(cube_r108, 0.0F, 3.1416F, 0.0F); + cube_r108.setTextureOffset(98, 106).addBox(10.0F, -18.0F, -13.0F, 3.0F, 3.0F, 23.0F, 0.0F, false); + bone52 = new ModelRenderer(this); + bone52.setRotationPoint(0.0F, 0.0F, 0.0F); + bone51.addChild(bone52); + setRotationAngle(bone52, 0.0F, -1.5708F, 0.0F); + cube_r109 = new ModelRenderer(this); + cube_r109.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone52.addChild(cube_r109); + setRotationAngle(cube_r109, 1.0021F, -0.7255F, -0.4941F); + cube_r109.setTextureOffset(38, 144).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + cube_r110 = new ModelRenderer(this); + cube_r110.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone52.addChild(cube_r110); + setRotationAngle(cube_r110, 0.2707F, -0.5082F, 0.5615F); + cube_r110.setTextureOffset(143, 80).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + bone53 = new ModelRenderer(this); + bone53.setRotationPoint(0.0F, 0.5F, -9.5F); + bone51.addChild(bone53); + cube_r111 = new ModelRenderer(this); + cube_r111.setRotationPoint(1.0F, 32.5F, -13.5F); + bone53.addChild(cube_r111); + setRotationAngle(cube_r111, 0.0F, -1.5708F, 0.0F); + cube_r111.setTextureOffset(102, 40).addBox(11.0F, -33.0F, -10.0F, 1.0F, 1.0F, 22.0F, 0.0F, false); + cube_r112 = new ModelRenderer(this); + cube_r112.setRotationPoint(1.0F, 32.5F, -14.0F); + bone53.addChild(cube_r112); + setRotationAngle(cube_r112, 0.0F, -1.5708F, 0.0F); + cube_r112.setTextureOffset(102, 0).addBox(12.0F, -32.0F, -10.0F, 0.0F, 17.0F, 22.0F, 0.0F, false); + bone54 = new ModelRenderer(this); + bone54.setRotationPoint(0.0F, -17.0F, 0.0F); + setRotationAngle(bone54, 0.0F, 3.1416F, 0.0F); + bone54.setTextureOffset(53, 24).addBox(-12.0F, 24.0F, -11.0F, 1.0F, 17.0F, 23.0F, 0.0F, false); + cube_r113 = new ModelRenderer(this); + cube_r113.setRotationPoint(-22.0F, 33.0F, -23.0F); + bone54.addChild(cube_r113); + setRotationAngle(cube_r113, 0.0F, -1.5708F, 0.0F); + cube_r113.setTextureOffset(45, 89).addBox(11.0F, -30.0F, -11.0F, 1.0F, 15.0F, 1.0F, 0.0F, false); + cube_r114 = new ModelRenderer(this); + cube_r114.setRotationPoint(-22.5F, 19.0F, -22.5F); + bone54.addChild(cube_r114); + setRotationAngle(cube_r114, 0.0F, -1.5708F, 0.0F); + cube_r114.setTextureOffset(65, 144).addBox(10.0F, -19.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r114.setTextureOffset(56, 144).addBox(10.0F, -1.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r115 = new ModelRenderer(this); + cube_r115.setRotationPoint(0.0F, 40.0F, 0.0F); + bone54.addChild(cube_r115); + setRotationAngle(cube_r115, 0.0F, 3.1416F, 0.0F); + cube_r115.setTextureOffset(98, 106).addBox(10.0F, -18.0F, -13.0F, 3.0F, 3.0F, 23.0F, 0.0F, false); + bone55 = new ModelRenderer(this); + bone55.setRotationPoint(0.0F, 0.0F, 0.0F); + bone54.addChild(bone55); + setRotationAngle(bone55, 0.0F, -1.5708F, 0.0F); + cube_r116 = new ModelRenderer(this); + cube_r116.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone55.addChild(cube_r116); + setRotationAngle(cube_r116, 1.0021F, -0.7255F, -0.4941F); + cube_r116.setTextureOffset(38, 144).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + cube_r117 = new ModelRenderer(this); + cube_r117.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone55.addChild(cube_r117); + setRotationAngle(cube_r117, 0.2707F, -0.5082F, 0.5615F); + cube_r117.setTextureOffset(143, 80).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + bone56 = new ModelRenderer(this); + bone56.setRotationPoint(0.0F, 0.5F, -9.5F); + bone54.addChild(bone56); + cube_r118 = new ModelRenderer(this); + cube_r118.setRotationPoint(1.0F, 32.5F, -13.5F); + bone56.addChild(cube_r118); + setRotationAngle(cube_r118, 0.0F, -1.5708F, 0.0F); + cube_r118.setTextureOffset(102, 40).addBox(11.0F, -33.0F, -10.0F, 1.0F, 1.0F, 22.0F, 0.0F, false); + cube_r119 = new ModelRenderer(this); + cube_r119.setRotationPoint(1.0F, 32.5F, -14.0F); + bone56.addChild(cube_r119); + setRotationAngle(cube_r119, 0.0F, -1.5708F, 0.0F); + cube_r119.setTextureOffset(102, 0).addBox(12.0F, -32.0F, -10.0F, 0.0F, 17.0F, 22.0F, 0.0F, false); + bone57 = new ModelRenderer(this); + bone57.setRotationPoint(0.0F, -17.0F, 0.0F); + setRotationAngle(bone57, 0.0F, 1.5708F, 0.0F); + bone57.setTextureOffset(53, 24).addBox(-12.0F, 24.0F, -11.0F, 1.0F, 17.0F, 23.0F, 0.0F, false); + cube_r120 = new ModelRenderer(this); + cube_r120.setRotationPoint(-22.0F, 33.0F, -23.0F); + bone57.addChild(cube_r120); + setRotationAngle(cube_r120, 0.0F, -1.5708F, 0.0F); + cube_r120.setTextureOffset(45, 89).addBox(11.0F, -30.0F, -11.0F, 1.0F, 15.0F, 1.0F, 0.0F, false); + cube_r121 = new ModelRenderer(this); + cube_r121.setRotationPoint(-22.5F, 19.0F, -22.5F); + bone57.addChild(cube_r121); + setRotationAngle(cube_r121, 0.0F, -1.5708F, 0.0F); + cube_r121.setTextureOffset(65, 144).addBox(10.0F, -19.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r121.setTextureOffset(56, 144).addBox(10.0F, -1.0F, -12.0F, 2.0F, 4.0F, 2.0F, 0.0F, false); + cube_r122 = new ModelRenderer(this); + cube_r122.setRotationPoint(0.0F, 40.0F, 0.0F); + bone57.addChild(cube_r122); + setRotationAngle(cube_r122, 0.0F, 3.1416F, 0.0F); + cube_r122.setTextureOffset(98, 106).addBox(10.0F, -18.0F, -13.0F, 3.0F, 3.0F, 23.0F, 0.0F, false); + bone58 = new ModelRenderer(this); + bone58.setRotationPoint(0.0F, 0.0F, 0.0F); + bone57.addChild(bone58); + setRotationAngle(bone58, 0.0F, -1.5708F, 0.0F); + cube_r123 = new ModelRenderer(this); + cube_r123.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone58.addChild(cube_r123); + setRotationAngle(cube_r123, 1.0021F, -0.7255F, -0.4941F); + cube_r123.setTextureOffset(38, 144).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + cube_r124 = new ModelRenderer(this); + cube_r124.setRotationPoint(-11.5F, 0.0F, 11.5F); + bone58.addChild(cube_r124); + setRotationAngle(cube_r124, 0.2707F, -0.5082F, 0.5615F); + cube_r124.setTextureOffset(143, 80).addBox(-0.5F, -13.0F, -0.5F, 1.0F, 13.0F, 1.0F, 0.0F, false); + bone59 = new ModelRenderer(this); + bone59.setRotationPoint(0.0F, 0.5F, -9.5F); + bone57.addChild(bone59); + cube_r125 = new ModelRenderer(this); + cube_r125.setRotationPoint(1.0F, 32.5F, -13.5F); + bone59.addChild(cube_r125); + setRotationAngle(cube_r125, 0.0F, -1.5708F, 0.0F); + cube_r125.setTextureOffset(102, 40).addBox(11.0F, -33.0F, -10.0F, 1.0F, 1.0F, 22.0F, 0.0F, false); + cube_r126 = new ModelRenderer(this); + cube_r126.setRotationPoint(1.0F, 32.5F, -14.0F); + bone59.addChild(cube_r126); + setRotationAngle(cube_r126, 0.0F, -1.5708F, 0.0F); + cube_r126.setTextureOffset(102, 0).addBox(12.0F, -32.0F, -10.0F, 0.0F, 17.0F, 22.0F, 0.0F, false); + bone26 = new ModelRenderer(this); + bone26.setRotationPoint(0.0F, -16.5F, 0.0F); + setRotationAngle(bone26, 0.0F, -1.5708F, 0.0F); + cube_r127 = new ModelRenderer(this); + cube_r127.setRotationPoint(0.0F, 0.0F, 0.0F); + bone26.addChild(cube_r127); + setRotationAngle(cube_r127, 0.0F, -1.5708F, 0.0F); + cube_r127.setTextureOffset(0, 107).addBox(-0.5F, -0.5F, -11.0F, 1.0F, 1.0F, 22.0F, 0.0F, false); + cube_r128 = new ModelRenderer(this); + cube_r128.setRotationPoint(0.0F, 0.0F, -9.5F); + bone26.addChild(cube_r128); + setRotationAngle(cube_r128, 0.0F, 3.1416F, 0.0F); + cube_r128.setTextureOffset(0, 107).addBox(-0.5F, -0.5F, -20.5F, 1.0F, 1.0F, 22.0F, 0.0F, false); + bb_main = new ModelRenderer(this); + bb_main.setRotationPoint(0.0F, 24.0F, 0.0F); + bb_main.setTextureOffset(0, 0).addBox(-11.0F, -1.0F, -11.0F, 22.0F, 1.0F, 22.0F, 0.0F, false); + bb_main.setTextureOffset(39, 69).addBox(-8.0F, -124.75F, -8.0F, 16.0F, 0.0F, 16.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Balloonstrip.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip11.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip12.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip10.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip9.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip7.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Balloonstrip8.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + Engine.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone34.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone60.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone51.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone54.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone57.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bone26.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/LadyBugInFlightRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/LadyBugInFlightRenderer.java new file mode 100644 index 0000000..d54947b --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/LadyBugInFlightRenderer.java @@ -0,0 +1,155 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.LadyBugInFlightEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class LadyBugInFlightRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(LadyBugInFlightEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelLadyBirdInFlight(), 0.3f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/ladybug.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.4 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelLadyBirdInFlight extends EntityModel { + private final ModelRenderer Body; + private final ModelRenderer RightLeg; + private final ModelRenderer cube_r1; + private final ModelRenderer LeftLeg; + private final ModelRenderer cube_r2; + private final ModelRenderer RightLeg2; + private final ModelRenderer cube_r3; + private final ModelRenderer LeftLeg2; + private final ModelRenderer cube_r4; + private final ModelRenderer rightwing; + private final ModelRenderer cube_r5; + private final ModelRenderer leftwing; + private final ModelRenderer cube_r6; + private final ModelRenderer head; + private final ModelRenderer cube_r7; + + public ModelLadyBirdInFlight() { + textureWidth = 32; + textureHeight = 32; + Body = new ModelRenderer(this); + Body.setRotationPoint(0.0F, 21.0F, -2.0F); + setRotationAngle(Body, -0.2182F, 0.0F, 0.0F); + Body.setTextureOffset(0, 0).addBox(-2.0F, 0.0F, 0.0F, 4.0F, 3.0F, 5.0F, 0.0F, false); + RightLeg = new ModelRenderer(this); + RightLeg.setRotationPoint(-2.0F, 2.25F, 2.5F); + Body.addChild(RightLeg); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(0.0F, 0.0F, -0.5F); + RightLeg.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0F, 0.0F, -0.5236F); + cube_r1.setTextureOffset(19, 2).addBox(-2.0F, 0.0F, 2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + cube_r1.setTextureOffset(19, 0).addBox(-2.0F, 0.0F, -2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + LeftLeg = new ModelRenderer(this); + LeftLeg.setRotationPoint(2.0F, 2.25F, 2.5F); + Body.addChild(LeftLeg); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(0.0F, 0.0F, -0.5F); + LeftLeg.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0F, 0.0F, 0.5236F); + cube_r2.setTextureOffset(22, 20).addBox(0.0F, 0.0F, 2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + cube_r2.setTextureOffset(19, 6).addBox(0.0F, 0.0F, -2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + RightLeg2 = new ModelRenderer(this); + RightLeg2.setRotationPoint(2.0F, 2.25F, 2.5F); + Body.addChild(RightLeg2); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(0.0F, 0.0F, -0.5F); + RightLeg2.addChild(cube_r3); + setRotationAngle(cube_r3, 0.0F, 0.0F, 0.5236F); + cube_r3.setTextureOffset(22, 18).addBox(0.0F, 0.0F, 0.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + LeftLeg2 = new ModelRenderer(this); + LeftLeg2.setRotationPoint(-2.0F, 2.25F, 2.5F); + Body.addChild(LeftLeg2); + cube_r4 = new ModelRenderer(this); + cube_r4.setRotationPoint(0.0F, 0.0F, -0.5F); + LeftLeg2.addChild(cube_r4); + setRotationAngle(cube_r4, 0.0F, 0.0F, -0.5236F); + cube_r4.setTextureOffset(19, 4).addBox(-2.0F, 0.0F, 0.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + rightwing = new ModelRenderer(this); + rightwing.setRotationPoint(-0.1F, 20.95F, -2.15F); + setRotationAngle(rightwing, 0.108F, -0.404F, 0.7438F); + cube_r5 = new ModelRenderer(this); + cube_r5.setRotationPoint(-2.101F, 0.2457F, -0.1112F); + rightwing.addChild(cube_r5); + setRotationAngle(cube_r5, 0.0451F, -0.1289F, -0.0229F); + cube_r5.setTextureOffset(0, 9).addBox(0.0F, 0.0F, 0.0F, 2.0F, 3.0F, 5.0F, 0.2F, false); + leftwing = new ModelRenderer(this); + leftwing.setRotationPoint(0.1F, 20.95F, -2.1F); + setRotationAngle(leftwing, 0.127F, 0.532F, -0.6743F); + cube_r6 = new ModelRenderer(this); + cube_r6.setRotationPoint(2.1007F, 0.243F, -0.164F); + leftwing.addChild(cube_r6); + setRotationAngle(cube_r6, 0.0451F, 0.1289F, 0.0229F); + cube_r6.setTextureOffset(15, 9).addBox(-2.0F, 0.0F, 0.0F, 2.0F, 3.0F, 5.0F, 0.2F, false); + head = new ModelRenderer(this); + head.setRotationPoint(0.0F, 22.5F, -2.25F); + head.setTextureOffset(13, 18).addBox(-1.0F, -1.0F, -2.0F, 2.0F, 2.0F, 2.0F, 0.0F, false); + cube_r7 = new ModelRenderer(this); + cube_r7.setRotationPoint(0.5F, -1.0F, -2.0F); + head.addChild(cube_r7); + setRotationAngle(cube_r7, 0.48F, 0.0F, 0.0F); + cube_r7.setTextureOffset(0, 18).addBox(-3.0F, -4.0F, 0.0F, 5.0F, 4.0F, 0.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + Body.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + rightwing.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + leftwing.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + head.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.LeftLeg.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightLeg2.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftLeg2.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.rightwing.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.leftwing.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.RightLeg.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.Body.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/LadybugRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/LadybugRenderer.java new file mode 100644 index 0000000..6117465 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/LadybugRenderer.java @@ -0,0 +1,153 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.entity.LadybugEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class LadybugRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(LadybugEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelLadyBird(), 0.3f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/ladybug.png"); + } + }; + }); + } + } + + // Made with Blockbench 4.12.4 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelLadyBird extends EntityModel { + private final ModelRenderer rightwing; + private final ModelRenderer cube_r1; + private final ModelRenderer leftwing; + private final ModelRenderer cube_r2; + private final ModelRenderer head; + private final ModelRenderer cube_r3; + private final ModelRenderer RightLeg; + private final ModelRenderer cube_r4; + private final ModelRenderer LeftLeg; + private final ModelRenderer cube_r5; + private final ModelRenderer RightLeg2; + private final ModelRenderer cube_r6; + private final ModelRenderer LeftLeg2; + private final ModelRenderer cube_r7; + private final ModelRenderer bb_main; + + public ModelLadyBird() { + textureWidth = 32; + textureHeight = 32; + rightwing = new ModelRenderer(this); + rightwing.setRotationPoint(-0.1F, 20.95F, -2.15F); + setRotationAngle(rightwing, -0.0366F, 0.0904F, 0.1661F); + cube_r1 = new ModelRenderer(this); + cube_r1.setRotationPoint(-2.101F, 0.2457F, -0.1112F); + rightwing.addChild(cube_r1); + setRotationAngle(cube_r1, 0.0451F, -0.1289F, -0.0229F); + cube_r1.setTextureOffset(0, 9).addBox(0.0F, 0.0F, 0.0F, 2.0F, 3.0F, 5.0F, 0.2F, false); + leftwing = new ModelRenderer(this); + leftwing.setRotationPoint(0.1F, 20.95F, -2.1F); + setRotationAngle(leftwing, -0.0513F, -0.0872F, -0.168F); + cube_r2 = new ModelRenderer(this); + cube_r2.setRotationPoint(2.1007F, 0.243F, -0.164F); + leftwing.addChild(cube_r2); + setRotationAngle(cube_r2, 0.0451F, 0.1289F, 0.0229F); + cube_r2.setTextureOffset(15, 9).addBox(-2.0F, 0.0F, 0.0F, 2.0F, 3.0F, 5.0F, 0.2F, false); + head = new ModelRenderer(this); + head.setRotationPoint(0.0F, 23.0F, -2.0F); + head.setTextureOffset(13, 18).addBox(-1.0F, -1.0F, -2.0F, 2.0F, 2.0F, 2.0F, 0.0F, false); + cube_r3 = new ModelRenderer(this); + cube_r3.setRotationPoint(0.5F, -1.0F, -2.0F); + head.addChild(cube_r3); + setRotationAngle(cube_r3, 0.48F, 0.0F, 0.0F); + cube_r3.setTextureOffset(0, 18).addBox(-3.0F, -4.0F, 0.0F, 5.0F, 4.0F, 0.0F, 0.0F, false); + RightLeg = new ModelRenderer(this); + RightLeg.setRotationPoint(-2.0F, 23.25F, 0.5F); + cube_r4 = new ModelRenderer(this); + cube_r4.setRotationPoint(0.0F, 0.0F, -0.5F); + RightLeg.addChild(cube_r4); + setRotationAngle(cube_r4, 0.0F, 0.0F, -0.5236F); + cube_r4.setTextureOffset(19, 2).addBox(-2.0F, 0.0F, 2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + cube_r4.setTextureOffset(19, 0).addBox(-2.0F, 0.0F, -2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + LeftLeg = new ModelRenderer(this); + LeftLeg.setRotationPoint(2.0F, 23.25F, 0.5F); + cube_r5 = new ModelRenderer(this); + cube_r5.setRotationPoint(0.0F, 0.0F, -0.5F); + LeftLeg.addChild(cube_r5); + setRotationAngle(cube_r5, 0.0F, 0.0F, 0.5236F); + cube_r5.setTextureOffset(22, 20).addBox(0.0F, 0.0F, 2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + cube_r5.setTextureOffset(19, 6).addBox(0.0F, 0.0F, -2.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + RightLeg2 = new ModelRenderer(this); + RightLeg2.setRotationPoint(2.0F, 23.25F, 0.5F); + cube_r6 = new ModelRenderer(this); + cube_r6.setRotationPoint(0.0F, 0.0F, -0.5F); + RightLeg2.addChild(cube_r6); + setRotationAngle(cube_r6, 0.0F, 0.0F, 0.5236F); + cube_r6.setTextureOffset(22, 18).addBox(0.0F, 0.0F, 0.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + LeftLeg2 = new ModelRenderer(this); + LeftLeg2.setRotationPoint(-2.0F, 23.25F, 0.5F); + cube_r7 = new ModelRenderer(this); + cube_r7.setRotationPoint(0.0F, 0.0F, -0.5F); + LeftLeg2.addChild(cube_r7); + setRotationAngle(cube_r7, 0.0F, 0.0F, -0.5236F); + cube_r7.setTextureOffset(19, 4).addBox(-2.0F, 0.0F, 0.0F, 2.0F, 0.0F, 1.0F, 0.0F, false); + bb_main = new ModelRenderer(this); + bb_main.setRotationPoint(0.0F, 24.0F, 0.0F); + bb_main.setTextureOffset(0, 0).addBox(-2.0F, -3.0F, -2.0F, 4.0F, 3.0F, 5.0F, 0.0F, false); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + rightwing.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + leftwing.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + head.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftLeg.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + RightLeg2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + LeftLeg2.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + bb_main.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.LeftLeg.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightLeg2.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.LeftLeg2.rotateAngleZ = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.rightwing.rotateAngleY = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.leftwing.rotateAngleY = MathHelper.cos(f * 0.6662F) * f1; + this.head.rotateAngleY = f3 / (180F / (float) Math.PI); + this.head.rotateAngleX = f4 / (180F / (float) Math.PI); + this.RightLeg.rotateAngleZ = MathHelper.cos(f * 1.0F) * 1.0F * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/entity/renderer/TigerFishRenderer.java b/src/main/java/studio/halbear/hem/entity/renderer/TigerFishRenderer.java new file mode 100644 index 0000000..efca295 --- /dev/null +++ b/src/main/java/studio/halbear/hem/entity/renderer/TigerFishRenderer.java @@ -0,0 +1,152 @@ + +package studio.halbear.hem.entity.renderer; + +import studio.halbear.hem.procedures.TigerFishEntityShakingConditionProcedure; +import studio.halbear.hem.entity.TigerFishEntity; + +import net.minecraftforge.fml.client.registry.RenderingRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; +import net.minecraft.client.renderer.entity.model.EntityModel; +import net.minecraft.client.renderer.entity.MobRenderer; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +import com.mojang.blaze3d.vertex.IVertexBuilder; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class TigerFishRenderer { + public static class ModelRegisterHandler { + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void registerModels(ModelRegistryEvent event) { + RenderingRegistry.registerEntityRenderingHandler(TigerFishEntity.entity, renderManager -> { + return new MobRenderer(renderManager, new ModelTigerFish(), 0.5f) { + + @Override + public ResourceLocation getEntityTexture(Entity entity) { + return new ResourceLocation("hem:textures/entities/tigerfish.png"); + } + + @Override + protected boolean func_230495_a_(LivingEntity _ent) { + Entity entity = _ent; + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + return TigerFishEntityShakingConditionProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + }; + }); + } + } + + // Made with Blockbench 4.12.4 + // Exported for Minecraft version 1.15 - 1.16 with MCP mappings + // Paste this class into your mod and generate all required imports + public static class ModelTigerFish extends EntityModel { + private final ModelRenderer OuterBody; + private final ModelRenderer Body; + private final ModelRenderer HeadY; + private final ModelRenderer leftWhisker; + private final ModelRenderer leftWhisker_r1; + private final ModelRenderer RightWhisker; + private final ModelRenderer RightWhisker_r1; + private final ModelRenderer RightFin; + private final ModelRenderer TailFin3; + private final ModelRenderer TailFin; + private final ModelRenderer TailFin2; + private final ModelRenderer leftFin; + + public ModelTigerFish() { + textureWidth = 128; + textureHeight = 128; + OuterBody = new ModelRenderer(this); + OuterBody.setRotationPoint(0.0F, 21.0F, 8.0F); + Body = new ModelRenderer(this); + Body.setRotationPoint(0.0F, 0.0F, 0.0F); + OuterBody.addChild(Body); + HeadY = new ModelRenderer(this); + HeadY.setRotationPoint(0.0F, 0.0F, -12.0F); + Body.addChild(HeadY); + HeadY.setTextureOffset(0, 0).addBox(-5.0F, -2.0F, -4.0F, 10.0F, 4.0F, 16.0F, 0.0F, false); + HeadY.setTextureOffset(0, 20).addBox(-5.0F, -2.0F, -4.0F, 10.0F, 4.0F, 16.0F, 0.2F, false); + HeadY.setTextureOffset(52, 16).addBox(0.0F, -7.0F, -4.0F, 0.0F, 11.0F, 16.0F, 0.0F, false); + leftWhisker = new ModelRenderer(this); + leftWhisker.setRotationPoint(2.0F, -1.0F, -4.05F); + HeadY.addChild(leftWhisker); + leftWhisker_r1 = new ModelRenderer(this); + leftWhisker_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + leftWhisker.addChild(leftWhisker_r1); + setRotationAngle(leftWhisker_r1, 0.119F, 0.734F, 0.1767F); + leftWhisker_r1.setTextureOffset(0, 56).addBox(0.0F, -4.0F, 0.0F, 8.0F, 7.0F, 0.0F, 0.0F, false); + RightWhisker = new ModelRenderer(this); + RightWhisker.setRotationPoint(-2.0F, -1.0F, -4.05F); + HeadY.addChild(RightWhisker); + RightWhisker_r1 = new ModelRenderer(this); + RightWhisker_r1.setRotationPoint(0.0F, 0.0F, 0.0F); + RightWhisker.addChild(RightWhisker_r1); + setRotationAngle(RightWhisker_r1, 0.1578F, -0.7279F, -0.2348F); + RightWhisker_r1.setTextureOffset(16, 56).addBox(-8.0F, -4.0F, 0.0F, 8.0F, 7.0F, 0.0F, 0.0F, false); + RightFin = new ModelRenderer(this); + RightFin.setRotationPoint(-5.0F, 2.0F, 4.0F); + HeadY.addChild(RightFin); + RightFin.setTextureOffset(0, 40).addBox(-10.0F, 0.0F, -8.0F, 10.0F, 0.0F, 16.0F, 0.0F, false); + TailFin3 = new ModelRenderer(this); + TailFin3.setRotationPoint(0.0F, 0.0F, 12.0F); + HeadY.addChild(TailFin3); + TailFin = new ModelRenderer(this); + TailFin.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin3.addChild(TailFin); + TailFin2 = new ModelRenderer(this); + TailFin2.setRotationPoint(0.0F, 0.0F, 0.0F); + TailFin.addChild(TailFin2); + TailFin2.setTextureOffset(52, 43).addBox(0.0F, -7.0F, 0.0F, 0.0F, 11.0F, 16.0F, 0.0F, false); + leftFin = new ModelRenderer(this); + leftFin.setRotationPoint(5.0F, 2.0F, 4.0F); + HeadY.addChild(leftFin); + leftFin.setTextureOffset(0, 40).addBox(0.0F, 0.0F, -8.0F, 10.0F, 0.0F, 16.0F, 0.0F, true); + } + + @Override + public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, + float alpha) { + OuterBody.render(matrixStack, buffer, packedLight, packedOverlay, red, green, blue, alpha); + } + + public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { + modelRenderer.rotateAngleX = x; + modelRenderer.rotateAngleY = y; + modelRenderer.rotateAngleZ = z; + } + + public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) { + this.TailFin.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.leftWhisker.rotateAngleY = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.OuterBody.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.TailFin3.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.RightWhisker.rotateAngleY = MathHelper.cos(f * 0.6662F) * f1; + this.TailFin2.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1; + this.leftFin.rotateAngleZ = MathHelper.cos(f * 0.6662F + (float) Math.PI) * f1; + this.HeadY.rotateAngleX = f4 / (180F / (float) Math.PI); + this.Body.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1; + this.RightFin.rotateAngleZ = MathHelper.cos(f * 0.6662F) * f1; + } + } + +} diff --git a/src/main/java/studio/halbear/hem/gui/AirboatGasCelViewGui.java b/src/main/java/studio/halbear/hem/gui/AirboatGasCelViewGui.java new file mode 100644 index 0000000..d5dff72 --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/AirboatGasCelViewGui.java @@ -0,0 +1,415 @@ + +package studio.halbear.hem.gui; + +import studio.halbear.hem.item.GasCanister612litreItem; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.items.SlotItemHandler; +import net.minecraftforge.items.ItemStackHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.network.IContainerFactory; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.DeferredWorkQueue; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.network.PacketBuffer; +import net.minecraft.item.ItemStack; +import net.minecraft.inventory.container.Slot; +import net.minecraft.inventory.container.ContainerType; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.gui.ScreenManager; + +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; + +@HemModElements.ModElement.Tag +public class AirboatGasCelViewGui extends HemModElements.ModElement { + public static HashMap guistate = new HashMap(); + private static ContainerType containerType = null; + + public AirboatGasCelViewGui(HemModElements instance) { + super(instance, 309); + elements.addNetworkMessage(ButtonPressedMessage.class, ButtonPressedMessage::buffer, ButtonPressedMessage::new, + ButtonPressedMessage::handler); + elements.addNetworkMessage(GUISlotChangedMessage.class, GUISlotChangedMessage::buffer, GUISlotChangedMessage::new, + GUISlotChangedMessage::handler); + containerType = new ContainerType<>(new GuiContainerModFactory()); + FMLJavaModLoadingContext.get().getModEventBus().register(new ContainerRegisterHandler()); + } + + private static class ContainerRegisterHandler { + @SubscribeEvent + public void registerContainer(RegistryEvent.Register> event) { + event.getRegistry().register(containerType.setRegistryName("airboat_gas_cel_view")); + } + } + + @OnlyIn(Dist.CLIENT) + public void initElements() { + DeferredWorkQueue.runLater(() -> ScreenManager.registerFactory(containerType, AirboatGasCelViewGuiWindow::new)); + } + + public static class GuiContainerModFactory implements IContainerFactory { + public GuiContainerMod create(int id, PlayerInventory inv, PacketBuffer extraData) { + return new GuiContainerMod(id, inv, extraData); + } + } + + public static class GuiContainerMod extends Container implements Supplier> { + World world; + PlayerEntity entity; + int x, y, z; + private IItemHandler internal; + private Map customSlots = new HashMap<>(); + private boolean bound = false; + + public GuiContainerMod(int id, PlayerInventory inv, PacketBuffer extraData) { + super(containerType, id); + this.entity = inv.player; + this.world = inv.player.world; + this.internal = new ItemStackHandler(7); + BlockPos pos = null; + if (extraData != null) { + pos = extraData.readBlockPos(); + this.x = pos.getX(); + this.y = pos.getY(); + this.z = pos.getZ(); + } + if (pos != null) { + if (extraData.readableBytes() == 1) { // bound to item + byte hand = extraData.readByte(); + ItemStack itemstack; + if (hand == 0) + itemstack = this.entity.getHeldItemMainhand(); + else + itemstack = this.entity.getHeldItemOffhand(); + itemstack.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> { + this.internal = capability; + this.bound = true; + }); + } else if (extraData.readableBytes() > 1) { + extraData.readByte(); // drop padding + Entity entity = world.getEntityByID(extraData.readVarInt()); + if (entity != null) + entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> { + this.internal = capability; + this.bound = true; + }); + } else { // might be bound to block + TileEntity ent = inv.player != null ? inv.player.world.getTileEntity(pos) : null; + if (ent != null) { + ent.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null).ifPresent(capability -> { + this.internal = capability; + this.bound = true; + }); + } + } + } + this.customSlots.put(0, this.addSlot(new SlotItemHandler(internal, 0, 261, 44) { + @Override + public boolean isItemValid(ItemStack stack) { + return (GasCanister612litreItem.block == stack.getItem()); + } + })); + this.customSlots.put(1, this.addSlot(new SlotItemHandler(internal, 1, 283, 44) { + @Override + public boolean isItemValid(ItemStack stack) { + return (GasCanister612litreItem.block == stack.getItem()); + } + })); + this.customSlots.put(2, this.addSlot(new SlotItemHandler(internal, 2, 305, 44) { + @Override + public boolean isItemValid(ItemStack stack) { + return (GasCanister612litreItem.block == stack.getItem()); + } + })); + this.customSlots.put(3, this.addSlot(new SlotItemHandler(internal, 3, 327, 44) { + @Override + public boolean isItemValid(ItemStack stack) { + return (GasCanister612litreItem.block == stack.getItem()); + } + })); + this.customSlots.put(4, this.addSlot(new SlotItemHandler(internal, 4, 349, 44) { + @Override + public boolean isItemValid(ItemStack stack) { + return (GasCanister612litreItem.block == stack.getItem()); + } + })); + this.customSlots.put(5, this.addSlot(new SlotItemHandler(internal, 5, 371, 44) { + })); + this.customSlots.put(6, this.addSlot(new SlotItemHandler(internal, 6, 393, 44) { + @Override + public boolean isItemValid(ItemStack stack) { + return (GasCanister612litreItem.block == stack.getItem()); + } + })); + int si; + int sj; + for (si = 0; si < 3; ++si) + for (sj = 0; sj < 9; ++sj) + this.addSlot(new Slot(inv, sj + (si + 1) * 9, 254 + 8 + sj * 18, 0 + 84 + si * 18)); + for (si = 0; si < 9; ++si) + this.addSlot(new Slot(inv, si, 254 + 8 + si * 18, 0 + 142)); + } + + public Map get() { + return customSlots; + } + + @Override + public boolean canInteractWith(PlayerEntity player) { + return true; + } + + @Override + public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { + ItemStack itemstack = ItemStack.EMPTY; + Slot slot = (Slot) this.inventorySlots.get(index); + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + if (index < 7) { + if (!this.mergeItemStack(itemstack1, 7, this.inventorySlots.size(), true)) { + return ItemStack.EMPTY; + } + slot.onSlotChange(itemstack1, itemstack); + } else if (!this.mergeItemStack(itemstack1, 0, 7, false)) { + if (index < 7 + 27) { + if (!this.mergeItemStack(itemstack1, 7 + 27, this.inventorySlots.size(), true)) { + return ItemStack.EMPTY; + } + } else { + if (!this.mergeItemStack(itemstack1, 7, 7 + 27, false)) { + return ItemStack.EMPTY; + } + } + return ItemStack.EMPTY; + } + if (itemstack1.getCount() == 0) { + slot.putStack(ItemStack.EMPTY); + } else { + slot.onSlotChanged(); + } + if (itemstack1.getCount() == itemstack.getCount()) { + return ItemStack.EMPTY; + } + slot.onTake(playerIn, itemstack1); + } + return itemstack; + } + + @Override /** + * Merges provided ItemStack with the first avaliable one in the container/player inventor between minIndex (included) and maxIndex (excluded). Args : stack, minIndex, maxIndex, negativDirection. /!\ the Container implementation do not check if the item is valid for the slot + */ + protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) { + boolean flag = false; + int i = startIndex; + if (reverseDirection) { + i = endIndex - 1; + } + if (stack.isStackable()) { + while (!stack.isEmpty()) { + if (reverseDirection) { + if (i < startIndex) { + break; + } + } else if (i >= endIndex) { + break; + } + Slot slot = this.inventorySlots.get(i); + ItemStack itemstack = slot.getStack(); + if (slot.isItemValid(itemstack) && !itemstack.isEmpty() && areItemsAndTagsEqual(stack, itemstack)) { + int j = itemstack.getCount() + stack.getCount(); + int maxSize = Math.min(slot.getSlotStackLimit(), stack.getMaxStackSize()); + if (j <= maxSize) { + stack.setCount(0); + itemstack.setCount(j); + slot.putStack(itemstack); + flag = true; + } else if (itemstack.getCount() < maxSize) { + stack.shrink(maxSize - itemstack.getCount()); + itemstack.setCount(maxSize); + slot.putStack(itemstack); + flag = true; + } + } + if (reverseDirection) { + --i; + } else { + ++i; + } + } + } + if (!stack.isEmpty()) { + if (reverseDirection) { + i = endIndex - 1; + } else { + i = startIndex; + } + while (true) { + if (reverseDirection) { + if (i < startIndex) { + break; + } + } else if (i >= endIndex) { + break; + } + Slot slot1 = this.inventorySlots.get(i); + ItemStack itemstack1 = slot1.getStack(); + if (itemstack1.isEmpty() && slot1.isItemValid(stack)) { + if (stack.getCount() > slot1.getSlotStackLimit()) { + slot1.putStack(stack.split(slot1.getSlotStackLimit())); + } else { + slot1.putStack(stack.split(stack.getCount())); + } + slot1.onSlotChanged(); + flag = true; + break; + } + if (reverseDirection) { + --i; + } else { + ++i; + } + } + } + return flag; + } + + @Override + public void onContainerClosed(PlayerEntity playerIn) { + super.onContainerClosed(playerIn); + if (!bound && (playerIn instanceof ServerPlayerEntity)) { + if (!playerIn.isAlive() || playerIn instanceof ServerPlayerEntity && ((ServerPlayerEntity) playerIn).hasDisconnected()) { + for (int j = 0; j < internal.getSlots(); ++j) { + playerIn.dropItem(internal.extractItem(j, internal.getStackInSlot(j).getCount(), false), false); + } + } else { + for (int i = 0; i < internal.getSlots(); ++i) { + playerIn.inventory.placeItemBackInInventory(playerIn.world, + internal.extractItem(i, internal.getStackInSlot(i).getCount(), false)); + } + } + } + } + + private void slotChanged(int slotid, int ctype, int meta) { + if (this.world != null && this.world.isRemote()) { + HemMod.PACKET_HANDLER.sendToServer(new GUISlotChangedMessage(slotid, x, y, z, ctype, meta)); + handleSlotAction(entity, slotid, ctype, meta, x, y, z); + } + } + } + + public static class ButtonPressedMessage { + int buttonID, x, y, z; + + public ButtonPressedMessage(PacketBuffer buffer) { + this.buttonID = buffer.readInt(); + this.x = buffer.readInt(); + this.y = buffer.readInt(); + this.z = buffer.readInt(); + } + + public ButtonPressedMessage(int buttonID, int x, int y, int z) { + this.buttonID = buttonID; + this.x = x; + this.y = y; + this.z = z; + } + + public static void buffer(ButtonPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.buttonID); + buffer.writeInt(message.x); + buffer.writeInt(message.y); + buffer.writeInt(message.z); + } + + public static void handler(ButtonPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + PlayerEntity entity = context.getSender(); + int buttonID = message.buttonID; + int x = message.x; + int y = message.y; + int z = message.z; + handleButtonAction(entity, buttonID, x, y, z); + }); + context.setPacketHandled(true); + } + } + + public static class GUISlotChangedMessage { + int slotID, x, y, z, changeType, meta; + + public GUISlotChangedMessage(int slotID, int x, int y, int z, int changeType, int meta) { + this.slotID = slotID; + this.x = x; + this.y = y; + this.z = z; + this.changeType = changeType; + this.meta = meta; + } + + public GUISlotChangedMessage(PacketBuffer buffer) { + this.slotID = buffer.readInt(); + this.x = buffer.readInt(); + this.y = buffer.readInt(); + this.z = buffer.readInt(); + this.changeType = buffer.readInt(); + this.meta = buffer.readInt(); + } + + public static void buffer(GUISlotChangedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.slotID); + buffer.writeInt(message.x); + buffer.writeInt(message.y); + buffer.writeInt(message.z); + buffer.writeInt(message.changeType); + buffer.writeInt(message.meta); + } + + public static void handler(GUISlotChangedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + PlayerEntity entity = context.getSender(); + int slotID = message.slotID; + int changeType = message.changeType; + int meta = message.meta; + int x = message.x; + int y = message.y; + int z = message.z; + handleSlotAction(entity, slotID, changeType, meta, x, y, z); + }); + context.setPacketHandled(true); + } + } + + static void handleButtonAction(PlayerEntity entity, int buttonID, int x, int y, int z) { + World world = entity.world; + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + } + + private static void handleSlotAction(PlayerEntity entity, int slotID, int changeType, int meta, int x, int y, int z) { + World world = entity.world; + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + } +} diff --git a/src/main/java/studio/halbear/hem/gui/AirboatGasCelViewGuiWindow.java b/src/main/java/studio/halbear/hem/gui/AirboatGasCelViewGuiWindow.java new file mode 100644 index 0000000..37c96b4 --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/AirboatGasCelViewGuiWindow.java @@ -0,0 +1,165 @@ + +package studio.halbear.hem.gui; + +import studio.halbear.hem.HemMod; + +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.gui.widget.button.Button; +import net.minecraft.client.gui.screen.inventory.ContainerScreen; +import net.minecraft.client.Minecraft; + +import java.util.HashMap; + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.matrix.MatrixStack; + +@OnlyIn(Dist.CLIENT) +public class AirboatGasCelViewGuiWindow extends ContainerScreen { + private World world; + private int x, y, z; + private PlayerEntity entity; + private final static HashMap guistate = AirboatGasCelViewGui.guistate; + + public AirboatGasCelViewGuiWindow(AirboatGasCelViewGui.GuiContainerMod container, PlayerInventory inventory, ITextComponent text) { + super(container, inventory, text); + this.world = container.world; + this.x = container.x; + this.y = container.y; + this.z = container.z; + this.entity = container.entity; + this.xSize = 428; + this.ySize = 166; + } + + private static final ResourceLocation texture = new ResourceLocation("hem:textures/screens/airboat_gas_cel_view.png"); + + @Override + public void render(MatrixStack ms, int mouseX, int mouseY, float partialTicks) { + this.renderBackground(ms); + super.render(ms, mouseX, mouseY, partialTicks); + this.renderHoveredTooltip(ms, mouseX, mouseY); + } + + @Override + protected void drawGuiContainerBackgroundLayer(MatrixStack ms, float partialTicks, int gx, int gy) { + RenderSystem.color4f(1, 1, 1, 1); + RenderSystem.enableBlend(); + RenderSystem.defaultBlendFunc(); + Minecraft.getInstance().getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.blit(ms, k, l, 0, 0, this.xSize, this.ySize, this.xSize, this.ySize); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/airshipheliumui.png")); + this.blit(ms, this.guiLeft + 2, this.guiTop + 3, 0, 0, 256, 139, 256, 139); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 61, this.guiTop + 96, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 61, this.guiTop + 90, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 61, this.guiTop + 85, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 85, this.guiTop + 96, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 85, this.guiTop + 85, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 85, this.guiTop + 90, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 37, this.guiTop + 92, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 37, this.guiTop + 81, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 37, this.guiTop + 86, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 109, this.guiTop + 96, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 133, this.guiTop + 96, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 157, this.guiTop + 92, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluibottom.png")); + this.blit(ms, this.guiLeft + 181, this.guiTop + 86, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 109, this.guiTop + 90, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 133, this.guiTop + 90, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 157, this.guiTop + 86, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluiprogress.png")); + this.blit(ms, this.guiLeft + 181, this.guiTop + 80, 0, 0, 22, 6, 22, 6); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 109, this.guiTop + 85, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 133, this.guiTop + 85, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 157, this.guiTop + 81, 0, 0, 22, 5, 22, 5); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/heliumfilluitop.png")); + this.blit(ms, this.guiLeft + 181, this.guiTop + 75, 0, 0, 22, 5, 22, 5); + + RenderSystem.disableBlend(); + } + + @Override + public boolean keyPressed(int key, int b, int c) { + if (key == 256) { + this.minecraft.player.closeScreen(); + return true; + } + return super.keyPressed(key, b, c); + } + + @Override + public void tick() { + super.tick(); + } + + @Override + protected void drawGuiContainerForegroundLayer(MatrixStack ms, int mouseX, int mouseY) { + } + + @Override + public void onClose() { + super.onClose(); + Minecraft.getInstance().keyboardListener.enableRepeatEvents(false); + } + + @Override + public void init(Minecraft minecraft, int width, int height) { + super.init(minecraft, width, height); + minecraft.keyboardListener.enableRepeatEvents(true); + this.addButton(new Button(this.guiLeft + 260, this.guiTop + 62, 92, 20, new StringTextComponent("Fill Gas Cels"), e -> { + if (true) { + HemMod.PACKET_HANDLER.sendToServer(new AirboatGasCelViewGui.ButtonPressedMessage(0, x, y, z)); + AirboatGasCelViewGui.handleButtonAction(entity, 0, x, y, z); + } + })); + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/AltimeterOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/AltimeterOverlay.java new file mode 100644 index 0000000..1a582cb --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/AltimeterOverlay.java @@ -0,0 +1,106 @@ + +package studio.halbear.hem.gui.overlay; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; +import studio.halbear.hem.HemModVariables; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; +import net.minecraft.tags.EntityTypeTags; + + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.platform.GlStateManager; + +@Mod.EventBusSubscriber +public class AltimeterOverlay { + static ResourceLocation[] AltimeterNumbers = new ResourceLocation[10]; + static ResourceLocation[] AltimeterNumbersDecimal = new ResourceLocation[10]; + static{ + for(int i = 0; i < 10; i++){ + AltimeterNumbers[i] = new ResourceLocation("hem:textures/screens/odometernumber"+i+ ".png"); + AltimeterNumbersDecimal[i] = new ResourceLocation("hem:textures/screens/odometernumberdecimal"+i+ ".png"); + } + } + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.NORMAL) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + RenderSystem.disableDepthTest(); + RenderSystem.depthMask(false); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, + GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableAlphaTest(); + if (entity.isPassenger() && EntityTypeTags.getCollection().getTagByID(new ResourceLocation("hem:hem_altitude_vehicles")) + .contains((entity.getRidingEntity()).getType())) { + String AltimeterValue = ""; + if((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).Altimeter < 9999.9){ + AltimeterValue = String.valueOf(Math.max(Math.round((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).Altimeter * 10.0),0)/10.0); + } else{ + AltimeterValue = "9999.9"; + } + AltimeterValue = AltimeterValue.replace(".", ""); + char[] OdemeterValues = AltimeterValue.toCharArray(); + int[] indexes = new int[5]; + for(int i = 5; i > 0; i--){ + if(i <= OdemeterValues.length){ + indexes[5 - i] = Integer.parseInt("" + OdemeterValues[OdemeterValues.length - i]); + } else{ + indexes[5 - i] = 0; + } + } + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/altimeter.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*6, h/12, 0, 0, (h/6)*2, h/6, (h/6)*2, h/6); + + Minecraft.getInstance().getTextureManager().bindTexture(AltimeterNumbers[indexes[0]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*6 + (h/6)*2*8/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(AltimeterNumbers[indexes[1]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*6 + (h/6)*2*30/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(AltimeterNumbers[indexes[2]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*6 + (h/6)*2*52/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(AltimeterNumbers[indexes[3]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*6 + (h/6)*2*74/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(AltimeterNumbersDecimal[indexes[4]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*6 + (h/6)*2*101/128,h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + + } + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + RenderSystem.enableAlphaTest(); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/GooedOverlayOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/GooedOverlayOverlay.java new file mode 100644 index 0000000..888908c --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/GooedOverlayOverlay.java @@ -0,0 +1,224 @@ + +package studio.halbear.hem.gui.overlay; + +import studio.halbear.hem.procedures.GooedOverlayDisplayOverlayIngameProcedure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.platform.GlStateManager; + +@Mod.EventBusSubscriber +public class GooedOverlayOverlay { + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGHEST) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + RenderSystem.disableDepthTest(); + RenderSystem.depthMask(false); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, + GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableAlphaTest(); + if (GooedOverlayDisplayOverlayIngameProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) { + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/transparentgreen.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), 0, 0, 0, 0, w, h, w, h); + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -110, posY + 20, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 106, posY + -79, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -151, posY + -59, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 118, posY + 65, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -162, posY + 61, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -35, posY + -61, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -189, posY + -92, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 32, posY + 74, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -200, posY + 9, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 124, posY + -34, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -80, posY + -81, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -29, posY + 77, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 181, posY + -57, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -177, posY + -34, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 15, posY + -102, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 75, posY + 27, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -128, posY + 93, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -126, posY + -106, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 157, posY + -89, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 75, posY + -27, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 65, posY + 80, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -227, posY + -135, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 76, posY + -141, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 211, posY + 78, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -259, posY + 85, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -100, posY + 112, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -115, posY + -137, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -22, posY + -131, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -254, posY + -65, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 219, posY + 67, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -152, posY + 13, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 31, posY + -46, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 11, posY + 23, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -35, posY + 25, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -48, posY + -6, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -72, posY + 21, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -9, posY + 44, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -70, posY + 60, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -92, posY + 60, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 61, posY + -86, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 35, posY + 1, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -82, posY + -27, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -33, posY + -35, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 5, posY + 3, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -82, posY + 3, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 158, posY + 21, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 191, posY + 46, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -121, posY + -26, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed3.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + -217, posY + 85, 0, 0, 32, 32, 32, 32); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 182, posY + 96, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed2.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 189, posY + -116, 0, 0, 16, 16, 16, 16); + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/gooed1.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX + 89, posY + -119, 0, 0, 16, 16, 16, 16); + + } + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + RenderSystem.enableAlphaTest(); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/HotAirBalloonUIOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/HotAirBalloonUIOverlay.java new file mode 100644 index 0000000..3f740be --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/HotAirBalloonUIOverlay.java @@ -0,0 +1,52 @@ + +package studio.halbear.hem.gui.overlay; + +import studio.halbear.hem.procedures.HotAirBalloonUIDisplayOverlayIngame2Procedure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class HotAirBalloonUIOverlay { + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGH) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + if (HotAirBalloonUIDisplayOverlayIngame2Procedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) { + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/OdometerOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/OdometerOverlay.java new file mode 100644 index 0000000..6b47224 --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/OdometerOverlay.java @@ -0,0 +1,105 @@ + +package studio.halbear.hem.gui.overlay; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; +import studio.halbear.hem.HemModVariables; +import net.minecraft.tags.EntityTypeTags; + + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.platform.GlStateManager; + +@Mod.EventBusSubscriber +public class OdometerOverlay { + static ResourceLocation[] OdometerNumbers = new ResourceLocation[10]; + static ResourceLocation[] OdometerNumbersDecimal = new ResourceLocation[10]; + static{ + for(int i = 0; i < 10; i++){ + OdometerNumbers[i] = new ResourceLocation("hem:textures/screens/odometernumber"+i+ ".png"); + OdometerNumbersDecimal[i] = new ResourceLocation("hem:textures/screens/odometernumberdecimal"+i+ ".png"); + } + } + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.NORMAL) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + RenderSystem.disableDepthTest(); + RenderSystem.depthMask(false); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, + GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableAlphaTest(); + if (entity.isPassenger() && EntityTypeTags.getCollection().getTagByID(new ResourceLocation("hem:hem_odometer_vehicles")) + .contains((entity.getRidingEntity()).getType())) { + String OdometerValue = ""; + if((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).VehicleOdometer < 9999.9){ + OdometerValue = String.valueOf(Math.round((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).VehicleOdometer * 10.0)/10.0); + } else{ + OdometerValue = "9999.9"; + } + OdometerValue = OdometerValue.replace(".", ""); + char[] OdemeterValues = OdometerValue.toCharArray(); + int[] indexes = new int[5]; + for(int i = 5; i > 0; i--){ + if(i <= OdemeterValues.length){ + indexes[5 - i] = Integer.parseInt("" + OdemeterValues[OdemeterValues.length - i]); + } else{ + indexes[5 - i] = 0; + } + } + + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/odometer.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*3, h/12, 0, 0, (h/6)*2, h/6, (h/6)*2, h/6); + + Minecraft.getInstance().getTextureManager().bindTexture(OdometerNumbers[indexes[0]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*3 + (h/6)*2*8/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(OdometerNumbers[indexes[1]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*3 + (h/6)*2*30/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(OdometerNumbers[indexes[2]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*3 + (h/6)*2*52/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(OdometerNumbers[indexes[3]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*3 + (h/6)*2*74/128, h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + Minecraft.getInstance().getTextureManager().bindTexture(OdometerNumbersDecimal[indexes[4]]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/8)*3 + (h/6)*2*101/128,h/12 + (h/6)*19/64, 0, 0, (h/6)* 20/64, (h/6) * 37/64, (h/6)* 20/64, (h/6) * 37/64); + + } + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + RenderSystem.enableAlphaTest(); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/PressureGaugeOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/PressureGaugeOverlay.java new file mode 100644 index 0000000..1a17101 --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/PressureGaugeOverlay.java @@ -0,0 +1,79 @@ + +package studio.halbear.hem.gui.overlay; + +import studio.halbear.hem.HemModVariables; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; +import net.minecraft.tags.EntityTypeTags; + + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.platform.GlStateManager; + +@Mod.EventBusSubscriber +public class PressureGaugeOverlay { + static ResourceLocation[] GaugeTextures = new ResourceLocation[32]; + static{ + for(int i = 0; i < 32; i++){ + GaugeTextures[i] = new ResourceLocation("hem:textures/screens/hotairballoonpressureguage"+i+ ".png"); + } + } + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGH) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + RenderSystem.disableDepthTest(); + RenderSystem.depthMask(false); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, + GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableAlphaTest(); + if (entity.isPassenger() && EntityTypeTags.getCollection().getTagByID(new ResourceLocation("hem:hem_pressure_vehicles")) + .contains((entity.getRidingEntity()).getType())) { + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/pipe.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w/20 + h/6,h- (int)(h/5.5), 0, 0, h/6, (h/6)*4, h/6, (h/6)*4); + int Index = (int)Math.floor((Math.floor(32 * ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PSI/50.0)) % 32.0)); + Minecraft.getInstance().getTextureManager() .bindTexture(GaugeTextures[Index]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w/20 + h/6,h- (int)(h/5.5), 0, 0, h/6, h/6, h/6, h/6); + } + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + RenderSystem.enableAlphaTest(); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/SpeedGaugeOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/SpeedGaugeOverlay.java new file mode 100644 index 0000000..bcee0be --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/SpeedGaugeOverlay.java @@ -0,0 +1,78 @@ + +package studio.halbear.hem.gui.overlay; + +import studio.halbear.hem.HemModVariables; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + import net.minecraft.tags.EntityTypeTags; + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.platform.GlStateManager; + +@Mod.EventBusSubscriber +public class SpeedGaugeOverlay { + static ResourceLocation[] GaugeTextures = new ResourceLocation[32]; + static{ + for(int i = 0; i < 32; i++){ + GaugeTextures[i] = new ResourceLocation("hem:textures/screens/speedgauge"+i+ ".png"); + } + } + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.NORMAL) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + RenderSystem.disableDepthTest(); + RenderSystem.depthMask(false); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, + GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableAlphaTest(); + if (entity.isPassenger() && EntityTypeTags.getCollection().getTagByID(new ResourceLocation("hem:hem_speed_vehicles")) + .contains((entity.getRidingEntity()).getType())) { + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/pipe.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/6)*3, h- (int)(h/5), 0, 0, h/6, (h/6)*4, h/6, (h/6)*4); + int Index = (int)Math.floor((Math.floor(32 * ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).MPH/80.0)) % 32.0)); + Minecraft.getInstance().getTextureManager().bindTexture(GaugeTextures[Index]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), w - (h/6)*3, h- (int)(h/5), 0, 0, h/6, h/6, h/6, h/6); + } + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + RenderSystem.enableAlphaTest(); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/studio/halbear/hem/gui/overlay/TemperatureGaugeOverlay.java b/src/main/java/studio/halbear/hem/gui/overlay/TemperatureGaugeOverlay.java new file mode 100644 index 0000000..35ff991 --- /dev/null +++ b/src/main/java/studio/halbear/hem/gui/overlay/TemperatureGaugeOverlay.java @@ -0,0 +1,79 @@ + +package studio.halbear.hem.gui.overlay; + +import studio.halbear.hem.HemModVariables; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.EventPriority; +import net.minecraftforge.client.event.RenderGameOverlayEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; +import net.minecraft.tags.EntityTypeTags; + + +import com.mojang.blaze3d.systems.RenderSystem; +import com.mojang.blaze3d.platform.GlStateManager; + +@Mod.EventBusSubscriber +public class TemperatureGaugeOverlay { + static ResourceLocation[] GaugeTextures = new ResourceLocation[32]; + static{ + for(int i = 0; i < 32; i++){ + GaugeTextures[i] = new ResourceLocation("hem:textures/screens/tempgauge"+i+ ".png"); + } + } + @OnlyIn(Dist.CLIENT) + @SubscribeEvent(priority = EventPriority.HIGH) + public static void eventHandler(RenderGameOverlayEvent.Post event) { + if (event.getType() == RenderGameOverlayEvent.ElementType.HELMET) { + int w = event.getWindow().getScaledWidth(); + int h = event.getWindow().getScaledHeight(); + int posX = w / 2; + int posY = h / 2; + World _world = null; + double _x = 0; + double _y = 0; + double _z = 0; + PlayerEntity entity = Minecraft.getInstance().player; + if (entity != null) { + _world = entity.world; + _x = entity.getPosX(); + _y = entity.getPosY(); + _z = entity.getPosZ(); + } + World world = _world; + double x = _x; + double y = _y; + double z = _z; + RenderSystem.disableDepthTest(); + RenderSystem.depthMask(false); + RenderSystem.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, + GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderSystem.disableAlphaTest(); + if (entity.isPassenger() && EntityTypeTags.getCollection().getTagByID(new ResourceLocation("hem:hem_heat_vehicles")) + .contains((entity.getRidingEntity()).getType())) { + Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("hem:textures/screens/pipe.png")); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), (int)(w/20) + (int)((h/6) *1.8),h- (int)(h/6.5), 0, 0, h/6, (h/6)*4, h/6, (h/6)*4); + int Index = (int)Math.max(Math.floor((Math.floor(32 * ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).Heat/160.0)) % 32.0)),0); + Minecraft.getInstance().getTextureManager().bindTexture(GaugeTextures[Index]); + Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), (int)(w/20) + (int)((h/6) *1.8),h- (int)(h/3.5), 0, 0, h/6, h/6, h/6, h/6); + } + RenderSystem.depthMask(true); + RenderSystem.enableDepthTest(); + RenderSystem.enableAlphaTest(); + RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/BlueleafItem.java b/src/main/java/studio/halbear/hem/item/BlueleafItem.java new file mode 100644 index 0000000..3780594 --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/BlueleafItem.java @@ -0,0 +1,46 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.world.dimension.BlueleafDimension; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ActionResultType; +import net.minecraft.item.ItemUseContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.Item; +import net.minecraft.entity.player.PlayerEntity; + +public class BlueleafItem extends Item { + @ObjectHolder("hem:blueleaf") + public static final Item block = null; + + public BlueleafItem() { + super(new Item.Properties().group(ItemGroup.TOOLS).maxDamage(64)); + } + + @Override + public ActionResultType onItemUse(ItemUseContext context) { + PlayerEntity entity = context.getPlayer(); + BlockPos pos = context.getPos().offset(context.getFace()); + ItemStack itemstack = context.getItem(); + World world = context.getWorld(); + if (!entity.canPlayerEdit(pos, context.getFace(), itemstack)) { + return ActionResultType.FAIL; + } else { + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + boolean success = false; + if (world.isAirBlock(pos) && true) { + BlueleafDimension.portal.portalSpawn(world, pos); + itemstack.damageItem(1, entity, c -> c.sendBreakAnimation(context.getHand())); + success = true; + } + return success ? ActionResultType.SUCCESS : ActionResultType.FAIL; + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/ButterflySpawnEggItem.java b/src/main/java/studio/halbear/hem/item/ButterflySpawnEggItem.java new file mode 100644 index 0000000..7a73eca --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/ButterflySpawnEggItem.java @@ -0,0 +1,77 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.procedures.ButterflySpawnEggUseOnBlockProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemUseContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class ButterflySpawnEggItem extends HemModElements.ModElement { + @ObjectHolder("hem:butterfly_spawn_egg") + public static final Item block = null; + + public ButterflySpawnEggItem(HemModElements instance) { + super(instance, 43); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(BlueleafTabItemGroup.tab).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("butterfly_spawn_egg"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public ActionResultType onItemUseFirst(ItemStack stack, ItemUseContext context) { + ActionResultType retval = super.onItemUseFirst(stack, context); + World world = context.getWorld(); + BlockPos pos = context.getPos(); + PlayerEntity entity = context.getPlayer(); + Direction direction = context.getFace(); + BlockState blockstate = world.getBlockState(pos); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + ItemStack itemstack = context.getItem(); + + ButterflySpawnEggUseOnBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity), + new AbstractMap.SimpleEntry<>("itemstack", itemstack)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/FluffaloTuftItem.java b/src/main/java/studio/halbear/hem/item/FluffaloTuftItem.java new file mode 100644 index 0000000..68e59c5 --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/FluffaloTuftItem.java @@ -0,0 +1,44 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.block.BlockState; + +@HemModElements.ModElement.Tag +public class FluffaloTuftItem extends HemModElements.ModElement { + @ObjectHolder("hem:fluffalo_tuft") + public static final Item block = null; + + public FluffaloTuftItem(HemModElements instance) { + super(instance, 273); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(BlueleafTabItemGroup.tab).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("fluffalo_tuft"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/GasCanister612litreItem.java b/src/main/java/studio/halbear/hem/item/GasCanister612litreItem.java new file mode 100644 index 0000000..a0b6f85 --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/GasCanister612litreItem.java @@ -0,0 +1,87 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.procedures.GasCanister612litreItemIsCraftedsmeltedProcedure; +import studio.halbear.hem.procedures.GasCanister612litreItemInInventoryTickProcedure; +import studio.halbear.hem.itemgroup.HalsExplorationModTechItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class GasCanister612litreItem extends HemModElements.ModElement { + @ObjectHolder("hem:gas_canister_612litre") + public static final Item block = null; + + public GasCanister612litreItem(HemModElements instance) { + super(instance, 308); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(HalsExplorationModTechItemGroup.tab).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("gas_canister_612litre"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public void addInformation(ItemStack itemstack, World world, List list, ITooltipFlag flag) { + super.addInformation(itemstack, world, list, flag); + list.add(new StringTextComponent("612 Litres")); + } + + @Override + public void onCreated(ItemStack itemstack, World world, PlayerEntity entity) { + super.onCreated(itemstack, world, entity); + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + + GasCanister612litreItemIsCraftedsmeltedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("itemstack", itemstack)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public void inventoryTick(ItemStack itemstack, World world, Entity entity, int slot, boolean selected) { + super.inventoryTick(itemstack, world, entity, slot, selected); + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + + GasCanister612litreItemInInventoryTickProcedure.executeProcedure( + Stream.of(new AbstractMap.SimpleEntry<>("entity", entity), new AbstractMap.SimpleEntry<>("itemstack", itemstack)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/GoldFishItemItem.java b/src/main/java/studio/halbear/hem/item/GoldFishItemItem.java new file mode 100644 index 0000000..27d2205 --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/GoldFishItemItem.java @@ -0,0 +1,68 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.item.Rarity; +import net.minecraft.item.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.Food; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.block.BlockState; + +@HemModElements.ModElement.Tag +public class GoldFishItemItem extends HemModElements.ModElement { + @ObjectHolder("hem:gold_fish_item") + public static final Item block = null; + + public GoldFishItemItem(HemModElements instance) { + super(instance, 54); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(BlueleafTabItemGroup.tab).maxStackSize(64).rarity(Rarity.COMMON) + .food((new Food.Builder()).hunger(1).saturation(0.3f) + + .meat().build())); + setRegistryName("gold_fish_item"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public ItemStack onItemUseFinish(ItemStack itemstack, World world, LivingEntity entity) { + ItemStack retval = new ItemStack(Items.BONE); + super.onItemUseFinish(itemstack, world, entity); + if (itemstack.isEmpty()) { + return retval; + } else { + if (entity instanceof PlayerEntity) { + PlayerEntity player = (PlayerEntity) entity; + if (!player.isCreative() && !player.inventory.addItemStackToInventory(retval)) + player.dropItem(retval, false); + } + return itemstack; + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/HotAirBalloonItemItem.java b/src/main/java/studio/halbear/hem/item/HotAirBalloonItemItem.java new file mode 100644 index 0000000..503c64a --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/HotAirBalloonItemItem.java @@ -0,0 +1,76 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.procedures.HotAirBalloonItemRightclickedOnBlockProcedure; +import studio.halbear.hem.itemgroup.HalsExplorationModTechItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemUseContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class HotAirBalloonItemItem extends HemModElements.ModElement { + @ObjectHolder("hem:hot_air_balloon_item") + public static final Item block = null; + + public HotAirBalloonItemItem(HemModElements instance) { + super(instance, 277); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(HalsExplorationModTechItemGroup.tab).maxStackSize(1).rarity(Rarity.COMMON)); + setRegistryName("hot_air_balloon_item"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public ActionResultType onItemUseFirst(ItemStack stack, ItemUseContext context) { + ActionResultType retval = super.onItemUseFirst(stack, context); + World world = context.getWorld(); + BlockPos pos = context.getPos(); + PlayerEntity entity = context.getPlayer(); + Direction direction = context.getFace(); + BlockState blockstate = world.getBlockState(pos); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + ItemStack itemstack = context.getItem(); + + HotAirBalloonItemRightclickedOnBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("itemstack", itemstack)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/LadybugSpawnEggItem.java b/src/main/java/studio/halbear/hem/item/LadybugSpawnEggItem.java new file mode 100644 index 0000000..53f7b55 --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/LadybugSpawnEggItem.java @@ -0,0 +1,77 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.procedures.LadybugSpawnEggRightclickedOnBlockProcedure; +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; +import net.minecraft.item.Rarity; +import net.minecraft.item.ItemUseContext; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class LadybugSpawnEggItem extends HemModElements.ModElement { + @ObjectHolder("hem:ladybug_spawn_egg") + public static final Item block = null; + + public LadybugSpawnEggItem(HemModElements instance) { + super(instance, 36); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(BlueleafTabItemGroup.tab).maxStackSize(64).rarity(Rarity.COMMON)); + setRegistryName("ladybug_spawn_egg"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public ActionResultType onItemUseFirst(ItemStack stack, ItemUseContext context) { + ActionResultType retval = super.onItemUseFirst(stack, context); + World world = context.getWorld(); + BlockPos pos = context.getPos(); + PlayerEntity entity = context.getPlayer(); + Direction direction = context.getFace(); + BlockState blockstate = world.getBlockState(pos); + int x = pos.getX(); + int y = pos.getY(); + int z = pos.getZ(); + ItemStack itemstack = context.getItem(); + + LadybugSpawnEggRightclickedOnBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity), + new AbstractMap.SimpleEntry<>("itemstack", itemstack)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + return retval; + } + } +} diff --git a/src/main/java/studio/halbear/hem/item/TigerFishItemItem.java b/src/main/java/studio/halbear/hem/item/TigerFishItemItem.java new file mode 100644 index 0000000..8381589 --- /dev/null +++ b/src/main/java/studio/halbear/hem/item/TigerFishItemItem.java @@ -0,0 +1,68 @@ + +package studio.halbear.hem.item; + +import studio.halbear.hem.itemgroup.BlueleafTabItemGroup; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; + +import net.minecraft.world.World; +import net.minecraft.item.Rarity; +import net.minecraft.item.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Item; +import net.minecraft.item.Food; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.block.BlockState; + +@HemModElements.ModElement.Tag +public class TigerFishItemItem extends HemModElements.ModElement { + @ObjectHolder("hem:tiger_fish_item") + public static final Item block = null; + + public TigerFishItemItem(HemModElements instance) { + super(instance, 53); + } + + @Override + public void initElements() { + elements.items.add(() -> new ItemCustom()); + } + + public static class ItemCustom extends Item { + public ItemCustom() { + super(new Item.Properties().group(BlueleafTabItemGroup.tab).maxStackSize(64).rarity(Rarity.COMMON) + .food((new Food.Builder()).hunger(3).saturation(1.5f) + + .meat().build())); + setRegistryName("tiger_fish_item"); + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public float getDestroySpeed(ItemStack par1ItemStack, BlockState par2Block) { + return 1F; + } + + @Override + public ItemStack onItemUseFinish(ItemStack itemstack, World world, LivingEntity entity) { + ItemStack retval = new ItemStack(Items.BONE); + super.onItemUseFinish(itemstack, world, entity); + if (itemstack.isEmpty()) { + return retval; + } else { + if (entity instanceof PlayerEntity) { + PlayerEntity player = (PlayerEntity) entity; + if (!player.isCreative() && !player.inventory.addItemStackToInventory(retval)) + player.dropItem(retval, false); + } + return itemstack; + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/itemgroup/BlueleafTabItemGroup.java b/src/main/java/studio/halbear/hem/itemgroup/BlueleafTabItemGroup.java new file mode 100644 index 0000000..a4422c0 --- /dev/null +++ b/src/main/java/studio/halbear/hem/itemgroup/BlueleafTabItemGroup.java @@ -0,0 +1,36 @@ + +package studio.halbear.hem.itemgroup; + +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemGroup; + +@HemModElements.ModElement.Tag +public class BlueleafTabItemGroup extends HemModElements.ModElement { + public BlueleafTabItemGroup(HemModElements instance) { + super(instance, 63); + } + + @Override + public void initElements() { + tab = new ItemGroup("tabblueleaf_tab") { + @OnlyIn(Dist.CLIENT) + @Override + public ItemStack createIcon() { + return new ItemStack(BlueleafGrassBlockBlock.block); + } + + @OnlyIn(Dist.CLIENT) + public boolean hasSearchBar() { + return false; + } + }; + } + + public static ItemGroup tab; +} diff --git a/src/main/java/studio/halbear/hem/itemgroup/HalsExplorationModTechItemGroup.java b/src/main/java/studio/halbear/hem/itemgroup/HalsExplorationModTechItemGroup.java new file mode 100644 index 0000000..3b9fe01 --- /dev/null +++ b/src/main/java/studio/halbear/hem/itemgroup/HalsExplorationModTechItemGroup.java @@ -0,0 +1,36 @@ + +package studio.halbear.hem.itemgroup; + +import studio.halbear.hem.item.HotAirBalloonItemItem; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemGroup; + +@HemModElements.ModElement.Tag +public class HalsExplorationModTechItemGroup extends HemModElements.ModElement { + public HalsExplorationModTechItemGroup(HemModElements instance) { + super(instance, 290); + } + + @Override + public void initElements() { + tab = new ItemGroup("tabhals_exploration_mod_tech") { + @OnlyIn(Dist.CLIENT) + @Override + public ItemStack createIcon() { + return new ItemStack(HotAirBalloonItemItem.block); + } + + @OnlyIn(Dist.CLIENT) + public boolean hasSearchBar() { + return false; + } + }; + } + + public static ItemGroup tab; +} diff --git a/src/main/java/studio/halbear/hem/keybind/OpenGasCellViewKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/OpenGasCellViewKeyBinding.java new file mode 100644 index 0000000..1f3b8cd --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/OpenGasCellViewKeyBinding.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.OpenGasCellViewOnKeyReleasedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class OpenGasCellViewKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public OpenGasCellViewKeyBinding(HemModElements instance) { + super(instance, 310); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.open_gas_cell_view", GLFW.GLFW_KEY_O, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 1) { + + OpenGasCellViewOnKeyReleasedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleAccelerateKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleAccelerateKeyBinding.java new file mode 100644 index 0000000..d19e104 --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleAccelerateKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleAccelerateOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleAccelerateOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleAccelerateKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleAccelerateKeyBinding(HemModElements instance) { + super(instance, 184); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_accelerate", GLFW.GLFW_KEY_W, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleAccelerateOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleAccelerateOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleBackwardKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleBackwardKeyBinding.java new file mode 100644 index 0000000..8893c52 --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleBackwardKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleBackwardOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleBackwardOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleBackwardKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleBackwardKeyBinding(HemModElements instance) { + super(instance, 179); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_backward", GLFW.GLFW_KEY_S, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleBackwardOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleBackwardOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleDecelerateKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleDecelerateKeyBinding.java new file mode 100644 index 0000000..3ad676b --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleDecelerateKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleDecelerateOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleDecelerateOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleDecelerateKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleDecelerateKeyBinding(HemModElements instance) { + super(instance, 185); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_decelerate", GLFW.GLFW_KEY_S, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleDecelerateOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleDecelerateOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleForwardKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleForwardKeyBinding.java new file mode 100644 index 0000000..1355a5c --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleForwardKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleForwardOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleForwardOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleForwardKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleForwardKeyBinding(HemModElements instance) { + super(instance, 169); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_forward", GLFW.GLFW_KEY_W, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleForwardOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleForwardOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleIncreasePressureKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleIncreasePressureKeyBinding.java new file mode 100644 index 0000000..dd2939a --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleIncreasePressureKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleIncreasePressureOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleIncreasePressureOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleIncreasePressureKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleIncreasePressureKeyBinding(HemModElements instance) { + super(instance, 186); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_increase_pressure", GLFW.GLFW_KEY_SPACE, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleIncreasePressureOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleIncreasePressureOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleReleasePressureKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleReleasePressureKeyBinding.java new file mode 100644 index 0000000..c05e5c1 --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleReleasePressureKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleReleasePressureOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleReleasePressureOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleReleasePressureKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleReleasePressureKeyBinding(HemModElements instance) { + super(instance, 187); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_release_pressure", GLFW.GLFW_KEY_LEFT_CONTROL, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleReleasePressureOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleReleasePressureOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleStrafeLeftKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleStrafeLeftKeyBinding.java new file mode 100644 index 0000000..ae5f411 --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleStrafeLeftKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleStrafeLeftOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleStrafeLeftOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleStrafeLeftKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleStrafeLeftKeyBinding(HemModElements instance) { + super(instance, 182); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_strafe_left", GLFW.GLFW_KEY_Z, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleStrafeLeftOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleStrafeLeftOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleStrafeRightKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleStrafeRightKeyBinding.java new file mode 100644 index 0000000..2840414 --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleStrafeRightKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleStrafeRightOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleStrafeRightOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleStrafeRightKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleStrafeRightKeyBinding(HemModElements instance) { + super(instance, 183); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_strafe_right", GLFW.GLFW_KEY_X, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleStrafeRightOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleStrafeRightOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleTurnLeftKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleTurnLeftKeyBinding.java new file mode 100644 index 0000000..ea3b185 --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleTurnLeftKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleTurnLeftOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleTurnLeftOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleTurnLeftKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleTurnLeftKeyBinding(HemModElements instance) { + super(instance, 180); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_turn_left", GLFW.GLFW_KEY_A, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleTurnLeftOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleTurnLeftOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/keybind/VehicleTurnRightKeyBinding.java b/src/main/java/studio/halbear/hem/keybind/VehicleTurnRightKeyBinding.java new file mode 100644 index 0000000..d3fccaa --- /dev/null +++ b/src/main/java/studio/halbear/hem/keybind/VehicleTurnRightKeyBinding.java @@ -0,0 +1,116 @@ + +package studio.halbear.hem.keybind; + +import studio.halbear.hem.procedures.VehicleTurnRightOnKeyReleasedProcedure; +import studio.halbear.hem.procedures.VehicleTurnRightOnKeyPressedProcedure; +import studio.halbear.hem.HemModElements; +import studio.halbear.hem.HemMod; + +import org.lwjgl.glfw.GLFW; + +import net.minecraftforge.fml.network.NetworkEvent; +import net.minecraftforge.fml.client.registry.ClientRegistry; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.client.event.InputEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.World; +import net.minecraft.util.math.BlockPos; +import net.minecraft.network.PacketBuffer; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.function.Supplier; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@HemModElements.ModElement.Tag +public class VehicleTurnRightKeyBinding extends HemModElements.ModElement { + @OnlyIn(Dist.CLIENT) + private KeyBinding keys; + private long lastpress = 0; + + public VehicleTurnRightKeyBinding(HemModElements instance) { + super(instance, 181); + elements.addNetworkMessage(KeyBindingPressedMessage.class, KeyBindingPressedMessage::buffer, KeyBindingPressedMessage::new, + KeyBindingPressedMessage::handler); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initElements() { + keys = new KeyBinding("key.hem.vehicle_turn_right", GLFW.GLFW_KEY_D, "key.categories.hals_exploration_mod"); + ClientRegistry.registerKeyBinding(keys); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent + @OnlyIn(Dist.CLIENT) + public void onKeyInput(InputEvent.KeyInputEvent event) { + if (Minecraft.getInstance().currentScreen == null) { + if (event.getKey() == keys.getKey().getKeyCode()) { + if (event.getAction() == GLFW.GLFW_PRESS) { + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(0, 0)); + pressAction(Minecraft.getInstance().player, 0, 0); + lastpress = System.currentTimeMillis(); + } else if (event.getAction() == GLFW.GLFW_RELEASE) { + int dt = (int) (System.currentTimeMillis() - lastpress); + HemMod.PACKET_HANDLER.sendToServer(new KeyBindingPressedMessage(1, dt)); + pressAction(Minecraft.getInstance().player, 1, dt); + } + } + } + } + + public static class KeyBindingPressedMessage { + int type, pressedms; + + public KeyBindingPressedMessage(int type, int pressedms) { + this.type = type; + this.pressedms = pressedms; + } + + public KeyBindingPressedMessage(PacketBuffer buffer) { + this.type = buffer.readInt(); + this.pressedms = buffer.readInt(); + } + + public static void buffer(KeyBindingPressedMessage message, PacketBuffer buffer) { + buffer.writeInt(message.type); + buffer.writeInt(message.pressedms); + } + + public static void handler(KeyBindingPressedMessage message, Supplier contextSupplier) { + NetworkEvent.Context context = contextSupplier.get(); + context.enqueueWork(() -> { + pressAction(context.getSender(), message.type, message.pressedms); + }); + context.setPacketHandled(true); + } + } + + private static void pressAction(PlayerEntity entity, int type, int pressedms) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + // security measure to prevent arbitrary chunk generation + if (!world.isBlockLoaded(new BlockPos(x, y, z))) + return; + if (type == 0) { + + VehicleTurnRightOnKeyPressedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + if (type == 1) { + + VehicleTurnRightOnKeyReleasedProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("entity", entity)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/BlueLeavesParticle.java b/src/main/java/studio/halbear/hem/particle/BlueLeavesParticle.java new file mode 100644 index 0000000..6d4be09 --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/BlueLeavesParticle.java @@ -0,0 +1,98 @@ + +package studio.halbear.hem.particle; + +import studio.halbear.hem.procedures.BlueleavesCollideProcedure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class BlueLeavesParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("blue_leaves")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + private float angularVelocity; + private float angularAcceleration; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 2; + this.maxAge = 9999; + this.particleGravity = (float) 0.3; + this.canCollide = true; + this.motionX = vx * 0.3; + this.motionY = vy * 0.3; + this.motionZ = vz * 0.3; + this.angularVelocity = (float) 0.4; + this.angularAcceleration = (float) -0.02; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_OPAQUE; + } + + @Override + public void tick() { + super.tick(); + this.prevParticleAngle = this.particleAngle; + this.particleAngle += this.angularVelocity; + this.angularVelocity += this.angularAcceleration; + double x = this.posX; + double y = this.posY; + double z = this.posZ; + if (BlueleavesCollideProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("onGround", onGround)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + this.setExpired(); + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/BlueleafAmbienceParticle.java b/src/main/java/studio/halbear/hem/particle/BlueleafAmbienceParticle.java new file mode 100644 index 0000000..bd59aaf --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/BlueleafAmbienceParticle.java @@ -0,0 +1,90 @@ + +package studio.halbear.hem.particle; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class BlueleafAmbienceParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("blueleaf_ambience")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + private float angularVelocity; + private float angularAcceleration; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 1.5; + this.maxAge = (int) Math.max(1, 40 + (this.rand.nextInt(20) - 10)); + this.particleGravity = (float) -0.1; + this.canCollide = true; + this.motionX = vx * 0; + this.motionY = vy * 0; + this.motionZ = vz * 0; + this.angularVelocity = (float) 0.1; + this.angularAcceleration = (float) 0; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public int getBrightnessForRender(float partialTick) { + return 15728880; + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_LIT; + } + + @Override + public void tick() { + super.tick(); + this.prevParticleAngle = this.particleAngle; + this.particleAngle += this.angularVelocity; + this.angularVelocity += this.angularAcceleration; + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/FluorescentLeavesParticlesParticle.java b/src/main/java/studio/halbear/hem/particle/FluorescentLeavesParticlesParticle.java new file mode 100644 index 0000000..b2e72f5 --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/FluorescentLeavesParticlesParticle.java @@ -0,0 +1,105 @@ + +package studio.halbear.hem.particle; + +import studio.halbear.hem.procedures.FluorescentLeavesParticlesAdditionalParticleExpiryConditionProcedure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class FluorescentLeavesParticlesParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("fluorescent_leaves_particles")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + private float angularVelocity; + private float angularAcceleration; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 2; + this.maxAge = 200; + this.particleGravity = (float) 0.1; + this.canCollide = true; + this.motionX = vx * 0.3; + this.motionY = vy * 0.3; + this.motionZ = vz * 0.3; + this.angularVelocity = (float) 0.3; + this.angularAcceleration = (float) -0.01; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public int getBrightnessForRender(float partialTick) { + return 15728880; + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_LIT; + } + + @Override + public void tick() { + super.tick(); + this.prevParticleAngle = this.particleAngle; + this.particleAngle += this.angularVelocity; + this.angularVelocity += this.angularAcceleration; + double x = this.posX; + double y = this.posY; + double z = this.posZ; + if (FluorescentLeavesParticlesAdditionalParticleExpiryConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("onGround", onGround)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + this.setExpired(); + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/LavenderParticlesParticle.java b/src/main/java/studio/halbear/hem/particle/LavenderParticlesParticle.java new file mode 100644 index 0000000..f2673ab --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/LavenderParticlesParticle.java @@ -0,0 +1,78 @@ + +package studio.halbear.hem.particle; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class LavenderParticlesParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("lavender_particles")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 2; + this.maxAge = (int) Math.max(1, 60 + (this.rand.nextInt(80) - 40)); + this.particleGravity = (float) -0.05; + this.canCollide = true; + this.motionX = vx * 0.2; + this.motionY = vy * 0.2; + this.motionZ = vz * 0.2; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_OPAQUE; + } + + @Override + public void tick() { + super.tick(); + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/LilyPadParticlesParticle.java b/src/main/java/studio/halbear/hem/particle/LilyPadParticlesParticle.java new file mode 100644 index 0000000..a61fe45 --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/LilyPadParticlesParticle.java @@ -0,0 +1,83 @@ + +package studio.halbear.hem.particle; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class LilyPadParticlesParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("lily_pad_particles")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 1.3; + this.maxAge = (int) Math.max(1, 20 + (this.rand.nextInt(40) - 20)); + this.particleGravity = (float) -0.2; + this.canCollide = true; + this.motionX = vx * 0.2; + this.motionY = vy * 0.2; + this.motionZ = vz * 0.2; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public int getBrightnessForRender(float partialTick) { + return 15728880; + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_LIT; + } + + @Override + public void tick() { + super.tick(); + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/RobotDamageParticle.java b/src/main/java/studio/halbear/hem/particle/RobotDamageParticle.java new file mode 100644 index 0000000..55d3b43 --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/RobotDamageParticle.java @@ -0,0 +1,98 @@ + +package studio.halbear.hem.particle; + +import studio.halbear.hem.procedures.BlueleavesCollideProcedure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class RobotDamageParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("robot_damage")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + private float angularVelocity; + private float angularAcceleration; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 1; + this.maxAge = 1000; + this.particleGravity = (float) 0.6; + this.canCollide = true; + this.motionX = vx * 0.2; + this.motionY = vy * 0.2; + this.motionZ = vz * 0.2; + this.angularVelocity = (float) 0.3; + this.angularAcceleration = (float) 0; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_OPAQUE; + } + + @Override + public void tick() { + super.tick(); + this.prevParticleAngle = this.particleAngle; + this.particleAngle += this.angularVelocity; + this.angularVelocity += this.angularAcceleration; + double x = this.posX; + double y = this.posY; + double z = this.posZ; + if (BlueleavesCollideProcedure.executeProcedure(Stream.of(new AbstractMap.SimpleEntry<>("onGround", onGround)).collect(HashMap::new, + (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + this.setExpired(); + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/particle/SevereDamageParticlesParticle.java b/src/main/java/studio/halbear/hem/particle/SevereDamageParticlesParticle.java new file mode 100644 index 0000000..0dfb9f5 --- /dev/null +++ b/src/main/java/studio/halbear/hem/particle/SevereDamageParticlesParticle.java @@ -0,0 +1,85 @@ + +package studio.halbear.hem.particle; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.client.event.ParticleFactoryRegisterEvent; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.particles.ParticleType; +import net.minecraft.particles.BasicParticleType; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.client.particle.SpriteTexturedParticle; +import net.minecraft.client.particle.Particle; +import net.minecraft.client.particle.IParticleRenderType; +import net.minecraft.client.particle.IParticleFactory; +import net.minecraft.client.particle.IAnimatedSprite; +import net.minecraft.client.Minecraft; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class SevereDamageParticlesParticle { + public static final BasicParticleType particle = new BasicParticleType(false); + + @SubscribeEvent + public static void registerParticleType(RegistryEvent.Register> event) { + event.getRegistry().register(particle.setRegistryName("severe_damage_particles")); + } + + @OnlyIn(Dist.CLIENT) + @SubscribeEvent + public static void registerParticle(ParticleFactoryRegisterEvent event) { + Minecraft.getInstance().particles.registerFactory(particle, CustomParticleFactory::new); + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticle extends SpriteTexturedParticle { + private final IAnimatedSprite spriteSet; + private float angularVelocity; + private float angularAcceleration; + + protected CustomParticle(ClientWorld world, double x, double y, double z, double vx, double vy, double vz, IAnimatedSprite spriteSet) { + super(world, x, y, z); + this.spriteSet = spriteSet; + this.setSize((float) 0.2, (float) 0.2); + this.particleScale *= (float) 1.5; + this.maxAge = (int) Math.max(1, 35 + (this.rand.nextInt(40) - 20)); + this.particleGravity = (float) 0.4; + this.canCollide = true; + this.motionX = vx * 0.3; + this.motionY = vy * 0.3; + this.motionZ = vz * 0.3; + this.angularVelocity = (float) 0.1; + this.angularAcceleration = (float) 0; + this.selectSpriteRandomly(spriteSet); + } + + @Override + public IParticleRenderType getRenderType() { + return IParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; + } + + @Override + public void tick() { + super.tick(); + this.prevParticleAngle = this.particleAngle; + this.particleAngle += this.angularVelocity; + this.angularVelocity += this.angularAcceleration; + } + } + + @OnlyIn(Dist.CLIENT) + private static class CustomParticleFactory implements IParticleFactory { + private final IAnimatedSprite spriteSet; + + public CustomParticleFactory(IAnimatedSprite spriteSet) { + this.spriteSet = spriteSet; + } + + public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, + double zSpeed) { + return new CustomParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet); + } + } +} diff --git a/src/main/java/studio/halbear/hem/potion/GooedPotionEffect.java b/src/main/java/studio/halbear/hem/potion/GooedPotionEffect.java new file mode 100644 index 0000000..62c6a86 --- /dev/null +++ b/src/main/java/studio/halbear/hem/potion/GooedPotionEffect.java @@ -0,0 +1,99 @@ + +package studio.halbear.hem.potion; + +import studio.halbear.hem.procedures.GooedOnEffectActiveTickProcedure; +import studio.halbear.hem.procedures.GooedEffectStartedappliedProcedure; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.World; +import net.minecraft.potion.EffectType; +import net.minecraft.potion.EffectInstance; +import net.minecraft.potion.Effect; +import net.minecraft.entity.ai.attributes.AttributeModifierManager; +import net.minecraft.entity.LivingEntity; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.Collections; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) +public class GooedPotionEffect { + @ObjectHolder("hem:gooed") + public static final Effect potion = null; + + @SubscribeEvent + public static void registerEffect(RegistryEvent.Register event) { + event.getRegistry().register(new EffectCustom()); + } + + public static class EffectCustom extends Effect { + public EffectCustom() { + super(EffectType.HARMFUL, -12097002); + setRegistryName("gooed"); + } + + @Override + public String getName() { + return "effect.gooed"; + } + + @Override + public boolean isBeneficial() { + return false; + } + + @Override + public boolean isInstant() { + return false; + } + + @Override + public boolean shouldRenderInvText(EffectInstance effect) { + return true; + } + + @Override + public boolean shouldRender(EffectInstance effect) { + return true; + } + + @Override + public boolean shouldRenderHUD(EffectInstance effect) { + return true; + } + + @Override + public void applyAttributesModifiersToEntity(LivingEntity entity, AttributeModifierManager attributeMapIn, int amplifier) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + + GooedEffectStartedappliedProcedure.executeProcedure(Collections.emptyMap()); + } + + @Override + public void performEffect(LivingEntity entity, int amplifier) { + World world = entity.world; + double x = entity.getPosX(); + double y = entity.getPosY(); + double z = entity.getPosZ(); + + GooedOnEffectActiveTickProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), + new AbstractMap.SimpleEntry<>("z", z), new AbstractMap.SimpleEntry<>("entity", entity)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AirboatOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/AirboatOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..ee1db0c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AirboatOnEntityTickUpdateProcedure.java @@ -0,0 +1,202 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Map; +import java.util.List; +import java.util.Comparator; + +public class AirboatOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure AirboatOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure AirboatOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure AirboatOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure AirboatOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure AirboatOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + double Dx = 0; + double Dy = 0; + double TPS = 0; + double Ylevel = 0; + double Iterations = 0; + if (entity.ticksExisted % 5 == 0) { + Dx = (entity.getPosX() - entity.getPersistentData().getDouble("lastPosX")); + Dy = (entity.getPosZ() - entity.getPersistentData().getDouble("lastPosY")); + entity.getPersistentData().putDouble("MetresTravelled", + (entity.getPersistentData().getDouble("MetresTravelled") + Math.abs(Dx) + Math.abs(Dy))); + entity.getPersistentData().putDouble("lastPosX", (entity.getPosX())); + entity.getPersistentData().putDouble("lastPosY", (entity.getPosZ())); + } + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (9 / 2d), (y - 4) - (9 / 2d), z - (9 / 2d), x + (9 / 2d), (y - 4) + (9 / 2d), z + (9 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, (y - 4), z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if (entityiterator.isPassenger() && entityiterator instanceof ServerPlayerEntity) { + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).PilotingVehicleID == entity.getPersistentData().getDouble("ID")) { + { + double _setval = (entity.getPersistentData().getDouble("Pressure")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PSI = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Fuel")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Fuel = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Heat")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Heat = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("MetresTravelled")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleOdometerMetres = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + entity.rotationYaw = (float) (((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleYaw)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + entity.getPersistentData().putDouble("Yaw", ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleYaw)); + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleIncreasePressure) { + entity.getPersistentData().putBoolean("OpenFlame", (true)); + } else { + entity.getPersistentData().putBoolean("OpenFlame", (false)); + } + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleReleasePressure) { + entity.getPersistentData().putBoolean("ReleasePressure", (true)); + } else { + entity.getPersistentData().putBoolean("ReleasePressure", (false)); + } + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleForward) { + entity.getPersistentData().putDouble("XVel", (0.05 * entity.getLookVec().x)); + entity.getPersistentData().putDouble("YVel", (0.05 * entity.getLookVec().z)); + } + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleBackward) { + entity.getPersistentData().putDouble("YVel", ((-0.05) * entity.getLookVec().z)); + entity.getPersistentData().putDouble("XVel", ((-0.05) * entity.getLookVec().x)); + } + } + } + } + } + entity.getPersistentData().putDouble("Tick", (entity.getPersistentData().getDouble("Tick") - 1)); + if (entity.getMotion().getX() > 2) { + entity.getPersistentData().putDouble("XVel", (2 - entity.getMotion().getX())); + } + if (entity.getMotion().getX() < -2) { + entity.getPersistentData().putDouble("XVel", ((-2) - entity.getMotion().getX())); + } + if (entity.getMotion().getZ() > 2) { + entity.getPersistentData().putDouble("YVel", (2 - entity.getMotion().getZ())); + } + if (entity.getMotion().getZ() < -2) { + entity.getPersistentData().putDouble("YVel", ((-2) - entity.getMotion().getZ())); + } + if (entity.getPersistentData().getDouble("Heat") <= 10 && entity.getPersistentData().getDouble("Pressure") <= 10 + && entity.getMotion().getY() >= -0.5) { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), (entity.getMotion().getY() - 0.05), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } else if (entity.getPersistentData().getDouble("Pressure") > 10) { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), + (entity.getPersistentData().getDouble("Pressure") / 75), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } else if (entity.getPersistentData().getDouble("Pressure") < 10) { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), (entity.getMotion().getY() - 0.05), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } else { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), (entity.getMotion().getY()), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } + entity.getPersistentData().putDouble("YVel", 0); + entity.getPersistentData().putDouble("XVel", 0); + if (entity.getPersistentData().getDouble("Pressure") <= 35 && entity.getPersistentData().getBoolean("OpenFlame")) { + entity.getPersistentData().putDouble("Pressure", + (entity.getPersistentData().getDouble("Pressure") + entity.getPersistentData().getDouble("Heat") / 150)); + } + if (entity.getPersistentData().getBoolean("OpenFlame")) { + world.addParticle(ParticleTypes.LARGE_SMOKE, x, y, z, 0, (entity.getMotion().getY() + 0.2), 0); + } + if (entity.getPersistentData().getDouble("Tick") <= 0) { + entity.getPersistentData().putDouble("Tick", 20); + if (entity.getPersistentData().getBoolean("ReleasePressure")) { + entity.getPersistentData().putDouble("Pressure", Math.round(entity.getPersistentData().getDouble("Pressure") - 1)); + } + if (entity.getPersistentData().getDouble("Pressure") > 10 && entity.getPersistentData().getDouble("Heat") >= 10 + && !entity.getPersistentData().getBoolean("OpenFlame")) { + entity.getPersistentData().putDouble("Pressure", Math.round(entity.getPersistentData().getDouble("Pressure") - 1)); + } else if (entity.getPersistentData().getDouble("Pressure") < 10 && !entity.getPersistentData().getBoolean("ReleasePressure")) { + entity.getPersistentData().putDouble("Pressure", Math.round(entity.getPersistentData().getDouble("Pressure") + 1)); + } + if (entity.getPersistentData().getDouble("Fuel") > 0 && entity.getPersistentData().getDouble("Heat") < 150) { + entity.getPersistentData().putDouble("Heat", (entity.getPersistentData().getDouble("Heat") + 5)); + entity.getPersistentData().putDouble("Fuel", (entity.getPersistentData().getDouble("Fuel") - 1)); + } else if (entity.getPersistentData().getDouble("Fuel") > 0 && entity.getPersistentData().getDouble("Heat") > 0) { + entity.getPersistentData().putDouble("Fuel", (entity.getPersistentData().getDouble("Fuel") - 1)); + } else if (entity.getPersistentData().getDouble("Fuel") <= 0 && entity.getPersistentData().getDouble("Heat") > 0) { + entity.getPersistentData().putDouble("Heat", (entity.getPersistentData().getDouble("Heat") - 1)); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AirboatOnInitialEntitySpawnProcedure.java b/src/main/java/studio/halbear/hem/procedures/AirboatOnInitialEntitySpawnProcedure.java new file mode 100644 index 0000000..011274e --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AirboatOnInitialEntitySpawnProcedure.java @@ -0,0 +1,44 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class AirboatOnInitialEntitySpawnProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure AirboatOnInitialEntitySpawn!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure AirboatOnInitialEntitySpawn!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + Entity entity = (Entity) dependencies.get("entity"); + entity.getPersistentData().putDouble("Tick", 20); + entity.getPersistentData().putDouble("Helium", 100); + entity.getPersistentData().putDouble("Heat", 0); + entity.getPersistentData().putDouble("Fuel", 0); + entity.getPersistentData().putDouble("lastPosX", 0); + entity.getPersistentData().putDouble("lastPosZ", 0); + entity.getPersistentData().putDouble("MetresTravelled", 0); + entity.getPersistentData().putDouble("RPM", 0); + entity.getPersistentData().putDouble("Pressure", 10); + entity.getPersistentData().putBoolean("ReleasePressure", (false)); + entity.getPersistentData().putBoolean("OpenFlame", (false)); + entity.getPersistentData().putDouble("XVel", 0); + entity.getPersistentData().putDouble("YVel", 0); + entity.getPersistentData().putDouble("Yaw", (entity.rotationYaw)); + entity.getPersistentData().putDouble("ID", HemModVariables.WorldVariables.get(world).VehicleID); + HemModVariables.WorldVariables.get(world).VehicleID = (HemModVariables.WorldVariables.get(world).VehicleID + 1); + HemModVariables.WorldVariables.get(world).syncData(world); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AirboatRightClickedOnEntityProcedure.java b/src/main/java/studio/halbear/hem/procedures/AirboatRightClickedOnEntityProcedure.java new file mode 100644 index 0000000..17e2f82 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AirboatRightClickedOnEntityProcedure.java @@ -0,0 +1,84 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.ItemTags; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class AirboatRightClickedOnEntityProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure AirboatRightClickedOnEntity!"); + return; + } + if (dependencies.get("sourceentity") == null) { + if (!dependencies.containsKey("sourceentity")) + HemMod.LOGGER.warn("Failed to load dependency sourceentity for procedure AirboatRightClickedOnEntity!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + Entity sourceentity = (Entity) dependencies.get("sourceentity"); + if (ItemTags.getCollection().getTagByID(new ResourceLocation("forge:hem_fossilfuel")).contains( + ((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemMainhand() : ItemStack.EMPTY).getItem())) { + (((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemMainhand() : ItemStack.EMPTY)).shrink((int) 1); + entity.getPersistentData().putDouble("Fuel", (entity.getPersistentData().getDouble("Fuel") + 5)); + if (sourceentity instanceof PlayerEntity && !sourceentity.world.isRemote()) { + ((PlayerEntity) sourceentity).sendStatusMessage(new StringTextComponent("Vehicle Fueled"), (true)); + } + } + if (!sourceentity.isSneaking() && !entity.isBeingRidden() || sourceentity.isPassenger() && (sourceentity.getRidingEntity()) == entity) { + { + double _setval = (entity.getPersistentData().getDouble("ID")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PilotingVehicleID = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("MetresTravelled")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleOdometerMetres = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Fuel")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Fuel = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Pressure")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PSI = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Heat")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Heat = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Yaw")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleYaw = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AntHillSpawnOnStructureInstanceGeneratedProcedure.java b/src/main/java/studio/halbear/hem/procedures/AntHillSpawnOnStructureInstanceGeneratedProcedure.java new file mode 100644 index 0000000..9e269d3 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AntHillSpawnOnStructureInstanceGeneratedProcedure.java @@ -0,0 +1,294 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.BlueleafDirtBlockBlock; +import studio.halbear.hem.block.AntsBlock; +import studio.halbear.hem.block.AntHillBlock; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.state.Property; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; +import java.util.Map; + +public class AntHillSpawnOnStructureInstanceGeneratedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure AntHillSpawnOnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure AntHillSpawnOnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure AntHillSpawnOnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure AntHillSpawnOnStructureInstanceGenerated!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + double Random = 0; + world.setBlockState(new BlockPos(x, y + 1, z), AntHillBlock.block.getDefaultState(), 3); + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x + 1, y, z))).getBlock())) { + { + BlockPos _bp = new BlockPos(x + 1, y, z); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x + 1, y + 1, z))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x + 1, y + 1, z); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x - 1, y, z))).getBlock())) { + { + BlockPos _bp = new BlockPos(x - 1, y, z); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x - 1, y + 1, z))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x - 1, y + 1, z); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x + 1, y, z - 1))).getBlock())) { + { + BlockPos _bp = new BlockPos(x + 1, y, z - 1); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x + 1, y + 1, z - 1))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x + 1, y + 1, z - 1); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x + 1, y, z + 1))).getBlock())) { + { + BlockPos _bp = new BlockPos(x + 1, y, z + 1); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x + 1, y + 1, z + 1))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x + 1, y + 1, z + 1); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x - 1, y, z + 1))).getBlock())) { + { + BlockPos _bp = new BlockPos(x - 1, y, z + 1); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x - 1, y + 1, z + 1))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x - 1, y + 1, z + 1); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y, z + 1))).getBlock())) { + { + BlockPos _bp = new BlockPos(x, y, z + 1); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x, y + 1, z + 1))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x, y + 1, z + 1); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + if (Math.random() > 0.5 && BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y, z - 1))).getBlock())) { + { + BlockPos _bp = new BlockPos(x, y, z - 1); + BlockState _bs = BlueleafDirtBlockBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (Math.random() > 0.5 && (world.getBlockState(new BlockPos(x, y + 1, z - 1))).getBlock() == Blocks.AIR) { + { + BlockPos _bp = new BlockPos(x, y + 1, z - 1); + BlockState _bs = AntsBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AntHillUpdateTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/AntHillUpdateTickProcedure.java new file mode 100644 index 0000000..d2b1e45 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AntHillUpdateTickProcedure.java @@ -0,0 +1,93 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.AntsBlock; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.block.Blocks; + +import java.util.Random; +import java.util.Map; + +public class AntHillUpdateTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure AntHillUpdateTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure AntHillUpdateTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure AntHillUpdateTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure AntHillUpdateTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + double Random = 0; + Random = Math.random(); + if (Random >= 0.1) { + if ((world.getBlockState(new BlockPos(x + 1, y, z))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x + 1, y, z), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x - 1, y, z))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x - 1, y, z), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x - 1, y, z - 1))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x - 1, y, z - 1), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x + 1, y, z - 1))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x + 1, y, z - 1), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x - 1, y, z + 1))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x - 1, y, z + 1), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x + 1, y, z + 1))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x + 1, y, z + 1), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x, y, z + 1))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x, y, z + 1), AntsBlock.block.getDefaultState(), 3); + } + } + if ((world.getBlockState(new BlockPos(x, y, z - 1))).getBlock() == Blocks.AIR) { + Random = Math.random(); + if (Random >= 0.75) { + world.setBlockState(new BlockPos(x, y, z - 1), AntsBlock.block.getDefaultState(), 3); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AntsBlockAddedProcedure.java b/src/main/java/studio/halbear/hem/procedures/AntsBlockAddedProcedure.java new file mode 100644 index 0000000..d44e778 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AntsBlockAddedProcedure.java @@ -0,0 +1,45 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class AntsBlockAddedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure AntsBlockAdded!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure AntsBlockAdded!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure AntsBlockAdded!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure AntsBlockAdded!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (!BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y - 1, z))).getBlock())) { + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/AntsEntityWalksOnTheBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/AntsEntityWalksOnTheBlockProcedure.java new file mode 100644 index 0000000..dd4590c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/AntsEntityWalksOnTheBlockProcedure.java @@ -0,0 +1,110 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.LadybugEntity; +import studio.halbear.hem.block.AntsBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.entity.Entity; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.Map; + +public class AntsEntityWalksOnTheBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure AntsEntityWalksOnTheBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure AntsEntityWalksOnTheBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure AntsEntityWalksOnTheBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure AntsEntityWalksOnTheBlock!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure AntsEntityWalksOnTheBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (entity instanceof LadybugEntity.CustomEntity) { + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.eat")), + SoundCategory.NEUTRAL, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.eat")), + SoundCategory.NEUTRAL, (float) 1, (float) 1, false); + } + world.playEvent(2001, new BlockPos(x, y, z), Block.getStateId(AntsBlock.block.getDefaultState())); + new Object() { + private int ticks = 0; + private float waitTicks; + private IWorld world; + + public void start(IWorld world, int waitTicks) { + this.waitTicks = waitTicks; + MinecraftForge.EVENT_BUS.register(this); + this.world = world; + } + + @SubscribeEvent + public void tick(TickEvent.ServerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + this.ticks += 1; + if (this.ticks >= this.waitTicks) + run(); + } + } + + private void run() { + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = Blocks.AIR.getDefaultState(); + world.setBlockState(_bp, _bs, 3); + } + MinecraftForge.EVENT_BUS.unregister(this); + } + }.start(world, (int) 10); + } else { + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = Blocks.AIR.getDefaultState(); + world.setBlockState(_bp, _bs, 3); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(ParticleTypes.POOF, x, y, z, (int) 3, 0, 0, 0, 0.05); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BloomedBulbFlowerUpdateTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/BloomedBulbFlowerUpdateTickProcedure.java new file mode 100644 index 0000000..c146788 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BloomedBulbFlowerUpdateTickProcedure.java @@ -0,0 +1,58 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.BulbFlowerBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class BloomedBulbFlowerUpdateTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BloomedBulbFlowerUpdateTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BloomedBulbFlowerUpdateTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BloomedBulbFlowerUpdateTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BloomedBulbFlowerUpdateTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (!((world instanceof World) ? ((World) world).isDaytime() : false)) { + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), BulbFlowerBlock.block.getDefaultState(), 3); + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.BLOCKS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.BLOCKS, (float) 1, (float) 1, false); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BloomedMuncherEntityCollidesInTheBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/BloomedMuncherEntityCollidesInTheBlockProcedure.java new file mode 100644 index 0000000..e3c7a85 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BloomedMuncherEntityCollidesInTheBlockProcedure.java @@ -0,0 +1,212 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.SevereDamageParticlesParticle; +import studio.halbear.hem.block.MuncherBlock; +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.state.Property; +import net.minecraft.potion.Effects; +import net.minecraft.potion.EffectInstance; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.block.BlockState; + +import java.util.Map; +import java.util.Collections; + +public class BloomedMuncherEntityCollidesInTheBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BloomedMuncherEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BloomedMuncherEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BloomedMuncherEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BloomedMuncherEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure BloomedMuncherEntityCollidesInTheBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "tickable") && (new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating")) == false) { + if (entity instanceof ServerPlayerEntity || ((entity instanceof LivingEntity) ? ((LivingEntity) entity).getMaxHealth() : -1) < 50 + && !(entity instanceof ItemEntity) && !(entity instanceof ServerPlayerEntity)) { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("bites", (5 + Math.round(5 * Math.random()))); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 0); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("maxcooldown", 20); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putString("victimuuid", (entity.getUniqueID().toString())); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (entity instanceof ServerPlayerEntity) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Eaten = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = x; + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.LastPlantTrapX = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = z; + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.LastPlantTrapZ = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = y; + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.LastPlantTrapY = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + entity.setMotion(0, 0.1, 0); + { + Entity _ent = entity; + _ent.setPositionAndUpdate((x + 0.5), y, (z + 0.5)); + if (_ent instanceof ServerPlayerEntity) { + ((ServerPlayerEntity) _ent).connection.setPlayerLocation((x + 0.5), y, (z + 0.5), _ent.rotationYaw, _ent.rotationPitch, + Collections.emptySet()); + } + } + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.INVISIBILITY, (int) 9999999, (int) 5, (false), (false))); + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.SLOWNESS, (int) 9999999, (int) 100, (false), (false))); + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.hoglin.angry")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.hoglin.angry")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(SevereDamageParticlesParticle.particle, x, y, z, (int) 10, 0, 2, 0, 0.3); + } + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = MuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + TileEntity _te = world.getTileEntity(_bp); + CompoundNBT _bnbt = null; + if (_te != null) { + _bnbt = _te.write(new CompoundNBT()); + _te.remove(); + } + world.setBlockState(_bp, _bs, 3); + if (_bnbt != null) { + _te = world.getTileEntity(_bp); + if (_te != null) { + try { + _te.read(_bso, _bnbt); + } catch (Exception ignored) { + } + } + } + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BloomedMuncherUpdateTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/BloomedMuncherUpdateTickProcedure.java new file mode 100644 index 0000000..7699ed0 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BloomedMuncherUpdateTickProcedure.java @@ -0,0 +1,205 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.MuncherBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.state.Property; +import net.minecraft.entity.projectile.ArrowEntity; +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.item.ArmorStandEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.AreaEffectCloudEntity; +import net.minecraft.block.BlockState; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Map; +import java.util.List; +import java.util.Comparator; + +public class BloomedMuncherUpdateTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BloomedMuncherUpdateTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BloomedMuncherUpdateTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BloomedMuncherUpdateTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BloomedMuncherUpdateTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + double entitiesInside = 0; + double entitiesNearby = 0; + if (new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating")) { + if (new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown") > 0) { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", ((new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown")) - 1)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + } else { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (false)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putString("victimuuid", "nill"); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + } + } + if (!(new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating"))) { + entitiesNearby = 0; + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (6 / 2d), y - (6 / 2d), z - (6 / 2d), x + (6 / 2d), y + (6 / 2d), z + (6 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if (!(entityiterator instanceof ItemEntity) && !(entityiterator instanceof ArrowEntity) + && !(entityiterator instanceof AreaEffectCloudEntity) && !(entityiterator instanceof ArmorStandEntity)) { + entitiesNearby = (entitiesNearby + 1); + } + } + } + if (!((world instanceof World) ? ((World) world).isDaytime() : false) && entitiesNearby == 0) { + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = MuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.HOSTILE, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.HOSTILE, (float) 1, (float) 1, false); + } + } else if (Math.random() > 0.99 && entitiesNearby == 0) { + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = MuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.HOSTILE, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.HOSTILE, (float) 1, (float) 1, false); + } + } + } + if (!(new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "tickable"))) { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("tickable", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BlueleafFluorescentLeavesParticleSpawningConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/BlueleafFluorescentLeavesParticleSpawningConditionProcedure.java new file mode 100644 index 0000000..11c1af6 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BlueleafFluorescentLeavesParticleSpawningConditionProcedure.java @@ -0,0 +1,24 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; + +import java.util.Map; + +public class BlueleafFluorescentLeavesParticleSpawningConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BlueleafFluorescentLeavesParticleSpawningCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + if (!((world instanceof World) ? ((World) world).isDaytime() : false)) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderConditionProcedure.java new file mode 100644 index 0000000..b689d83 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderConditionProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import java.util.Map; + +public class BlueleafLavenderConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BlueleafLavenderCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BlueleafLavenderCondition!"); + return false; + } + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (z < 0 || z <= 0 && x % 24 != 0 || z <= 16 && z > 0 && x % 24 == 0) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderMobplayerCollidesWithPlantProcedure.java b/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderMobplayerCollidesWithPlantProcedure.java new file mode 100644 index 0000000..01f32bb --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderMobplayerCollidesWithPlantProcedure.java @@ -0,0 +1,71 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.LavenderParticlesParticle; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.IWorld; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class BlueleafLavenderMobplayerCollidesWithPlantProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BlueleafLavenderMobplayerCollidesWithPlant!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BlueleafLavenderMobplayerCollidesWithPlant!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BlueleafLavenderMobplayerCollidesWithPlant!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BlueleafLavenderMobplayerCollidesWithPlant!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure BlueleafLavenderMobplayerCollidesWithPlant!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + double zv = 0; + double xv = 0; + xv = (entity.getMotion().getX()); + zv = (entity.getMotion().getZ()); + if (entity.getMotion().getX() < 0) { + xv = (xv * (-1)); + } + if (entity.getMotion().getZ() < 0) { + zv = (zv * (-1)); + } + if (entity.isSprinting()) { + xv = 0.15; + zv = 0.15; + } + if (xv > 0.05 || zv > 0.05) { + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LavenderParticlesParticle.particle, x, (y + 1), z, (int) Math.round(20 * (xv + zv)), 1, 0.5, 1, + 0.1); + } + } + if (entity.getMotion().getY() > 0.05) { + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LavenderParticlesParticle.particle, x, (y + 1), z, (int) 20, 1, 0.5, 1, 0.3); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderUpdateTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderUpdateTickProcedure.java new file mode 100644 index 0000000..263ef65 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BlueleafLavenderUpdateTickProcedure.java @@ -0,0 +1,42 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.LavenderParticlesParticle; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.IWorld; + +import java.util.Map; + +public class BlueleafLavenderUpdateTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BlueleafLavenderUpdateTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BlueleafLavenderUpdateTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BlueleafLavenderUpdateTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BlueleafLavenderUpdateTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LavenderParticlesParticle.particle, x, y, z, (int) 30, 3, 1, 3, 0.1); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BlueleafWheatAdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/BlueleafWheatAdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..1f509ff --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BlueleafWheatAdditionalGenerationConditionProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import java.util.Map; + +public class BlueleafWheatAdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BlueleafWheatAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BlueleafWheatAdditionalGenerationCondition!"); + return false; + } + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (z > 16 || z < 16 && z >= 0 && x % 24 == 0 || z >= 16 && x % 24 != 0) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BlueleavesCollideProcedure.java b/src/main/java/studio/halbear/hem/procedures/BlueleavesCollideProcedure.java new file mode 100644 index 0000000..d254744 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BlueleavesCollideProcedure.java @@ -0,0 +1,21 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import java.util.Map; + +public class BlueleavesCollideProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("onGround") == null) { + if (!dependencies.containsKey("onGround")) + HemMod.LOGGER.warn("Failed to load dependency onGround for procedure BlueleavesCollide!"); + return false; + } + boolean onGround = (boolean) dependencies.get("onGround"); + if (onGround) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/Boulder4AdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/Boulder4AdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..05c38b4 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/Boulder4AdditionalGenerationConditionProcedure.java @@ -0,0 +1,45 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; + +import java.util.Map; + +public class Boulder4AdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure Boulder4AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure Boulder4AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure Boulder4AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure Boulder4AdditionalGenerationCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y - 1, z))).getBlock())) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BulbFlowerPlantRightClickedProcedure.java b/src/main/java/studio/halbear/hem/procedures/BulbFlowerPlantRightClickedProcedure.java new file mode 100644 index 0000000..8839932 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BulbFlowerPlantRightClickedProcedure.java @@ -0,0 +1,74 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.BulbFlowerBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class BulbFlowerPlantRightClickedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BulbFlowerPlantRightClicked!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BulbFlowerPlantRightClicked!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BulbFlowerPlantRightClicked!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BulbFlowerPlantRightClicked!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure BulbFlowerPlantRightClicked!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + double Xv = 0; + double Zv = 0; + Xv = (entity.getMotion().getX()); + Zv = (entity.getMotion().getZ()); + if (Xv < 0) { + Xv = (Xv * (-1)); + } + if (Zv < 0) { + Zv = (Zv * (-1)); + } + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), BulbFlowerBlock.block.getDefaultState(), 3); + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.BLOCKS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.BLOCKS, (float) 1, (float) 1, false); + } + entity.setMotion((entity.getMotion().getX()), (0.2 + ((Zv + Xv) / 2) * 3), (entity.getLookVec().z)); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/BulbFlowerUpdateTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/BulbFlowerUpdateTickProcedure.java new file mode 100644 index 0000000..75b6316 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/BulbFlowerUpdateTickProcedure.java @@ -0,0 +1,91 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.block.BloomedBulbFlowerBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.Entity; +import net.minecraft.block.Blocks; + +import java.util.function.Function; +import java.util.Random; +import java.util.Map; +import java.util.Comparator; + +public class BulbFlowerUpdateTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure BulbFlowerUpdateTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure BulbFlowerUpdateTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure BulbFlowerUpdateTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure BulbFlowerUpdateTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + double Random = 0; + Random = Math.random(); + if (Random > 0.5 && !(((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (1.3 / 2d), y - (1.3 / 2d), z - (1.3 / 2d), x + (1.3 / 2d), y + (1.3 / 2d), z + (1.3 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null)) { + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), BloomedBulbFlowerBlock.block.getDefaultState(), 3); + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.BLOCKS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.BLOCKS, (float) 1, (float) 1, false); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LilyPadParticlesParticle.particle, x, y, z, (int) 10, 1, 0, 1, 0.1); + } + } else { + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.pollinate")), + SoundCategory.BLOCKS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.bee.pollinate")), + SoundCategory.BLOCKS, (float) 1, (float) 1, false); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LilyPadParticlesParticle.particle, x, y, z, (int) 3, 1, 0, 1, 0.1); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/ButterflySpawnEggUseOnBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/ButterflySpawnEggUseOnBlockProcedure.java new file mode 100644 index 0000000..8765fc2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/ButterflySpawnEggUseOnBlockProcedure.java @@ -0,0 +1,92 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.GiantButterflyWalkingEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.GameType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; +import net.minecraft.client.network.play.NetworkPlayerInfo; +import net.minecraft.client.entity.player.AbstractClientPlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.Map; + +public class ButterflySpawnEggUseOnBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure ButterflySpawnEggUseOnBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure ButterflySpawnEggUseOnBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure ButterflySpawnEggUseOnBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure ButterflySpawnEggUseOnBlock!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure ButterflySpawnEggUseOnBlock!"); + return; + } + if (dependencies.get("itemstack") == null) { + if (!dependencies.containsKey("itemstack")) + HemMod.LOGGER.warn("Failed to load dependency itemstack for procedure ButterflySpawnEggUseOnBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); + if (!BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y + 1, z))).getBlock())) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new GiantButterflyWalkingEntity.CustomEntity(GiantButterflyWalkingEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, (y + 1), z, world.getRandom().nextFloat() * 360F, 0); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!(new Object() { + public boolean checkGamemode(Entity _ent) { + if (_ent instanceof ServerPlayerEntity) { + return ((ServerPlayerEntity) _ent).interactionManager.getGameType() == GameType.CREATIVE; + } else if (_ent instanceof PlayerEntity && _ent.world.isRemote()) { + NetworkPlayerInfo _npi = Minecraft.getInstance().getConnection() + .getPlayerInfo(((AbstractClientPlayerEntity) _ent).getGameProfile().getId()); + return _npi != null && _npi.getGameType() == GameType.CREATIVE; + } + return false; + } + }.checkGamemode(entity))) { + (itemstack).shrink((int) 1); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/CancelFallDamageProcedure.java b/src/main/java/studio/halbear/hem/procedures/CancelFallDamageProcedure.java new file mode 100644 index 0000000..e889e71 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/CancelFallDamageProcedure.java @@ -0,0 +1,94 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.GiantLilyPadBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.Event; +import net.minecraftforge.event.entity.living.LivingFallEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.entity.Entity; + +import java.util.stream.Stream; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +public class CancelFallDamageProcedure { + @Mod.EventBusSubscriber + private static class GlobalTrigger { + @SubscribeEvent + public static void onEntityFall(LivingFallEvent event) { + if (event != null && event.getEntity() != null) { + Entity entity = event.getEntity(); + double i = entity.getPosX(); + double j = entity.getPosY(); + double k = entity.getPosZ(); + double damagemultiplier = event.getDamageMultiplier(); + double distance = event.getDistance(); + World world = entity.world; + Map dependencies = new HashMap<>(); + dependencies.put("x", i); + dependencies.put("y", j); + dependencies.put("z", k); + dependencies.put("damagemultiplier", damagemultiplier); + dependencies.put("distance", distance); + dependencies.put("world", world); + dependencies.put("entity", entity); + dependencies.put("event", event); + executeProcedure(dependencies); + } + } + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure CancelFallDamage!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure CancelFallDamage!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure CancelFallDamage!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure CancelFallDamage!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure CancelFallDamage!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if ((world.getBlockState(new BlockPos(x, y, z))).getBlock() == GiantLilyPadBlock.block) { + if (dependencies.get("event") != null) { + Object _obj = dependencies.get("event"); + if (_obj instanceof Event) { + Event _evt = (Event) _obj; + if (_evt.isCancelable()) + _evt.setCanceled(true); + } + } + GiantLilyPadEntityCollidesInTheBlockProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("entity", entity), + new AbstractMap.SimpleEntry<>("x", x), new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/DanglingFluorescentLeavesBlockValidPlacementConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/DanglingFluorescentLeavesBlockValidPlacementConditionProcedure.java new file mode 100644 index 0000000..453401f --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/DanglingFluorescentLeavesBlockValidPlacementConditionProcedure.java @@ -0,0 +1,43 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class DanglingFluorescentLeavesBlockValidPlacementConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure DanglingFluorescentLeavesBlockValidPlacementCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure DanglingFluorescentLeavesBlockValidPlacementCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure DanglingFluorescentLeavesBlockValidPlacementCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure DanglingFluorescentLeavesBlockValidPlacementCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if ((world.getBlockState(new BlockPos(x, y + 1, z))).getBlock() == Blocks.AIR) { + return false; + } + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/DanglingFluorescentLeavesNeighbourBlockChangesProcedure.java b/src/main/java/studio/halbear/hem/procedures/DanglingFluorescentLeavesNeighbourBlockChangesProcedure.java new file mode 100644 index 0000000..2802abb --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/DanglingFluorescentLeavesNeighbourBlockChangesProcedure.java @@ -0,0 +1,47 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.block.Blocks; +import net.minecraft.block.Block; + +import java.util.Map; + +public class DanglingFluorescentLeavesNeighbourBlockChangesProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure DanglingFluorescentLeavesNeighbourBlockChanges!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure DanglingFluorescentLeavesNeighbourBlockChanges!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure DanglingFluorescentLeavesNeighbourBlockChanges!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure DanglingFluorescentLeavesNeighbourBlockChanges!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if ((world.getBlockState(new BlockPos(x, y + 1, z))).getBlock() == Blocks.AIR) { + if (world instanceof World) { + Block.spawnDrops(world.getBlockState(new BlockPos(x, y, z)), (World) world, new BlockPos(x, y, z)); + world.destroyBlock(new BlockPos(x, y, z), false); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/DormantAgedEmberleafMilitaryBotEntityShakingConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/DormantAgedEmberleafMilitaryBotEntityShakingConditionProcedure.java new file mode 100644 index 0000000..e24bcbc --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/DormantAgedEmberleafMilitaryBotEntityShakingConditionProcedure.java @@ -0,0 +1,53 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.Entity; + +import java.util.function.Function; +import java.util.Map; +import java.util.Comparator; + +public class DormantAgedEmberleafMilitaryBotEntityShakingConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure DormantAgedEmberleafMilitaryBotEntityShakingCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure DormantAgedEmberleafMilitaryBotEntityShakingCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure DormantAgedEmberleafMilitaryBotEntityShakingCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure DormantAgedEmberleafMilitaryBotEntityShakingCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (3 / 2d), y - (3 / 2d), z - (3 / 2d), x + (3 / 2d), y + (3 / 2d), z + (3 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..28675b6 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure.java @@ -0,0 +1,134 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.EmberleafMilitaryBotEntity; +import studio.halbear.hem.entity.DormantAgedEmberleafMilitaryBotEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.function.Function; +import java.util.Map; +import java.util.Comparator; + +public class DormantAgedEmberleafMilitaryBotOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure DormantAgedEmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure DormantAgedEmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure DormantAgedEmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure DormantAgedEmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure DormantAgedEmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (3 / 2d), y - (3 / 2d), z - (3 / 2d), x + (3 / 2d), y + (3 / 2d), z + (3 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) { + if (entity instanceof DormantAgedEmberleafMilitaryBotEntity.CustomEntity) { + if (Math.random() > 0.99) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new EmberleafMilitaryBotEntity.CustomEntity(EmberleafMilitaryBotEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, + world.getDifficultyForLocation(entityToSpawn.getPosition()), SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, + (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (((Entity) world.getEntitiesWithinAABB(EmberleafMilitaryBotEntity.CustomEntity.class, + new AxisAlignedBB(x - (0.5 / 2d), y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) instanceof LivingEntity) + ((LivingEntity) ((Entity) world + .getEntitiesWithinAABB(EmberleafMilitaryBotEntity.CustomEntity.class, new AxisAlignedBB(x - (0.5 / 2d), + y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null))) + .setHealth((float) ((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHealth() : -1)); + if (!entity.world.isRemote()) + entity.remove(); + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(ParticleTypes.CLOUD, x, y, z, (int) 25, 1, 1, 1, 0.2); + } + } + } else { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new EmberleafMilitaryBotEntity.CustomEntity(EmberleafMilitaryBotEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (((Entity) world.getEntitiesWithinAABB(EmberleafMilitaryBotEntity.CustomEntity.class, + new AxisAlignedBB(x - (0.5 / 2d), y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) instanceof LivingEntity) + ((LivingEntity) ((Entity) world.getEntitiesWithinAABB(EmberleafMilitaryBotEntity.CustomEntity.class, + new AxisAlignedBB(x - (0.5 / 2d), y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null))) + .setHealth((float) ((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHealth() : -1)); + if (!entity.world.isRemote()) + entity.remove(); + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(ParticleTypes.CLOUD, x, y, z, (int) 25, 1, 1, 1, 0.2); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/DrivingVehicleCheckProcedure.java b/src/main/java/studio/halbear/hem/procedures/DrivingVehicleCheckProcedure.java new file mode 100644 index 0000000..ae76553 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/DrivingVehicleCheckProcedure.java @@ -0,0 +1,148 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; + +import net.minecraft.world.World; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.EntityTypeTags; +import net.minecraft.entity.Entity; + +import java.util.Map; +import java.util.HashMap; + +public class DrivingVehicleCheckProcedure { + @Mod.EventBusSubscriber + private static class GlobalTrigger { + @SubscribeEvent + public static void onPlayerTick(TickEvent.PlayerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + Entity entity = event.player; + World world = entity.world; + double i = entity.getPosX(); + double j = entity.getPosY(); + double k = entity.getPosZ(); + Map dependencies = new HashMap<>(); + dependencies.put("x", i); + dependencies.put("y", j); + dependencies.put("z", k); + dependencies.put("world", world); + dependencies.put("entity", entity); + dependencies.put("event", event); + executeProcedure(dependencies); + } + } + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure DrivingVehicleCheck!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle + && entity.isPassenger() && !EntityTypeTags.getCollection().getTagByID(new ResourceLocation("forge:vehicle_driver_seat")) + .contains((entity.getRidingEntity()).getType())) { + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PilotingVehicle = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleForward = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleBackward = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleTurnLeft = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleTurnRight = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleStrafeLeft = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleStrafeRight = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleAccelerate = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleDecelerate = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleIncreasePressure = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleReleasePressure = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (-1); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PilotingVehicleID = _setval; + capability.syncPlayerVariables(entity); + }); + } + } else if (!(entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).PilotingVehicle && entity.isPassenger() + && EntityTypeTags.getCollection().getTagByID(new ResourceLocation("forge:vehicle_driver_seat")) + .contains((entity.getRidingEntity()).getType())) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PilotingVehicle = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotEntityDiesProcedure.java b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotEntityDiesProcedure.java new file mode 100644 index 0000000..b027e09 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotEntityDiesProcedure.java @@ -0,0 +1,78 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.EmberleafMilitaryRobotUpperHalfEntity; +import studio.halbear.hem.entity.EmberleafMilitaryRobotLowerHalfEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class EmberleafMilitaryBotEntityDiesProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure EmberleafMilitaryBotEntityDies!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure EmberleafMilitaryBotEntityDies!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure EmberleafMilitaryBotEntityDies!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure EmberleafMilitaryBotEntityDies!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure EmberleafMilitaryBotEntityDies!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (world instanceof ServerWorld) { + Entity entityToSpawn = new EmberleafMilitaryRobotLowerHalfEntity.CustomEntity(EmberleafMilitaryRobotLowerHalfEntity.entity, + (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion(0, 0, 0); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (world instanceof ServerWorld) { + Entity entityToSpawn = new EmberleafMilitaryRobotUpperHalfEntity.CustomEntity(EmberleafMilitaryRobotUpperHalfEntity.entity, + (World) world); + entityToSpawn.setLocationAndAngles(x, (y + 1), z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion(0, 0.4, 0); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!entity.world.isRemote()) + entity.remove(); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotEntityIsHurtProcedure.java b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotEntityIsHurtProcedure.java new file mode 100644 index 0000000..b563ee6 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotEntityIsHurtProcedure.java @@ -0,0 +1,42 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.RobotDamageParticle; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; + +import java.util.Map; + +public class EmberleafMilitaryBotEntityIsHurtProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure EmberleafMilitaryBotEntityIsHurt!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure EmberleafMilitaryBotEntityIsHurt!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure EmberleafMilitaryBotEntityIsHurt!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure EmberleafMilitaryBotEntityIsHurt!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + for (int index0 = 0; index0 < (int) (10); index0++) { + world.addParticle(RobotDamageParticle.particle, x, (y + 1 + Math.random()), z, (-0.5 + 1 * Math.random()), (0.3 + 1 * Math.random()), + (-0.5 + 1 * Math.random())); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..e266a7e --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryBotOnEntityTickUpdateProcedure.java @@ -0,0 +1,97 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.DormantEmberleafMilitaryBotEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.function.Function; +import java.util.Map; +import java.util.Comparator; + +public class EmberleafMilitaryBotOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure EmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure EmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure EmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure EmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure EmberleafMilitaryBotOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (16 / 2d), y - (16 / 2d), z - (16 / 2d), x + (16 / 2d), y + (16 / 2d), z + (16 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) { + entity.getPersistentData().putDouble("dormantTimer", 100); + } else if (entity.getPersistentData().getDouble("dormantTimer") == 0) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new DormantEmberleafMilitaryBotEntity.CustomEntity(DormantEmberleafMilitaryBotEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (((Entity) world + .getEntitiesWithinAABB(DormantEmberleafMilitaryBotEntity.CustomEntity.class, + new AxisAlignedBB(x - (0.5 / 2d), y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) instanceof LivingEntity) + ((LivingEntity) ((Entity) world.getEntitiesWithinAABB(DormantEmberleafMilitaryBotEntity.CustomEntity.class, + new AxisAlignedBB(x - (0.5 / 2d), y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null))) + .setHealth((float) ((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHealth() : -1)); + if (!entity.world.isRemote()) + entity.remove(); + } else { + entity.getPersistentData().putDouble("dormantTimer", (entity.getPersistentData().getDouble("dormantTimer") - 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..71e8938 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure.java @@ -0,0 +1,71 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.RobotDamageParticle; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.Explosion; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class EmberleafMilitaryRobotLowerHalfOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure EmberleafMilitaryRobotLowerHalfOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure EmberleafMilitaryRobotLowerHalfOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure EmberleafMilitaryRobotLowerHalfOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure EmberleafMilitaryRobotLowerHalfOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure EmberleafMilitaryRobotLowerHalfOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(RobotDamageParticle.particle, x, y, z, (int) 1, 0, 1, 0, 0.3); + } + if (entity.getPersistentData().getDouble("expirationtimer") <= 0) { + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(RobotDamageParticle.particle, x, y, z, (int) 25, 0, 1, 0, 0.3); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(ParticleTypes.LARGE_SMOKE, x, y, z, (int) 25, 0, 1, 0, 0.3); + } + if (!entity.world.isRemote()) + entity.remove(); + if (world instanceof World && !((World) world).isRemote) { + ((World) world).createExplosion(null, (int) x, (int) y, (int) z, (float) 2, Explosion.Mode.BREAK); + } + } else { + entity.getPersistentData().putDouble("expirationtimer", (entity.getPersistentData().getDouble("expirationtimer") - 1)); + } + if (entity.getPersistentData().getDouble("expirationtimer") == 0 && !entity.getPersistentData().getBoolean("ticking")) { + entity.getPersistentData().putBoolean("ticking", (true)); + entity.getPersistentData().putDouble("expirationtimer", (60 + 200 * Math.random())); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure.java b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure.java new file mode 100644 index 0000000..d161187 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure.java @@ -0,0 +1,22 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawnProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure EmberleafMilitaryRobotLowerHalfOnInitialEntitySpawn!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + entity.getPersistentData().putDouble("expirationtimer", (60 + 200 * Math.random())); + entity.getPersistentData().putBoolean("ticking", (true)); + entity.setMotion((entity.getLookVec().x * 0.5), (entity.getMotion().getY()), (entity.getLookVec().z * 0.5)); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/FallenLeavesEntityCollidesInTheBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/FallenLeavesEntityCollidesInTheBlockProcedure.java new file mode 100644 index 0000000..b5c1be0 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/FallenLeavesEntityCollidesInTheBlockProcedure.java @@ -0,0 +1,55 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.BlueLeavesParticle; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.entity.Entity; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class FallenLeavesEntityCollidesInTheBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure FallenLeavesEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure FallenLeavesEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure FallenLeavesEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure FallenLeavesEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure FallenLeavesEntityCollidesInTheBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (entity.isSprinting()) { + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + for (int index0 = 0; index0 < (int) (20); index0++) { + world.addParticle(BlueLeavesParticle.particle, x, y, z, (-0.5 + 1 * Math.random()), 0.5, (-0.5 + 1 * Math.random())); + } + } else if (entity.getMotion().getZ() != 0 || entity.getMotion().getX() != 0) { + world.addParticle(BlueLeavesParticle.particle, x, y, z, (-0.3 + 0.6 * Math.random()), 0.3, (-0.3 + 0.6 * Math.random())); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/FluffaloRightClickedOnEntityProcedure.java b/src/main/java/studio/halbear/hem/procedures/FluffaloRightClickedOnEntityProcedure.java new file mode 100644 index 0000000..866da34 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/FluffaloRightClickedOnEntityProcedure.java @@ -0,0 +1,107 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.item.FluffaloTuftItem; +import studio.halbear.hem.entity.FluffaloShavedEntity; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.Random; +import java.util.Map; + +public class FluffaloRightClickedOnEntityProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure FluffaloRightClickedOnEntity!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure FluffaloRightClickedOnEntity!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure FluffaloRightClickedOnEntity!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure FluffaloRightClickedOnEntity!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure FluffaloRightClickedOnEntity!"); + return; + } + if (dependencies.get("sourceentity") == null) { + if (!dependencies.containsKey("sourceentity")) + HemMod.LOGGER.warn("Failed to load dependency sourceentity for procedure FluffaloRightClickedOnEntity!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + Entity sourceentity = (Entity) dependencies.get("sourceentity"); + if (((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemMainhand() : ItemStack.EMPTY) + .getItem() == Items.SHEARS) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new FluffaloShavedEntity.CustomEntity(FluffaloShavedEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion((entity.getMotion().getX()), (entity.getMotion().getY()), (entity.getMotion().getZ())); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!entity.world.isRemote()) + entity.remove(); + { + ItemStack _ist = ((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemMainhand() : ItemStack.EMPTY); + if (_ist.attemptDamageItem((int) 1, new Random(), null)) { + _ist.shrink(1); + _ist.setDamage(0); + } + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.sheep.shear")), + SoundCategory.PLAYERS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.sheep.shear")), + SoundCategory.PLAYERS, (float) 1, (float) 1, false); + } + for (int index0 = 0; index0 < (int) (1 + Math.round(5 * Math.random())); index0++) { + if (world instanceof World && !world.isRemote()) { + ItemEntity entityToSpawn = new ItemEntity((World) world, x, y, z, new ItemStack(FluffaloTuftItem.block)); + entityToSpawn.setPickupDelay((int) 10); + world.addEntity(entityToSpawn); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/FluffaloShavedEntityShakingConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/FluffaloShavedEntityShakingConditionProcedure.java new file mode 100644 index 0000000..aa8f964 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/FluffaloShavedEntityShakingConditionProcedure.java @@ -0,0 +1,10 @@ +package studio.halbear.hem.procedures; + +import java.util.Map; + +public class FluffaloShavedEntityShakingConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/FluffaloShavedOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/FluffaloShavedOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..eb10467 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/FluffaloShavedOnEntityTickUpdateProcedure.java @@ -0,0 +1,67 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.FluffaloEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class FluffaloShavedOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure FluffaloShavedOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure FluffaloShavedOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure FluffaloShavedOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure FluffaloShavedOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure FluffaloShavedOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + entity.getPersistentData().putDouble("GrowthTicks", (entity.getPersistentData().getDouble("GrowthTicks") - 1)); + if (entity.getPersistentData().getDouble("GrowthTicks") <= 0) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new FluffaloEntity.CustomEntity(FluffaloEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion((entity.getMotion().getX()), (entity.getMotion().getY()), (entity.getMotion().getZ())); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!entity.world.isRemote()) + entity.remove(); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/FluffaloShavedOnInitialEntitySpawnProcedure.java b/src/main/java/studio/halbear/hem/procedures/FluffaloShavedOnInitialEntitySpawnProcedure.java new file mode 100644 index 0000000..ce9db7b --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/FluffaloShavedOnInitialEntitySpawnProcedure.java @@ -0,0 +1,20 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class FluffaloShavedOnInitialEntitySpawnProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure FluffaloShavedOnInitialEntitySpawn!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + entity.getPersistentData().putDouble("GrowthTicks", (2000 + 2000 * Math.random())); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/FluorescentLeavesParticlesAdditionalParticleExpiryConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/FluorescentLeavesParticlesAdditionalParticleExpiryConditionProcedure.java new file mode 100644 index 0000000..21aafc0 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/FluorescentLeavesParticlesAdditionalParticleExpiryConditionProcedure.java @@ -0,0 +1,59 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.FallenLeavesBlock; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class FluorescentLeavesParticlesAdditionalParticleExpiryConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure FluorescentLeavesParticlesAdditionalParticleExpiryCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure FluorescentLeavesParticlesAdditionalParticleExpiryCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure FluorescentLeavesParticlesAdditionalParticleExpiryCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure FluorescentLeavesParticlesAdditionalParticleExpiryCondition!"); + return false; + } + if (dependencies.get("onGround") == null) { + if (!dependencies.containsKey("onGround")) + HemMod.LOGGER.warn("Failed to load dependency onGround for procedure FluorescentLeavesParticlesAdditionalParticleExpiryCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + boolean onGround = (boolean) dependencies.get("onGround"); + if (onGround) { + if (Math.random() > 0.7) { + if (BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y - 1, z))).getBlock()) + && (world.getBlockState(new BlockPos(x, y, z))).getBlock() == Blocks.AIR) { + world.setBlockState(new BlockPos(x, y, z), FallenLeavesBlock.block.getDefaultState(), 3); + } + } + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GasCanister612litreItemInInventoryTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/GasCanister612litreItemInInventoryTickProcedure.java new file mode 100644 index 0000000..6e44eab --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GasCanister612litreItemInInventoryTickProcedure.java @@ -0,0 +1,39 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.item.ItemStack; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class GasCanister612litreItemInInventoryTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GasCanister612litreItemInInventoryTick!"); + return; + } + if (dependencies.get("itemstack") == null) { + if (!dependencies.containsKey("itemstack")) + HemMod.LOGGER.warn("Failed to load dependency itemstack for procedure GasCanister612litreItemInInventoryTick!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); + double Force = 0; + double Weight = 0; + if (!itemstack.getOrCreateTag().getBoolean("Setup")) { + itemstack.getOrCreateTag().putBoolean("Setup", (true)); + itemstack.getOrCreateTag().putDouble("GasFilled", 612); + itemstack.getOrCreateTag().putString("Contents", "Helium"); + } + if ((itemstack.getOrCreateTag().getString("Contents")).equals("Helium")) { + Weight = (10000 * (110 + ((entity instanceof LivingEntity) ? ((LivingEntity) entity).getTotalArmorValue() : 0))); + Force = ((itemstack.getOrCreateTag().getDouble("GasFilled") * (itemstack).getCount()) / Weight); + entity.setMotion(entity.getMotion().getX(), entity.getMotion().getY() + Force, entity.getMotion().getZ()); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GasCanister612litreItemIsCraftedsmeltedProcedure.java b/src/main/java/studio/halbear/hem/procedures/GasCanister612litreItemIsCraftedsmeltedProcedure.java new file mode 100644 index 0000000..a579b7d --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GasCanister612litreItemIsCraftedsmeltedProcedure.java @@ -0,0 +1,21 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.item.ItemStack; + +import java.util.Map; + +public class GasCanister612litreItemIsCraftedsmeltedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("itemstack") == null) { + if (!dependencies.containsKey("itemstack")) + HemMod.LOGGER.warn("Failed to load dependency itemstack for procedure GasCanister612litreItemIsCraftedsmelted!"); + return; + } + ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); + itemstack.getOrCreateTag().putDouble("GasFilled", 612); + itemstack.getOrCreateTag().putString("Contents", "Helium"); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GettingEatenProcedure.java b/src/main/java/studio/halbear/hem/procedures/GettingEatenProcedure.java new file mode 100644 index 0000000..ccc2897 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GettingEatenProcedure.java @@ -0,0 +1,133 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.potion.Effects; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; +import java.util.HashMap; +import java.util.Collections; + +public class GettingEatenProcedure { + @Mod.EventBusSubscriber + private static class GlobalTrigger { + @SubscribeEvent + public static void onPlayerTick(TickEvent.PlayerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + Entity entity = event.player; + World world = entity.world; + double i = entity.getPosX(); + double j = entity.getPosY(); + double k = entity.getPosZ(); + Map dependencies = new HashMap<>(); + dependencies.put("x", i); + dependencies.put("y", j); + dependencies.put("z", k); + dependencies.put("world", world); + dependencies.put("entity", entity); + dependencies.put("event", event); + executeProcedure(dependencies); + } + } + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure GettingEaten!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GettingEaten!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).Eaten + && (entity.getMotion().getY() > 0.15 || entity.getMotion().getZ() != 0 || entity.getMotion().getX() != 0)) { + entity.setMotion(0, 0.01, 0); + { + Entity _ent = entity; + _ent.setPositionAndUpdate( + ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapX + 0.5), + ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapY), + ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapZ + 0.5)); + if (_ent instanceof ServerPlayerEntity) { + ((ServerPlayerEntity) _ent).connection.setPlayerLocation( + ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapX + 0.5), + ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapY), + ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapZ + 0.5), + _ent.rotationYaw, _ent.rotationPitch, Collections.emptySet()); + } + } + } + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).Eaten + && ((new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, + new BlockPos( + (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapX, + (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapY, + (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapZ), + "eating")) == false || !(new Object() { + public String getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getString(tag); + return ""; + } + }.getValue(world, + new BlockPos( + (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapX, + (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapY, + (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPlantTrapZ), + "victimuuid")).equals(entity.getUniqueID().toString()))) { + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Eaten = _setval; + capability.syncPlayerVariables(entity); + }); + } + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).removePotionEffect(Effects.SLOWNESS); + } + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).removePotionEffect(Effects.MINING_FATIGUE); + } + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).removePotionEffect(Effects.INVISIBILITY); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GiantButterflyOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/GiantButterflyOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..50d3965 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GiantButterflyOnEntityTickUpdateProcedure.java @@ -0,0 +1,190 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.GiantButterflyWalkingEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Random; +import java.util.Map; +import java.util.List; +import java.util.Comparator; + +public class GiantButterflyOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure GiantButterflyOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure GiantButterflyOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure GiantButterflyOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure GiantButterflyOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GiantButterflyOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (entity.getMotion().getY() > -0.15 && entity.getMotion().getX() < 0.015 && entity.getMotion().getZ() < 0.015 + && entity.getMotion().getX() > -0.015 && entity.getMotion().getZ() > -0.015) { + entity.setMotion((entity.getMotion().getX()), (entity.getMotion().getY() - 0.05), (entity.getMotion().getZ())); + } + if (BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y - 0.2, z))).getBlock()) && entity.getMotion().getX() == 0 + && entity.getMotion().getZ() == 0) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new GiantButterflyWalkingEntity.CustomEntity(GiantButterflyWalkingEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) (entity.rotationPitch)); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion((entity.getMotion().getX()), (entity.getMotion().getY()), (entity.getMotion().getZ())); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (entity.isBeingRidden()) { + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (2 / 2d), y - (2 / 2d), z - (2 / 2d), x + (2 / 2d), y + (2 / 2d), z + (2 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if (entityiterator instanceof ServerPlayerEntity && entityiterator.isPassenger() + && (entityiterator.getRidingEntity()) == entity) { + entityiterator + .startRiding(((Entity) world + .getEntitiesWithinAABB(GiantButterflyWalkingEntity.CustomEntity.class, new AxisAlignedBB(x - (2 / 2d), + y - (2 / 2d), z - (2 / 2d), x + (2 / 2d), y + (2 / 2d), z + (2 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator + .comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null))); + ((Entity) world.getEntitiesWithinAABB(GiantButterflyWalkingEntity.CustomEntity.class, + new AxisAlignedBB(x - (2 / 2d), y - (2 / 2d), z - (2 / 2d), x + (2 / 2d), y + (2 / 2d), z + (2 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)).getPersistentData().putBoolean("DespawnImmune", (true)); + } + } + } + } + if (!entity.world.isRemote()) + entity.remove(); + } + if (entity.isBeingRidden()) { + if (entity.getPersistentData().getDouble("decisioncooldown") == 0) { + entity.getPersistentData().putDouble("decisioncooldown", (MathHelper.nextInt(new Random(), 30, 120))); + if (Math.random() >= 0.3) { + entity.getPersistentData().putBoolean("move", (true)); + } else { + entity.getPersistentData().putBoolean("move", (false)); + } + if (Math.random() >= 0.5) { + entity.getPersistentData().putDouble("goalyaw", (MathHelper.nextInt(new Random(), -360, 360))); + } + } + if (!world.isAirBlock(new BlockPos(x + entity.getLookVec().x, y, z + entity.getLookVec().z))) { + entity.rotationYaw = (float) ((entity.rotationYaw + 15)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + } + if (entity.getPersistentData().getBoolean("move")) { + entity.setMotion((entity.getLookVec().x / 8), (entity.getMotion().getY()), (entity.getLookVec().z / 8)); + } + if (entity.getPersistentData().getDouble("goalyaw") != entity.rotationYaw) { + if (entity.getPersistentData().getDouble("goalyaw") > entity.rotationYaw + 11) { + entity.rotationYaw = (float) ((entity.rotationYaw + 10)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + } else if (entity.getPersistentData().getDouble("goalyaw") > entity.rotationYaw) { + entity.rotationYaw = (float) ((entity.rotationYaw + 1)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + } + if (entity.getPersistentData().getDouble("goalyaw") < entity.rotationYaw - 11) { + entity.rotationYaw = (float) ((entity.rotationYaw - 10)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + } else if (entity.getPersistentData().getDouble("goalyaw") < entity.rotationYaw) { + entity.rotationYaw = (float) ((entity.rotationYaw - 1)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + } + } + entity.getPersistentData().putDouble("decisioncooldown", (entity.getPersistentData().getDouble("decisioncooldown") - 1)); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GiantButterflyWalkingNaturalEntitySpawningConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/GiantButterflyWalkingNaturalEntitySpawningConditionProcedure.java new file mode 100644 index 0000000..239f287 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GiantButterflyWalkingNaturalEntitySpawningConditionProcedure.java @@ -0,0 +1,55 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; + +import java.util.Map; + +public class GiantButterflyWalkingNaturalEntitySpawningConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure GiantButterflyWalkingNaturalEntitySpawningCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure GiantButterflyWalkingNaturalEntitySpawningCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure GiantButterflyWalkingNaturalEntitySpawningCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure GiantButterflyWalkingNaturalEntitySpawningCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (!(world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) != null + && world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) + .equals(new ResourceLocation("hem:blueleaf_hayfever_fields"))) + || world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) != null + && world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) + .equals(new ResourceLocation("hem:blueleaf_hayfever_fields")) + && z < 0) { + if (!BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y + 1, z))).getBlock())) { + return true; + } + return false; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GiantButterflyWalkingOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/GiantButterflyWalkingOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..5086bc7 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GiantButterflyWalkingOnEntityTickUpdateProcedure.java @@ -0,0 +1,110 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.LadyBugInFlightEntity; +import studio.halbear.hem.entity.GiantButterflyEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Map; +import java.util.List; +import java.util.Comparator; + +public class GiantButterflyWalkingOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure GiantButterflyWalkingOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure GiantButterflyWalkingOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure GiantButterflyWalkingOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure GiantButterflyWalkingOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GiantButterflyWalkingOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + double random = 0; + random = Math.random(); + if (random >= 0.3 && random <= 0.305 || ((Entity) world + .getEntitiesWithinAABB(LadyBugInFlightEntity.CustomEntity.class, + new AxisAlignedBB(x - (6 / 2d), y - (6 / 2d), z - (6 / 2d), x + (6 / 2d), y + (6 / 2d), z + (6 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new GiantButterflyEntity.CustomEntity(GiantButterflyEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, (y + 0.5), z, (float) (entity.rotationYaw), (float) (entity.rotationPitch)); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion((entity.getMotion().getX() + entity.getLookVec().x * 0.25), 0.3, + (entity.getMotion().getZ() + entity.getLookVec().z * 0.25)); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (entity.isBeingRidden()) { + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (2 / 2d), y - (2 / 2d), z - (2 / 2d), x + (2 / 2d), y + (2 / 2d), z + (2 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if (entityiterator instanceof ServerPlayerEntity && entityiterator.isPassenger() + && (entityiterator.getRidingEntity()) == entity) { + entityiterator + .startRiding(((Entity) world + .getEntitiesWithinAABB(GiantButterflyEntity.CustomEntity.class, new AxisAlignedBB(x - (2 / 2d), + y - (2 / 2d), z - (2 / 2d), x + (2 / 2d), y + (2 / 2d), z + (2 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator + .comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null))); + } + } + } + } + if (!entity.world.isRemote()) + entity.remove(); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GiantLilyPadEntityCollidesInTheBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/GiantLilyPadEntityCollidesInTheBlockProcedure.java new file mode 100644 index 0000000..45063bc --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GiantLilyPadEntityCollidesInTheBlockProcedure.java @@ -0,0 +1,67 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class GiantLilyPadEntityCollidesInTheBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure GiantLilyPadEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure GiantLilyPadEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure GiantLilyPadEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure GiantLilyPadEntityCollidesInTheBlock!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GiantLilyPadEntityCollidesInTheBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (entity.getMotion().getY() < -0.25) { + entity.setMotion((entity.getMotion().getX()), (entity.getMotion().getY() * (-1)), (entity.getMotion().getZ())); + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.slime.jump")), + SoundCategory.BLOCKS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.slime.jump")), + SoundCategory.BLOCKS, (float) 1, (float) 1, false); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LilyPadParticlesParticle.particle, x, y, z, (int) 10, 1, 0, 1, 0.5); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GooedActiveTickConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/GooedActiveTickConditionProcedure.java new file mode 100644 index 0000000..bd2beb5 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GooedActiveTickConditionProcedure.java @@ -0,0 +1,23 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class GooedActiveTickConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GooedActiveTickCondition!"); + return false; + } + Entity entity = (Entity) dependencies.get("entity"); + if (entity.isInWaterRainOrBubbleColumn()) { + return false; + } + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GooedEffectStartedappliedProcedure.java b/src/main/java/studio/halbear/hem/procedures/GooedEffectStartedappliedProcedure.java new file mode 100644 index 0000000..4b0b0e6 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GooedEffectStartedappliedProcedure.java @@ -0,0 +1,10 @@ +package studio.halbear.hem.procedures; + +import java.util.Map; + +public class GooedEffectStartedappliedProcedure { + + public static void executeProcedure(Map dependencies) { + + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GooedOnEffectActiveTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/GooedOnEffectActiveTickProcedure.java new file mode 100644 index 0000000..33c2ad2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GooedOnEffectActiveTickProcedure.java @@ -0,0 +1,147 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.potion.GooedPotionEffect; +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.potion.Effects; +import net.minecraft.potion.EffectInstance; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; +import java.util.Collection; + +public class GooedOnEffectActiveTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure GooedOnEffectActiveTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure GooedOnEffectActiveTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure GooedOnEffectActiveTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure GooedOnEffectActiveTick!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GooedOnEffectActiveTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + ItemStack SpawnedGem = ItemStack.EMPTY; + if (Math.random() > 0.99) { + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.slime.squish")), + SoundCategory.PLAYERS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.slime.squish")), + SoundCategory.PLAYERS, (float) 1, (float) 1, false); + } + } + if (entity.isInWaterRainOrBubbleColumn()) { + if (new Object() { + boolean check(Entity _entity) { + if (_entity instanceof LivingEntity) { + Collection effects = ((LivingEntity) _entity).getActivePotionEffects(); + for (EffectInstance effect : effects) { + if (effect.getPotion() == Effects.SLOWNESS) + return true; + } + } + return false; + } + }.check(entity) && new Object() { + boolean check(Entity _entity) { + if (_entity instanceof LivingEntity) { + Collection effects = ((LivingEntity) _entity).getActivePotionEffects(); + for (EffectInstance effect : effects) { + if (effect.getPotion() == GooedPotionEffect.potion) + return true; + } + } + return false; + } + }.check(entity)) { + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(GooedPotionEffect.potion, (int) (-1), (int) 1)); + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.SLOWNESS, (int) (-1), (int) 1)); + } + } else if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).GooCooldown == 0) { + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.SLOWNESS, (int) 40, (int) 0)); + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(GooedPotionEffect.potion, (int) 40, (int) 0)); + if (!(((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHeldItemMainhand() : ItemStack.EMPTY).getItem() == (ItemStack.EMPTY) + .getItem())) { + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.slime_block.fall")), + SoundCategory.PLAYERS, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.slime_block.fall")), + SoundCategory.PLAYERS, (float) 1, (float) 1, false); + } + SpawnedGem = (((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHeldItemMainhand() : ItemStack.EMPTY).copy()); + ((SpawnedGem)).setCount((int) 1); + if (world instanceof World && !world.isRemote()) { + ItemEntity entityToSpawn = new ItemEntity((World) world, (x + entity.getLookVec().x), y, (z + entity.getLookVec().z), + (SpawnedGem)); + entityToSpawn.setPickupDelay((int) 10); + world.addEntity(entityToSpawn); + } + (((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHeldItemMainhand() : ItemStack.EMPTY)).shrink((int) 1); + } + { + double _setval = (10 + Math.round(10 * Math.random())); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.GooCooldown = _setval; + capability.syncPlayerVariables(entity); + }); + } + } else { + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.SLOWNESS, (int) 40, (int) 0)); + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(GooedPotionEffect.potion, (int) 40, (int) 0)); + { + double _setval = ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).GooCooldown - 1); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.GooCooldown = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/GooedOverlayDisplayOverlayIngameProcedure.java b/src/main/java/studio/halbear/hem/procedures/GooedOverlayDisplayOverlayIngameProcedure.java new file mode 100644 index 0000000..b90fb7d --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/GooedOverlayDisplayOverlayIngameProcedure.java @@ -0,0 +1,38 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.potion.GooedPotionEffect; +import studio.halbear.hem.HemMod; + +import net.minecraft.potion.EffectInstance; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; +import java.util.Collection; + +public class GooedOverlayDisplayOverlayIngameProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure GooedOverlayDisplayOverlayIngame!"); + return false; + } + Entity entity = (Entity) dependencies.get("entity"); + if (new Object() { + boolean check(Entity _entity) { + if (_entity instanceof LivingEntity) { + Collection effects = ((LivingEntity) _entity).getActivePotionEffects(); + for (EffectInstance effect : effects) { + if (effect.getPotion() == GooedPotionEffect.potion) + return true; + } + } + return false; + } + }.check(entity)) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/HotAirBalloonItemRightclickedOnBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonItemRightclickedOnBlockProcedure.java new file mode 100644 index 0000000..8bfd0ec --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonItemRightclickedOnBlockProcedure.java @@ -0,0 +1,63 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.HotAirBalloonEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class HotAirBalloonItemRightclickedOnBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure HotAirBalloonItemRightclickedOnBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure HotAirBalloonItemRightclickedOnBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure HotAirBalloonItemRightclickedOnBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure HotAirBalloonItemRightclickedOnBlock!"); + return; + } + if (dependencies.get("itemstack") == null) { + if (!dependencies.containsKey("itemstack")) + HemMod.LOGGER.warn("Failed to load dependency itemstack for procedure HotAirBalloonItemRightclickedOnBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); + if (world instanceof ServerWorld) { + Entity entityToSpawn = new HotAirBalloonEntity.CustomEntity(HotAirBalloonEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, (y + 1), z, (float) 0, (float) 0); + entityToSpawn.setRenderYawOffset((float) 0); + entityToSpawn.setRotationYawHead((float) 0); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + (itemstack).shrink((int) 1); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/HotAirBalloonOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..c704b2b --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonOnEntityTickUpdateProcedure.java @@ -0,0 +1,176 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Map; +import java.util.List; +import java.util.Comparator; + +public class HotAirBalloonOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure HotAirBalloonOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure HotAirBalloonOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure HotAirBalloonOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure HotAirBalloonOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure HotAirBalloonOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + boolean W = false; + boolean S = false; + boolean A = false; + boolean D = false; + Entity Player = null; + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (9 / 2d), y - (9 / 2d), z - (9 / 2d), x + (9 / 2d), y + (9 / 2d), z + (9 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if (entityiterator.isPassenger() && entityiterator instanceof ServerPlayerEntity) { + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).PilotingVehicleID == entity.getPersistentData().getDouble("ID")) { + { + double _setval = (entity.getPersistentData().getDouble("Pressure")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PSI = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Fuel")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Fuel = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + { + double _setval = (entity.getPersistentData().getDouble("Heat")); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Heat = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + entity.rotationYaw = (float) (((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleYaw)); + entity.setRenderYawOffset(entity.rotationYaw); + entity.prevRotationYaw = entity.rotationYaw; + if (entity instanceof LivingEntity) { + ((LivingEntity) entity).prevRenderYawOffset = entity.rotationYaw; + ((LivingEntity) entity).rotationYawHead = entity.rotationYaw; + ((LivingEntity) entity).prevRotationYawHead = entity.rotationYaw; + } + entity.rotationPitch = (float) ((entity.rotationPitch)); + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleIncreasePressure) { + entity.getPersistentData().putBoolean("OpenFlame", (true)); + } else { + entity.getPersistentData().putBoolean("OpenFlame", (false)); + } + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleForward) { + entity.getPersistentData().putDouble("XVel", (0.025 * entity.getLookVec().x)); + entity.getPersistentData().putDouble("YVel", (0.025 * entity.getLookVec().z)); + } + if ((entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleBackward) { + entity.getPersistentData().putDouble("YVel", ((-0.025) * entity.getLookVec().z)); + entity.getPersistentData().putDouble("XVel", ((-0.025) * entity.getLookVec().x)); + } + } + } + } + } + entity.getPersistentData().putDouble("Tick", (entity.getPersistentData().getDouble("Tick") - 1)); + if (entity.getMotion().getX() > 0.35) { + entity.getPersistentData().putDouble("XVel", (0.35 - entity.getMotion().getX())); + } + if (entity.getMotion().getX() < -0.35) { + entity.getPersistentData().putDouble("XVel", ((-0.35) - entity.getMotion().getX())); + } + if (entity.getMotion().getZ() > 0.35) { + entity.getPersistentData().putDouble("YVel", (0.35 - entity.getMotion().getZ())); + } + if (entity.getMotion().getZ() < -0.35) { + entity.getPersistentData().putDouble("YVel", ((-0.35) - entity.getMotion().getZ())); + } + if (entity.getPersistentData().getDouble("Heat") <= 10 && entity.getPersistentData().getDouble("Pressure") <= 0 + && entity.getMotion().getY() >= -0.5) { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), (entity.getMotion().getY() - 0.05), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } else if (entity.getPersistentData().getDouble("Pressure") > 0) { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), + (entity.getPersistentData().getDouble("Pressure") / 75), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } else if (entity.getMotion().getY() >= -0.05) { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), (entity.getMotion().getY() - 0.05), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } else { + entity.setMotion((entity.getMotion().getX() + entity.getPersistentData().getDouble("XVel")), (entity.getMotion().getY()), + (entity.getMotion().getZ() + entity.getPersistentData().getDouble("YVel"))); + } + entity.getPersistentData().putDouble("YVel", 0); + entity.getPersistentData().putDouble("XVel", 0); + if (entity.getPersistentData().getDouble("Pressure") <= 35 && entity.getPersistentData().getBoolean("OpenFlame")) { + entity.getPersistentData().putDouble("Pressure", + (entity.getPersistentData().getDouble("Pressure") + entity.getPersistentData().getDouble("Heat") / 150)); + } + if (entity.getPersistentData().getBoolean("OpenFlame")) { + world.addParticle(ParticleTypes.LARGE_SMOKE, x, y, z, 0, (entity.getMotion().getY() + 0.2), 0); + } + if (entity.getPersistentData().getDouble("Tick") <= 0) { + entity.getPersistentData().putDouble("Tick", 20); + if (entity.getPersistentData().getDouble("Pressure") > 0 && entity.getPersistentData().getDouble("Heat") >= 10 + && !entity.getPersistentData().getBoolean("OpenFlame")) { + entity.getPersistentData().putDouble("Pressure", Math.round(entity.getPersistentData().getDouble("Pressure") - 1)); + } else if (entity.getPersistentData().getDouble("Pressure") > 0 && entity.getPersistentData().getDouble("Heat") < 10) { + entity.getPersistentData().putDouble("Pressure", Math.round(entity.getPersistentData().getDouble("Pressure") - 5)); + } + if (entity.getPersistentData().getDouble("Fuel") > 0 && entity.getPersistentData().getDouble("Heat") < 150) { + entity.getPersistentData().putDouble("Heat", (entity.getPersistentData().getDouble("Heat") + 5)); + entity.getPersistentData().putDouble("Fuel", (entity.getPersistentData().getDouble("Fuel") - 1)); + } else if (entity.getPersistentData().getDouble("Fuel") > 0 && entity.getPersistentData().getDouble("Heat") > 0) { + entity.getPersistentData().putDouble("Fuel", (entity.getPersistentData().getDouble("Fuel") - 1)); + } else if (entity.getPersistentData().getDouble("Fuel") <= 0 && entity.getPersistentData().getDouble("Heat") > 0) { + entity.getPersistentData().putDouble("Heat", (entity.getPersistentData().getDouble("Heat") - 1)); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/HotAirBalloonOnInitialEntitySpawnProcedure.java b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonOnInitialEntitySpawnProcedure.java new file mode 100644 index 0000000..45bda55 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonOnInitialEntitySpawnProcedure.java @@ -0,0 +1,38 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class HotAirBalloonOnInitialEntitySpawnProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure HotAirBalloonOnInitialEntitySpawn!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure HotAirBalloonOnInitialEntitySpawn!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + Entity entity = (Entity) dependencies.get("entity"); + entity.getPersistentData().putDouble("Tick", 20); + entity.getPersistentData().putDouble("Heat", 0); + entity.getPersistentData().putDouble("Fuel", 0); + entity.getPersistentData().putDouble("Pressure", 0); + entity.getPersistentData().putBoolean("OpenFlame", (false)); + entity.getPersistentData().putDouble("XVel", 0); + entity.getPersistentData().putDouble("YVel", 0); + entity.getPersistentData().putDouble("Yaw", (entity.rotationYaw)); + entity.getPersistentData().putDouble("ID", HemModVariables.WorldVariables.get(world).VehicleID); + HemModVariables.WorldVariables.get(world).VehicleID = (HemModVariables.WorldVariables.get(world).VehicleID + 1); + HemModVariables.WorldVariables.get(world).syncData(world); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/HotAirBalloonRightClickedOnEntityProcedure.java b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonRightClickedOnEntityProcedure.java new file mode 100644 index 0000000..633f97c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonRightClickedOnEntityProcedure.java @@ -0,0 +1,49 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.ItemTags; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class HotAirBalloonRightClickedOnEntityProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure HotAirBalloonRightClickedOnEntity!"); + return; + } + if (dependencies.get("sourceentity") == null) { + if (!dependencies.containsKey("sourceentity")) + HemMod.LOGGER.warn("Failed to load dependency sourceentity for procedure HotAirBalloonRightClickedOnEntity!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + Entity sourceentity = (Entity) dependencies.get("sourceentity"); + if (ItemTags.getCollection().getTagByID(new ResourceLocation("forge:hem_fossilfuel")).contains( + ((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemMainhand() : ItemStack.EMPTY).getItem())) { + (((sourceentity instanceof LivingEntity) ? ((LivingEntity) sourceentity).getHeldItemMainhand() : ItemStack.EMPTY)).shrink((int) 1); + entity.getPersistentData().putDouble("Fuel", (entity.getPersistentData().getDouble("Fuel") + 5)); + if (sourceentity instanceof PlayerEntity && !sourceentity.world.isRemote()) { + ((PlayerEntity) sourceentity).sendStatusMessage(new StringTextComponent("Vehicle Fueled"), (true)); + } + } + if (!sourceentity.isSneaking() && !entity.isBeingRidden() || sourceentity.isPassenger() && (sourceentity.getRidingEntity()) == entity) { + { + double _setval = (entity.getPersistentData().getDouble("ID")); + sourceentity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.PilotingVehicleID = _setval; + capability.syncPlayerVariables(sourceentity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/HotAirBalloonUIDisplayOverlayIngame2Procedure.java b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonUIDisplayOverlayIngame2Procedure.java new file mode 100644 index 0000000..b6e1dfb --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonUIDisplayOverlayIngame2Procedure.java @@ -0,0 +1,25 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.EntityTypeTags; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class HotAirBalloonUIDisplayOverlayIngame2Procedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure HotAirBalloonUIDisplayOverlayIngame2!"); + return false; + } + Entity entity = (Entity) dependencies.get("entity"); + if (EntityTypeTags.getCollection().getTagByID(new ResourceLocation("minecraft:skeletons")).contains(entity.getType())) { + return true; + } + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/HotAirBalloonUIDisplayOverlayIngameProcedure.java b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonUIDisplayOverlayIngameProcedure.java new file mode 100644 index 0000000..d2ed05a --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/HotAirBalloonUIDisplayOverlayIngameProcedure.java @@ -0,0 +1,24 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.HotAirBalloonEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class HotAirBalloonUIDisplayOverlayIngameProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure HotAirBalloonUIDisplayOverlayIngame!"); + return false; + } + Entity entity = (Entity) dependencies.get("entity"); + if (entity.isPassenger() && (entity.getRidingEntity()) instanceof HotAirBalloonEntity.CustomEntity) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/LadyBugInFlightOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/LadyBugInFlightOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..d4433d5 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/LadyBugInFlightOnEntityTickUpdateProcedure.java @@ -0,0 +1,100 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.LadybugEntity; +import studio.halbear.hem.entity.GiantButterflyWalkingEntity; +import studio.halbear.hem.entity.GiantButterflyEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.function.Function; +import java.util.Map; +import java.util.Comparator; + +public class LadyBugInFlightOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure LadyBugInFlightOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure LadyBugInFlightOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure LadyBugInFlightOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure LadyBugInFlightOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure LadyBugInFlightOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y - 0.05, z))).getBlock()) + && !(((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) + && !(((Entity) world + .getEntitiesWithinAABB(GiantButterflyWalkingEntity.CustomEntity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) + && !(((Entity) world + .getEntitiesWithinAABB(GiantButterflyEntity.CustomEntity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null)) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new LadybugEntity.CustomEntity(LadybugEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion((entity.getMotion().getX()), (entity.getMotion().getY()), (entity.getMotion().getZ())); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!entity.world.isRemote()) + entity.remove(); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/LadybugOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/LadybugOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..3b1e7fb --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/LadybugOnEntityTickUpdateProcedure.java @@ -0,0 +1,94 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.LadyBugInFlightEntity; +import studio.halbear.hem.entity.GiantButterflyWalkingEntity; +import studio.halbear.hem.entity.GiantButterflyEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; + +import java.util.function.Function; +import java.util.Map; +import java.util.Comparator; + +public class LadybugOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure LadybugOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure LadybugOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure LadybugOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure LadybugOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure LadybugOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null || ((Entity) world + .getEntitiesWithinAABB(GiantButterflyWalkingEntity.CustomEntity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null + || ((Entity) world + .getEntitiesWithinAABB(GiantButterflyEntity.CustomEntity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new LadyBugInFlightEntity.CustomEntity(LadyBugInFlightEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, y, z, (float) (entity.rotationYaw), (float) 0); + entityToSpawn.setRenderYawOffset((float) (entity.rotationYaw)); + entityToSpawn.setRotationYawHead((float) (entity.rotationYaw)); + entityToSpawn.setMotion((entity.getMotion().getX()), (entity.getMotion().getY()), (entity.getMotion().getZ())); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!entity.world.isRemote()) + entity.remove(); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/LadybugSpawnEggRightclickedOnBlockProcedure.java b/src/main/java/studio/halbear/hem/procedures/LadybugSpawnEggRightclickedOnBlockProcedure.java new file mode 100644 index 0000000..74cdb7c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/LadybugSpawnEggRightclickedOnBlockProcedure.java @@ -0,0 +1,92 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.entity.LadybugEntity; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.GameType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.item.ItemStack; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.SpawnReason; +import net.minecraft.entity.MobEntity; +import net.minecraft.entity.ILivingEntityData; +import net.minecraft.entity.Entity; +import net.minecraft.client.network.play.NetworkPlayerInfo; +import net.minecraft.client.entity.player.AbstractClientPlayerEntity; +import net.minecraft.client.Minecraft; + +import java.util.Map; + +public class LadybugSpawnEggRightclickedOnBlockProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure LadybugSpawnEggRightclickedOnBlock!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure LadybugSpawnEggRightclickedOnBlock!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure LadybugSpawnEggRightclickedOnBlock!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure LadybugSpawnEggRightclickedOnBlock!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure LadybugSpawnEggRightclickedOnBlock!"); + return; + } + if (dependencies.get("itemstack") == null) { + if (!dependencies.containsKey("itemstack")) + HemMod.LOGGER.warn("Failed to load dependency itemstack for procedure LadybugSpawnEggRightclickedOnBlock!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + ItemStack itemstack = (ItemStack) dependencies.get("itemstack"); + if (!BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y + 1, z))).getBlock())) { + if (world instanceof ServerWorld) { + Entity entityToSpawn = new LadybugEntity.CustomEntity(LadybugEntity.entity, (World) world); + entityToSpawn.setLocationAndAngles(x, (y + 1), z, world.getRandom().nextFloat() * 360F, 0); + if (entityToSpawn instanceof MobEntity) + ((MobEntity) entityToSpawn).onInitialSpawn((ServerWorld) world, world.getDifficultyForLocation(entityToSpawn.getPosition()), + SpawnReason.MOB_SUMMONED, (ILivingEntityData) null, (CompoundNBT) null); + world.addEntity(entityToSpawn); + } + if (!(new Object() { + public boolean checkGamemode(Entity _ent) { + if (_ent instanceof ServerPlayerEntity) { + return ((ServerPlayerEntity) _ent).interactionManager.getGameType() == GameType.CREATIVE; + } else if (_ent instanceof PlayerEntity && _ent.world.isRemote()) { + NetworkPlayerInfo _npi = Minecraft.getInstance().getConnection() + .getPlayerInfo(((AbstractClientPlayerEntity) _ent).getGameProfile().getId()); + return _npi != null && _npi.getGameType() == GameType.CREATIVE; + } + return false; + } + }.checkGamemode(entity))) { + (itemstack).shrink((int) 1); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/LushTree1AdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/LushTree1AdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..eaadd55 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/LushTree1AdditionalGenerationConditionProcedure.java @@ -0,0 +1,53 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; + +import java.util.Map; + +public class LushTree1AdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure LushTree1AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure LushTree1AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure LushTree1AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure LushTree1AdditionalGenerationCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x, y, z))).getBlock()) + && (world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) != null + && world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) + .equals(new ResourceLocation("hem:blueleaf_hayfever_fields")) + && z < 0 + || !(world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) != null + && world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) + .equals(new ResourceLocation("hem:blueleaf_hayfever_fields"))))) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherBlockDestroyedByPlayerProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherBlockDestroyedByPlayerProcedure.java new file mode 100644 index 0000000..8184a87 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherBlockDestroyedByPlayerProcedure.java @@ -0,0 +1,392 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.potion.GooedPotionEffect; +import studio.halbear.hem.block.MuncherBlock; +import studio.halbear.hem.block.BloomedMuncherBlock; +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.Event; +import net.minecraftforge.event.world.BlockEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.state.Property; +import net.minecraft.potion.Effects; +import net.minecraft.potion.EffectInstance; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Map; +import java.util.List; +import java.util.HashMap; +import java.util.Comparator; +import java.util.Collection; + +public class MuncherBlockDestroyedByPlayerProcedure { + @Mod.EventBusSubscriber + private static class GlobalTrigger { + @SubscribeEvent + public static void onBlockBreak(BlockEvent.BreakEvent event) { + Entity entity = event.getPlayer(); + IWorld world = event.getWorld(); + Map dependencies = new HashMap<>(); + dependencies.put("xpAmount", event.getExpToDrop()); + dependencies.put("x", event.getPos().getX()); + dependencies.put("y", event.getPos().getY()); + dependencies.put("z", event.getPos().getZ()); + dependencies.put("px", entity.getPosX()); + dependencies.put("py", entity.getPosY()); + dependencies.put("pz", entity.getPosZ()); + dependencies.put("world", world); + dependencies.put("entity", entity); + dependencies.put("blockstate", event.getState()); + dependencies.put("event", event); + executeProcedure(dependencies); + } + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherBlockDestroyedByPlayer!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherBlockDestroyedByPlayer!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherBlockDestroyedByPlayer!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherBlockDestroyedByPlayer!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure MuncherBlockDestroyedByPlayer!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + double entitiesInside = 0; + double entitiesNearby = 0; + if ((world.getBlockState(new BlockPos(x, y, z))).getBlock() == MuncherBlock.block) { + if (dependencies.get("event") != null) { + Object _obj = dependencies.get("event"); + if (_obj instanceof Event) { + Event _evt = (Event) _obj; + if (_evt.isCancelable()) + _evt.setCanceled(true); + } + } + if (new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating")) { + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (6 / 2d), y - (6 / 2d), z - (6 / 2d), x + (6 / 2d), y + (6 / 2d), z + (6 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if ((entityiterator.getUniqueID().toString()).equals(new Object() { + public String getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getString(tag); + return ""; + } + }.getValue(world, new BlockPos(x, y, z), "victimuuid"))) { + if (entityiterator instanceof ServerPlayerEntity) { + if ((entity.getUniqueID().toString()).equals(new Object() { + public String getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getString(tag); + return ""; + } + }.getValue(world, new BlockPos(x, y, z), "victimuuid"))) { + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).attackEntityFrom(new DamageSource("muncher").setDamageBypassesArmor(), + (float) (((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHealth() : -1) - 1)); + } + } + } else { + if (Math.random() > 0.8) { + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).attackEntityFrom(new DamageSource("muncher").setDamageBypassesArmor(), + (float) ((entityiterator instanceof LivingEntity) + ? ((LivingEntity) entityiterator).getMaxHealth() + : -1)); + } + } + } + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(GooedPotionEffect.potion, (int) 60, (int) 1)); + { + boolean _setval = (false); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Eaten = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.MINING_FATIGUE); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.SLOWNESS); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.INVISIBILITY); + } + } + } + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 80); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BloomedMuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + TileEntity _te = world.getTileEntity(_bp); + CompoundNBT _bnbt = null; + if (_te != null) { + _bnbt = _te.write(new CompoundNBT()); + _te.remove(); + } + world.setBlockState(_bp, _bs, 3); + if (_bnbt != null) { + _te = world.getTileEntity(_bp); + if (_te != null) { + try { + _te.read(_bso, _bnbt); + } catch (Exception ignored) { + } + } + } + } + } else { + entitiesInside = 0; + { + List _entfound = world.getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (0.5 / 2d), y - (0.5 / 2d), z - (0.5 / 2d), x + (0.5 / 2d), y + (0.5 / 2d), z + (0.5 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if (entityiterator instanceof ServerPlayerEntity && new Object() { + boolean check(Entity _entity) { + if (_entity instanceof LivingEntity) { + Collection effects = ((LivingEntity) _entity).getActivePotionEffects(); + for (EffectInstance effect : effects) { + if (effect.getPotion() == Effects.INVISIBILITY) + return true; + } + } + return false; + } + }.check(entityiterator) || !(entityiterator instanceof ServerPlayerEntity) && new Object() { + boolean check(Entity _entity) { + if (_entity instanceof LivingEntity) { + Collection effects = ((LivingEntity) _entity).getActivePotionEffects(); + for (EffectInstance effect : effects) { + if (effect.getPotion() == Effects.INVISIBILITY) + return true; + } + } + return false; + } + }.check(entityiterator)) { + entitiesInside = 1; + if (entityiterator instanceof ServerPlayerEntity) { + if ((entity.getUniqueID().toString()).equals(entityiterator.getUniqueID().toString())) { + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).attackEntityFrom(new DamageSource("muncher").setDamageBypassesArmor(), + (float) (((entity instanceof LivingEntity) ? ((LivingEntity) entity).getHealth() : -1) - 1)); + } + } + { + boolean _setval = (false); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Eaten = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + } else { + if (Math.random() > 0.8) { + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).attackEntityFrom(new DamageSource("muncher").setDamageBypassesArmor(), + (float) ((entityiterator instanceof LivingEntity) + ? ((LivingEntity) entityiterator).getMaxHealth() + : -1)); + } + } + } + if (entity instanceof LivingEntity) + ((LivingEntity) entity).addPotionEffect(new EffectInstance(GooedPotionEffect.potion, (int) 60, (int) 1)); + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.MINING_FATIGUE); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.SLOWNESS); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.INVISIBILITY); + } + if (world instanceof World && !world.isRemote()) { + ((World) world) + .playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 80); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BloomedMuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + TileEntity _te = world.getTileEntity(_bp); + CompoundNBT _bnbt = null; + if (_te != null) { + _bnbt = _te.write(new CompoundNBT()); + _te.remove(); + } + world.setBlockState(_bp, _bs, 3); + if (_bnbt != null) { + _te = world.getTileEntity(_bp); + if (_te != null) { + try { + _te.read(_bso, _bnbt); + } catch (Exception ignored) { + } + } + } + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 80); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + } + } + } + if (entitiesInside == 0) { + if (world instanceof World) { + Block.spawnDrops(world.getBlockState(new BlockPos(x, y, z)), (World) world, new BlockPos(x, y, z)); + world.destroyBlock(new BlockPos(x, y, z), false); + } + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherGenerationAdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherGenerationAdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..7a9f524 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherGenerationAdditionalGenerationConditionProcedure.java @@ -0,0 +1,43 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class MuncherGenerationAdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherGenerationAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherGenerationAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherGenerationAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherGenerationAdditionalGenerationCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (!((world.getBlockState(new BlockPos(x, y + 2, z))).getBlock() == Blocks.AIR)) { + return false; + } + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherGenerationOnStructureInstanceGeneratedProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherGenerationOnStructureInstanceGeneratedProcedure.java new file mode 100644 index 0000000..fee321c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherGenerationOnStructureInstanceGeneratedProcedure.java @@ -0,0 +1,45 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.MuncherBlock; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class MuncherGenerationOnStructureInstanceGeneratedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherGenerationOnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherGenerationOnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherGenerationOnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherGenerationOnStructureInstanceGenerated!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), MuncherBlock.block.getDefaultState(), 3); + if (world instanceof World) + ((World) world).notifyNeighborsOfStateChange(new BlockPos(x, y, z), ((World) world).getBlockState(new BlockPos(x, y, z)).getBlock()); + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherPlantAddedProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherPlantAddedProcedure.java new file mode 100644 index 0000000..886a0e4 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherPlantAddedProcedure.java @@ -0,0 +1,81 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.BloomedMuncherBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.state.Property; +import net.minecraft.block.BlockState; + +import java.util.Map; + +public class MuncherPlantAddedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherPlantAdded!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherPlantAdded!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherPlantAdded!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherPlantAdded!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if ((new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating")) == false) { + if ((world instanceof World) ? ((World) world).isDaytime() : false) { + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BloomedMuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.HOSTILE, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.HOSTILE, (float) 1, (float) 1, false); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherSproutAdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherSproutAdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..bf727de --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherSproutAdditionalGenerationConditionProcedure.java @@ -0,0 +1,47 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; + +import java.util.Map; + +public class MuncherSproutAdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherSproutAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherSproutAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherSproutAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherSproutAdditionalGenerationCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (!(world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) != null + && world.func_241828_r().getRegistry(Registry.BIOME_KEY).getKey(world.getBiome(new BlockPos(x, y, z))) + .equals(new ResourceLocation("hem:lush_blueleaf_marsh"))) + && Math.random() > 0.5) { + return false; + } + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherSproutClientDisplayRandomTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherSproutClientDisplayRandomTickProcedure.java new file mode 100644 index 0000000..0fa2e53 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherSproutClientDisplayRandomTickProcedure.java @@ -0,0 +1,99 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.MuncherBlock; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.common.MinecraftForge; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class MuncherSproutClientDisplayRandomTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherSproutClientDisplayRandomTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherSproutClientDisplayRandomTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherSproutClientDisplayRandomTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherSproutClientDisplayRandomTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (world instanceof ServerWorld) { + IWorld _worldorig = world; + world = ((ServerWorld) world).getServer().getWorld(RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))); + if (world != null) { + new Object() { + private int ticks = 0; + private float waitTicks; + private IWorld world; + + public void start(IWorld world, int waitTicks) { + this.waitTicks = waitTicks; + MinecraftForge.EVENT_BUS.register(this); + this.world = world; + } + + @SubscribeEvent + public void tick(TickEvent.ServerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + this.ticks += 1; + if (this.ticks >= this.waitTicks) + run(); + } + } + + private void run() { + if (world instanceof World && !world.isRemote()) { + ((World) world) + .playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.NEUTRAL, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("block.beehive.enter")), + SoundCategory.NEUTRAL, (float) 1, (float) 1, false); + } + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), MuncherBlock.block.getDefaultState(), 3); + if (world instanceof World) + ((World) world).notifyNeighborsOfStateChange(new BlockPos(x, y, z), + ((World) world).getBlockState(new BlockPos(x, y, z)).getBlock()); + MinecraftForge.EVENT_BUS.unregister(this); + } + }.start(world, (int) 20); + } + world = _worldorig; + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/MuncherUpdateTickProcedure.java b/src/main/java/studio/halbear/hem/procedures/MuncherUpdateTickProcedure.java new file mode 100644 index 0000000..a036a8f --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/MuncherUpdateTickProcedure.java @@ -0,0 +1,539 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.particle.SevereDamageParticlesParticle; +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.particle.BlueleafAmbienceParticle; +import studio.halbear.hem.block.BloomedMuncherBlock; +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.registries.ForgeRegistries; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.DamageSource; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.state.Property; +import net.minecraft.potion.Effects; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.block.BlockState; + +import java.util.stream.Collectors; +import java.util.function.Function; +import java.util.Map; +import java.util.List; +import java.util.Comparator; +import java.util.Collections; +import java.util.ArrayList; + +public class MuncherUpdateTickProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure MuncherUpdateTick!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure MuncherUpdateTick!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure MuncherUpdateTick!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure MuncherUpdateTick!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + double entitiesNearby = 0; + double entitiesInside = 0; + if ((new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating")) == true) { + entitiesInside = 0; + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (4 / 2d), y - (4 / 2d), z - (4 / 2d), x + (4 / 2d), y + (4 / 2d), z + (4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + if ((entityiterator.getUniqueID().toString()).equals(new Object() { + public String getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getString(tag); + return ""; + } + }.getValue(world, new BlockPos(x, y, z), "victimuuid"))) { + entitiesInside = 1; + if (new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown") > 0) { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", ((new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown")) - 1)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + } + if (new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "bites") > 1 && new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown") == 0) { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", Math.round((new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "maxcooldown")) / (2 + 1.5 * Math.random()))); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("bites", ((new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "bites")) - 1)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + entityiterator.setMotion(0, 0.1, 0); + { + Entity _ent = entityiterator; + _ent.setPositionAndUpdate((x + 0.5), y, (z + 0.5)); + if (_ent instanceof ServerPlayerEntity) { + ((ServerPlayerEntity) _ent).connection.setPlayerLocation((x + 0.5), y, (z + 0.5), _ent.rotationYaw, + _ent.rotationPitch, Collections.emptySet()); + } + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(LilyPadParticlesParticle.particle, x, y, z, (int) 10, 1, 2, 1, 0.3); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(SevereDamageParticlesParticle.particle, x, y, z, (int) 10, 1, 2, 1, 0.3); + } + if (world instanceof World && !world.isRemote()) { + ((World) world) + .playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.generic.eat")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.generic.eat")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + entityiterator.attackEntityFrom(DamageSource.CRAMMING, + (float) (((entityiterator instanceof LivingEntity) ? ((LivingEntity) entityiterator).getHealth() : -1) + / ((new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "bites")) * 2))); + if (entityiterator instanceof ServerPlayerEntity) { + if (entityiterator instanceof PlayerEntity) + ((PlayerEntity) entityiterator).getFoodStats() + .setFoodLevel((int) (((entityiterator instanceof PlayerEntity) + ? ((PlayerEntity) entityiterator).getFoodStats().getFoodLevel() + : 0) + - ((entityiterator instanceof PlayerEntity) + ? ((PlayerEntity) entityiterator).getFoodStats().getFoodLevel() + : 0) / 10)); + } + } else if (new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "bites") == 1 && new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown") == 0) { + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 5); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("bites", 0); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (world instanceof World && !world.isRemote()) { + ((World) world) + .playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.generic.eat")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.generic.eat")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + if (entityiterator instanceof ServerPlayerEntity) { + entityiterator.attackEntityFrom(DamageSource.CRAMMING, + (float) ((((entityiterator instanceof LivingEntity) ? ((LivingEntity) entityiterator).getHealth() : -1) / 3) + * 2)); + } else { + entityiterator.attackEntityFrom(DamageSource.CRAMMING, + (float) ((entityiterator instanceof LivingEntity) ? ((LivingEntity) entityiterator).getMaxHealth() : -1)); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(BlueleafAmbienceParticle.particle, x, y, z, (int) 10, 1, 2, 1, 0.3); + } + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(SevereDamageParticlesParticle.particle, x, y, z, (int) 20, 1, 2, 1, 0.3); + } + } else if (new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "bites") == 0 && new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown") == 0) { + if (world instanceof World && !world.isRemote()) { + ((World) world) + .playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS + .getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + { + boolean _setval = (false); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Eaten = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.INVISIBILITY); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.SLOWNESS); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 60); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BloomedMuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + TileEntity _te = world.getTileEntity(_bp); + CompoundNBT _bnbt = null; + if (_te != null) { + _bnbt = _te.write(new CompoundNBT()); + _te.remove(); + } + world.setBlockState(_bp, _bs, 3); + if (_bnbt != null) { + _te = world.getTileEntity(_bp); + if (_te != null) { + try { + _te.read(_bso, _bnbt); + } catch (Exception ignored) { + } + } + } + } + } + } + } + } + if (entitiesInside == 0 || new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "bites") == 0 && new Object() { + public double getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getDouble(tag); + return -1; + } + }.getValue(world, new BlockPos(x, y, z), "cooldown") == 0) { + if (entitiesInside == 0) { + { + List _players = new ArrayList<>(world.getPlayers()); + for (Entity entityiterator : _players) { + if ((entityiterator.getUniqueID().toString()).equals(new Object() { + public String getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getString(tag); + return ""; + } + }.getValue(world, new BlockPos(x, y, z), "victimuuid"))) { + { + boolean _setval = (false); + entityiterator.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Eaten = _setval; + capability.syncPlayerVariables(entityiterator); + }); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.INVISIBILITY); + } + if (entityiterator instanceof LivingEntity) { + ((LivingEntity) entityiterator).removePotionEffect(Effects.SLOWNESS); + } + } + } + } + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.player.burp")), + SoundCategory.HOSTILE, (float) 0.4, (float) 1, false); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putBoolean("eating", (true)); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + if (!world.isRemote()) { + BlockPos _bp = new BlockPos(x, y, z); + TileEntity _tileEntity = world.getTileEntity(_bp); + BlockState _bs = world.getBlockState(_bp); + if (_tileEntity != null) + _tileEntity.getTileData().putDouble("cooldown", 4); + if (world instanceof World) + ((World) world).notifyBlockUpdate(_bp, _bs, _bs, 3); + } + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BloomedMuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + TileEntity _te = world.getTileEntity(_bp); + CompoundNBT _bnbt = null; + if (_te != null) { + _bnbt = _te.write(new CompoundNBT()); + _te.remove(); + } + world.setBlockState(_bp, _bs, 3); + if (_bnbt != null) { + _te = world.getTileEntity(_bp); + if (_te != null) { + try { + _te.read(_bso, _bnbt); + } catch (Exception ignored) { + } + } + } + } + } + } else if ((new Object() { + public boolean getValue(IWorld world, BlockPos pos, String tag) { + TileEntity tileEntity = world.getTileEntity(pos); + if (tileEntity != null) + return tileEntity.getTileData().getBoolean(tag); + return false; + } + }.getValue(world, new BlockPos(x, y, z), "eating")) == false) { + entitiesNearby = 0; + entitiesInside = 0; + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (6 / 2d), y - (6 / 2d), z - (6 / 2d), x + (6 / 2d), y + (6 / 2d), z + (6 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + entitiesNearby = (entitiesNearby + 1); + } + } + { + List _entfound = world + .getEntitiesWithinAABB(Entity.class, + new AxisAlignedBB(x - (2 / 2d), y - (2 / 2d), z - (2 / 2d), x + (2 / 2d), y + (2 / 2d), z + (2 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).collect(Collectors.toList()); + for (Entity entityiterator : _entfound) { + entitiesInside = (entitiesInside + 1); + } + } + if (((Entity) world + .getEntitiesWithinAABB(ServerPlayerEntity.class, + new AxisAlignedBB(x - (1.4 / 2d), y - (1.4 / 2d), z - (1.4 / 2d), x + (1.4 / 2d), y + (1.4 / 2d), z + (1.4 / 2d)), null) + .stream().sorted(new Object() { + Comparator compareDistOf(double _x, double _y, double _z) { + return Comparator.comparing((Function) (_entcnd -> _entcnd.getDistanceSq(_x, _y, _z))); + } + }.compareDistOf(x, y, z)).findFirst().orElse(null)) != null) { + entitiesNearby = 0; + entitiesInside = 1; + } + if (entitiesInside == 0 && entitiesNearby > 0) { + { + BlockPos _bp = new BlockPos(x, y, z); + BlockState _bs = BloomedMuncherBlock.block.getDefaultState(); + BlockState _bso = world.getBlockState(_bp); + for (Map.Entry, Comparable> entry : _bso.getValues().entrySet()) { + Property _property = _bs.getBlock().getStateContainer().getProperty(entry.getKey().getName()); + if (_property != null && _bs.get(_property) != null) + try { + _bs = _bs.with(_property, (Comparable) entry.getValue()); + } catch (Exception e) { + } + } + world.setBlockState(_bp, _bs, 3); + } + if (world instanceof World && !world.isRemote()) { + ((World) world).playSound(null, new BlockPos(x, y, z), + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.HOSTILE, (float) 1, (float) 1); + } else { + ((World) world).playSound(x, y, z, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("block.beehive.exit")), + SoundCategory.HOSTILE, (float) 1, (float) 1, false); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/OpenGasCellViewOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/OpenGasCellViewOnKeyReleasedProcedure.java new file mode 100644 index 0000000..19abd08 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/OpenGasCellViewOnKeyReleasedProcedure.java @@ -0,0 +1,87 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.gui.AirboatGasCelViewGui; +import studio.halbear.hem.entity.AirboatEntity; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.fml.server.ServerLifecycleHooks; +import net.minecraftforge.fml.network.NetworkHooks; + +import net.minecraft.world.IWorld; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.ChatType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Util; +import net.minecraft.server.MinecraftServer; +import net.minecraft.network.PacketBuffer; +import net.minecraft.inventory.container.INamedContainerProvider; +import net.minecraft.inventory.container.Container; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.Entity; + +import java.util.Map; + +import io.netty.buffer.Unpooled; + +public class OpenGasCellViewOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure OpenGasCellViewOnKeyReleased!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure OpenGasCellViewOnKeyReleased!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure OpenGasCellViewOnKeyReleased!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure OpenGasCellViewOnKeyReleased!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure OpenGasCellViewOnKeyReleased!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (entity.isPassenger() && (entity.getRidingEntity()) instanceof AirboatEntity.CustomEntity) { + if (!world.isRemote()) { + MinecraftServer mcserv = ServerLifecycleHooks.getCurrentServer(); + if (mcserv != null) + mcserv.getPlayerList().func_232641_a_(new StringTextComponent("Message"), ChatType.SYSTEM, Util.DUMMY_UUID); + } + { + Entity _ent = entity; + if (_ent instanceof ServerPlayerEntity) { + BlockPos _bpos = new BlockPos(x, y, z); + NetworkHooks.openGui((ServerPlayerEntity) _ent, new INamedContainerProvider() { + @Override + public ITextComponent getDisplayName() { + return new StringTextComponent("AirboatGasCelView"); + } + + @Override + public Container createMenu(int id, PlayerInventory inventory, PlayerEntity player) { + return new AirboatGasCelViewGui.GuiContainerMod(id, inventory, new PacketBuffer(Unpooled.buffer()).writeBlockPos(_bpos)); + } + }, _bpos); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/SeaGrassGenerationAdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/SeaGrassGenerationAdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..d57e139 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/SeaGrassGenerationAdditionalGenerationConditionProcedure.java @@ -0,0 +1,46 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.block.FlowingFluidBlock; +import net.minecraft.block.Blocks; + +import java.util.Map; + +public class SeaGrassGenerationAdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure SeaGrassGenerationAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure SeaGrassGenerationAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure SeaGrassGenerationAdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure SeaGrassGenerationAdditionalGenerationCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if ((world.getBlockState(new BlockPos(x, y + 1, z))).getBlock() == Blocks.WATER + || (world.getBlockState(new BlockPos(x, y + 1, z))).getFluidState().isSource() + || (world.getBlockState(new BlockPos(x, y + 1, z))).getBlock() instanceof FlowingFluidBlock) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/SpeedCalculationProcedure.java b/src/main/java/studio/halbear/hem/procedures/SpeedCalculationProcedure.java new file mode 100644 index 0000000..3836a90 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/SpeedCalculationProcedure.java @@ -0,0 +1,165 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; + +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.entity.Entity; +import net.minecraft.block.Blocks; + +import java.util.Map; +import java.util.HashMap; + +public class SpeedCalculationProcedure { + @Mod.EventBusSubscriber + private static class GlobalTrigger { + @SubscribeEvent + public static void onPlayerTick(TickEvent.PlayerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + Entity entity = event.player; + World world = entity.world; + double i = entity.getPosX(); + double j = entity.getPosY(); + double k = entity.getPosZ(); + Map dependencies = new HashMap<>(); + dependencies.put("x", i); + dependencies.put("y", j); + dependencies.put("z", k); + dependencies.put("world", world); + dependencies.put("entity", entity); + dependencies.put("event", event); + executeProcedure(dependencies); + } + } + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure SpeedCalculation!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure SpeedCalculation!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure SpeedCalculation!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure SpeedCalculation!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + double TPS = 0; + double Dx = 0; + double Dy = 0; + double Ylevel = 0; + double Iterations = 0; + if (entity.ticksExisted % 10 == 0) { + Ylevel = (entity.getPosY()); + Iterations = 0; + for (int index0 = 0; index0 < (int) (300); index0++) { + Iterations = (Iterations + 1); + Ylevel = (Ylevel - 1); + if (!((world.getBlockState(new BlockPos(x, Ylevel, z))).getBlock() == Blocks.AIR)) { + break; + } + } + if (Iterations >= 300) { + { + double _setval = 9999.9; + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Altimeter = _setval; + capability.syncPlayerVariables(entity); + }); + } + } else { + { + double _setval = ((entity.getPosY() - Ylevel) * 3.28084); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.Altimeter = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } + if (entity.ticksExisted % 5 == 0) { + net.minecraft.server.MinecraftServer server = net.minecraftforge.fml.LogicalSidedProvider.INSTANCE + .get(net.minecraftforge.fml.LogicalSide.SERVER); + double meanTickTime = java.util.Arrays.stream(server.tickTimeArray).average().orElse(0.0) * 1.0E-6D; + Dx = (entity.getPosX() - (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPosX); + Dy = (entity.getPosZ() - (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).LastPosZ); + { + double _setval = ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleOdometerMetres * 0.000621371); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleOdometer = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (entity.getPosX()); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.LastPosX = _setval; + capability.syncPlayerVariables(entity); + }); + } + { + double _setval = (entity.getPosZ()); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.LastPosZ = _setval; + capability.syncPlayerVariables(entity); + }); + } + TPS = Math.min(20.0, 1000.0 / Math.max(1.0, meanTickTime));; + { + double _setval = Math.round(((Math.abs(Dx) + Math.abs(Dy)) / (20.0 / TPS)) * 4 * 2.23694); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.GoalMPH = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).MPH != (entity + .getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).GoalMPH) { + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).MPH > (entity + .getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).GoalMPH) { + { + double _setval = ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).MPH - 1); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.MPH = _setval; + capability.syncPlayerVariables(entity); + }); + } + } else if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).MPH < (entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).GoalMPH) { + { + double _setval = ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).MPH + 1); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.MPH = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/TigerFishEntityShakingConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/TigerFishEntityShakingConditionProcedure.java new file mode 100644 index 0000000..9af54e2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/TigerFishEntityShakingConditionProcedure.java @@ -0,0 +1,23 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class TigerFishEntityShakingConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure TigerFishEntityShakingCondition!"); + return false; + } + Entity entity = (Entity) dependencies.get("entity"); + if (entity.isInWaterRainOrBubbleColumn()) { + return false; + } + return true; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/TigerFishOnEntityTickUpdateProcedure.java b/src/main/java/studio/halbear/hem/procedures/TigerFishOnEntityTickUpdateProcedure.java new file mode 100644 index 0000000..a0b0d39 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/TigerFishOnEntityTickUpdateProcedure.java @@ -0,0 +1,55 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemMod; + +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.IWorld; +import net.minecraft.util.DamageSource; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class TigerFishOnEntityTickUpdateProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure TigerFishOnEntityTickUpdate!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure TigerFishOnEntityTickUpdate!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure TigerFishOnEntityTickUpdate!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure TigerFishOnEntityTickUpdate!"); + return; + } + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure TigerFishOnEntityTickUpdate!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + Entity entity = (Entity) dependencies.get("entity"); + if (Math.random() > 0.975) { + if (world instanceof ServerWorld) { + ((ServerWorld) world).spawnParticle(ParticleTypes.BUBBLE, x, y, z, (int) 5, 0, 0.3, 0, 0.1); + } + if (!entity.isInWaterRainOrBubbleColumn()) { + entity.attackEntityFrom(DamageSource.GENERIC, (float) 3); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleAccelerateOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleAccelerateOnKeyPressedProcedure.java new file mode 100644 index 0000000..8e7eed1 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleAccelerateOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleAccelerateOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleAccelerateOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleAccelerate = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleAccelerateOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleAccelerateOnKeyReleasedProcedure.java new file mode 100644 index 0000000..e320c4f --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleAccelerateOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleAccelerateOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleAccelerateOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleAccelerate = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleBackwardOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleBackwardOnKeyPressedProcedure.java new file mode 100644 index 0000000..d8f4a54 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleBackwardOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleBackwardOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleBackwardOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleBackward = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleBackwardOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleBackwardOnKeyReleasedProcedure.java new file mode 100644 index 0000000..d99a875 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleBackwardOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleBackwardOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleBackwardOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleBackward = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleDecelerateOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleDecelerateOnKeyPressedProcedure.java new file mode 100644 index 0000000..9b7c32e --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleDecelerateOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleDecelerateOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleDecelerateOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleDecelerate = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleDecelerateOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleDecelerateOnKeyReleasedProcedure.java new file mode 100644 index 0000000..6e05665 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleDecelerateOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleDecelerateOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleDecelerateOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleDecelerate = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleForwardOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleForwardOnKeyPressedProcedure.java new file mode 100644 index 0000000..76c672f --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleForwardOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleForwardOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleForwardOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleForward = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleForwardOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleForwardOnKeyReleasedProcedure.java new file mode 100644 index 0000000..ae6fac0 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleForwardOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleForwardOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleForwardOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleForward = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleIncreasePressureOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleIncreasePressureOnKeyPressedProcedure.java new file mode 100644 index 0000000..50f0258 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleIncreasePressureOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleIncreasePressureOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleIncreasePressureOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleIncreasePressure = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleIncreasePressureOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleIncreasePressureOnKeyReleasedProcedure.java new file mode 100644 index 0000000..9b79db4 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleIncreasePressureOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleIncreasePressureOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleIncreasePressureOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleIncreasePressure = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleReleasePressureOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleReleasePressureOnKeyPressedProcedure.java new file mode 100644 index 0000000..fbcd9e9 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleReleasePressureOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleReleasePressureOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleReleasePressureOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleReleasePressure = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleReleasePressureOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleReleasePressureOnKeyReleasedProcedure.java new file mode 100644 index 0000000..532fad2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleReleasePressureOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleReleasePressureOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleReleasePressureOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleReleasePressure = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleStrafeLeftOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeLeftOnKeyPressedProcedure.java new file mode 100644 index 0000000..fcacc57 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeLeftOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleStrafeLeftOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleStrafeLeftOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleStrafeLeft = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleStrafeLeftOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeLeftOnKeyReleasedProcedure.java new file mode 100644 index 0000000..10d0c61 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeLeftOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleStrafeLeftOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleStrafeLeftOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleStrafeLeft = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleStrafeRightOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeRightOnKeyPressedProcedure.java new file mode 100644 index 0000000..1249a60 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeRightOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleStrafeRightOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleStrafeRightOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleStrafeRight = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleStrafeRightOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeRightOnKeyReleasedProcedure.java new file mode 100644 index 0000000..b02925c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleStrafeRightOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleStrafeRightOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleStrafeRightOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleStrafeRight = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleTurnLeftOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleTurnLeftOnKeyPressedProcedure.java new file mode 100644 index 0000000..112f000 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleTurnLeftOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleTurnLeftOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleTurnLeftOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleTurnLeft = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleTurnLeftOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleTurnLeftOnKeyReleasedProcedure.java new file mode 100644 index 0000000..9888401 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleTurnLeftOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleTurnLeftOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleTurnLeftOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleTurnLeft = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleTurnRightOnKeyPressedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleTurnRightOnKeyPressedProcedure.java new file mode 100644 index 0000000..c2656c0 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleTurnRightOnKeyPressedProcedure.java @@ -0,0 +1,29 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleTurnRightOnKeyPressedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleTurnRightOnKeyPressed!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).PilotingVehicle) { + { + boolean _setval = (true); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleTurnRight = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleTurnRightOnKeyReleasedProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleTurnRightOnKeyReleasedProcedure.java new file mode 100644 index 0000000..35dae81 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleTurnRightOnKeyReleasedProcedure.java @@ -0,0 +1,27 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraft.entity.Entity; + +import java.util.Map; + +public class VehicleTurnRightOnKeyReleasedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleTurnRightOnKeyReleased!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + { + boolean _setval = (false); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleTurnRight = _setval; + capability.syncPlayerVariables(entity); + }); + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/VehicleYawProcedure.java b/src/main/java/studio/halbear/hem/procedures/VehicleYawProcedure.java new file mode 100644 index 0000000..9d22c75 --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/VehicleYawProcedure.java @@ -0,0 +1,68 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.HemModVariables; +import studio.halbear.hem.HemMod; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.TickEvent; + +import net.minecraft.world.World; +import net.minecraft.entity.Entity; + +import java.util.Map; +import java.util.HashMap; + +public class VehicleYawProcedure { + @Mod.EventBusSubscriber + private static class GlobalTrigger { + @SubscribeEvent + public static void onPlayerTick(TickEvent.PlayerTickEvent event) { + if (event.phase == TickEvent.Phase.END) { + Entity entity = event.player; + World world = entity.world; + double i = entity.getPosX(); + double j = entity.getPosY(); + double k = entity.getPosZ(); + Map dependencies = new HashMap<>(); + dependencies.put("x", i); + dependencies.put("y", j); + dependencies.put("z", k); + dependencies.put("world", world); + dependencies.put("entity", entity); + dependencies.put("event", event); + executeProcedure(dependencies); + } + } + } + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("entity") == null) { + if (!dependencies.containsKey("entity")) + HemMod.LOGGER.warn("Failed to load dependency entity for procedure VehicleYaw!"); + return; + } + Entity entity = (Entity) dependencies.get("entity"); + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new HemModVariables.PlayerVariables())).VehicleTurnLeft) { + { + double _setval = ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleYaw - 1); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleYaw = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + if ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleTurnRight) { + { + double _setval = ((entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null) + .orElse(new HemModVariables.PlayerVariables())).VehicleYaw + 1); + entity.getCapability(HemModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { + capability.VehicleYaw = _setval; + capability.syncPlayerVariables(entity); + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/Wall1AdditionalGenerationConditionProcedure.java b/src/main/java/studio/halbear/hem/procedures/Wall1AdditionalGenerationConditionProcedure.java new file mode 100644 index 0000000..7f5429c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/Wall1AdditionalGenerationConditionProcedure.java @@ -0,0 +1,40 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.BlueleafWheatBlock; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; + +import java.util.Map; + +public class Wall1AdditionalGenerationConditionProcedure { + + public static boolean executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure Wall1AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure Wall1AdditionalGenerationCondition!"); + return false; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure Wall1AdditionalGenerationCondition!"); + return false; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + if (((x - 8) % 16 == 0 || (z - 8) % 16 == 0) + && !((world.getBlockState(new BlockPos(x, world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, (int) x, (int) z), z))) + .getBlock() == BlueleafWheatBlock.block)) { + return true; + } + return false; + } +} diff --git a/src/main/java/studio/halbear/hem/procedures/Wall1OnStructureInstanceGeneratedProcedure.java b/src/main/java/studio/halbear/hem/procedures/Wall1OnStructureInstanceGeneratedProcedure.java new file mode 100644 index 0000000..d5da52c --- /dev/null +++ b/src/main/java/studio/halbear/hem/procedures/Wall1OnStructureInstanceGeneratedProcedure.java @@ -0,0 +1,228 @@ +package studio.halbear.hem.procedures; + +import studio.halbear.hem.block.BlueleafWheatBlock; +import studio.halbear.hem.block.BlueleafStoneGravelBlock; +import studio.halbear.hem.block.BlueleafLushLeavesBlock; +import studio.halbear.hem.block.BlueleafLavenderBlock; +import studio.halbear.hem.block.BlueleafFluorescentLeavesBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; +import studio.halbear.hem.block.BlueleafCobblestoneWallBlock; +import studio.halbear.hem.block.BlueleafCobblestoneStairsBlock; +import studio.halbear.hem.block.BlueleafCobblestoneSlabBlock; +import studio.halbear.hem.block.BlueleafCobblestoneBlock; +import studio.halbear.hem.HemMod; + +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.IWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.ResourceLocation; +import net.minecraft.tags.BlockTags; +import net.minecraft.block.Blocks; + +import java.util.Random; +import java.util.Map; +import java.util.Iterator; + +public class Wall1OnStructureInstanceGeneratedProcedure { + + public static void executeProcedure(Map dependencies) { + if (dependencies.get("world") == null) { + if (!dependencies.containsKey("world")) + HemMod.LOGGER.warn("Failed to load dependency world for procedure Wall1OnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("x") == null) { + if (!dependencies.containsKey("x")) + HemMod.LOGGER.warn("Failed to load dependency x for procedure Wall1OnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("y") == null) { + if (!dependencies.containsKey("y")) + HemMod.LOGGER.warn("Failed to load dependency y for procedure Wall1OnStructureInstanceGenerated!"); + return; + } + if (dependencies.get("z") == null) { + if (!dependencies.containsKey("z")) + HemMod.LOGGER.warn("Failed to load dependency z for procedure Wall1OnStructureInstanceGenerated!"); + return; + } + IWorld world = (IWorld) dependencies.get("world"); + double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x"); + double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y"); + double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z"); + double Iterator = 0; + double Random = 0; + double IteratorY = 0; + double IteratorX = 0; + double IteratorZ = 0; + double Random2 = 0; + double posY = 0; + double PosX = 0; + double PosZ = 0; + double PosYSource = 0; + double length = 0; + double PreviousType = 0; + if (z < -16) { + world.setBlockState(new BlockPos(x, y + 1, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y + 1, z), BlueleafLushLeavesBlock.block.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(x, y, z), BlueleafLushLeavesBlock.block.getDefaultState(), 3); + } + Iterator = 0; + for (int index0 = 0; index0 < (int) (3); index0++) { + PreviousType = Random; + IteratorX = 0; + IteratorZ = 0; + IteratorY = 0; + Random = Math.round(2 * Math.random()); + length = (4 + Math.round(6 * Math.random())); + if (Random == 1) { + length = 16; + } + if (z < -16) { + length = 8; + if (Random != 1) { + Random = Math.round(2 * Math.random()); + } + } + while (length > 0) { + length = (length - 1); + if (Iterator == 0) { + IteratorX = (IteratorX - 1); + } + if (Iterator == 1) { + IteratorX = (IteratorX + 1); + if ((x - 8) % 16 != 0 && PreviousType == 1) { + Random = 0; + } + } + if (Iterator == 2) { + IteratorZ = (IteratorZ + 1); + } + if (Iterator == 3) { + IteratorZ = (IteratorZ - 1); + if ((z - 8) % 16 != 0 && PreviousType == 1) { + Random = 0; + } + } + if ((Iterator > 1 && (x - 8) % 16 == 0 || Iterator <= 1 && (z - 8) % 16 == 0) + && (!BlockTags.getCollection().getTagByID(new ResourceLocation("forge:solid_block")) + .contains((world.getBlockState(new BlockPos(x + IteratorX, + world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, (int) (x + IteratorX), (int) (z + IteratorZ)) + + IteratorY, + z + IteratorZ))).getBlock()) + || (Random == 1 || z + IteratorZ < 0) && !((world.getBlockState(new BlockPos(x + IteratorX, + world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, (int) (x + IteratorX), (int) (z + IteratorZ)) + + IteratorY, + z + IteratorZ))).getBlock() == BlueleafWheatBlock.block + && !((world.getBlockState(new BlockPos(x + IteratorX, + world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, (int) (x + IteratorX), + (int) (z + IteratorZ)) + IteratorY, + z + IteratorZ))).getBlock() == BlueleafLavenderBlock.block)))) { + posY = (world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, (int) (x + IteratorX), (int) (z + IteratorZ)) + IteratorY); + PosYSource = (world.getHeight(Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, (int) (x + IteratorX), (int) (z + IteratorZ))); + PosX = (x + IteratorX); + PosZ = (z + IteratorZ); + Random2 = Math.random(); + if (!((world.getBlockState(new BlockPos(PosX, PosYSource, PosZ))).getBlock() == Blocks.WATER)) { + if (Random == 1 && ((x - 8) % 16 != 0 || (z - 8) % 16 != 0)) { + if ((world.getBlockState(new BlockPos(PosX, PosYSource - 1, PosZ))).getBlock() == BlueleafDirtBlockBlock.block) { + world.setBlockState(new BlockPos(PosX, PosYSource + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource + 2, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource, PosZ), Blocks.AIR.getDefaultState(), 3); + if (PosZ < 8) { + world.setBlockState(new BlockPos(PosX, PosYSource, PosZ), BlueleafLavenderBlock.block.getDefaultState(), 3); + } else { + world.setBlockState(new BlockPos(PosX, PosYSource, PosZ), BlueleafWheatBlock.block.getDefaultState(), 3); + } + } else if ((world.getBlockState(new BlockPos(PosX, PosYSource - 2, PosZ))).getBlock() == BlueleafStoneGravelBlock.block) { + world.setBlockState(new BlockPos(PosX, PosYSource + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource + 2, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource - 2, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource - 2, PosZ), BlueleafDirtBlockBlock.block.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), Blocks.AIR.getDefaultState(), 3); + if (PosZ < 8) { + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), BlueleafLavenderBlock.block.getDefaultState(), 3); + } else { + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), BlueleafWheatBlock.block.getDefaultState(), 3); + } + } + } else if (Random == 1 && (x - 8) % 16 == 0 && (z - 8) % 16 == 0) { + length = 0; + } + if (!((world.getBlockState(new BlockPos(PosX, PosYSource, PosZ))).getBlock() == BlueleafWheatBlock.block) + && !((world.getBlockState(new BlockPos(PosX, PosYSource, PosZ))).getBlock() == BlueleafLavenderBlock.block) + && (world.getBlockState(new BlockPos(PosX, PosYSource - 1, PosZ))).getBlock() == BlueleafDirtBlockBlock.block) { + if (Random == 0) { + if (PosZ < -16) { + world.setBlockState(new BlockPos(PosX, posY, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY, PosZ), BlueleafLushLeavesBlock.block.getDefaultState(), 3); + if (length > 1 && Math.random() > 0.3) { + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), BlueleafLushLeavesBlock.block.getDefaultState(), 3); + } + } else { + world.setBlockState(new BlockPos(PosX, posY, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY, PosZ), BlueleafCobblestoneBlock.block.getDefaultState(), 3); + if (Math.random() > 0.7) { + world.setBlockState(new BlockPos(PosX, posY, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY, PosZ), BlueleafCobblestoneStairsBlock.block.getDefaultState(), + 3); + } + if (length > 1) { + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), BlueleafCobblestoneSlabBlock.block.getDefaultState(), + 3); + if (Math.random() > 0.7) { + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), + BlueleafCobblestoneWallBlock.block.getDefaultState(), 3); + } + } + } + if (Random == 2) { + if (PosZ < -16) { + world.setBlockState(new BlockPos(PosX, posY, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY, PosZ), BlueleafFluorescentLeavesBlock.block.getDefaultState(), + 3); + if (length > 1 && Math.random() > 0.3) { + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), + BlueleafFluorescentLeavesBlock.block.getDefaultState(), 3); + } + } else { + world.setBlockState(new BlockPos(PosX, posY, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY, PosZ), BlueleafCobblestoneBlock.block.getDefaultState(), 3); + if (length > 1) { + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), BlueleafCobblestoneBlock.block.getDefaultState(), + 3); + if (Math.random() > 0.5) { + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, posY + 1, PosZ), + BlueleafStoneGravelBlock.block.getDefaultState(), 3); + } + } + } + } + if (Random != 1) { + if (PosZ < 0) { + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), + BlueleafDirtGrassBlockBlock.block.getDefaultState(), 3); + } else { + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), Blocks.AIR.getDefaultState(), 3); + world.setBlockState(new BlockPos(PosX, PosYSource - 1, PosZ), + BlueleafCobblestoneBlock.block.getDefaultState(), 3); + } + } + } + } + } + } + } + Iterator = (Iterator + 1); + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/biome/BlueleafPlainsBiome.java b/src/main/java/studio/halbear/hem/world/biome/BlueleafPlainsBiome.java new file mode 100644 index 0000000..7382d2b --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/biome/BlueleafPlainsBiome.java @@ -0,0 +1,166 @@ + +package studio.halbear.hem.world.biome; + +import studio.halbear.hem.particle.BlueleafAmbienceParticle; +import studio.halbear.hem.block.BlueleafStoneBlock; +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.BiomeDictionary; + +import net.minecraft.world.gen.treedecorator.TrunkVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; +import net.minecraft.world.gen.treedecorator.LeaveVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.CocoaTreeDecorator; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.biome.ParticleEffectAmbience; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.biome.DefaultBiomeFeatures; +import net.minecraft.world.biome.BiomeGenerationSettings; +import net.minecraft.world.biome.BiomeAmbience; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.IWorldWriter; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.MutableBoundingBox; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.BooleanProperty; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Set; +import java.util.Random; +import java.util.List; + +@HemModElements.ModElement.Tag +public class BlueleafPlainsBiome extends HemModElements.ModElement { + public static Biome biome; + + public BlueleafPlainsBiome(HemModElements instance) { + super(instance, 64); + FMLJavaModLoadingContext.get().getModEventBus().register(new BiomeRegisterHandler()); + } + + private static class BiomeRegisterHandler { + @SubscribeEvent + public void registerBiomes(RegistryEvent.Register event) { + if (biome == null) { + BiomeAmbience effects = new BiomeAmbience.Builder().setFogColor(12638463).setWaterColor(4159204).setWaterFogColor(329011) + .withSkyColor(7972607).withFoliageColor(-13382401).withGrassColor(-10040065) + .setParticle(new ParticleEffectAmbience(BlueleafAmbienceParticle.particle, 0.03f)).build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder().withSurfaceBuilder( + SurfaceBuilder.DEFAULT.func_242929_a(new SurfaceBuilderConfig(BlueleafGrassBlockBlock.block.getDefaultState(), + BlueleafStoneBlock.block.getDefaultState(), Blocks.WATER.getDefaultState()))); + DefaultBiomeFeatures.withFossils(biomeGenerationSettings); + MobSpawnInfo.Builder mobSpawnInfo = new MobSpawnInfo.Builder().isValidSpawnBiomeForPlayer(); + biome = new Biome.Builder().precipitation(Biome.RainType.RAIN).category(Biome.Category.PLAINS).depth(0.5f).scale(0.1f) + .temperature(0.6f).downfall(0.6f).setEffects(effects).withMobSpawnSettings(mobSpawnInfo.copy()) + .withGenerationSettings(biomeGenerationSettings.build()).build(); + event.getRegistry().register(biome.setRegistryName("hem:blueleaf_plains")); + } + } + } + + @Override + public void init(FMLCommonSetupEvent event) { + BiomeDictionary.addTypes(RegistryKey.getOrCreateKey(Registry.BIOME_KEY, WorldGenRegistries.BIOME.getKey(biome)), BiomeDictionary.Type.PLAINS, + BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.DRY); + } + + private static class CustomLeaveVineTreeDecorator extends LeaveVineTreeDecorator { + public static final CustomLeaveVineTreeDecorator instance = new CustomLeaveVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("blueleaf_plains_lvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomTrunkVineTreeDecorator extends TrunkVineTreeDecorator { + public static final CustomTrunkVineTreeDecorator instance = new CustomTrunkVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("blueleaf_plains_tvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomCocoaTreeDecorator extends CocoaTreeDecorator { + public static final CustomCocoaTreeDecorator instance = new CustomCocoaTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("blueleaf_plains_ctd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + public CustomCocoaTreeDecorator() { + super(0.2f); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + public void func_225576_a_(ISeedReader p_225576_1_, Random p_225576_2_, List p_225576_3_, List p_225576_4_, + Set p_225576_5_, MutableBoundingBox p_225576_6_) { + if (!(p_225576_2_.nextFloat() >= 0.2F)) { + int i = p_225576_3_.get(0).getY(); + p_225576_3_.stream().filter((p_236867_1_) -> { + return p_236867_1_.getY() - i <= 2; + }).forEach((p_242865_5_) -> { + for (Direction direction : Direction.Plane.HORIZONTAL) { + if (p_225576_2_.nextFloat() <= 0.25F) { + Direction direction1 = direction.getOpposite(); + BlockPos blockpos = p_242865_5_.add(direction1.getXOffset(), 0, direction1.getZOffset()); + if (Feature.isAirAt(p_225576_1_, blockpos)) { + BlockState blockstate = Blocks.AIR.getDefaultState(); + this.func_227423_a_(p_225576_1_, blockpos, blockstate, p_225576_5_, p_225576_6_); + } + } + } + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/biome/BlueleafWheatFieldsBiome.java b/src/main/java/studio/halbear/hem/world/biome/BlueleafWheatFieldsBiome.java new file mode 100644 index 0000000..eb8b841 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/biome/BlueleafWheatFieldsBiome.java @@ -0,0 +1,161 @@ + +package studio.halbear.hem.world.biome; + +import studio.halbear.hem.block.BlueleafStoneGravelBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.BiomeDictionary; + +import net.minecraft.world.gen.treedecorator.TrunkVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; +import net.minecraft.world.gen.treedecorator.LeaveVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.CocoaTreeDecorator; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.biome.BiomeGenerationSettings; +import net.minecraft.world.biome.BiomeAmbience; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.IWorldWriter; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.MutableBoundingBox; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.BooleanProperty; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Set; +import java.util.Random; +import java.util.List; + +@HemModElements.ModElement.Tag +public class BlueleafWheatFieldsBiome extends HemModElements.ModElement { + public static Biome biome; + + public BlueleafWheatFieldsBiome(HemModElements instance) { + super(instance, 84); + FMLJavaModLoadingContext.get().getModEventBus().register(new BiomeRegisterHandler()); + } + + private static class BiomeRegisterHandler { + @SubscribeEvent + public void registerBiomes(RegistryEvent.Register event) { + if (biome == null) { + BiomeAmbience effects = new BiomeAmbience.Builder().setFogColor(12638463).setWaterColor(-13382401).setWaterFogColor(329011) + .withSkyColor(7972607).withFoliageColor(-6697729).withGrassColor(-10053121).build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder().withSurfaceBuilder( + SurfaceBuilder.DEFAULT.func_242929_a(new SurfaceBuilderConfig(BlueleafDirtBlockBlock.block.getDefaultState(), + BlueleafStoneGravelBlock.block.getDefaultState(), Blocks.WATER.getDefaultState()))); + MobSpawnInfo.Builder mobSpawnInfo = new MobSpawnInfo.Builder().isValidSpawnBiomeForPlayer(); + biome = new Biome.Builder().precipitation(Biome.RainType.RAIN).category(Biome.Category.FOREST).depth(0.1f).scale(0.1f) + .temperature(0.5f).downfall(0.5f).setEffects(effects).withMobSpawnSettings(mobSpawnInfo.copy()) + .withGenerationSettings(biomeGenerationSettings.build()).build(); + event.getRegistry().register(biome.setRegistryName("hem:blueleaf_hayfever_fields")); + } + } + } + + @Override + public void init(FMLCommonSetupEvent event) { + BiomeDictionary.addTypes(RegistryKey.getOrCreateKey(Registry.BIOME_KEY, WorldGenRegistries.BIOME.getKey(biome)), BiomeDictionary.Type.RARE, + BiomeDictionary.Type.SPARSE, BiomeDictionary.Type.DRY); + } + + private static class CustomLeaveVineTreeDecorator extends LeaveVineTreeDecorator { + public static final CustomLeaveVineTreeDecorator instance = new CustomLeaveVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("blueleaf_hayfever_fields_lvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomTrunkVineTreeDecorator extends TrunkVineTreeDecorator { + public static final CustomTrunkVineTreeDecorator instance = new CustomTrunkVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("blueleaf_hayfever_fields_tvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomCocoaTreeDecorator extends CocoaTreeDecorator { + public static final CustomCocoaTreeDecorator instance = new CustomCocoaTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("blueleaf_hayfever_fields_ctd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + public CustomCocoaTreeDecorator() { + super(0.2f); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + public void func_225576_a_(ISeedReader p_225576_1_, Random p_225576_2_, List p_225576_3_, List p_225576_4_, + Set p_225576_5_, MutableBoundingBox p_225576_6_) { + if (!(p_225576_2_.nextFloat() >= 0.2F)) { + int i = p_225576_3_.get(0).getY(); + p_225576_3_.stream().filter((p_236867_1_) -> { + return p_236867_1_.getY() - i <= 2; + }).forEach((p_242865_5_) -> { + for (Direction direction : Direction.Plane.HORIZONTAL) { + if (p_225576_2_.nextFloat() <= 0.25F) { + Direction direction1 = direction.getOpposite(); + BlockPos blockpos = p_242865_5_.add(direction1.getXOffset(), 0, direction1.getZOffset()); + if (Feature.isAirAt(p_225576_1_, blockpos)) { + BlockState blockstate = Blocks.AIR.getDefaultState(); + this.func_227423_a_(p_225576_1_, blockpos, blockstate, p_225576_5_, p_225576_6_); + } + } + } + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/biome/HeightendBlueleafPlainsBiome.java b/src/main/java/studio/halbear/hem/world/biome/HeightendBlueleafPlainsBiome.java new file mode 100644 index 0000000..1b3935a --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/biome/HeightendBlueleafPlainsBiome.java @@ -0,0 +1,166 @@ + +package studio.halbear.hem.world.biome; + +import studio.halbear.hem.particle.BlueleafAmbienceParticle; +import studio.halbear.hem.block.BlueleafStoneBlock; +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.BiomeDictionary; + +import net.minecraft.world.gen.treedecorator.TrunkVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; +import net.minecraft.world.gen.treedecorator.LeaveVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.CocoaTreeDecorator; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.biome.ParticleEffectAmbience; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.biome.DefaultBiomeFeatures; +import net.minecraft.world.biome.BiomeGenerationSettings; +import net.minecraft.world.biome.BiomeAmbience; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.IWorldWriter; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.MutableBoundingBox; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.BooleanProperty; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Set; +import java.util.Random; +import java.util.List; + +@HemModElements.ModElement.Tag +public class HeightendBlueleafPlainsBiome extends HemModElements.ModElement { + public static Biome biome; + + public HeightendBlueleafPlainsBiome(HemModElements instance) { + super(instance, 135); + FMLJavaModLoadingContext.get().getModEventBus().register(new BiomeRegisterHandler()); + } + + private static class BiomeRegisterHandler { + @SubscribeEvent + public void registerBiomes(RegistryEvent.Register event) { + if (biome == null) { + BiomeAmbience effects = new BiomeAmbience.Builder().setFogColor(12638463).setWaterColor(4159204).setWaterFogColor(329011) + .withSkyColor(7972607).withFoliageColor(-13382401).withGrassColor(-10040065) + .setParticle(new ParticleEffectAmbience(BlueleafAmbienceParticle.particle, 0.03f)).build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder().withSurfaceBuilder( + SurfaceBuilder.DEFAULT.func_242929_a(new SurfaceBuilderConfig(BlueleafGrassBlockBlock.block.getDefaultState(), + BlueleafStoneBlock.block.getDefaultState(), Blocks.WATER.getDefaultState()))); + DefaultBiomeFeatures.withFossils(biomeGenerationSettings); + MobSpawnInfo.Builder mobSpawnInfo = new MobSpawnInfo.Builder().isValidSpawnBiomeForPlayer(); + biome = new Biome.Builder().precipitation(Biome.RainType.RAIN).category(Biome.Category.PLAINS).depth(1.3f).scale(0.2f) + .temperature(0.4f).downfall(0.5f).setEffects(effects).withMobSpawnSettings(mobSpawnInfo.copy()) + .withGenerationSettings(biomeGenerationSettings.build()).build(); + event.getRegistry().register(biome.setRegistryName("hem:heightend_blueleaf_plains")); + } + } + } + + @Override + public void init(FMLCommonSetupEvent event) { + BiomeDictionary.addTypes(RegistryKey.getOrCreateKey(Registry.BIOME_KEY, WorldGenRegistries.BIOME.getKey(biome)), BiomeDictionary.Type.PLAINS, + BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.DRY); + } + + private static class CustomLeaveVineTreeDecorator extends LeaveVineTreeDecorator { + public static final CustomLeaveVineTreeDecorator instance = new CustomLeaveVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("heightend_blueleaf_plains_lvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomTrunkVineTreeDecorator extends TrunkVineTreeDecorator { + public static final CustomTrunkVineTreeDecorator instance = new CustomTrunkVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("heightend_blueleaf_plains_tvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomCocoaTreeDecorator extends CocoaTreeDecorator { + public static final CustomCocoaTreeDecorator instance = new CustomCocoaTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("heightend_blueleaf_plains_ctd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + public CustomCocoaTreeDecorator() { + super(0.2f); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + public void func_225576_a_(ISeedReader p_225576_1_, Random p_225576_2_, List p_225576_3_, List p_225576_4_, + Set p_225576_5_, MutableBoundingBox p_225576_6_) { + if (!(p_225576_2_.nextFloat() >= 0.2F)) { + int i = p_225576_3_.get(0).getY(); + p_225576_3_.stream().filter((p_236867_1_) -> { + return p_236867_1_.getY() - i <= 2; + }).forEach((p_242865_5_) -> { + for (Direction direction : Direction.Plane.HORIZONTAL) { + if (p_225576_2_.nextFloat() <= 0.25F) { + Direction direction1 = direction.getOpposite(); + BlockPos blockpos = p_242865_5_.add(direction1.getXOffset(), 0, direction1.getZOffset()); + if (Feature.isAirAt(p_225576_1_, blockpos)) { + BlockState blockstate = Blocks.AIR.getDefaultState(); + this.func_227423_a_(p_225576_1_, blockpos, blockstate, p_225576_5_, p_225576_6_); + } + } + } + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/biome/LushBlueleafMarshBiome.java b/src/main/java/studio/halbear/hem/world/biome/LushBlueleafMarshBiome.java new file mode 100644 index 0000000..b724bef --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/biome/LushBlueleafMarshBiome.java @@ -0,0 +1,167 @@ + +package studio.halbear.hem.world.biome; + +import studio.halbear.hem.particle.LilyPadParticlesParticle; +import studio.halbear.hem.block.BlueleafMudBlock; +import studio.halbear.hem.block.BlueleafGravelMudBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.BiomeDictionary; + +import net.minecraft.world.gen.treedecorator.TrunkVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; +import net.minecraft.world.gen.treedecorator.LeaveVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.CocoaTreeDecorator; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.biome.ParticleEffectAmbience; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.biome.DefaultBiomeFeatures; +import net.minecraft.world.biome.BiomeGenerationSettings; +import net.minecraft.world.biome.BiomeAmbience; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.IWorldWriter; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.MutableBoundingBox; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.BooleanProperty; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Set; +import java.util.Random; +import java.util.List; + +@HemModElements.ModElement.Tag +public class LushBlueleafMarshBiome extends HemModElements.ModElement { + public static Biome biome; + + public LushBlueleafMarshBiome(HemModElements instance) { + super(instance, 133); + FMLJavaModLoadingContext.get().getModEventBus().register(new BiomeRegisterHandler()); + } + + private static class BiomeRegisterHandler { + @SubscribeEvent + public void registerBiomes(RegistryEvent.Register event) { + if (biome == null) { + BiomeAmbience effects = new BiomeAmbience.Builder().setFogColor(12638463).setWaterColor(-10053121).setWaterFogColor(329011) + .withSkyColor(7972607).withFoliageColor(-13382401).withGrassColor(-10040065) + .setParticle(new ParticleEffectAmbience(LilyPadParticlesParticle.particle, 0.01f)).build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder().withSurfaceBuilder( + SurfaceBuilder.DEFAULT.func_242929_a(new SurfaceBuilderConfig(BlueleafGravelMudBlock.block.getDefaultState(), + BlueleafMudBlock.block.getDefaultState(), Blocks.WATER.getDefaultState()))); + DefaultBiomeFeatures.withFossils(biomeGenerationSettings); + MobSpawnInfo.Builder mobSpawnInfo = new MobSpawnInfo.Builder().isValidSpawnBiomeForPlayer(); + biome = new Biome.Builder().precipitation(Biome.RainType.RAIN).category(Biome.Category.PLAINS).depth(-0.2f).scale(0.6f) + .temperature(0.8f).downfall(0.7f).setEffects(effects).withMobSpawnSettings(mobSpawnInfo.copy()) + .withGenerationSettings(biomeGenerationSettings.build()).build(); + event.getRegistry().register(biome.setRegistryName("hem:lush_blueleaf_marsh")); + } + } + } + + @Override + public void init(FMLCommonSetupEvent event) { + BiomeDictionary.addTypes(RegistryKey.getOrCreateKey(Registry.BIOME_KEY, WorldGenRegistries.BIOME.getKey(biome)), BiomeDictionary.Type.PLAINS, + BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.SWAMP, BiomeDictionary.Type.WET, + BiomeDictionary.Type.DENSE); + } + + private static class CustomLeaveVineTreeDecorator extends LeaveVineTreeDecorator { + public static final CustomLeaveVineTreeDecorator instance = new CustomLeaveVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("lush_blueleaf_marsh_lvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomTrunkVineTreeDecorator extends TrunkVineTreeDecorator { + public static final CustomTrunkVineTreeDecorator instance = new CustomTrunkVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("lush_blueleaf_marsh_tvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomCocoaTreeDecorator extends CocoaTreeDecorator { + public static final CustomCocoaTreeDecorator instance = new CustomCocoaTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("lush_blueleaf_marsh_ctd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + public CustomCocoaTreeDecorator() { + super(0.2f); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + public void func_225576_a_(ISeedReader p_225576_1_, Random p_225576_2_, List p_225576_3_, List p_225576_4_, + Set p_225576_5_, MutableBoundingBox p_225576_6_) { + if (!(p_225576_2_.nextFloat() >= 0.2F)) { + int i = p_225576_3_.get(0).getY(); + p_225576_3_.stream().filter((p_236867_1_) -> { + return p_236867_1_.getY() - i <= 2; + }).forEach((p_242865_5_) -> { + for (Direction direction : Direction.Plane.HORIZONTAL) { + if (p_225576_2_.nextFloat() <= 0.25F) { + Direction direction1 = direction.getOpposite(); + BlockPos blockpos = p_242865_5_.add(direction1.getXOffset(), 0, direction1.getZOffset()); + if (Feature.isAirAt(p_225576_1_, blockpos)) { + BlockState blockstate = Blocks.AIR.getDefaultState(); + this.func_227423_a_(p_225576_1_, blockpos, blockstate, p_225576_5_, p_225576_6_); + } + } + } + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/biome/LushBlueleafPlainsBiome.java b/src/main/java/studio/halbear/hem/world/biome/LushBlueleafPlainsBiome.java new file mode 100644 index 0000000..bf881c9 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/biome/LushBlueleafPlainsBiome.java @@ -0,0 +1,166 @@ + +package studio.halbear.hem.world.biome; + +import studio.halbear.hem.particle.BlueleafAmbienceParticle; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.BiomeDictionary; + +import net.minecraft.world.gen.treedecorator.TrunkVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.TreeDecoratorType; +import net.minecraft.world.gen.treedecorator.LeaveVineTreeDecorator; +import net.minecraft.world.gen.treedecorator.CocoaTreeDecorator; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilderConfig; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.biome.ParticleEffectAmbience; +import net.minecraft.world.biome.MobSpawnInfo; +import net.minecraft.world.biome.DefaultBiomeFeatures; +import net.minecraft.world.biome.BiomeGenerationSettings; +import net.minecraft.world.biome.BiomeAmbience; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.IWorldWriter; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.MutableBoundingBox; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.BooleanProperty; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Set; +import java.util.Random; +import java.util.List; + +@HemModElements.ModElement.Tag +public class LushBlueleafPlainsBiome extends HemModElements.ModElement { + public static Biome biome; + + public LushBlueleafPlainsBiome(HemModElements instance) { + super(instance, 65); + FMLJavaModLoadingContext.get().getModEventBus().register(new BiomeRegisterHandler()); + } + + private static class BiomeRegisterHandler { + @SubscribeEvent + public void registerBiomes(RegistryEvent.Register event) { + if (biome == null) { + BiomeAmbience effects = new BiomeAmbience.Builder().setFogColor(12638463).setWaterColor(-10053121).setWaterFogColor(329011) + .withSkyColor(7972607).withFoliageColor(-13382401).withGrassColor(-10040065) + .setParticle(new ParticleEffectAmbience(BlueleafAmbienceParticle.particle, 0.03f)).build(); + BiomeGenerationSettings.Builder biomeGenerationSettings = new BiomeGenerationSettings.Builder().withSurfaceBuilder( + SurfaceBuilder.DEFAULT.func_242929_a(new SurfaceBuilderConfig(BlueleafDirtGrassBlockBlock.block.getDefaultState(), + BlueleafDirtBlockBlock.block.getDefaultState(), Blocks.WATER.getDefaultState()))); + DefaultBiomeFeatures.withFossils(biomeGenerationSettings); + MobSpawnInfo.Builder mobSpawnInfo = new MobSpawnInfo.Builder().isValidSpawnBiomeForPlayer(); + biome = new Biome.Builder().precipitation(Biome.RainType.RAIN).category(Biome.Category.PLAINS).depth(0.1f).scale(0.2f) + .temperature(0.75f).downfall(0.6f).setEffects(effects).withMobSpawnSettings(mobSpawnInfo.copy()) + .withGenerationSettings(biomeGenerationSettings.build()).build(); + event.getRegistry().register(biome.setRegistryName("hem:lush_blueleaf_plains")); + } + } + } + + @Override + public void init(FMLCommonSetupEvent event) { + BiomeDictionary.addTypes(RegistryKey.getOrCreateKey(Registry.BIOME_KEY, WorldGenRegistries.BIOME.getKey(biome)), BiomeDictionary.Type.PLAINS, + BiomeDictionary.Type.FOREST, BiomeDictionary.Type.HILLS, BiomeDictionary.Type.DENSE); + } + + private static class CustomLeaveVineTreeDecorator extends LeaveVineTreeDecorator { + public static final CustomLeaveVineTreeDecorator instance = new CustomLeaveVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("lush_blueleaf_plains_lvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomTrunkVineTreeDecorator extends TrunkVineTreeDecorator { + public static final CustomTrunkVineTreeDecorator instance = new CustomTrunkVineTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("lush_blueleaf_plains_tvtd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + protected void func_227424_a_(IWorldWriter ww, BlockPos bp, BooleanProperty bpr, Set sbc, MutableBoundingBox mbb) { + this.func_227423_a_(ww, bp, Blocks.AIR.getDefaultState(), sbc, mbb); + } + } + + private static class CustomCocoaTreeDecorator extends CocoaTreeDecorator { + public static final CustomCocoaTreeDecorator instance = new CustomCocoaTreeDecorator(); + public static com.mojang.serialization.Codec codec; + public static TreeDecoratorType tdt; + static { + codec = com.mojang.serialization.Codec.unit(() -> instance); + tdt = new TreeDecoratorType(codec); + tdt.setRegistryName("lush_blueleaf_plains_ctd"); + ForgeRegistries.TREE_DECORATOR_TYPES.register(tdt); + } + + public CustomCocoaTreeDecorator() { + super(0.2f); + } + + @Override + protected TreeDecoratorType func_230380_a_() { + return tdt; + } + + @Override + public void func_225576_a_(ISeedReader p_225576_1_, Random p_225576_2_, List p_225576_3_, List p_225576_4_, + Set p_225576_5_, MutableBoundingBox p_225576_6_) { + if (!(p_225576_2_.nextFloat() >= 0.2F)) { + int i = p_225576_3_.get(0).getY(); + p_225576_3_.stream().filter((p_236867_1_) -> { + return p_236867_1_.getY() - i <= 2; + }).forEach((p_242865_5_) -> { + for (Direction direction : Direction.Plane.HORIZONTAL) { + if (p_225576_2_.nextFloat() <= 0.25F) { + Direction direction1 = direction.getOpposite(); + BlockPos blockpos = p_242865_5_.add(direction1.getXOffset(), 0, direction1.getZOffset()); + if (Feature.isAirAt(p_225576_1_, blockpos)) { + BlockState blockstate = Blocks.AIR.getDefaultState(); + this.func_227423_a_(p_225576_1_, blockpos, blockstate, p_225576_5_, p_225576_6_); + } + } + } + }); + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/dimension/BlueleafDimension.java b/src/main/java/studio/halbear/hem/world/dimension/BlueleafDimension.java new file mode 100644 index 0000000..0421190 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/dimension/BlueleafDimension.java @@ -0,0 +1,634 @@ + +package studio.halbear.hem.world.dimension; + +import studio.halbear.hem.item.BlueleafItem; +import studio.halbear.hem.block.BlueleafStoneBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; +import studio.halbear.hem.HemModElements; + +import net.minecraftforge.registries.ObjectHolder; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; +import net.minecraftforge.fml.DeferredWorkQueue; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.common.util.ITeleporter; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; + +import net.minecraft.world.server.TicketType; +import net.minecraft.world.server.ServerWorld; +import net.minecraft.world.gen.carver.WorldCarver; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.border.WorldBorder; +import net.minecraft.world.World; +import net.minecraft.world.IWorld; +import net.minecraft.world.DimensionType; +import net.minecraft.village.PointOfInterestType; +import net.minecraft.village.PointOfInterestManager; +import net.minecraft.village.PointOfInterest; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.vector.Vector3i; +import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.TeleportationRepositioner; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Direction; +import net.minecraft.state.properties.BlockStateProperties; +import net.minecraft.particles.ParticleTypes; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.entity.EntitySize; +import net.minecraft.entity.Entity; +import net.minecraft.client.world.DimensionRenderInfo; +import net.minecraft.client.renderer.RenderTypeLookup; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.block.material.Material; +import net.minecraft.block.SoundType; +import net.minecraft.block.PortalInfo; +import net.minecraft.block.NetherPortalBlock; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; +import net.minecraft.block.Block; +import net.minecraft.block.AbstractBlock; + +import javax.annotation.Nullable; + +import java.util.function.Predicate; +import java.util.function.Function; +import java.util.Set; +import java.util.Random; +import java.util.Optional; +import java.util.HashSet; +import java.util.Comparator; + +import it.unimi.dsi.fastutil.objects.Object2ObjectMap; + +import com.google.common.collect.Sets; +import com.google.common.collect.ImmutableSet; + +@HemModElements.ModElement.Tag +public class BlueleafDimension extends HemModElements.ModElement { + @ObjectHolder("hem:blueleaf_portal") + public static final CustomPortalBlock portal = null; + + public BlueleafDimension(HemModElements instance) { + super(instance, 55); + FMLJavaModLoadingContext.get().getModEventBus().register(new POIRegisterHandler()); + } + + @Override + public void init(FMLCommonSetupEvent event) { + Set replaceableBlocks = new HashSet<>(); + replaceableBlocks.add(BlueleafStoneBlock.block); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:blueleaf_plains")).getGenerationSettings().getSurfaceBuilder() + .get().getConfig().getTop().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:blueleaf_plains")).getGenerationSettings().getSurfaceBuilder() + .get().getConfig().getUnder().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:blueleaf_hayfever_fields")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getTop().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:blueleaf_hayfever_fields")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getUnder().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:heightend_blueleaf_plains")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getTop().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:heightend_blueleaf_plains")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getUnder().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:lush_blueleaf_plains")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getTop().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:lush_blueleaf_plains")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getUnder().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:lush_blueleaf_marsh")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getTop().getBlock()); + replaceableBlocks.add(ForgeRegistries.BIOMES.getValue(new ResourceLocation("hem:lush_blueleaf_marsh")).getGenerationSettings() + .getSurfaceBuilder().get().getConfig().getUnder().getBlock()); + DeferredWorkQueue.runLater(() -> { + try { + ObfuscationReflectionHelper.setPrivateValue(WorldCarver.class, WorldCarver.CAVE, new ImmutableSet.Builder() + .addAll((Set) ObfuscationReflectionHelper.getPrivateValue(WorldCarver.class, WorldCarver.CAVE, "field_222718_j")) + .addAll(replaceableBlocks).build(), "field_222718_j"); + ObfuscationReflectionHelper.setPrivateValue(WorldCarver.class, WorldCarver.CANYON, new ImmutableSet.Builder() + .addAll((Set) ObfuscationReflectionHelper.getPrivateValue(WorldCarver.class, WorldCarver.CANYON, "field_222718_j")) + .addAll(replaceableBlocks).build(), "field_222718_j"); + } catch (Exception e) { + e.printStackTrace(); + } + }); + } + + @Override + @OnlyIn(Dist.CLIENT) + public void clientLoad(FMLClientSetupEvent event) { + DimensionRenderInfo customEffect = new DimensionRenderInfo(128, true, DimensionRenderInfo.FogType.NORMAL, false, false) { + @Override + public Vector3d func_230494_a_(Vector3d color, float sunHeight) { + return color.mul(sunHeight * 0.94 + 0.06, sunHeight * 0.94 + 0.06, sunHeight * 0.91 + 0.09); + } + + @Override + public boolean func_230493_a_(int x, int y) { + return true; + } + }; + DeferredWorkQueue.runLater(() -> { + try { + Object2ObjectMap effectsRegistry = (Object2ObjectMap) ObfuscationReflectionHelper + .getPrivateValue(DimensionRenderInfo.class, null, "field_239208_a_"); + effectsRegistry.put(new ResourceLocation("hem:blueleaf"), customEffect); + } catch (Exception e) { + e.printStackTrace(); + } + }); + RenderTypeLookup.setRenderLayer(portal, RenderType.getTranslucent()); + } + + private static PointOfInterestType poi = null; + public static final TicketType CUSTOM_PORTAL = TicketType.create("blueleaf_portal", Vector3i::compareTo, 300); + + public static class POIRegisterHandler { + @SubscribeEvent + public void registerPointOfInterest(RegistryEvent.Register event) { + poi = new PointOfInterestType("blueleaf_portal", Sets.newHashSet(ImmutableSet.copyOf(portal.getStateContainer().getValidStates())), 0, 1) + .setRegistryName("blueleaf_portal"); + ForgeRegistries.POI_TYPES.register(poi); + } + } + + @Override + public void initElements() { + elements.blocks.add(() -> new CustomPortalBlock()); + elements.items.add(() -> new BlueleafItem().setRegistryName("blueleaf")); + } + + public static class CustomPortalBlock extends NetherPortalBlock { + public CustomPortalBlock() { + super(Block.Properties.create(Material.PORTAL).doesNotBlockMovement().tickRandomly().hardnessAndResistance(-1.0F).sound(SoundType.GLASS) + .setLightLevel(s -> 0).noDrops()); + setRegistryName("blueleaf_portal"); + } + + @Override + public void tick(BlockState blockstate, ServerWorld world, BlockPos pos, Random random) { + } + + @Override + public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + } + + public void portalSpawn(World world, BlockPos pos) { + Optional optional = CustomPortalSize.func_242964_a(world, pos, Direction.Axis.X); + if (optional.isPresent()) { + optional.get().placePortalBlocks(); + } + } + + @Override /** + * Update the provided state given the provided neighbor facing and neighbor state, returning a new state. For example, fences make their connections to the passed in state if possible, and wet concrete powder immediately returns its solidified counterpart. Note that this method should ideally consider only the specific face passed in. + */ + public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, + BlockPos facingPos) { + Direction.Axis direction$axis = facing.getAxis(); + Direction.Axis direction$axis1 = stateIn.get(AXIS); + boolean flag = direction$axis1 != direction$axis && direction$axis.isHorizontal(); + return !flag && !facingState.isIn(this) && !(new CustomPortalSize(worldIn, currentPos, direction$axis1)).validatePortal() + ? Blocks.AIR.getDefaultState() + : super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos); + } + + @OnlyIn(Dist.CLIENT) + @Override + public void animateTick(BlockState state, World world, BlockPos pos, Random random) { + for (int i = 0; i < 4; i++) { + double px = pos.getX() + random.nextFloat(); + double py = pos.getY() + random.nextFloat(); + double pz = pos.getZ() + random.nextFloat(); + double vx = (random.nextFloat() - 0.5) / 2.; + double vy = (random.nextFloat() - 0.5) / 2.; + double vz = (random.nextFloat() - 0.5) / 2.; + int j = random.nextInt(4) - 1; + if (world.getBlockState(pos.west()).getBlock() != this && world.getBlockState(pos.east()).getBlock() != this) { + px = pos.getX() + 0.5 + 0.25 * j; + vx = random.nextFloat() * 2 * j; + } else { + pz = pos.getZ() + 0.5 + 0.25 * j; + vz = random.nextFloat() * 2 * j; + } + world.addParticle(ParticleTypes.NAUTILUS, px, py, pz, vx, vy, vz); + } + if (random.nextInt(110) == 0) + world.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, + (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(("block.portal.ambient"))), + SoundCategory.BLOCKS, 0.5f, random.nextFloat() * 0.4F + 0.8F, false); + } + + @Override + public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { + if (!entity.isPassenger() && !entity.isBeingRidden() && entity.isNonBoss() && !entity.world.isRemote && true) { + if (entity.func_242280_ah()) { + entity.func_242279_ag(); + } else if (entity.world.getDimensionKey() != RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) { + entity.func_242279_ag(); + teleportToDimension(entity, pos, RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))); + } else { + entity.func_242279_ag(); + teleportToDimension(entity, pos, World.OVERWORLD); + } + } + } + + private void teleportToDimension(Entity entity, BlockPos pos, RegistryKey destinationType) { + entity.changeDimension(entity.getServer().getWorld(destinationType), + new TeleporterDimensionMod(entity.getServer().getWorld(destinationType), pos)); + } + } + + public static class CustomPortalSize { + private static final AbstractBlock.IPositionPredicate POSITION_PREDICATE = (state, blockReader, pos) -> { + return state.getBlock() == BlueleafDirtBlockBlock.block; + }; + private final IWorld world; + private final Direction.Axis axis; + private final Direction rightDir; + private int portalBlockCount; + @Nullable + private BlockPos bottomLeft; + private int height; + private int width; + + public static Optional func_242964_a(IWorld world, BlockPos pos, Direction.Axis axis) { + return func_242965_a(world, pos, (size) -> { + return size.isValid() && size.portalBlockCount == 0; + }, axis); + } + + public static Optional func_242965_a(IWorld world, BlockPos pos, Predicate sizePredicate, + Direction.Axis axis) { + Optional optional = Optional.of(new CustomPortalSize(world, pos, axis)).filter(sizePredicate); + if (optional.isPresent()) { + return optional; + } else { + Direction.Axis direction$axis = axis == Direction.Axis.X ? Direction.Axis.Z : Direction.Axis.X; + return Optional.of(new CustomPortalSize(world, pos, direction$axis)).filter(sizePredicate); + } + } + + public CustomPortalSize(IWorld worldIn, BlockPos pos, Direction.Axis axisIn) { + this.world = worldIn; + this.axis = axisIn; + this.rightDir = axisIn == Direction.Axis.X ? Direction.WEST : Direction.SOUTH; + this.bottomLeft = this.func_242971_a(pos); + if (this.bottomLeft == null) { + this.bottomLeft = pos; + this.width = 1; + this.height = 1; + } else { + this.width = this.func_242974_d(); + if (this.width > 0) { + this.height = this.func_242975_e(); + } + } + } + + @Nullable + private BlockPos func_242971_a(BlockPos pos) { + for (int i = Math.max(0, pos.getY() - 21); pos.getY() > i && canConnect(this.world.getBlockState(pos.down())); pos = pos.down()) { + } + Direction direction = this.rightDir.getOpposite(); + int j = this.func_242972_a(pos, direction) - 1; + return j < 0 ? null : pos.offset(direction, j); + } + + private int func_242974_d() { + int i = this.func_242972_a(this.bottomLeft, this.rightDir); + return i >= 2 && i <= 21 ? i : 0; + } + + private int func_242972_a(BlockPos pos, Direction direction) { + BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable(); + for (int i = 0; i <= 21; ++i) { + blockpos$mutable.setPos(pos).move(direction, i); + BlockState blockstate = this.world.getBlockState(blockpos$mutable); + if (!canConnect(blockstate)) { + if (POSITION_PREDICATE.test(blockstate, this.world, blockpos$mutable)) { + return i; + } + break; + } + BlockState blockstate1 = this.world.getBlockState(blockpos$mutable.move(Direction.DOWN)); + if (!POSITION_PREDICATE.test(blockstate1, this.world, blockpos$mutable)) { + break; + } + } + return 0; + } + + private int func_242975_e() { + BlockPos.Mutable blockpos$mutable = new BlockPos.Mutable(); + int i = this.func_242969_a(blockpos$mutable); + return i >= 3 && i <= 21 && this.func_242970_a(blockpos$mutable, i) ? i : 0; + } + + private boolean func_242970_a(BlockPos.Mutable mutablePos, int upDisplacement) { + for (int i = 0; i < this.width; ++i) { + BlockPos.Mutable blockpos$mutable = mutablePos.setPos(this.bottomLeft).move(Direction.UP, upDisplacement).move(this.rightDir, i); + if (!POSITION_PREDICATE.test(this.world.getBlockState(blockpos$mutable), this.world, blockpos$mutable)) { + return false; + } + } + return true; + } + + private int func_242969_a(BlockPos.Mutable mutablePos) { + for (int i = 0; i < 21; ++i) { + mutablePos.setPos(this.bottomLeft).move(Direction.UP, i).move(this.rightDir, -1); + if (!POSITION_PREDICATE.test(this.world.getBlockState(mutablePos), this.world, mutablePos)) { + return i; + } + mutablePos.setPos(this.bottomLeft).move(Direction.UP, i).move(this.rightDir, this.width); + if (!POSITION_PREDICATE.test(this.world.getBlockState(mutablePos), this.world, mutablePos)) { + return i; + } + for (int j = 0; j < this.width; ++j) { + mutablePos.setPos(this.bottomLeft).move(Direction.UP, i).move(this.rightDir, j); + BlockState blockstate = this.world.getBlockState(mutablePos); + if (!canConnect(blockstate)) { + return i; + } + if (blockstate.getBlock() == portal) { + ++this.portalBlockCount; + } + } + } + return 21; + } + + private static boolean canConnect(BlockState state) { + return state.isAir() || state.getBlock() == portal; + } + + public boolean isValid() { + return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21; + } + + public void placePortalBlocks() { + BlockState blockstate = portal.getDefaultState().with(NetherPortalBlock.AXIS, this.axis); + BlockPos.getAllInBoxMutable(this.bottomLeft, this.bottomLeft.offset(Direction.UP, this.height - 1).offset(this.rightDir, this.width - 1)) + .forEach((pos) -> { + this.world.setBlockState(pos, blockstate, 18); + if (this.world instanceof ServerWorld) + ((ServerWorld) this.world).getPointOfInterestManager().add(pos, poi); + }); + } + + public boolean validatePortal() { + return this.isValid() && this.portalBlockCount == this.width * this.height; + } + + public static Vector3d func_242973_a(TeleportationRepositioner.Result result, Direction.Axis axis, Vector3d positionVector, EntitySize size) { + double d0 = (double) result.width - (double) size.width; + double d1 = (double) result.height - (double) size.height; + BlockPos blockpos = result.startPos; + double d2; + if (d0 > 0.0D) { + float f = (float) blockpos.func_243648_a(axis) + size.width / 2.0F; + d2 = MathHelper.clamp(MathHelper.func_233020_c_(positionVector.getCoordinate(axis) - (double) f, 0.0D, d0), 0.0D, 1.0D); + } else { + d2 = 0.5D; + } + double d4; + if (d1 > 0.0D) { + Direction.Axis direction$axis = Direction.Axis.Y; + d4 = MathHelper.clamp(MathHelper.func_233020_c_( + positionVector.getCoordinate(direction$axis) - (double) blockpos.func_243648_a(direction$axis), 0.0D, d1), 0.0D, 1.0D); + } else { + d4 = 0.0D; + } + Direction.Axis direction$axis1 = axis == Direction.Axis.X ? Direction.Axis.Z : Direction.Axis.X; + double d3 = positionVector.getCoordinate(direction$axis1) - ((double) blockpos.func_243648_a(direction$axis1) + 0.5D); + return new Vector3d(d2, d4, d3); + } + + public static PortalInfo func_242963_a(ServerWorld world, TeleportationRepositioner.Result result, Direction.Axis axis, Vector3d offsetVector, + EntitySize size, Vector3d motion, float rotationYaw, float rotationPitch) { + BlockPos blockpos = result.startPos; + BlockState blockstate = world.getBlockState(blockpos); + Direction.Axis direction$axis = blockstate.get(BlockStateProperties.HORIZONTAL_AXIS); + double d0 = (double) result.width; + double d1 = (double) result.height; + int i = axis == direction$axis ? 0 : 90; + Vector3d vector3d = axis == direction$axis ? motion : new Vector3d(motion.z, motion.y, -motion.x); + double d2 = (double) size.width / 2.0D + (d0 - (double) size.width) * offsetVector.getX(); + double d3 = (d1 - (double) size.height) * offsetVector.getY(); + double d4 = 0.5D + offsetVector.getZ(); + boolean flag = direction$axis == Direction.Axis.X; + Vector3d vector3d1 = new Vector3d((double) blockpos.getX() + (flag ? d2 : d4), (double) blockpos.getY() + d3, + (double) blockpos.getZ() + (flag ? d4 : d2)); + return new PortalInfo(vector3d1, vector3d, rotationYaw + (float) i, rotationPitch); + } + } + + public static class TeleporterDimensionMod implements ITeleporter { + private final ServerWorld world; + private final BlockPos entityEnterPos; + + public TeleporterDimensionMod(ServerWorld worldServer, BlockPos entityEnterPos) { + this.world = worldServer; + this.entityEnterPos = entityEnterPos; + } + + public Optional getExistingPortal(BlockPos pos, boolean isNether) { + PointOfInterestManager pointofinterestmanager = this.world.getPointOfInterestManager(); + int i = isNether ? 16 : 128; + pointofinterestmanager.ensureLoadedAndValid(this.world, pos, i); + Optional optional = pointofinterestmanager.getInSquare((poiType) -> { + return poiType == poi; + }, pos, i, PointOfInterestManager.Status.ANY).sorted(Comparator.comparingDouble((poi) -> { + return poi.getPos().distanceSq(pos); + }).thenComparingInt((poi) -> { + return poi.getPos().getY(); + })).filter((poi) -> { + return this.world.getBlockState(poi.getPos()).hasProperty(BlockStateProperties.HORIZONTAL_AXIS); + }).findFirst(); + return optional.map((poi) -> { + BlockPos blockpos = poi.getPos(); + this.world.getChunkProvider().registerTicket(CUSTOM_PORTAL, new ChunkPos(blockpos), 3, blockpos); + BlockState blockstate = this.world.getBlockState(blockpos); + return TeleportationRepositioner.findLargestRectangle(blockpos, blockstate.get(BlockStateProperties.HORIZONTAL_AXIS), 21, + Direction.Axis.Y, 21, (posIn) -> { + return this.world.getBlockState(posIn) == blockstate; + }); + }); + } + + public Optional makePortal(BlockPos pos, Direction.Axis axis) { + Direction direction = Direction.getFacingFromAxis(Direction.AxisDirection.POSITIVE, axis); + double d0 = -1.0D; + BlockPos blockpos = null; + double d1 = -1.0D; + BlockPos blockpos1 = null; + WorldBorder worldborder = this.world.getWorldBorder(); + int i = this.world.func_234938_ad_() - 1; + BlockPos.Mutable blockpos$mutable = pos.toMutable(); + for (BlockPos.Mutable blockpos$mutable1 : BlockPos.func_243514_a(pos, 16, Direction.EAST, Direction.SOUTH)) { + int j = Math.min(i, this.world.getHeight(Heightmap.Type.MOTION_BLOCKING, blockpos$mutable1.getX(), blockpos$mutable1.getZ())); + int k = 1; + if (worldborder.contains(blockpos$mutable1) && worldborder.contains(blockpos$mutable1.move(direction, 1))) { + blockpos$mutable1.move(direction.getOpposite(), 1); + for (int l = j; l >= 0; --l) { + blockpos$mutable1.setY(l); + if (this.world.isAirBlock(blockpos$mutable1)) { + int i1; + for (i1 = l; l > 0 && this.world.isAirBlock(blockpos$mutable1.move(Direction.DOWN)); --l) { + } + if (l + 4 <= i) { + int j1 = i1 - l; + if (j1 <= 0 || j1 >= 3) { + blockpos$mutable1.setY(l); + if (this.checkRegionForPlacement(blockpos$mutable1, blockpos$mutable, direction, 0)) { + double d2 = pos.distanceSq(blockpos$mutable1); + if (this.checkRegionForPlacement(blockpos$mutable1, blockpos$mutable, direction, -1) + && this.checkRegionForPlacement(blockpos$mutable1, blockpos$mutable, direction, 1) + && (d0 == -1.0D || d0 > d2)) { + d0 = d2; + blockpos = blockpos$mutable1.toImmutable(); + } + if (d0 == -1.0D && (d1 == -1.0D || d1 > d2)) { + d1 = d2; + blockpos1 = blockpos$mutable1.toImmutable(); + } + } + } + } + } + } + } + } + if (d0 == -1.0D && d1 != -1.0D) { + blockpos = blockpos1; + d0 = d1; + } + if (d0 == -1.0D) { + blockpos = (new BlockPos(pos.getX(), MathHelper.clamp(pos.getY(), 70, this.world.func_234938_ad_() - 10), pos.getZ())).toImmutable(); + Direction direction1 = direction.rotateY(); + if (!worldborder.contains(blockpos)) { + return Optional.empty(); + } + for (int l1 = -1; l1 < 2; ++l1) { + for (int k2 = 0; k2 < 2; ++k2) { + for (int i3 = -1; i3 < 3; ++i3) { + BlockState blockstate1 = i3 < 0 ? BlueleafDirtBlockBlock.block.getDefaultState() : Blocks.AIR.getDefaultState(); + blockpos$mutable.setAndOffset(blockpos, k2 * direction.getXOffset() + l1 * direction1.getXOffset(), i3, + k2 * direction.getZOffset() + l1 * direction1.getZOffset()); + this.world.setBlockState(blockpos$mutable, blockstate1); + } + } + } + } + for (int k1 = -1; k1 < 3; ++k1) { + for (int i2 = -1; i2 < 4; ++i2) { + if (k1 == -1 || k1 == 2 || i2 == -1 || i2 == 3) { + blockpos$mutable.setAndOffset(blockpos, k1 * direction.getXOffset(), i2, k1 * direction.getZOffset()); + this.world.setBlockState(blockpos$mutable, BlueleafDirtBlockBlock.block.getDefaultState(), 3); + } + } + } + BlockState blockstate = portal.getDefaultState().with(NetherPortalBlock.AXIS, axis); + for (int j2 = 0; j2 < 2; ++j2) { + for (int l2 = 0; l2 < 3; ++l2) { + blockpos$mutable.setAndOffset(blockpos, j2 * direction.getXOffset(), l2, j2 * direction.getZOffset()); + this.world.setBlockState(blockpos$mutable, blockstate, 18); + this.world.getPointOfInterestManager().add(blockpos$mutable, poi); + } + } + return Optional.of(new TeleportationRepositioner.Result(blockpos.toImmutable(), 2, 3)); + } + + private boolean checkRegionForPlacement(BlockPos originalPos, BlockPos.Mutable offsetPos, Direction directionIn, int offsetScale) { + Direction direction = directionIn.rotateY(); + for (int i = -1; i < 3; ++i) { + for (int j = -1; j < 4; ++j) { + offsetPos.setAndOffset(originalPos, directionIn.getXOffset() * i + direction.getXOffset() * offsetScale, j, + directionIn.getZOffset() * i + direction.getZOffset() * offsetScale); + if (j < 0 && !this.world.getBlockState(offsetPos).getMaterial().isSolid()) { + return false; + } + if (j >= 0 && !this.world.isAirBlock(offsetPos)) { + return false; + } + } + } + return true; + } + + @Override + public Entity placeEntity(Entity entity, ServerWorld serverworld, ServerWorld server, float yaw, Function repositionEntity) { + PortalInfo portalinfo = getPortalInfo(entity, server); + if (entity instanceof ServerPlayerEntity) { + entity.setWorld(server); + server.addDuringPortalTeleport((ServerPlayerEntity) entity); + entity.rotationYaw = portalinfo.rotationYaw % 360.0F; + entity.rotationPitch = portalinfo.rotationPitch % 360.0F; + entity.moveForced(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z); + return entity; + } else { + Entity entityNew = entity.getType().create(server); + if (entityNew != null) { + entityNew.copyDataFromOld(entity); + entityNew.setLocationAndAngles(portalinfo.pos.x, portalinfo.pos.y, portalinfo.pos.z, portalinfo.rotationYaw, + entityNew.rotationPitch); + entityNew.setMotion(portalinfo.motion); + server.addFromAnotherDimension(entityNew); + } + return entityNew; + } + } + + private PortalInfo getPortalInfo(Entity entity, ServerWorld server) { + WorldBorder worldborder = server.getWorldBorder(); + double d0 = Math.max(-2.9999872E7D, worldborder.minX() + 16.); + double d1 = Math.max(-2.9999872E7D, worldborder.minZ() + 16.); + double d2 = Math.min(2.9999872E7D, worldborder.maxX() - 16.); + double d3 = Math.min(2.9999872E7D, worldborder.maxZ() - 16.); + double d4 = DimensionType.getCoordinateDifference(entity.world.getDimensionType(), server.getDimensionType()); + BlockPos blockpos1 = new BlockPos(MathHelper.clamp(entity.getPosX() * d4, d0, d2), entity.getPosY(), + MathHelper.clamp(entity.getPosZ() * d4, d1, d3)); + return this.getPortalRepositioner(entity, blockpos1).map(repositioner -> { + BlockState blockstate = entity.world.getBlockState(this.entityEnterPos); + Direction.Axis direction$axis; + Vector3d vector3d; + if (blockstate.hasProperty(BlockStateProperties.HORIZONTAL_AXIS)) { + direction$axis = blockstate.get(BlockStateProperties.HORIZONTAL_AXIS); + TeleportationRepositioner.Result teleportationrepositioner$result = TeleportationRepositioner.findLargestRectangle( + this.entityEnterPos, direction$axis, 21, Direction.Axis.Y, 21, pos -> entity.world.getBlockState(pos) == blockstate); + vector3d = CustomPortalSize.func_242973_a(teleportationrepositioner$result, direction$axis, entity.getPositionVec(), + entity.getSize(entity.getPose())); + } else { + direction$axis = Direction.Axis.X; + vector3d = new Vector3d(0.5, 0, 0); + } + return CustomPortalSize.func_242963_a(server, repositioner, direction$axis, vector3d, entity.getSize(entity.getPose()), + entity.getMotion(), entity.rotationYaw, entity.rotationPitch); + }).orElse(new PortalInfo(entity.getPositionVec(), Vector3d.ZERO, entity.rotationYaw, entity.rotationPitch)); + } + + protected Optional getPortalRepositioner(Entity entity, BlockPos pos) { + Optional optional = this.getExistingPortal(pos, false); + if (entity instanceof ServerPlayerEntity) { + if (optional.isPresent()) { + return optional; + } else { + Direction.Axis direction$axis = entity.world.getBlockState(this.entityEnterPos).func_235903_d_(NetherPortalBlock.AXIS) + .orElse(Direction.Axis.X); + return this.makePortal(pos, direction$axis); + } + } else { + return optional; + } + } + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/AntHillSpawnStructure.java b/src/main/java/studio/halbear/hem/world/structure/AntHillSpawnStructure.java new file mode 100644 index 0000000..1b08a6d --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/AntHillSpawnStructure.java @@ -0,0 +1,113 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.AntHillSpawnOnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class AntHillSpawnStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 250000) { + int count = random.nextInt(4) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "anthill")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + + AntHillSpawnOnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("ant_hill_spawn")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:ant_hill_spawn"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Boulder1Structure.java b/src/main/java/studio/halbear/hem/world/structure/Boulder1Structure.java new file mode 100644 index 0000000..17ccb36 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Boulder1Structure.java @@ -0,0 +1,131 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Boulder4AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafMudBlock; +import studio.halbear.hem.block.BlueleafGravelMudBlock; +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Boulder1Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 100000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGravelMudBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + -2, j + -1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Boulder4AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "boulder1")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("boulder_1")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:boulder_1"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Boulder2Structure.java b/src/main/java/studio/halbear/hem/world/structure/Boulder2Structure.java new file mode 100644 index 0000000..776fc86 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Boulder2Structure.java @@ -0,0 +1,131 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Boulder4AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafMudBlock; +import studio.halbear.hem.block.BlueleafGravelMudBlock; +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Boulder2Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 40000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGravelMudBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + -2, j + -1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Boulder4AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "boulder2")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("boulder_2")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:boulder_2"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Boulder3Structure.java b/src/main/java/studio/halbear/hem/world/structure/Boulder3Structure.java new file mode 100644 index 0000000..a3267c8 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Boulder3Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Boulder3Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 100000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -3, j + -2, k + -3); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "boulder3")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("boulder_3")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:boulder_3"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Boulder4Structure.java b/src/main/java/studio/halbear/hem/world/structure/Boulder4Structure.java new file mode 100644 index 0000000..3ab0478 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Boulder4Structure.java @@ -0,0 +1,122 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Boulder4AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Boulder4Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 100000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + -2, j + -1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Boulder4AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "boulder4")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("boulder_4")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:boulder_4"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Bush1Structure.java b/src/main/java/studio/halbear/hem/world/structure/Bush1Structure.java new file mode 100644 index 0000000..ecb06b2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Bush1Structure.java @@ -0,0 +1,107 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Bush1Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 100000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -2, j + 1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "bush1")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("bush_1")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:bush_1"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Bush2Structure.java b/src/main/java/studio/halbear/hem/world/structure/Bush2Structure.java new file mode 100644 index 0000000..4dac467 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Bush2Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Bush2Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 250000) { + int count = random.nextInt(6) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -1, j + 1, k + -1); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "bush2")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("bush_2")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:bush_2"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/FloatingIsland5x5Structure.java b/src/main/java/studio/halbear/hem/world/structure/FloatingIsland5x5Structure.java new file mode 100644 index 0000000..0638254 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/FloatingIsland5x5Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class FloatingIsland5x5Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 50000) { + int count = random.nextInt(4) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j += random.nextInt(64) + 16; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.AIR) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -2, j + 1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "5x5floatingisland")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("floating_island_5x_5")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:floating_island_5x_5"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.RAW_GENERATION).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Floatingisland15x15Structure.java b/src/main/java/studio/halbear/hem/world/structure/Floatingisland15x15Structure.java new file mode 100644 index 0000000..0a749bd --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Floatingisland15x15Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Floatingisland15x15Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 50000) { + int count = random.nextInt(4) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j += random.nextInt(64) + 16; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.AIR) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -7, j + 1, k + -7); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "15x15generalfloatingisland")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("floatingisland_15x_15")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:floatingisland_15x_15"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.RAW_GENERATION).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Floatingislandflipped11x11Structure.java b/src/main/java/studio/halbear/hem/world/structure/Floatingislandflipped11x11Structure.java new file mode 100644 index 0000000..8a498bc --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Floatingislandflipped11x11Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Floatingislandflipped11x11Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 50000) { + int count = random.nextInt(4) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j += random.nextInt(64) + 16; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.AIR) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -7, j + 1, k + -7); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "11x11floatingislandundertree")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("floatingislandflipped_11x_11")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:floatingislandflipped_11x_11"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.RAW_GENERATION).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Islandfragments5x5Structure.java b/src/main/java/studio/halbear/hem/world/structure/Islandfragments5x5Structure.java new file mode 100644 index 0000000..553f2d7 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Islandfragments5x5Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Islandfragments5x5Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 50000) { + int count = random.nextInt(4) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j += random.nextInt(64) + 16; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.AIR) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -2, j + 1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "5x5floatingislandfragments")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("islandfragments_5x_5")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:islandfragments_5x_5"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.RAW_GENERATION).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/LilyPadExtraGenerationStructure.java b/src/main/java/studio/halbear/hem/world/structure/LilyPadExtraGenerationStructure.java new file mode 100644 index 0000000..b21fce9 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/LilyPadExtraGenerationStructure.java @@ -0,0 +1,106 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class LilyPadExtraGenerationStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "giantlilypad")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("lily_pad_extra_generation")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:lily_pad_extra_generation"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/LilyPadGenerationStructure.java b/src/main/java/studio/halbear/hem/world/structure/LilyPadGenerationStructure.java new file mode 100644 index 0000000..75686f1 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/LilyPadGenerationStructure.java @@ -0,0 +1,108 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class LilyPadGenerationStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "giantlilypad")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("lily_pad_generation")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:lily_pad_generation"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/LushTree1Structure.java b/src/main/java/studio/halbear/hem/world/structure/LushTree1Structure.java new file mode 100644 index 0000000..c84ee71 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/LushTree1Structure.java @@ -0,0 +1,118 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.LushTree1AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class LushTree1Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 100000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -7, j + 0, k + -7); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!LushTree1AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "15x15lushtree")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("lush_tree_1")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:lush_tree_1"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/SeaGrassGenerationStructure.java b/src/main/java/studio/halbear/hem/world/structure/SeaGrassGenerationStructure.java new file mode 100644 index 0000000..f910ad6 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/SeaGrassGenerationStructure.java @@ -0,0 +1,121 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.SeaGrassGenerationAdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafStoneGravelBlock; +import studio.halbear.hem.block.BlueleafMudBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class SeaGrassGenerationStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(16) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafStoneGravelBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!SeaGrassGenerationAdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "seagrass")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("sea_grass_generation")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:sea_grass_generation"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/SmallLilyPadGenerationStructure.java b/src/main/java/studio/halbear/hem/world/structure/SmallLilyPadGenerationStructure.java new file mode 100644 index 0000000..1395d9d --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/SmallLilyPadGenerationStructure.java @@ -0,0 +1,108 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class SmallLilyPadGenerationStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(3) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "lilypad")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("small_lily_pad_generation")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:small_lily_pad_generation"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/SwampTree2Structure.java b/src/main/java/studio/halbear/hem/world/structure/SwampTree2Structure.java new file mode 100644 index 0000000..09311db --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/SwampTree2Structure.java @@ -0,0 +1,113 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafMudBlock; +import studio.halbear.hem.block.BlueleafGravelMudBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class SwampTree2Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 500000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGravelMudBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -7, j + -2, k + -7); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "15x15_4swamptree2")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("swamp_tree_2")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:swamp_tree_2"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/SwampTreeGenerationStructure.java b/src/main/java/studio/halbear/hem/world/structure/SwampTreeGenerationStructure.java new file mode 100644 index 0000000..4a873b8 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/SwampTreeGenerationStructure.java @@ -0,0 +1,106 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class SwampTreeGenerationStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 500000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -7, j + -4, k + -7); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "15x15_4swamptree")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("swamp_tree_generation")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:swamp_tree_generation"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Swampstructure5x5Structure.java b/src/main/java/studio/halbear/hem/world/structure/Swampstructure5x5Structure.java new file mode 100644 index 0000000..b1258fe --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Swampstructure5x5Structure.java @@ -0,0 +1,106 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafMudBlock; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Swampstructure5x5Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 700000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafMudBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -2, j + 1, k + -2); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "5x5swampstructure")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("swampstructure_5x_5")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:swampstructure_5x_5"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Tree11x11Structure.java b/src/main/java/studio/halbear/hem/world/structure/Tree11x11Structure.java new file mode 100644 index 0000000..a052d72 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Tree11x11Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Tree11x11Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 250000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -5, j + 1, k + -5); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "11x11generaltree")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("tree_11x_11")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:tree_11x_11"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Tree15x15Structure.java b/src/main/java/studio/halbear/hem/world/structure/Tree15x15Structure.java new file mode 100644 index 0000000..3e752ef --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Tree15x15Structure.java @@ -0,0 +1,110 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.block.BlueleafGrassBlockBlock; +import studio.halbear.hem.block.BlueleafDirtGrassBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class Tree15x15Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 250000) { + int count = random.nextInt(1) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtGrassBlockBlock.block) + blockCriteria = true; + if (blockAt.getBlock() == BlueleafGrassBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + -7, j + 1, k + -7); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "15x15generaltree")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("tree_15x_15")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:tree_15x_15"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:heightend_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Wall1Structure.java b/src/main/java/studio/halbear/hem/world/structure/Wall1Structure.java new file mode 100644 index 0000000..a637e45 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Wall1Structure.java @@ -0,0 +1,120 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Wall1OnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.procedures.Wall1AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Wall1Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(1) + 16; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Wall1AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "wall1")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, + new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + + Wall1OnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("wall_1")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:wall_1"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Wall2Structure.java b/src/main/java/studio/halbear/hem/world/structure/Wall2Structure.java new file mode 100644 index 0000000..de02b18 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Wall2Structure.java @@ -0,0 +1,120 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Wall1OnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.procedures.Wall1AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Wall2Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(1) + 16; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Wall1AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "wall2")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, + new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + + Wall1OnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("wall_2")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:wall_2"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Wall3Structure.java b/src/main/java/studio/halbear/hem/world/structure/Wall3Structure.java new file mode 100644 index 0000000..096909f --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Wall3Structure.java @@ -0,0 +1,120 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Wall1OnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.procedures.Wall1AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Wall3Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(1) + 16; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Wall1AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "wall3")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, + new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + + Wall1OnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("wall_3")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:wall_3"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Wall4Structure.java b/src/main/java/studio/halbear/hem/world/structure/Wall4Structure.java new file mode 100644 index 0000000..f4fd29d --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Wall4Structure.java @@ -0,0 +1,120 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Wall1OnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.procedures.Wall1AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Wall4Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(1) + 16; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Wall1AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "wall4")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, + new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + + Wall1OnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("wall_4")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:wall_4"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/Wall5Structure.java b/src/main/java/studio/halbear/hem/world/structure/Wall5Structure.java new file mode 100644 index 0000000..65fc755 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/Wall5Structure.java @@ -0,0 +1,120 @@ + +package studio.halbear.hem.world.structure; + +import studio.halbear.hem.procedures.Wall1OnStructureInstanceGeneratedProcedure; +import studio.halbear.hem.procedures.Wall1AdditionalGenerationConditionProcedure; +import studio.halbear.hem.block.BlueleafDirtBlockBlock; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.BlockState; + +import java.util.stream.Stream; +import java.util.Random; +import java.util.Map; +import java.util.HashMap; +import java.util.AbstractMap; + +@Mod.EventBusSubscriber +public class Wall5Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(1) + 16; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.OCEAN_FLOOR_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == BlueleafDirtBlockBlock.block) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.NONE; + Mirror mirror = Mirror.NONE; + BlockPos spawnTo = new BlockPos(i + 0, j + 1, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + if (!Wall1AdditionalGenerationConditionProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll))) + continue; + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "wall5")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, + new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + + Wall1OnStructureInstanceGeneratedProcedure.executeProcedure(Stream + .of(new AbstractMap.SimpleEntry<>("world", world), new AbstractMap.SimpleEntry<>("x", x), + new AbstractMap.SimpleEntry<>("y", y), new AbstractMap.SimpleEntry<>("z", z)) + .collect(HashMap::new, (_m, _e) -> _m.put(_e.getKey(), _e.getValue()), Map::putAll)); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("wall_5")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:wall_5"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:blueleaf_hayfever_fields").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/WaterLoggedLeavesGenerationStructure.java b/src/main/java/studio/halbear/hem/world/structure/WaterLoggedLeavesGenerationStructure.java new file mode 100644 index 0000000..ce0d7b2 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/WaterLoggedLeavesGenerationStructure.java @@ -0,0 +1,108 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class WaterLoggedLeavesGenerationStructure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 1000000) { + int count = random.nextInt(16) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "waterloggedgrass")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("water_logged_leaves_generation")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:water_logged_leaves_generation"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_plains").equals(event.getName())) + biomeCriteria = true; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem/world/structure/WaterloggedLeaves3x3Structure.java b/src/main/java/studio/halbear/hem/world/structure/WaterloggedLeaves3x3Structure.java new file mode 100644 index 0000000..1af96d4 --- /dev/null +++ b/src/main/java/studio/halbear/hem/world/structure/WaterloggedLeaves3x3Structure.java @@ -0,0 +1,106 @@ + +package studio.halbear.hem.world.structure; + +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.event.world.BiomeLoadingEvent; +import net.minecraftforge.event.RegistryEvent; + +import net.minecraft.world.gen.placement.Placement; +import net.minecraft.world.gen.placement.IPlacementConfig; +import net.minecraft.world.gen.feature.template.Template; +import net.minecraft.world.gen.feature.template.PlacementSettings; +import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; +import net.minecraft.world.gen.feature.NoFeatureConfig; +import net.minecraft.world.gen.feature.IFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.ConfiguredFeature; +import net.minecraft.world.gen.Heightmap; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.World; +import net.minecraft.world.ISeedReader; +import net.minecraft.util.registry.WorldGenRegistries; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.Rotation; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.RegistryKey; +import net.minecraft.util.Mirror; +import net.minecraft.block.Blocks; +import net.minecraft.block.BlockState; + +import java.util.Random; + +@Mod.EventBusSubscriber +public class WaterloggedLeaves3x3Structure { + private static Feature feature = null; + private static ConfiguredFeature configuredFeature = null; + + @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) + private static class FeatureRegisterHandler { + @SubscribeEvent + public static void registerFeature(RegistryEvent.Register> event) { + feature = new Feature(NoFeatureConfig.field_236558_a_) { + @Override + public boolean generate(ISeedReader world, ChunkGenerator generator, Random random, BlockPos pos, NoFeatureConfig config) { + int ci = (pos.getX() >> 4) << 4; + int ck = (pos.getZ() >> 4) << 4; + RegistryKey dimensionType = world.getWorld().getDimensionKey(); + boolean dimensionCriteria = false; + if (dimensionType == RegistryKey.getOrCreateKey(Registry.WORLD_KEY, new ResourceLocation("hem:blueleaf"))) + dimensionCriteria = true; + if (!dimensionCriteria) + return false; + if ((random.nextInt(1000000) + 1) <= 700000) { + int count = random.nextInt(16) + 1; + for (int a = 0; a < count; a++) { + int i = ci + random.nextInt(16); + int k = ck + random.nextInt(16); + int j = world.getHeight(Heightmap.Type.WORLD_SURFACE_WG, i, k); + j -= 1; + BlockState blockAt = world.getBlockState(new BlockPos(i, j, k)); + boolean blockCriteria = false; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.BUBBLE_COLUMN) + blockCriteria = true; + if (blockAt.getBlock() == Blocks.WATER) + blockCriteria = true; + if (!blockCriteria) + continue; + Rotation rotation = Rotation.values()[random.nextInt(3)]; + Mirror mirror = Mirror.values()[random.nextInt(2)]; + BlockPos spawnTo = new BlockPos(i + -1, j + 0, k + -1); + int x = spawnTo.getX(); + int y = spawnTo.getY(); + int z = spawnTo.getZ(); + Template template = world.getWorld().getStructureTemplateManager() + .getTemplateDefaulted(new ResourceLocation("hem", "waterloggedleaves3x3")); + if (template == null) + return false; + template.func_237144_a_(world, spawnTo, new PlacementSettings().setRotation(rotation).setRandom(random).setMirror(mirror) + .addProcessor(BlockIgnoreStructureProcessor.AIR_AND_STRUCTURE_BLOCK).setChunk(null).setIgnoreEntities(false), + random); + } + } + return true; + } + }; + configuredFeature = feature.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG) + .withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)); + event.getRegistry().register(feature.setRegistryName("waterlogged_leaves_3x_3")); + Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, new ResourceLocation("hem:waterlogged_leaves_3x_3"), configuredFeature); + } + } + + @SubscribeEvent + public static void addFeatureToBiomes(BiomeLoadingEvent event) { + boolean biomeCriteria = false; + if (new ResourceLocation("hem:lush_blueleaf_marsh").equals(event.getName())) + biomeCriteria = true; + if (!biomeCriteria) + return; + event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> configuredFeature); + } +} diff --git a/src/main/java/studio/halbear/hem_custom/mixin/CameraMixins.java b/src/main/java/studio/halbear/hem_custom/mixin/CameraMixins.java new file mode 100644 index 0000000..9aea019 --- /dev/null +++ b/src/main/java/studio/halbear/hem_custom/mixin/CameraMixins.java @@ -0,0 +1,30 @@ +package studio.halbear.hem_custom.mixin; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.ActiveRenderInfo; +import net.minecraft.client.settings.PointOfView; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.vector.Vector3f; +import net.minecraft.world.IBlockReader; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import static studio.halbear.hem_custom.vehicles.VehicleCameraSettings.GetCameraOffsets; + +@Mixin(ActiveRenderInfo.class) +public abstract class CameraMixins { + + @Inject(method = "update", at = @At(value = "TAIL"),cancellable = true) + private void update(IBlockReader currentRenderedLevel, Entity entity, boolean isDetached, boolean isMirrored, float partialTicks, CallbackInfo ci){ + + if(entity.isPassenger() && Minecraft.getInstance().gameSettings.getPointOfView() != PointOfView.FIRST_PERSON && entity.getRidingEntity().getClass().getName().contains("studio.halbear.hem.entity")){ + Vector3f Position = GetCameraOffsets(); + this.movePosition(-this.calcCameraDistance(Position.getZ()), Position.getY(), Position.getX()); + } + } + @Shadow protected abstract void movePosition(double p_216782_1_, double p_216782_3_, double p_216782_5_); + @Shadow protected abstract double calcCameraDistance(double p_216779_1_); +} diff --git a/src/main/java/studio/halbear/hem_custom/vehicles/VehicleCameraSettings.java b/src/main/java/studio/halbear/hem_custom/vehicles/VehicleCameraSettings.java new file mode 100644 index 0000000..4b246dc --- /dev/null +++ b/src/main/java/studio/halbear/hem_custom/vehicles/VehicleCameraSettings.java @@ -0,0 +1,85 @@ +package studio.halbear.hem_custom.vehicles; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.settings.PointOfView; +import net.minecraft.util.math.vector.Vector3f; +import net.minecraftforge.client.event.EntityViewRenderEvent; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; + +@Mod.EventBusSubscriber +public class VehicleCameraSettings { + private static Vector3f CamOffset = new Vector3f(0.0f, 0.0f, 0.0f); + private static Vector3f CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + private static float CamFOV = 0.0f; + private static float CamFOVExternal = 0.0f; + private static String CurrentEntity = ""; + private static boolean HemVehicle = false; + + public static Vector3f GetCameraOffsets(){ + return CamOffset; + } + + @SubscribeEvent + public static void PlayerTickEvent(TickEvent.PlayerTickEvent event) { + Minecraft minecraftInstance = Minecraft.getInstance(); + if (minecraftInstance.player != null && minecraftInstance.player.isPassenger() && minecraftInstance.player.getRidingEntity() != null + && CurrentEntity != minecraftInstance.player.getRidingEntity().getClass().getName()) { + CurrentEntity = minecraftInstance.player.getRidingEntity().getClass().getName(); + HemVehicle = CurrentEntity.contains("studio.halbear.hem.entity"); + switch (CurrentEntity) { + case "studio.halbear.hem.entity.HotAirBalloonEntity$CustomEntity" : //yeah i hardcoded ts + CamOffset = new Vector3f(0.0f, 1.0f, 4.0f); + CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + CamFOV = 70.0f; + CamFOVExternal = 80.0f; + break; + case "studio.halbear.hem.entity.AirboatEntity$CustomEntity" : + CamOffset = new Vector3f(0.0f, 4.0f, 16.0f); + CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + CamFOV = 70.0f; + CamFOVExternal = 65.0f; + break; + } + } + if (minecraftInstance.player != null && (!minecraftInstance.player.isPassenger() || !HemVehicle) + && (CamFOVExternal != (float) Minecraft.getInstance().gameSettings.fov + || CamFOV != (float) Minecraft.getInstance().gameSettings.fov || CamOffset.getX() != 0 || CamOffset.getY() != 0 + || CamOffset.getZ() != 0 || CamTransformations.getX() != 0 || CamTransformations.getY() != 0 + || CamTransformations.getZ() != 0)) { + CamOffset = new Vector3f(0.0f, 0.0f, 0.0f);// reset if the players not riding an entity and if any the values aren't 0 + CamTransformations = new Vector3f(0.0f, 0.0f, 0.0f); + CamFOV = (float) Minecraft.getInstance().gameSettings.fov; + CamFOVExternal = (float) Minecraft.getInstance().gameSettings.fov; + if (!minecraftInstance.player.isPassenger()) + CurrentEntity = ""; + } + } + + @SubscribeEvent + public static void onCameraSetup(EntityViewRenderEvent.CameraSetup event) { // sets the Yaw, Roll, and Pitch for the camera, ONLY if its a HEM vehcile as to avoid unnecessary ticks + if (HemVehicle) { + event.setRoll(event.getRoll() + CamTransformations.getX()); + event.setYaw(event.getYaw() + CamTransformations.getY()); + event.setPitch(event.getPitch() + CamTransformations.getZ()); + } + } + + @SubscribeEvent + public static void onCameraSetup(EntityViewRenderEvent.FOVModifier event) { // sets the FOV + if (HemVehicle) { + Minecraft minecraftInstance = Minecraft.getInstance(); + if (minecraftInstance.player != null && minecraftInstance.gameRenderer != null) { + PointOfView Cam = minecraftInstance.gameSettings.getPointOfView(); + if (Cam == PointOfView.FIRST_PERSON) { + event.setFOV(CamFOV); + } else { + event.setFOV(CamFOVExternal); + } + } + } else if (event.getFOV() != Minecraft.getInstance().gameSettings.fov) { + event.setFOV(Minecraft.getInstance().gameSettings.fov); + } + } +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..73853f1 --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,26 @@ +modLoader="javafml" +loaderVersion="[36,)" +license="Academic Free License v3.0" + +[[mods]] +modId="hem" +version="1.0.0" +displayName="Hal's Exploration Mod" +credits="halbear1" +displayURL="https://halbear.net" +logoFile="logo.png" +authors="halbear1" +description=''' +A steampunk exploration mod that adds tech, vehicles, and dimensions +''' + +[[dependencies.hem]] + modId="minecraft" + mandatory=true + versionRange="[1.16.5]" + ordering="NONE" + side="BOTH" + + + + diff --git a/src/main/resources/assets/hem/blockstates/ant_hill.json b/src/main/resources/assets/hem/blockstates/ant_hill.json new file mode 100644 index 0000000..5353d5f --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/ant_hill.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/ant_hill" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/ants.json b/src/main/resources/assets/hem/blockstates/ants.json new file mode 100644 index 0000000..79b829d --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/ants.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=north": { + "model": "hem:block/ants" + }, + "facing=east": { + "model": "hem:block/ants", + "y": 90 + }, + "facing=south": { + "model": "hem:block/ants", + "y": 180 + }, + "facing=west": { + "model": "hem:block/ants", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/bloomed_bulb_flower.json b/src/main/resources/assets/hem/blockstates/bloomed_bulb_flower.json new file mode 100644 index 0000000..afc853b --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/bloomed_bulb_flower.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/bloomed_bulb_flower" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/bloomed_muncher.json b/src/main/resources/assets/hem/blockstates/bloomed_muncher.json new file mode 100644 index 0000000..22cde9d --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/bloomed_muncher.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=north": { + "model": "hem:block/bloomed_muncher" + }, + "facing=east": { + "model": "hem:block/bloomed_muncher", + "y": 90 + }, + "facing=south": { + "model": "hem:block/bloomed_muncher", + "y": 180 + }, + "facing=west": { + "model": "hem:block/bloomed_muncher", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_blossomer.json b/src/main/resources/assets/hem/blockstates/blueleaf_blossomer.json new file mode 100644 index 0000000..b35192f --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_blossomer.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_blossomer" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_brown_cap.json b/src/main/resources/assets/hem/blockstates/blueleaf_brown_cap.json new file mode 100644 index 0000000..272c41e --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_brown_cap.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_brown_cap" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_butter_slump.json b/src/main/resources/assets/hem/blockstates/blueleaf_butter_slump.json new file mode 100644 index 0000000..d120165 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_butter_slump.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_butter_slump" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_cabbage_flower.json b/src/main/resources/assets/hem/blockstates/blueleaf_cabbage_flower.json new file mode 100644 index 0000000..c030bb1 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_cabbage_flower.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_cabbage_flower" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone.json b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone.json new file mode 100644 index 0000000..f34ae24 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_cobblestone" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_slab.json b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_slab.json new file mode 100644 index 0000000..5310812 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_slab.json @@ -0,0 +1,13 @@ +{ + "variants": { + "type=bottom": { + "model": "hem:block/blueleaf_cobblestone_slab" + }, + "type=top": { + "model": "hem:block/blueleaf_cobblestone_slab_top" + }, + "type=double": { + "model": "hem:block/blueleaf_cobblestone_slab_full" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_stairs.json b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_stairs.json new file mode 100644 index 0000000..48b01cc --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_stairs.json @@ -0,0 +1,209 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs" + }, + "facing=west,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "y": 180, + "uvlock": true + }, + "facing=south,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "y": 90, + "uvlock": true + }, + "facing=north,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner" + }, + "facing=west,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "y": 180, + "uvlock": true + }, + "facing=south,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "y": 90, + "uvlock": true + }, + "facing=north,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "y": 270, + "uvlock": true + }, + "facing=west,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "y": 90, + "uvlock": true + }, + "facing=south,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner" + }, + "facing=north,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "y": 180, + "uvlock": true + }, + "facing=east,half=top,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "x": 180, + "uvlock": true + }, + "facing=west,half=top,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=south,half=top,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=north,half=top,shape=straight": { + "model": "hem:block/blueleaf_cobblestone_stairs", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=east,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=west,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=south,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=north,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "uvlock": true + }, + "facing=east,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "uvlock": true + }, + "facing=west,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=south,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=north,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=east,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=west,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=south,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=north,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "uvlock": true + }, + "facing=east,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "uvlock": true + }, + "facing=west,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=south,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=north,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_inner", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer" + }, + "facing=west,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "y": 180, + "uvlock": true + }, + "facing=south,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "y": 90, + "uvlock": true + }, + "facing=north,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "y": 270, + "uvlock": true + }, + "facing=west,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "y": 90, + "uvlock": true + }, + "facing=south,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer" + }, + "facing=north,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_cobblestone_stairs_outer", + "y": 180, + "uvlock": true + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_wall.json b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_wall.json new file mode 100644 index 0000000..3fb7db1 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_cobblestone_wall.json @@ -0,0 +1,90 @@ +{ + "multipart": [ + { + "when": { + "up": "true" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_cobblestone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_dead_log.json b/src/main/resources/assets/hem/blockstates/blueleaf_dead_log.json new file mode 100644 index 0000000..214d50b --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_dead_log.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "hem:block/blueleaf_dead_log", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "hem:block/blueleaf_dead_log" + }, + "axis=z": { + "model": "hem:block/blueleaf_dead_log", + "x": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_dirt_block.json b/src/main/resources/assets/hem/blockstates/blueleaf_dirt_block.json new file mode 100644 index 0000000..9f91c5a --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_dirt_block.json @@ -0,0 +1,11 @@ +{ + "variants": { + "": [{ + "model": "hem:block/blueleaf_dirt_block", "weight": 5 + }, + { + "model": "hem:block/blueleaf_dirt_coarse_block", "weight": 1 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_dirt_grass_block.json b/src/main/resources/assets/hem/blockstates/blueleaf_dirt_grass_block.json new file mode 100644 index 0000000..2d679e5 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_dirt_grass_block.json @@ -0,0 +1,20 @@ +{ + "variants": { + "": [{ + "model": "hem:block/blueleaf_dirt_grass_block", "weight": 10 + }, + { + "model": "hem:block/grass/blueleaf_dirt_grass_alternate", "weight": 10 + }, + { + "model": "hem:block/grass/blueleaf_dirt_grass_bright", "weight": 10 + }, + { + "model": "hem:block/grass/blueleaf_dirt_grass_flower", "weight": 1 + }, + { + "model": "hem:block/grass/blueleaf_dirt_grass_flowers", "weight": 4 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_fluorescent_leaves.json b/src/main/resources/assets/hem/blockstates/blueleaf_fluorescent_leaves.json new file mode 100644 index 0000000..877308e --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_fluorescent_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_fluorescent_leaves" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_grass.json b/src/main/resources/assets/hem/blockstates/blueleaf_grass.json new file mode 100644 index 0000000..2e02f35 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_grass.json @@ -0,0 +1,20 @@ +{ + "variants": { + "": [{ + "model": "hem:block/blueleaf_grass" + }, + { + "model": "hem:block/blueleaf_grass_medium" + }, + { + "model": "hem:block/blueleaf_grass_short" + }, + { + "model": "hem:block/blueleaf_grass_super_short" + }, + { + "model": "hem:block/blueleaf_grass_tall" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_grass_block.json b/src/main/resources/assets/hem/blockstates/blueleaf_grass_block.json new file mode 100644 index 0000000..2d17b57 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_grass_block.json @@ -0,0 +1,21 @@ +{ + "variants": { + "": [ + { + "model": "hem:block/blueleaf_grass_block", "weight": 10 + }, + { + "model": "hem:block/grass/blueleaf_grass_block_alternate", "weight": 10 + }, + { + "model": "hem:block/grass/blueleaf_grass_block_bright", "weight": 10 + }, + { + "model": "hem:block/grass/blueleaf_grass_block_flower", "weight": 1 + }, + { + "model": "hem:block/grass/blueleaf_grass_block_flowers", "weight": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_gravel_mud.json b/src/main/resources/assets/hem/blockstates/blueleaf_gravel_mud.json new file mode 100644 index 0000000..4e714dc --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_gravel_mud.json @@ -0,0 +1,14 @@ +{ + "variants": { + "": [{ + "model": "hem:block/blueleaf_gravel_mud", "weight": 5 + }, + { + "model": "hem:block/blueleaf_grass_stone_mud", "weight": 2 + }, + { + "model": "hem:block/blueleaf_stone_mud", "weight": 2 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_green_cap.json b/src/main/resources/assets/hem/blockstates/blueleaf_green_cap.json new file mode 100644 index 0000000..89e4003 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_green_cap.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_green_cap" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_lavender.json b/src/main/resources/assets/hem/blockstates/blueleaf_lavender.json new file mode 100644 index 0000000..0a425ed --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_lavender.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_lavender" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_leaves.json b/src/main/resources/assets/hem/blockstates/blueleaf_leaves.json new file mode 100644 index 0000000..9fd6092 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_leaves.json @@ -0,0 +1,14 @@ +{ + "variants": { + "": [{ + "model": "hem:block/blueleaf_leaves" + }, + { + "model": "hem:block/blueleaf_leaves_dense" + }, + { + "model": "hem:block/blueleaf_leaves_sparse" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_lily_pad.json b/src/main/resources/assets/hem/blockstates/blueleaf_lily_pad.json new file mode 100644 index 0000000..b19b1a3 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_lily_pad.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=north": { + "model": "hem:block/blueleaf_lily_pad" + }, + "facing=east": { + "model": "hem:block/blueleaf_lily_pad", + "y": 90 + }, + "facing=south": { + "model": "hem:block/blueleaf_lily_pad", + "y": 180 + }, + "facing=west": { + "model": "hem:block/blueleaf_lily_pad", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_log.json b/src/main/resources/assets/hem/blockstates/blueleaf_log.json new file mode 100644 index 0000000..2efa09b --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_log.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "hem:block/blueleaf_log", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "hem:block/blueleaf_log" + }, + "axis=z": { + "model": "hem:block/blueleaf_log", + "x": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_lush_leaves.json b/src/main/resources/assets/hem/blockstates/blueleaf_lush_leaves.json new file mode 100644 index 0000000..e5e0f7e --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_lush_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_lush_leaves" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_mature_blossomer.json b/src/main/resources/assets/hem/blockstates/blueleaf_mature_blossomer.json new file mode 100644 index 0000000..ea82672 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_mature_blossomer.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_mature_blossomer" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_mature_cabbage_flower.json b/src/main/resources/assets/hem/blockstates/blueleaf_mature_cabbage_flower.json new file mode 100644 index 0000000..800faf6 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_mature_cabbage_flower.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_mature_cabbage_flower" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_mud.json b/src/main/resources/assets/hem/blockstates/blueleaf_mud.json new file mode 100644 index 0000000..938e589 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_mud.json @@ -0,0 +1,14 @@ +{ + "variants": { + "": [ + { + "model": "hem:block/blueleaf_mud", + "weight": 7 + }, + { + "model": "hem:block/blueleaf_stony_mud", + "weight": 3 + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_portal.json b/src/main/resources/assets/hem/blockstates/blueleaf_portal.json new file mode 100644 index 0000000..77f14a8 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_portal.json @@ -0,0 +1,10 @@ +{ + "variants": { + "axis=z": { + "model": "hem:block/blueleaf_portal_ew" + }, + "axis=x": { + "model": "hem:block/blueleaf_portal_ns" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_red_cap.json b/src/main/resources/assets/hem/blockstates/blueleaf_red_cap.json new file mode 100644 index 0000000..036bb36 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_red_cap.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_red_cap" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_redwood_leaves.json b/src/main/resources/assets/hem/blockstates/blueleaf_redwood_leaves.json new file mode 100644 index 0000000..7e0ebad --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_redwood_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_redwood_leaves" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_redwood_log.json b/src/main/resources/assets/hem/blockstates/blueleaf_redwood_log.json new file mode 100644 index 0000000..e127f78 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_redwood_log.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "hem:block/blueleaf_redwood_log", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "hem:block/blueleaf_redwood_log" + }, + "axis=z": { + "model": "hem:block/blueleaf_redwood_log", + "x": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_sea_grass.json b/src/main/resources/assets/hem/blockstates/blueleaf_sea_grass.json new file mode 100644 index 0000000..3f17b38 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_sea_grass.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_sea_grass" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_stone.json b/src/main/resources/assets/hem/blockstates/blueleaf_stone.json new file mode 100644 index 0000000..b2d6bbc --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_stone.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_stone" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_stone_gravel.json b/src/main/resources/assets/hem/blockstates/blueleaf_stone_gravel.json new file mode 100644 index 0000000..1fbabc0 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_stone_gravel.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_stone_gravel" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_stone_slab.json b/src/main/resources/assets/hem/blockstates/blueleaf_stone_slab.json new file mode 100644 index 0000000..73e09f4 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_stone_slab.json @@ -0,0 +1,13 @@ +{ + "variants": { + "type=bottom": { + "model": "hem:block/blueleaf_stone_slab" + }, + "type=top": { + "model": "hem:block/blueleaf_stone_slab_top" + }, + "type=double": { + "model": "hem:block/blueleaf_stone_slab_full" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_stone_stair.json b/src/main/resources/assets/hem/blockstates/blueleaf_stone_stair.json new file mode 100644 index 0000000..7dba37e --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_stone_stair.json @@ -0,0 +1,209 @@ +{ + "variants": { + "facing=east,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_stone_stair" + }, + "facing=west,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "y": 180, + "uvlock": true + }, + "facing=south,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "y": 90, + "uvlock": true + }, + "facing=north,half=bottom,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner" + }, + "facing=west,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "y": 180, + "uvlock": true + }, + "facing=south,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "y": 90, + "uvlock": true + }, + "facing=north,half=bottom,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "y": 270, + "uvlock": true + }, + "facing=west,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "y": 90, + "uvlock": true + }, + "facing=south,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner" + }, + "facing=north,half=bottom,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "y": 180, + "uvlock": true + }, + "facing=east,half=top,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "x": 180, + "uvlock": true + }, + "facing=west,half=top,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=south,half=top,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=north,half=top,shape=straight": { + "model": "hem:block/blueleaf_stone_stair", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=east,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=west,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=south,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=north,half=top,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "uvlock": true + }, + "facing=east,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "uvlock": true + }, + "facing=west,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=south,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=north,half=top,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=east,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=west,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=south,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=north,half=top,shape=inner_right": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "uvlock": true + }, + "facing=east,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "uvlock": true + }, + "facing=west,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "y": 180, + "uvlock": true + }, + "facing=south,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "y": 90, + "uvlock": true + }, + "facing=north,half=top,shape=inner_left": { + "model": "hem:block/blueleaf_stone_stair_inner", + "x": 180, + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer" + }, + "facing=west,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "y": 180, + "uvlock": true + }, + "facing=south,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "y": 90, + "uvlock": true + }, + "facing=north,half=bottom,shape=outer_right": { + "model": "hem:block/blueleaf_stone_stair_outer", + "y": 270, + "uvlock": true + }, + "facing=east,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "y": 270, + "uvlock": true + }, + "facing=west,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "y": 90, + "uvlock": true + }, + "facing=south,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer" + }, + "facing=north,half=bottom,shape=outer_left": { + "model": "hem:block/blueleaf_stone_stair_outer", + "y": 180, + "uvlock": true + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_stone_wall.json b/src/main/resources/assets/hem/blockstates/blueleaf_stone_wall.json new file mode 100644 index 0000000..0144afc --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_stone_wall.json @@ -0,0 +1,90 @@ +{ + "multipart": [ + { + "when": { + "up": "true" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "hem:block/blueleaf_stone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_tall_blooming_flower.json b/src/main/resources/assets/hem/blockstates/blueleaf_tall_blooming_flower.json new file mode 100644 index 0000000..269134d --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_tall_blooming_flower.json @@ -0,0 +1,10 @@ +{ + "variants": { + "half=upper": { + "model": "hem:block/blueleaf_tall_blooming_flower" + }, + "half=lower": { + "model": "hem:block/blueleaf_tall_blooming_flower_bottom" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_tall_grass.json b/src/main/resources/assets/hem/blockstates/blueleaf_tall_grass.json new file mode 100644 index 0000000..c48560c --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_tall_grass.json @@ -0,0 +1,10 @@ +{ + "variants": { + "half=upper": { + "model": "hem:block/blueleaf_tall_grass" + }, + "half=lower": { + "model": "hem:block/blueleaf_tall_grass_bottom" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_tall_sprout.json b/src/main/resources/assets/hem/blockstates/blueleaf_tall_sprout.json new file mode 100644 index 0000000..45c4683 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_tall_sprout.json @@ -0,0 +1,10 @@ +{ + "variants": { + "half=upper": { + "model": "hem:block/blueleaf_tall_sprout" + }, + "half=lower": { + "model": "hem:block/blueleaf_tall_sprout_bottom" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_wheat.json b/src/main/resources/assets/hem/blockstates/blueleaf_wheat.json new file mode 100644 index 0000000..1ff17cd --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_wheat.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/blueleaf_wheat" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/blueleaf_wood.json b/src/main/resources/assets/hem/blockstates/blueleaf_wood.json new file mode 100644 index 0000000..440923b --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/blueleaf_wood.json @@ -0,0 +1,16 @@ +{ + "variants": { + "axis=x": { + "model": "hem:block/blueleaf_wood", + "x": 90, + "y": 90 + }, + "axis=y": { + "model": "hem:block/blueleaf_wood" + }, + "axis=z": { + "model": "hem:block/blueleaf_wood", + "x": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/bulb_flower.json b/src/main/resources/assets/hem/blockstates/bulb_flower.json new file mode 100644 index 0000000..c7ca606 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/bulb_flower.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/bulb_flower" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/dangling_fluorescent_leaves.json b/src/main/resources/assets/hem/blockstates/dangling_fluorescent_leaves.json new file mode 100644 index 0000000..1ffbc0a --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/dangling_fluorescent_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/dangling_fluorescent_leaves" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/fallen_leaves.json b/src/main/resources/assets/hem/blockstates/fallen_leaves.json new file mode 100644 index 0000000..d58f683 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/fallen_leaves.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/fallen_leaves" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/giant_lily_pad.json b/src/main/resources/assets/hem/blockstates/giant_lily_pad.json new file mode 100644 index 0000000..76b7ef5 --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/giant_lily_pad.json @@ -0,0 +1,34 @@ +{ + "variants": { + "facing=north": [{ + "model": "hem:block/giant_lily_pad" + }, + { + "model": "hem:block/giant_lily_pad_flowerless" + }], + "facing=east": [{ + "model": "hem:block/giant_lily_pad", + "y": 90 + }, + { + "model": "hem:block/giant_lily_pad_flowerless", + "y": 90 + }], + "facing=south": [{ + "model": "hem:block/giant_lily_pad", + "y": 180 + }, + { + "model": "hem:block/giant_lily_pad_flowerless", + "y": 180 + }], + "facing=west": [{ + "model": "hem:block/giant_lily_pad", + "y": 270 + }, + { + "model": "hem:block/giant_lily_pad_flowerless", + "y": 270 + }] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/muncher.json b/src/main/resources/assets/hem/blockstates/muncher.json new file mode 100644 index 0000000..38c612e --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/muncher.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=north": { + "model": "hem:block/muncher" + }, + "facing=east": { + "model": "hem:block/muncher", + "y": 90 + }, + "facing=south": { + "model": "hem:block/muncher", + "y": 180 + }, + "facing=west": { + "model": "hem:block/muncher", + "y": 270 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/blockstates/muncher_sprout.json b/src/main/resources/assets/hem/blockstates/muncher_sprout.json new file mode 100644 index 0000000..9ffb5cf --- /dev/null +++ b/src/main/resources/assets/hem/blockstates/muncher_sprout.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "hem:block/muncher_sprout" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/lang/en_us.json b/src/main/resources/assets/hem/lang/en_us.json new file mode 100644 index 0000000..12d236a --- /dev/null +++ b/src/main/resources/assets/hem/lang/en_us.json @@ -0,0 +1,106 @@ +{ + "entity.hem.giant_butterfly": "Giant Butterfly", + "block.hem.blueleaf_wheat": "Blueleaf Wheat", + "block.hem.blueleaf_tall_blooming_flower": "Blueleaf Tall Blooming Flower", + "item.hem.emberleaf_military_robot_upper_half_spawn_egg": "Emberleaf Military Robot Upper Half Spawn Egg", + "entity.hem.gold_fish": "Tiger Fish", + "biome.hem.blueleaf_hayfever_fields": "Blueleaf hayfever Fields", + "block.hem.ant_hill": "Ant Hill", + "key.hem.vehicle_strafe_left": "Strafe/Yaw Vehicle Left", + "block.hem.blueleaf_lily_pad": "Giant Lily Pad", + "item.hem.giant_butterfly_walking_spawn_egg": "Giant Butterfly Spawn Egg", + "entity.hem.giant_butterfly_walking": "Giant Butterfly", + "block.hem.blueleaf_green_cap": "Blueleaf Green Cap Mushroom", + "block.hem.bloomed_bulb_flower": "Bloomed Bulb Flower", + "item.hem.emberleaf_military_robot_lower_half_spawn_egg": "Emberleaf Military Robot Lower Half Spawn Egg", + "key.hem.vehicle_turn_left": "Turn/Roll Vehicle Left", + "entity.hem.fluffalo_shaved": "Fluffalo", + "block.hem.blueleaf_stone_wall": "Blueleaf Stone Wall", + "block.hem.blueleaf_blossomer": "Blueleaf Blossomer", + "entity.hem.emberleaf_military_robot_lower_half": "Emberleaf Military Robot Lower Half", + "biome.hem.heightend_blueleaf_plains": "Blueleaf Hilly Plains", + "entity.hem.dormant_emberleaf_military_bot": "Dormant Emberleaf Military Bot", + "block.hem.blueleaf_red_cap": "Blueleaf Red Cap Mushroom", + "block.hem.blueleaf_redwood_log": "Blueleaf Redwood Log", + "block.hem.blueleaf_cobblestone_stairs": "Blueleaf Cobblestone Stairs", + "block.hem.blueleaf_stone_slab": "Blueleaf Stone Slab", + "item.hem.tiger_fish_spawn_egg": "Tiger Fish Spawn Egg", + "block.hem.blueleaf_lavender": "Blueleaf Lavender", + "block.hem.blueleaf_stone_gravel": "Blueleaf Stone Gravel", + "key.hem.vehicle_turn_right": "Turn/Roll Vehicle Right", + "key.hem.vehicle_forward": "Vehicle Forward", + "item.hem.fluffalo_shaved_spawn_egg": "Fluffalo Spawn Egg", + "block.hem.blueleaf_mature_blossomer": "Blueleaf Blossomer", + "block.hem.blueleaf_cobblestone_slab": "Blueleaf Cobblestone Slab", + "block.hem.blueleaf_mud": "Blueleaf Mud", + "block.hem.blueleaf_grass": "Blueleaf Grass", + "item.hem.dormant_emberleaf_military_bot_spawn_egg": "Dormant Emberleaf Military Bot Spawn Egg", + "itemGroup.tabhals_exploration_mod_tech": "Hals Exploration Mod Tech", + "block.hem.muncher": "Muncher \u0027Flower\u0027", + "block.hem.blueleaf_dead_log": "Blueleaf Dead Log", + "key.hem.vehicle_accelerate": "Vehicle Accelerate", + "block.hem.blueleaf_redwood_leaves": "Blueleaf Redwood Leaves", + "item.hem.emberleaf_military_bot_spawn_egg": " Emberleaf Military Bot Spawn Egg", + "block.hem.ants": "Ants", + "block.hem.blueleaf_tall_grass": "Blueleaf Tall Grass", + "block.hem.muncher_sprout": "Muncher Sprout", + "entity.hem.tiger_fish": "Tiger Fish", + "biome.hem.lush_blueleaf_plains": "Blueleaf Lush Plains", + "item.hem.gas_canister_612litre": "Gas Canister", + "biome.hem.lush_blueleaf_marsh": "Blueleaf Lush Marsh", + "entity.hem.airboat": "Airboat", + "entity.hem.emberleaf_military_bot": " Emberleaf Military Bot", + "item.hem.butterfly_spawn_egg": "Butterfly", + "item.hem.tiger_fish_item": "Tiger Fish", + "block.hem.blueleaf_sea_grass": "Blueleaf Sea Grass", + "key.hem.vehicle_strafe_right": "Strafe/Yaw Vehicle Right", + "biome.hem.blueleaf_plains": "Blueleaf Plains", + "itemGroup.tabblueleaf_tab": "Hal\u0027s Exploration Mod Blueleaf", + "block.hem.blueleaf_leaves": "Blueleaf Leaves", + "entity.hem.emberleaf_military_robot_upper_half": "Emberleaf Military Robot Upper Half", + "block.hem.blueleaf_brown_cap": "Blueleaf Brown Cap Mushroom", + "block.hem.blueleaf_mature_cabbage_flower": "Blueleaf Mature Cabbage Flower", + "block.hem.blueleaf_cabbage_flower": "Blueleaf Cabbage Flower", + "item.hem.hot_air_balloon_item": "Hot Air Balloon", + "block.hem.bulb_flower": "Bulb Flower", + "block.hem.blueleaf_dirt_block": "Blueleaf Dirt Block", + "block.hem.fallen_leaves": "Fallen Leaves", + "block.hem.blueleaf_butter_slump": "Blueleaf Butter Slump", + "item.hem.dormant_aged_emberleaf_military_bot_spawn_egg": "Dormant Aged Emberleaf Military Bot Spawn Egg", + "item.hem.fluffalo_spawn_egg": "Fluffalo Spawn Egg", + "block.hem.blueleaf_dirt_grass_block": "Blueleaf Grassy Dirt Block", + "item.hem.lady_bug_in_flight_spawn_egg": "Ladybug Spawn Egg", + "item.hem.giant_butterfly_spawn_egg": "Giant Butterfly Spawn Egg", + "block.hem.blueleaf_stone": "Blueleaf Stone", + "block.hem.blueleaf_grass_block": "Blueleaf Grass Block", + "block.hem.blueleaf_tall_sprout": "Blueleaf Tall Sprout", + "block.hem.blueleaf_lush_leaves": "Blueleaf Lush Leaves", + "block.hem.blueleaf_fluorescent_leaves": "Blueleaf Fluorescent Leaves", + "block.hem.blueleaf_cobblestone_wall": "Blueleaf Cobblestone Wall", + "item.hem.gold_fish_spawn_egg": "Tiger Fish Spawn Egg", + "key.hem.vehicle_increase_pressure": "Increase Vehicle Pressure", + "block.hem.blueleaf_wood": "Blueleaf Wood", + "item.hem.blueleaf": "Blueleaf Portal Igniter", + "key.hem.vehicle_backward": "Vehicle Backward", + "block.hem.blueleaf_cobblestone": "Blueleaf Cobblestone", + "item.hem.hot_air_balloon_spawn_egg": "Hot Air Balloon Spawn Egg", + "entity.hem.hot_air_balloon": "Hot Air Balloon", + "key.hem.vehicle_decelerate": "Vehicle Decelerate", + "entity.hem.ladybug": "Ladybug", + "block.hem.bloomed_muncher": "Bloomed Muncher \u0027Flower\u0027", + "item.hem.ladybug_spawn_egg": "Ladybug", + "block.hem.blueleaf_log": "Blueleaf Log", + "item.hem.fluffalo_tuft": "Fluffalo Tuft", + "entity.hem.fluffalo": "Fluffalo", + "key.hem.vehicle_release_pressure": "Release Vehicle Pressure", + "block.hem.blueleaf_gravel_mud": "Blueleaf Gravel Topped Mud", + "block.hem.blueleaf_stone_stair": "Blueleaf Stone Stairs", + "entity.hem.dormant_aged_emberleaf_military_bot": "Dormant Aged Emberleaf Military Bot", + "item.hem.gold_fish_item": "Goldfish", + "item.hem.airboat_spawn_egg": "Airboat Spawn Egg", + "block.hem.giant_lily_pad": "Giant Lily Pad", + "block.hem.dangling_fluorescent_leaves": "Dangling Fluorescent Leaves", + "key.hem.open_gas_cell_view": "Open Gas Cell View", + "effect.gooed": "Gooed", + "entity.hem.lady_bug_in_flight": "Ladybug" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/ant_hill.json b/src/main/resources/assets/hem/models/block/ant_hill.json new file mode 100644 index 0000000..ed39100 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/ant_hill.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/anthill", + "textures": { + "all": "hem:blocks/anthill", + "particle": "hem:blocks/anthill", + "0": "hem:blocks/anthill" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/ants.json b/src/main/resources/assets/hem/models/block/ants.json new file mode 100644 index 0000000..f9bc93d --- /dev/null +++ b/src/main/resources/assets/hem/models/block/ants.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/ants", + "textures": { + "all": "hem:blocks/ants-sheet", + "particle": "hem:blocks/ants-sheet", + "0": "hem:blocks/ants-sheet" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/bloomed_bulb_flower.json b/src/main/resources/assets/hem/models/block/bloomed_bulb_flower.json new file mode 100644 index 0000000..58adbcd --- /dev/null +++ b/src/main/resources/assets/hem/models/block/bloomed_bulb_flower.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/bulbflower", + "textures": { + "all": "hem:blocks/bulbflower", + "particle": "hem:blocks/blueleafleavesscarse", + "0": "hem:blocks/bulbflower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/bloomed_muncher.json b/src/main/resources/assets/hem/models/block/bloomed_muncher.json new file mode 100644 index 0000000..49ca5e6 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/bloomed_muncher.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/openmuncher", + "textures": { + "all": "hem:blocks/openmuncher", + "particle": "hem:blocks/blueleafleavesscarse", + "0": "hem:blocks/openmuncher" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_blossomer.json b/src/main/resources/assets/hem/models/block/blueleaf_blossomer.json new file mode 100644 index 0000000..d0907e0 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_blossomer.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafblossomer", + "particle": "hem:blocks/blueleafblossomer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_brown_cap.json b/src/main/resources/assets/hem/models/block/blueleaf_brown_cap.json new file mode 100644 index 0000000..2fac57f --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_brown_cap.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafbrowncap", + "particle": "hem:blocks/blueleafbrowncap" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_butter_slump.json b/src/main/resources/assets/hem/models/block/blueleaf_butter_slump.json new file mode 100644 index 0000000..1f71c2d --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_butter_slump.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafbutterslump", + "particle": "hem:blocks/blueleafbutterslump" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cabbage_flower.json b/src/main/resources/assets/hem/models/block/blueleaf_cabbage_flower.json new file mode 100644 index 0000000..a8764cf --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cabbage_flower.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafyoungcabbageflowerr", + "particle": "hem:blocks/blueleafyoungcabbageflowerr" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone.json new file mode 100644 index 0000000..26cac81 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstonecobble", + "up": "hem:blocks/blueleafstonecobble", + "north": "hem:blocks/blueleafstonecobble", + "east": "hem:blocks/blueleafstonecobble", + "south": "hem:blocks/blueleafstonecobble", + "west": "hem:blocks/blueleafstonecobble", + "particle": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab.json new file mode 100644 index 0000000..177c9bd --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "block/slab", + "textures": { + "bottom": "hem:blocks/blueleafstonecobble", + "top": "hem:blocks/blueleafstonecobble", + "side": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab_full.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab_full.json new file mode 100644 index 0000000..6c4b467 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab_full.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "hem:blocks/blueleafstonecobble", + "top": "hem:blocks/blueleafstonecobble", + "side": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab_top.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab_top.json new file mode 100644 index 0000000..7af8598 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_slab_top.json @@ -0,0 +1,8 @@ +{ + "parent": "block/slab_top", + "textures": { + "bottom": "hem:blocks/blueleafstonecobble", + "top": "hem:blocks/blueleafstonecobble", + "side": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs.json new file mode 100644 index 0000000..126f9bf --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "hem:blocks/blueleafstonecobble", + "top": "hem:blocks/blueleafstonecobble", + "side": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs_inner.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs_inner.json new file mode 100644 index 0000000..36efeb5 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "hem:blocks/blueleafstonecobble", + "top": "hem:blocks/blueleafstonecobble", + "side": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs_outer.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs_outer.json new file mode 100644 index 0000000..72cdb92 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_stairs_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "hem:blocks/blueleafstonecobble", + "top": "hem:blocks/blueleafstonecobble", + "side": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall.json new file mode 100644 index 0000000..3556423 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall.json @@ -0,0 +1,7 @@ +{ + "parent": "block/template_wall_side", + "textures": { + "wall": "hem:blocks/blueleafstonecobble", + "particle": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_inventory.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_inventory.json new file mode 100644 index 0000000..47c7604 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_inventory.json @@ -0,0 +1,7 @@ +{ + "parent": "block/wall_inventory", + "textures": { + "wall": "hem:blocks/blueleafstonecobble", + "particle": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_post.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_post.json new file mode 100644 index 0000000..134e482 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_post.json @@ -0,0 +1,7 @@ +{ + "parent": "block/template_wall_post", + "textures": { + "wall": "hem:blocks/blueleafstonecobble", + "particle": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_side_tall.json b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_side_tall.json new file mode 100644 index 0000000..01a055f --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_cobblestone_wall_side_tall.json @@ -0,0 +1,7 @@ +{ + "parent": "block/template_wall_side_tall", + "textures": { + "wall": "hem:blocks/blueleafstonecobble", + "particle": "hem:blocks/blueleafstonecobble" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_dead_log.json b/src/main/resources/assets/hem/models/block/blueleaf_dead_log.json new file mode 100644 index 0000000..2f8c58f --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_dead_log.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdeadlogtop", + "up": "hem:blocks/blueleafdeadlogtop", + "north": "hem:blocks/blueleafdeadlogside", + "east": "hem:blocks/blueleafdeadlogside", + "south": "hem:blocks/blueleafdeadlogside", + "west": "hem:blocks/blueleafdeadlogside", + "particle": "hem:blocks/blueleafdeadlogtop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_dirt_block.json b/src/main/resources/assets/hem/models/block/blueleaf_dirt_block.json new file mode 100644 index 0000000..21a26bd --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_dirt_block.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirt", + "up": "hem:blocks/blueleafdirt", + "north": "hem:blocks/blueleafdirt", + "east": "hem:blocks/blueleafdirt", + "south": "hem:blocks/blueleafdirt", + "west": "hem:blocks/blueleafdirt", + "particle": "hem:blocks/blueleafdirt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_dirt_coarse_block.json b/src/main/resources/assets/hem/models/block/blueleaf_dirt_coarse_block.json new file mode 100644 index 0000000..33b9f17 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_dirt_coarse_block.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirtcoarse", + "up": "hem:blocks/blueleafdirtcoarse", + "north": "hem:blocks/blueleafdirtcoarse", + "east": "hem:blocks/blueleafdirtcoarse", + "south": "hem:blocks/blueleafdirtcoarse", + "west": "hem:blocks/blueleafdirtcoarse", + "particle": "hem:blocks/blueleafdirtcoarse" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_dirt_grass_block.json b/src/main/resources/assets/hem/models/block/blueleaf_dirt_grass_block.json new file mode 100644 index 0000000..2e5fe7e --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_dirt_grass_block.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirt", + "up": "hem:blocks/blueleafgrasstop", + "north": "hem:blocks/blueleafgrasssidedirt", + "east": "hem:blocks/blueleafgrasssidedirt", + "south": "hem:blocks/blueleafgrasssidedirt", + "west": "hem:blocks/blueleafgrasssidedirt", + "particle": "hem:blocks/blueleafdirt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_fluorescent_leaves.json b/src/main/resources/assets/hem/models/block/blueleaf_fluorescent_leaves.json new file mode 100644 index 0000000..f8868f5 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_fluorescent_leaves.json @@ -0,0 +1,9 @@ +{ + "parent": "hem:custom/leaves", + "textures": { + "all": "hem:blocks/leaves", + "particle": "hem:blocks/leaves", + "0": "hem:blocks/leaves", + "1": "hem:blocks/leavesoverhang" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass.json b/src/main/resources/assets/hem/models/block/blueleaf_grass.json new file mode 100644 index 0000000..b9e69fe --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafgrasscurly", + "particle": "hem:blocks/blueleafgrasscurly" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_block.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_block.json new file mode 100644 index 0000000..54adfbb --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_block.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstone", + "up": "hem:blocks/blueleafgrasstop", + "north": "hem:blocks/blueleafgrasssidestone", + "east": "hem:blocks/blueleafgrasssidestone", + "south": "hem:blocks/blueleafgrasssidestone", + "west": "hem:blocks/blueleafgrasssidestone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_gravel_mud.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_gravel_mud.json new file mode 100644 index 0000000..2e56ace --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_gravel_mud.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/mud", + "up": "hem:blocks/pebblygrass", + "north": "hem:blocks/grassycobbleside", + "east": "hem:blocks/grassycobbleside", + "south": "hem:blocks/grassycobbleside", + "west": "hem:blocks/grassycobbleside", + "particle": "hem:blocks/mud" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_medium.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_medium.json new file mode 100644 index 0000000..569f7f9 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_medium.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafgrassmedium", + "particle": "hem:blocks/blueleafgrassmedium" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_short.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_short.json new file mode 100644 index 0000000..2df8099 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_short.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafgrassshort", + "particle": "hem:blocks/blueleafgrassshort" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_stone_mud.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_stone_mud.json new file mode 100644 index 0000000..6d79fd6 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_stone_mud.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/mud", + "up": "hem:blocks/grassycobble", + "north": "hem:blocks/grassycobbleside", + "east": "hem:blocks/grassycobbleside", + "south": "hem:blocks/grassycobbleside", + "west": "hem:blocks/grassycobbleside", + "particle": "hem:blocks/mud" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_super_short.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_super_short.json new file mode 100644 index 0000000..f07f731 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_super_short.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafgrasssupershort", + "particle": "hem:blocks/blueleafgrasssupershort" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_grass_tall.json b/src/main/resources/assets/hem/models/block/blueleaf_grass_tall.json new file mode 100644 index 0000000..d3864c3 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_grass_tall.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafgrasstall", + "particle": "hem:blocks/blueleafgrasstall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_gravel_mud.json b/src/main/resources/assets/hem/models/block/blueleaf_gravel_mud.json new file mode 100644 index 0000000..24818e1 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_gravel_mud.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/mud", + "up": "hem:blocks/blueleafstonegravel", + "north": "hem:blocks/muddygravelside", + "east": "hem:blocks/muddygravelside", + "south": "hem:blocks/muddygravelside", + "west": "hem:blocks/muddygravelside", + "particle": "hem:blocks/mud" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_green_cap.json b/src/main/resources/assets/hem/models/block/blueleaf_green_cap.json new file mode 100644 index 0000000..744b0f5 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_green_cap.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafgreencap", + "particle": "hem:blocks/blueleafgreencap" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_lavender.json b/src/main/resources/assets/hem/models/block/blueleaf_lavender.json new file mode 100644 index 0000000..5032519 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_lavender.json @@ -0,0 +1,9 @@ +{ + "parent": "hem:custom/lavender", + "textures": { + "all": "hem:blocks/lavenderblueleaf", + "particle": "hem:blocks/lavenderblueleaftop", + "0": "hem:blocks/lavenderblueleaf", + "missing": "hem:blocks/" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_leaves.json b/src/main/resources/assets/hem/models/block/blueleaf_leaves.json new file mode 100644 index 0000000..9d811e2 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_leaves.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdefaultleaves", + "up": "hem:blocks/blueleafdefaultleaves", + "north": "hem:blocks/blueleafdefaultleaves", + "east": "hem:blocks/blueleafdefaultleaves", + "south": "hem:blocks/blueleafdefaultleaves", + "west": "hem:blocks/blueleafdefaultleaves", + "particle": "hem:blocks/blueleafdefaultleaves" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_leaves_dense.json b/src/main/resources/assets/hem/models/block/blueleaf_leaves_dense.json new file mode 100644 index 0000000..dfe6264 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_leaves_dense.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdefaultleavesdense", + "up": "hem:blocks/blueleafdefaultleavesdense", + "north": "hem:blocks/blueleafdefaultleavesdense", + "east": "hem:blocks/blueleafdefaultleavesdense", + "south": "hem:blocks/blueleafdefaultleavesdense", + "west": "hem:blocks/blueleafdefaultleavesdense", + "particle": "hem:blocks/blueleafdefaultleavesdense" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_leaves_sparse.json b/src/main/resources/assets/hem/models/block/blueleaf_leaves_sparse.json new file mode 100644 index 0000000..46d81f4 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_leaves_sparse.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdefaultleavessparse", + "up": "hem:blocks/blueleafdefaultleavessparse", + "north": "hem:blocks/blueleafdefaultleavessparse", + "east": "hem:blocks/blueleafdefaultleavessparse", + "south": "hem:blocks/blueleafdefaultleavessparse", + "west": "hem:blocks/blueleafdefaultleavessparse", + "particle": "hem:blocks/blueleafdefaultleavessparse" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_lily_pad.json b/src/main/resources/assets/hem/models/block/blueleaf_lily_pad.json new file mode 100644 index 0000000..72957ee --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_lily_pad.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/blueleaflilypad", + "textures": { + "all": "hem:blocks/lilypad", + "particle": "hem:blocks/lilypad", + "0": "hem:blocks/lilypad" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_log.json b/src/main/resources/assets/hem/models/block/blueleaf_log.json new file mode 100644 index 0000000..ac5a8d1 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_log.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleaflogtop", + "up": "hem:blocks/blueleaflogtop", + "north": "hem:blocks/blueleaflogside", + "east": "hem:blocks/blueleaflogside", + "south": "hem:blocks/blueleaflogside", + "west": "hem:blocks/blueleaflogside", + "particle": "hem:blocks/blueleaflogtop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves.json b/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves.json new file mode 100644 index 0000000..c094e9a --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleaflushleaves", + "up": "hem:blocks/blueleaflushleaves", + "north": "hem:blocks/blueleaflushleaves", + "east": "hem:blocks/blueleaflushleaves", + "south": "hem:blocks/blueleaflushleaves", + "west": "hem:blocks/blueleaflushleaves", + "particle": "hem:blocks/blueleaflushleaves" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves_dark.json b/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves_dark.json new file mode 100644 index 0000000..2714f01 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves_dark.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "hem:blocks/blueleafleavesdark", + "particle": "hem:blocks/blueleafleavesdark" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves_scarse.json b/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves_scarse.json new file mode 100644 index 0000000..c424ec6 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_lush_leaves_scarse.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "hem:blocks/blueleafleavesscarse", + "particle": "hem:blocks/blueleafleavesscarse" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_mature_blossomer.json b/src/main/resources/assets/hem/models/block/blueleaf_mature_blossomer.json new file mode 100644 index 0000000..b933d30 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_mature_blossomer.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafmatureblossomer", + "particle": "hem:blocks/blueleafmatureblossomer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_mature_cabbage_flower.json b/src/main/resources/assets/hem/models/block/blueleaf_mature_cabbage_flower.json new file mode 100644 index 0000000..9493769 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_mature_cabbage_flower.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafmaturecabbageflower", + "particle": "hem:blocks/blueleafmaturecabbageflower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_mud.json b/src/main/resources/assets/hem/models/block/blueleaf_mud.json new file mode 100644 index 0000000..b689f7c --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_mud.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "hem:blocks/mud", + "particle": "hem:blocks/mud" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_portal_ew.json b/src/main/resources/assets/hem/models/block/blueleaf_portal_ew.json new file mode 100644 index 0000000..fe9643c --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_portal_ew.json @@ -0,0 +1,40 @@ +{ + "textures": { + "particle": "hem:blocks/blueleafleavesscarse", + "portal": "hem:blocks/blueleafleavesscarse" + }, + "elements": [ + { + "from": [ + 6, + 0, + 0 + ], + "to": [ + 10, + 16, + 16 + ], + "faces": { + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#portal" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#portal" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_portal_ns.json b/src/main/resources/assets/hem/models/block/blueleaf_portal_ns.json new file mode 100644 index 0000000..1d28e0b --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_portal_ns.json @@ -0,0 +1,40 @@ +{ + "textures": { + "particle": "hem:blocks/blueleafleavesscarse", + "portal": "hem:blocks/blueleafleavesscarse" + }, + "elements": [ + { + "from": [ + 0, + 0, + 6 + ], + "to": [ + 16, + 16, + 10 + ], + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#portal" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#portal" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_red_cap.json b/src/main/resources/assets/hem/models/block/blueleaf_red_cap.json new file mode 100644 index 0000000..2b92ac8 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_red_cap.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafredcap", + "particle": "hem:blocks/blueleafredcap" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_redwood_leaves.json b/src/main/resources/assets/hem/models/block/blueleaf_redwood_leaves.json new file mode 100644 index 0000000..8f35d87 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_redwood_leaves.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "hem:blocks/blueleafleavesfir", + "particle": "hem:blocks/blueleafleavesfir" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_redwood_log.json b/src/main/resources/assets/hem/models/block/blueleaf_redwood_log.json new file mode 100644 index 0000000..72e9022 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_redwood_log.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafredwoodlogtop", + "up": "hem:blocks/blueleafredwoodlogtop", + "north": "hem:blocks/blueleafredwoodlogside", + "east": "hem:blocks/blueleafredwoodlogside", + "south": "hem:blocks/blueleafredwoodlogside", + "west": "hem:blocks/blueleafredwoodlogside", + "particle": "hem:blocks/blueleafredwoodlogtop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_sea_grass.json b/src/main/resources/assets/hem/models/block/blueleaf_sea_grass.json new file mode 100644 index 0000000..abc8569 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_sea_grass.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafseagrass", + "particle": "hem:blocks/blueleafseagrass" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone.json b/src/main/resources/assets/hem/models/block/blueleaf_stone.json new file mode 100644 index 0000000..bdcf09e --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstone", + "up": "hem:blocks/blueleafstone", + "north": "hem:blocks/blueleafstone", + "east": "hem:blocks/blueleafstone", + "south": "hem:blocks/blueleafstone", + "west": "hem:blocks/blueleafstone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_gravel.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_gravel.json new file mode 100644 index 0000000..03483f8 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_gravel.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstonegravel", + "up": "hem:blocks/blueleafstonegravel", + "north": "hem:blocks/blueleafstonegravel", + "east": "hem:blocks/blueleafstonegravel", + "south": "hem:blocks/blueleafstonegravel", + "west": "hem:blocks/blueleafstonegravel", + "particle": "hem:blocks/blueleafstonegravel" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_mud.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_mud.json new file mode 100644 index 0000000..a24c230 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_mud.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/mud", + "up": "hem:blocks/blueleafstonecobble", + "north": "hem:blocks/muddygravelside", + "east": "hem:blocks/muddygravelside", + "south": "hem:blocks/muddygravelside", + "west": "hem:blocks/muddygravelside", + "particle": "hem:blocks/mud" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_slab.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_slab.json new file mode 100644 index 0000000..3cffc78 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_slab.json @@ -0,0 +1,8 @@ +{ + "parent": "block/slab", + "textures": { + "bottom": "hem:blocks/blueleafstone", + "top": "hem:blocks/blueleafstone", + "side": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_slab_full.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_slab_full.json new file mode 100644 index 0000000..7e47e34 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_slab_full.json @@ -0,0 +1,8 @@ +{ + "parent": "block/cube_bottom_top", + "textures": { + "bottom": "hem:blocks/blueleafstone", + "top": "hem:blocks/blueleafstone", + "side": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_slab_top.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_slab_top.json new file mode 100644 index 0000000..0abb1dc --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_slab_top.json @@ -0,0 +1,8 @@ +{ + "parent": "block/slab_top", + "textures": { + "bottom": "hem:blocks/blueleafstone", + "top": "hem:blocks/blueleafstone", + "side": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_stair.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_stair.json new file mode 100644 index 0000000..ea4a15b --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_stair.json @@ -0,0 +1,8 @@ +{ + "parent": "block/stairs", + "textures": { + "bottom": "hem:blocks/blueleafstone", + "top": "hem:blocks/blueleafstone", + "side": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_stair_inner.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_stair_inner.json new file mode 100644 index 0000000..5c540fe --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_stair_inner.json @@ -0,0 +1,8 @@ +{ + "parent": "block/inner_stairs", + "textures": { + "bottom": "hem:blocks/blueleafstone", + "top": "hem:blocks/blueleafstone", + "side": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_stair_outer.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_stair_outer.json new file mode 100644 index 0000000..74fd91b --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_stair_outer.json @@ -0,0 +1,8 @@ +{ + "parent": "block/outer_stairs", + "textures": { + "bottom": "hem:blocks/blueleafstone", + "top": "hem:blocks/blueleafstone", + "side": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_wall.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall.json new file mode 100644 index 0000000..915ea80 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall.json @@ -0,0 +1,7 @@ +{ + "parent": "block/template_wall_side", + "textures": { + "wall": "hem:blocks/blueleafstone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_inventory.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_inventory.json new file mode 100644 index 0000000..539f23d --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_inventory.json @@ -0,0 +1,7 @@ +{ + "parent": "block/wall_inventory", + "textures": { + "wall": "hem:blocks/blueleafstone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_post.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_post.json new file mode 100644 index 0000000..807c119 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_post.json @@ -0,0 +1,7 @@ +{ + "parent": "block/template_wall_post", + "textures": { + "wall": "hem:blocks/blueleafstone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_side_tall.json b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_side_tall.json new file mode 100644 index 0000000..b3c0e58 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stone_wall_side_tall.json @@ -0,0 +1,7 @@ +{ + "parent": "block/template_wall_side_tall", + "textures": { + "wall": "hem:blocks/blueleafstone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_stony_mud.json b/src/main/resources/assets/hem/models/block/blueleaf_stony_mud.json new file mode 100644 index 0000000..59c694b --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_stony_mud.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "hem:blocks/stonymud", + "particle": "hem:blocks/stonymud" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_tall_blooming_flower.json b/src/main/resources/assets/hem/models/block/blueleaf_tall_blooming_flower.json new file mode 100644 index 0000000..af7a9f9 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_tall_blooming_flower.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafbloomingflower", + "particle": "hem:blocks/blueleafbloomingflower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_tall_blooming_flower_bottom.json b/src/main/resources/assets/hem/models/block/blueleaf_tall_blooming_flower_bottom.json new file mode 100644 index 0000000..b7124e1 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_tall_blooming_flower_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafbloomingflowerbottom", + "particle": "hem:blocks/blueleafbloomingflowerbottom" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_tall_grass.json b/src/main/resources/assets/hem/models/block/blueleaf_tall_grass.json new file mode 100644 index 0000000..9925ee7 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_tall_grass.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleaftallgrasstop", + "particle": "hem:blocks/blueleaftallgrasstop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_tall_grass_bottom.json b/src/main/resources/assets/hem/models/block/blueleaf_tall_grass_bottom.json new file mode 100644 index 0000000..f24fa02 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_tall_grass_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleaftallgrassbottom", + "particle": "hem:blocks/blueleaftallgrassbottom" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_tall_sprout.json b/src/main/resources/assets/hem/models/block/blueleaf_tall_sprout.json new file mode 100644 index 0000000..2d09bf3 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_tall_sprout.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafsprouttop", + "particle": "hem:blocks/blueleafsprouttop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_tall_sprout_bottom.json b/src/main/resources/assets/hem/models/block/blueleaf_tall_sprout_bottom.json new file mode 100644 index 0000000..2f62a60 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_tall_sprout_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafsproutbottom", + "particle": "hem:blocks/blueleafsproutbottom" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_wheat.json b/src/main/resources/assets/hem/models/block/blueleaf_wheat.json new file mode 100644 index 0000000..f5fcdc7 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_wheat.json @@ -0,0 +1,9 @@ +{ + "parent": "hem:custom/wheat", + "textures": { + "all": "hem:blocks/wheettop", + "particle": "hem:blocks/wheettop", + "0": "hem:blocks/wheat", + "missing": "hem:blocks/" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_wheat_bottom.json b/src/main/resources/assets/hem/models/block/blueleaf_wheat_bottom.json new file mode 100644 index 0000000..c7ed2d5 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_wheat_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/wheetbottom", + "particle": "hem:blocks/wheetbottom" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/blueleaf_wood.json b/src/main/resources/assets/hem/models/block/blueleaf_wood.json new file mode 100644 index 0000000..b93d90b --- /dev/null +++ b/src/main/resources/assets/hem/models/block/blueleaf_wood.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleaflogside", + "up": "hem:blocks/blueleaflogside", + "north": "hem:blocks/blueleaflogside", + "east": "hem:blocks/blueleaflogside", + "south": "hem:blocks/blueleaflogside", + "west": "hem:blocks/blueleaflogside", + "particle": "hem:blocks/blueleaflogside" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/bulb_flower.json b/src/main/resources/assets/hem/models/block/bulb_flower.json new file mode 100644 index 0000000..69c38d8 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/bulb_flower.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/bulbflowerclosed", + "textures": { + "all": "hem:blocks/bulbflowerclose", + "particle": "hem:blocks/blueleafearlybulbflowerbottom", + "0": "hem:blocks/bulbflowerclose" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/bulb_flower_bottom.json b/src/main/resources/assets/hem/models/block/bulb_flower_bottom.json new file mode 100644 index 0000000..c3fc1b3 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/bulb_flower_bottom.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/blueleafearlybulbflowerbottom", + "particle": "hem:blocks/blueleafearlybulbflowerbottom" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/dangling_fluorescent_leaves.json b/src/main/resources/assets/hem/models/block/dangling_fluorescent_leaves.json new file mode 100644 index 0000000..0050a30 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/dangling_fluorescent_leaves.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/danglingfluorescentleaves", + "particle": "hem:blocks/danglingfluorescentleaves" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/fallen_leaves.json b/src/main/resources/assets/hem/models/block/fallen_leaves.json new file mode 100644 index 0000000..76b988a --- /dev/null +++ b/src/main/resources/assets/hem/models/block/fallen_leaves.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/leafpile", + "textures": { + "all": "hem:blocks/blueleafdefaultleavessparse", + "particle": "hem:blocks/blueleafdefaultleavessparse", + "1": "hem:blocks/blueleafdefaultleavessparse" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/giant_lily_pad.json b/src/main/resources/assets/hem/models/block/giant_lily_pad.json new file mode 100644 index 0000000..f0e21e8 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/giant_lily_pad.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/giantlilypad", + "textures": { + "all": "hem:blocks/giantlilypad", + "particle": "hem:blocks/giantlilypad", + "0": "hem:blocks/giantlilypad" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/giant_lily_pad_flowerless.json b/src/main/resources/assets/hem/models/block/giant_lily_pad_flowerless.json new file mode 100644 index 0000000..03b2c0c --- /dev/null +++ b/src/main/resources/assets/hem/models/block/giant_lily_pad_flowerless.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/giantlilypadnoflower", + "textures": { + "all": "hem:blocks/giantlilypad", + "particle": "hem:blocks/giantlilypad", + "0": "hem:blocks/giantlilypad" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_alternate.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_alternate.json new file mode 100644 index 0000000..7c4f7ef --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_alternate.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirt", + "up": "hem:blocks/blueleafgrasstopalternate", + "north": "hem:blocks/blueleafgrasssidedirt", + "east": "hem:blocks/blueleafgrasssidedirt", + "south": "hem:blocks/blueleafgrasssidedirt", + "west": "hem:blocks/blueleafgrasssidedirt", + "particle": "hem:blocks/blueleafdirt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_bright.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_bright.json new file mode 100644 index 0000000..71756fc --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_bright.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirt", + "up": "hem:blocks/blueleafgrasstopbright", + "north": "hem:blocks/blueleafgrasssidedirt", + "east": "hem:blocks/blueleafgrasssidedirt", + "south": "hem:blocks/blueleafgrasssidedirt", + "west": "hem:blocks/blueleafgrasssidedirt", + "particle": "hem:blocks/blueleafdirt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_flower.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_flower.json new file mode 100644 index 0000000..6dc1aaa --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_flower.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirt", + "up": "hem:blocks/blueleafgrasstopflower", + "north": "hem:blocks/blueleafgrasssidedirt", + "east": "hem:blocks/blueleafgrasssidedirt", + "south": "hem:blocks/blueleafgrasssidedirt", + "west": "hem:blocks/blueleafgrasssidedirt", + "particle": "hem:blocks/blueleafdirt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_flowers.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_flowers.json new file mode 100644 index 0000000..553e385 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_dirt_grass_flowers.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafdirt", + "up": "hem:blocks/blueleafgrasstopflowers", + "north": "hem:blocks/blueleafgrasssidedirt", + "east": "hem:blocks/blueleafgrasssidedirt", + "south": "hem:blocks/blueleafgrasssidedirt", + "west": "hem:blocks/blueleafgrasssidedirt", + "particle": "hem:blocks/blueleafdirt" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_alternate.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_alternate.json new file mode 100644 index 0000000..40394f5 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_alternate.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstone", + "up": "hem:blocks/blueleafgrasstopalternate", + "north": "hem:blocks/blueleafgrasssidestone", + "east": "hem:blocks/blueleafgrasssidestone", + "south": "hem:blocks/blueleafgrasssidestone", + "west": "hem:blocks/blueleafgrasssidestone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_bright.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_bright.json new file mode 100644 index 0000000..4304902 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_bright.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstone", + "up": "hem:blocks/blueleafgrasstopbright", + "north": "hem:blocks/blueleafgrasssidestone", + "east": "hem:blocks/blueleafgrasssidestone", + "south": "hem:blocks/blueleafgrasssidestone", + "west": "hem:blocks/blueleafgrasssidestone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_flower.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_flower.json new file mode 100644 index 0000000..d15a283 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_flower.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstone", + "up": "hem:blocks/blueleafgrasstopflower", + "north": "hem:blocks/blueleafgrasssidestone", + "east": "hem:blocks/blueleafgrasssidestone", + "south": "hem:blocks/blueleafgrasssidestone", + "west": "hem:blocks/blueleafgrasssidestone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_flowers.json b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_flowers.json new file mode 100644 index 0000000..7797ce8 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/grass/blueleaf_grass_block_flowers.json @@ -0,0 +1,12 @@ +{ + "parent": "block/cube", + "textures": { + "down": "hem:blocks/blueleafstone", + "up": "hem:blocks/blueleafgrasstopflowers", + "north": "hem:blocks/blueleafgrasssidestone", + "east": "hem:blocks/blueleafgrasssidestone", + "south": "hem:blocks/blueleafgrasssidestone", + "west": "hem:blocks/blueleafgrasssidestone", + "particle": "hem:blocks/blueleafstone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/muncher.json b/src/main/resources/assets/hem/models/block/muncher.json new file mode 100644 index 0000000..936292f --- /dev/null +++ b/src/main/resources/assets/hem/models/block/muncher.json @@ -0,0 +1,8 @@ +{ + "parent": "hem:custom/chomperclosed", + "textures": { + "all": "hem:blocks/blueleafmuncherclosed", + "particle": "hem:blocks/blueleafmuncherclosed", + "0": "hem:blocks/blueleafmuncherclosed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/block/muncher_sprout.json b/src/main/resources/assets/hem/models/block/muncher_sprout.json new file mode 100644 index 0000000..7fae329 --- /dev/null +++ b/src/main/resources/assets/hem/models/block/muncher_sprout.json @@ -0,0 +1,7 @@ +{ + "parent": "block/cross", + "textures": { + "cross": "hem:blocks/munchersprout", + "particle": "hem:blocks/munchersprout" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/anthill.json b/src/main/resources/assets/hem/models/custom/anthill.json new file mode 100644 index 0000000..d39b258 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/anthill.json @@ -0,0 +1,338 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [ + 32, + 32 + ], + "elements": [ + { + "from": [ + 2, + 0, + 2 + ], + "to": [ + 14, + 5, + 14 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 2, + 0, + 1 + ] + }, + "faces": { + "north": { + "uv": [ + 6, + 0, + 12, + 2.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 2.5, + 12, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 5, + 12, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 7.5, + 12, + 10 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 6, + 6, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6, + 0, + 0, + 6 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 12, + 0, + 1 + ], + "to": [ + 15, + 3, + 4 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 13, + 0, + 2 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 1.5, + 1.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8, + 1, + 9.5, + 2.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7, + 6, + 8.5, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 8.5, + 7.5, + 10 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4.5, + 6.5, + 6, + 8 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 9, + 3.5, + 10.5, + 5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 1, + 0, + 12 + ], + "to": [ + 4, + 3, + 15 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 2, + 0, + 13 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 1.5, + 1.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8, + 1, + 9.5, + 2.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7, + 6, + 8.5, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 7, + 8, + 8.5, + 9.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 8, + 10, + 9.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 9, + 3.5, + 10.5, + 5 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 2.5, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 2.5, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "firstperson_righthand": { + "translation": [ + 0, + 5.25, + 0 + ], + "scale": [ + 0.65, + 0.75, + 0.4 + ] + }, + "firstperson_lefthand": { + "translation": [ + 0, + 5.25, + 0 + ], + "scale": [ + 0.65, + 0.75, + 0.4 + ] + }, + "ground": { + "translation": [ + 0, + 0.25, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "gui": { + "rotation": [ + 37, + 41, + 0 + ], + "translation": [ + 0, + 3.25, + 0 + ], + "scale": [ + 0.91, + 0.91, + 0.91 + ] + }, + "head": { + "translation": [ + 0, + 13, + 0 + ] + }, + "fixed": { + "rotation": [ + -90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -6.25 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/ants.json b/src/main/resources/assets/hem/models/custom/ants.json new file mode 100644 index 0000000..a6d869a --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/ants.json @@ -0,0 +1,161 @@ +{ + "credit": "Made with Blockbench", + "elements": [ + { + "from": [ + 0, + 0.5, + 0 + ], + "to": [ + 16, + 0.5, + 16 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.5, + 0 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 0, + 1, + 0 + ], + "to": [ + 16, + 1, + 16 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 8, + 1, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "rotation": 90, + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "rotation": 270, + "texture": "#0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/blueleaflilypad.json b/src/main/resources/assets/hem/models/custom/blueleaflilypad.json new file mode 100644 index 0000000..901a369 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/blueleaflilypad.json @@ -0,0 +1,79 @@ +{ + "format_version": "1.9.0", + "credit": "Made with Blockbench", + "ambientocclusion": false, + "texture_size": [ + 16, + 17 + ], + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 0.5, + 16 + ], + "faces": { + "north": { + "uv": [ + 0.032, + 0.03012, + 15.968, + 0.91106 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0.032, + 0.03012, + 15.968, + 0.91106 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0.032, + 0.03012, + 15.968, + 0.91106 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0.032, + 0.03012, + 15.968, + 0.91106 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0.032, + 1, + 15.968, + 15.96988 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0.032, + 16, + 16, + 0.91106 + ], + "texture": "#0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/bulbflower.json b/src/main/resources/assets/hem/models/custom/bulbflower.json new file mode 100644 index 0000000..e12ab06 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/bulbflower.json @@ -0,0 +1,425 @@ +{ + "credit": "Made with Blockbench", + "ambientocclusion": false, + "texture_size": [ + 64, + 64 + ], + "elements": [ + { + "from": [ + -5, + 2.1, + -5 + ], + "to": [ + 21, + 2.1, + 21 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.1, + 0 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 6.5, + 6.5, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6.5, + 0, + 0, + 6.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -5.05, + 2.3, + -5.05 + ], + "to": [ + 21.05, + 2.4, + 21.05 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.35, + 0 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 6.5, + 13, + 0, + 6.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6.5, + 6.5, + 0, + 13 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -5, + 1.5, + -5 + ], + "to": [ + 21, + 1.5, + 21 + ], + "rotation": { + "angle": 45, + "axis": "y", + "origin": [ + 8, + 1.5, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 6.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 13, + 6.5, + 6.5, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 13, + 0, + 6.5, + 6.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 2, + 9 + ], + "rotation": { + "angle": 45, + "axis": "y", + "origin": [ + 8, + 1, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 13, + 0.5, + 13.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13, + 0, + 13.5, + 0.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0.5, + 13, + 1, + 13.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13, + 0.5, + 13.5, + 1 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 1.5, + 13.5, + 1, + 13 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 13.5, + 1, + 13, + 1.5 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_righthand": { + "rotation": [ + 58, + 21, + 28 + ], + "translation": [ + 0, + 3.5, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.35 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 58, + 21, + 28 + ], + "translation": [ + 0, + 3.5, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.35 + ] + }, + "ground": { + "translation": [ + 0, + 1.25, + 1.75 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "gui": { + "rotation": [ + 90, + 0, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "head": { + "translation": [ + 0, + 13.25, + 0 + ] + }, + "fixed": { + "rotation": [ + -91, + 0, + 0 + ], + "translation": [ + 0, + 0, + -8.25 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/bulbflowerclosed.json b/src/main/resources/assets/hem/models/custom/bulbflowerclosed.json new file mode 100644 index 0000000..e10c54c --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/bulbflowerclosed.json @@ -0,0 +1,168 @@ +{ + "credit": "Made with Blockbench", + "ambientocclusion": false, + "texture_size": [ + 16, + 32 + ], + "elements": [ + { + "from": [ + 0, + 0, + 8 + ], + "to": [ + 16, + 32, + 8 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 0, + 0 + ], + "to": [ + 8, + 32, + 16 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 90, + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 270, + "texture": "#0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/canister612l.json b/src/main/resources/assets/hem/models/custom/canister612l.json new file mode 100644 index 0000000..210cfeb --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/canister612l.json @@ -0,0 +1,719 @@ +{ + "format_version": "1.9.0", + "credit": "Made with Blockbench", + "texture_size": [ + 64, + 64 + ], + "elements": [ + { + "from": [ + 4.8, + -0.2, + 4.8 + ], + "to": [ + 11.2, + 17.2, + 11.2 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 1.5, + 4.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1.75, + 0, + 3.25, + 4.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3.5, + 0, + 5, + 4.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 4.5, + 1.5, + 8.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 1.5, + 7, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8.5, + 1.75, + 7, + 3.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5, + 0, + 5 + ], + "to": [ + 11, + 17, + 11 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 8, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 1.75, + 4.5, + 3.25, + 8.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.5, + 4.5, + 5, + 8.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5.25, + 0, + 6.75, + 4.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5.25, + 4.5, + 6.75, + 8.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 5, + 7, + 3.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8.5, + 5.25, + 7, + 6.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 20, + 6 + ], + "to": [ + 10, + 21, + 10 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 24, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 8.75, + 4, + 9.75, + 4.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8.75, + 4.5, + 9.75, + 4.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8.75, + 5, + 9.75, + 5.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8.75, + 5.5, + 9.75, + 5.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 8, + 7, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 8.25, + 7, + 9.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5.8, + 19.8, + 5.8 + ], + "to": [ + 10.2, + 21.2, + 10.2 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 24, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 8.75, + 6, + 9.75, + 6.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8.75, + 6.5, + 9.75, + 6.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 9, + 1, + 9.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 1.25, + 9, + 2.25, + 9.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 9.25, + 8, + 8.25, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 9.25, + 8.25, + 8.25, + 9.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 17, + 7 + ], + "to": [ + 9, + 20, + 9 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 24, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 8.75, + 0, + 9.25, + 0.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8.75, + 1, + 9.25, + 1.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8.75, + 2, + 9.25, + 2.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8.75, + 3, + 9.25, + 3.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 9.5, + 2.5, + 9 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.75, + 9, + 3.25, + 9.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8.64645, + 18, + 4.89645 + ], + "to": [ + 9.64645, + 19, + 7.89645 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 9.14645, + 18.5, + 6.89645 + ] + }, + "faces": { + "north": { + "uv": [ + 2, + 9.5, + 2.25, + 9.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 9.5, + 0.75, + 9.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.5, + 2, + 9.75, + 2.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 9.5, + 0, + 10.25, + 0.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 9.75, + 1.25, + 9.5, + 0.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 1.25, + 9.5, + 1, + 10.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8.44645, + 17.8, + 4.69645 + ], + "to": [ + 9.84645, + 19.2, + 8.09645 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 9.14645, + 18.5, + 6.89645 + ] + }, + "faces": { + "north": { + "uv": [ + 1.5, + 9.5, + 1.75, + 9.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4, + 9, + 4.75, + 9.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.5, + 1.5, + 9.75, + 1.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5, + 9, + 5.75, + 9.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 6.25, + 9.75, + 6, + 9 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6.75, + 9, + 6.5, + 9.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 18.35, + 19.2, + 9.55 + ], + "to": [ + 16.95, + 17.8, + 6.15 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 15.15, + 18.5, + -2.65 + ] + }, + "faces": { + "north": { + "uv": [ + 1.5, + 9.5, + 1.75, + 9.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4, + 9, + 4.75, + 9.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.5, + 1.5, + 9.75, + 1.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5, + 9, + 5.75, + 9.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 6.25, + 9.75, + 6, + 9 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6.75, + 9, + 6.5, + 9.75 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + -11.5, + -1 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + -12.25, + 0 + ] + }, + "firstperson_righthand": { + "rotation": [ + 17, + 163, + -21 + ], + "translation": [ + 1.5, + 1.75, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "firstperson_lefthand": { + "rotation": [ + -9, + 59, + 29 + ], + "translation": [ + 1.5, + 1.75, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "ground": { + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "gui": { + "rotation": [ + 24, + -180, + 22 + ], + "translation": [ + 0, + -1.5, + 0 + ], + "scale": [ + 0.7, + 0.7, + 0.7 + ] + }, + "head": { + "translation": [ + 0, + 14.25, + 0 + ] + }, + "fixed": { + "rotation": [ + 0, + 0, + 38 + ], + "translation": [ + 0, + -3.25, + 0 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/chomperclosed.json b/src/main/resources/assets/hem/models/custom/chomperclosed.json new file mode 100644 index 0000000..f720b41 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/chomperclosed.json @@ -0,0 +1,168 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [ + 16, + 32 + ], + "ambientocclusion": false, + "elements": [ + { + "from": [ + 0, + 0, + 8 + ], + "to": [ + 16, + 32, + 8 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 0, + 0 + ], + "to": [ + 8, + 32, + 16 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 90, + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 270, + "texture": "#0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/giantlilypad.json b/src/main/resources/assets/hem/models/custom/giantlilypad.json new file mode 100644 index 0000000..e86f3d3 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/giantlilypad.json @@ -0,0 +1,728 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [ + 128, + 128 + ], + "elements": [ + { + "from": [ + -6, + 0.1, + -6 + ], + "to": [ + 22, + 0.1, + 22 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.1, + 0 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 2.625, + 8.5, + 2.625 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 5, + 9.5, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 5.125, + 9.5, + 5.125 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 5.25, + 9.5, + 5.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3.5, + 3.5, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 0, + 0, + 3.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -6, + 0.35, + -6 + ], + "to": [ + 22, + 0.35, + 22 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.35, + 0 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 2.625, + 8.5, + 2.625 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 5, + 9.5, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 5.125, + 9.5, + 5.125 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 5.25, + 9.5, + 5.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3.5, + 7.125, + 0, + 3.625 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 3.625, + 0, + 7.125 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 4, + 0.5, + 4 + ], + "to": [ + 12, + 4.5, + 12 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0.5, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 0.75, + 6, + 1.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5, + 1.375, + 6, + 1.875 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5, + 2, + 6, + 2.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 3.625, + 5, + 4.625, + 5.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4.625, + 3.75, + 3.625, + 2.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4.625, + 3.875, + 3.625, + 4.875 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 12, + 0.5, + 4 + ], + "to": [ + 4, + 4.5, + 12 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 15, + 0.5, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 0.75, + 6, + 1.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5, + 1.375, + 6, + 1.875 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5, + 2, + 6, + 2.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 3.625, + 5, + 4.625, + 5.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4.625, + 3.75, + 3.625, + 2.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4.625, + 3.875, + 3.625, + 4.875 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 3, + 0.2, + 3 + ], + "to": [ + 13, + 5.2, + 13 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0.2, + 6 + ] + }, + "faces": { + "north": { + "uv": [ + 4.75, + 2.75, + 6, + 3.375 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4.75, + 3.5, + 6, + 4.125 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.75, + 4.25, + 6, + 4.875 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5, + 0, + 6.25, + 0.625 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4.875, + 1.25, + 3.625, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4.875, + 1.375, + 3.625, + 2.625 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 13, + 0.45, + 3 + ], + "to": [ + 3, + 5.45, + 13 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 17, + 0.45, + 6 + ] + }, + "faces": { + "north": { + "uv": [ + 4.75, + 2.75, + 6, + 3.375 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4.75, + 3.5, + 6, + 4.125 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.75, + 4.25, + 6, + 4.875 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5, + 0, + 6.25, + 0.625 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4.875, + 1.25, + 3.625, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4.875, + 1.375, + 3.625, + 2.625 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 0.8, + 6 + ], + "to": [ + 10, + 5.8, + 10 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + -0.2, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 4.75, + 5, + 5.25, + 5.625 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.375, + 5, + 5.875, + 5.625 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3.625, + 5.625, + 4.125, + 6.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.25, + 5.75, + 4.75, + 6.375 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 5.375, + 6.25, + 4.875, + 5.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6, + 5.75, + 5.5, + 6.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 10, + 0.8, + 6 + ], + "to": [ + 6, + 5.8, + 10 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 11, + -0.2, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 4.75, + 5, + 5.25, + 5.625 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.375, + 5, + 5.875, + 5.625 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3.625, + 5.625, + 4.125, + 6.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.25, + 5.75, + 4.75, + 6.375 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 5.375, + 6.25, + 4.875, + 5.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6, + 5.75, + 5.5, + 6.25 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_righthand": { + "rotation": [ + 0, + 44, + 0 + ], + "translation": [ + -1, + 5.25, + 1.5 + ], + "scale": [ + 0.28, + 0.3, + 0.22 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 0, + 36, + 0 + ], + "translation": [ + -0.75, + 5.25, + 1 + ], + "scale": [ + 0.24, + 0.3, + 0.19 + ] + }, + "ground": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "gui": { + "rotation": [ + 40, + 145, + 0 + ], + "translation": [ + 0, + 1.5, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "head": { + "translation": [ + 0, + 14.75, + 0 + ] + }, + "fixed": { + "rotation": [ + -90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -9 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/giantlilypadnoflower.json b/src/main/resources/assets/hem/models/custom/giantlilypadnoflower.json new file mode 100644 index 0000000..c483f8d --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/giantlilypadnoflower.json @@ -0,0 +1,266 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [ + 128, + 128 + ], + "elements": [ + { + "from": [ + -6, + 0.1, + -6 + ], + "to": [ + 22, + 0.1, + 22 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.1, + 0 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 2.625, + 8.5, + 2.625 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 5, + 9.5, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 5.125, + 9.5, + 5.125 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 5.25, + 9.5, + 5.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3.5, + 3.5, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 0, + 0, + 3.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -6, + 0.35, + -6 + ], + "to": [ + 22, + 0.35, + 22 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 0.35, + 0 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 2.625, + 8.5, + 2.625 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 5, + 9.5, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 5.125, + 9.5, + 5.125 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 5.25, + 9.5, + 5.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3.5, + 7.125, + 0, + 3.625 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 3.625, + 0, + 7.125 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_righthand": { + "rotation": [ + 0, + 44, + 0 + ], + "translation": [ + -1, + 5.25, + 1.5 + ], + "scale": [ + 0.28, + 0.3, + 0.22 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 0, + 36, + 0 + ], + "translation": [ + -0.75, + 5.25, + 1 + ], + "scale": [ + 0.24, + 0.3, + 0.19 + ] + }, + "ground": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "gui": { + "rotation": [ + 40, + 145, + 0 + ], + "translation": [ + 0, + 1.5, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "head": { + "translation": [ + 0, + 14.75, + 0 + ] + }, + "fixed": { + "rotation": [ + -90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -9 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/lavender.json b/src/main/resources/assets/hem/models/custom/lavender.json new file mode 100644 index 0000000..e10c54c --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/lavender.json @@ -0,0 +1,168 @@ +{ + "credit": "Made with Blockbench", + "ambientocclusion": false, + "texture_size": [ + 16, + 32 + ], + "elements": [ + { + "from": [ + 0, + 0, + 8 + ], + "to": [ + 16, + 32, + 8 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 0, + 0 + ], + "to": [ + 8, + 32, + 16 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 90, + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 270, + "texture": "#0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/leafpile.json b/src/main/resources/assets/hem/models/custom/leafpile.json new file mode 100644 index 0000000..97091ed --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/leafpile.json @@ -0,0 +1,99 @@ +{ + "credit": "Made with Blockbench", + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 1, + 16 + ], + "faces": { + "north": { + "uv": [ + 7.968, + 7.032, + 7.032, + 7.968 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 7.032, + 7.032, + 7.968, + 7.968 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 7.032, + 7.032, + 7.968, + 7.968 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 7.032, + 7.032, + 7.968, + 7.968 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0.032, + 0.032, + 15.968, + 15.968 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0.032, + 0.032, + 15.968, + 15.968 + ], + "texture": "#1" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 2.25, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 2.25, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/leafpilewaterlogged.json b/src/main/resources/assets/hem/models/custom/leafpilewaterlogged.json new file mode 100644 index 0000000..706fab6 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/leafpilewaterlogged.json @@ -0,0 +1,82 @@ +{ + "credit": "Made with Blockbench", + "elements": [ + { + "from": [ + 0, + 15, + 0 + ], + "to": [ + 16, + 16, + 16 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 0, + 15, + 0 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 1 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 0, + 3, + 16, + 4 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#1" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/leaves.json b/src/main/resources/assets/hem/models/custom/leaves.json new file mode 100644 index 0000000..74a2877 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/leaves.json @@ -0,0 +1,283 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [ + 30, + 60 + ], + "elements": [ + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 16, + 16 + ], + "shade": true, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -8, + -5, + 8 + ], + "to": [ + 22, + 11, + 8 + ], + "rotation": { + "angle": 45, + "axis": "y", + "origin": [ + 7, + 11, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 8 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 8 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 8 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 8 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0, + 8, + 0, + 0 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0, + 0, + 0, + 8 + ], + "texture": "#1" + } + } + }, + { + "from": [ + -8, + -5, + 8 + ], + "to": [ + 22, + 11, + 8 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 7, + 11, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 8, + 16, + 16 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 8 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 0, + 8, + 16, + 16 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 8 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 16, + 0, + 0, + 0 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 16, + 0, + 0, + 0 + ], + "texture": "#1" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "thirdperson_lefthand": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_righthand": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_lefthand": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "ground": { + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "gui": { + "rotation": [ + 32, + -45, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/openmuncher.json b/src/main/resources/assets/hem/models/custom/openmuncher.json new file mode 100644 index 0000000..7eff905 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/openmuncher.json @@ -0,0 +1,653 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [ + 64, + 64 + ], + "elements": [ + { + "from": [ + 7, + 0, + 7 + ], + "to": [ + 9, + 3, + 9 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 15, + 2, + 15.5, + 2.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 15, + 2.75, + 15.5, + 3.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3, + 15, + 3.5, + 15.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 3.5, + 15, + 4, + 15.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 4, + 15, + 3.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4.5, + 15, + 4, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 2.8, + 6 + ], + "to": [ + 10, + 4.8, + 10 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 2.8, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 1, + 15, + 2, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 15, + 1, + 16, + 1.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 15, + 1.5, + 16, + 2 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 15, + 3, + 15.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 1, + 16, + 0, + 15 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 16, + 0, + 15, + 1 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -7, + 3.3, + -7 + ], + "to": [ + 23, + 3.3, + 23 + ], + "rotation": { + "angle": 45, + "axis": "y", + "origin": [ + 8, + 3.3, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 7.5, + 7.5, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 7.5, + 0, + 0, + 7.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -7, + 4.05, + -7 + ], + "to": [ + 23, + 4.05, + 23 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 8, + 4.05, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 7.5, + 7.5, + 0, + 0 + ], + "rotation": 90, + "texture": "#0" + }, + "down": { + "uv": [ + 7.5, + 0, + 0, + 7.5 + ], + "rotation": 270, + "texture": "#0" + } + } + }, + { + "from": [ + -7, + 5.25, + -7 + ], + "to": [ + 23, + 5.25, + 23 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 5.25, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 15, + 7.5, + 7.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 7.5, + 7.5, + 15 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -7, + 5.3, + -7 + ], + "to": [ + 23, + 5.3, + 23 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 5.3, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 15, + 7.5, + 7.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 7.5, + 7.5, + 15 + ], + "texture": "#0" + } + } + }, + { + "from": [ + -7, + 5, + -7 + ], + "to": [ + 23, + 5, + 23 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 5, + 7 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 7.5, + 0 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 7.5, + 7.5, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 0, + 7.5, + 7.5 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 2.25, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_righthand": { + "rotation": [ + 57, + 0, + 0 + ], + "translation": [ + 0, + 4, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 57, + 0, + 0 + ], + "translation": [ + 0, + 4, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "ground": { + "translation": [ + 0, + 0.75, + 0 + ], + "scale": [ + 0.3, + 0.3, + 0.3 + ] + }, + "gui": { + "rotation": [ + 46, + 0, + 0 + ], + "scale": [ + 0.4, + 0.4, + 0.4 + ] + }, + "head": { + "translation": [ + 0, + 11.75, + 0 + ] + }, + "fixed": { + "rotation": [ + -90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -4.75 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/shadedcrossmodel.json b/src/main/resources/assets/hem/models/custom/shadedcrossmodel.json new file mode 100644 index 0000000..399e3c0 --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/shadedcrossmodel.json @@ -0,0 +1,162 @@ +{ + "credit": "Made with Blockbench", + "ambientocclusion": false, + "elements": [ + { + "from": [ + -2, + 0, + 8 + ], + "to": [ + 18, + 16, + 8 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 0, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 180, + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 180, + "texture": "#0" + } + } + }, + { + "from": [ + -2, + 0, + 8 + ], + "to": [ + 18, + 16, + 8 + ], + "rotation": { + "angle": 45, + "axis": "y", + "origin": [ + 8, + 0, + 8 + ] + }, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 16, + 0, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 16, + 0, + 0, + 0 + ], + "texture": "#0" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/custom/wheat.json b/src/main/resources/assets/hem/models/custom/wheat.json new file mode 100644 index 0000000..674672d --- /dev/null +++ b/src/main/resources/assets/hem/models/custom/wheat.json @@ -0,0 +1,168 @@ +{ + "credit": "Made with Blockbench", + "ambientocclusion": false, + "texture_size": [ + 16, + 32 + ], + "elements": [ + { + "from": [ + 0, + 0, + 8 + ], + "to": [ + 16, + 32, + 8 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#missing" + }, + "south": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#missing" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#missing" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "texture": "#missing" + } + } + }, + { + "from": [ + 8, + 0, + 0 + ], + "to": [ + 8, + 32, + 16 + ], + "rotation": { + "angle": -45, + "axis": "y", + "origin": [ + 8, + 16, + 8 + ] + }, + "shade": false, + "faces": { + "north": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#missing" + }, + "east": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 0, + 0, + 16 + ], + "texture": "#missing" + }, + "west": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 90, + "texture": "#missing" + }, + "down": { + "uv": [ + 0, + 0, + 16, + 0 + ], + "rotation": 270, + "texture": "#missing" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/airboat_spawn_egg.json b/src/main/resources/assets/hem/models/item/airboat_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/airboat_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/ant_hill.json b/src/main/resources/assets/hem/models/item/ant_hill.json new file mode 100644 index 0000000..a9e21e0 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/ant_hill.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/ant_hill", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/ants.json b/src/main/resources/assets/hem/models/item/ants.json new file mode 100644 index 0000000..c8c646d --- /dev/null +++ b/src/main/resources/assets/hem/models/item/ants.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/ant" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/bloomed_bulb_flower.json b/src/main/resources/assets/hem/models/item/bloomed_bulb_flower.json new file mode 100644 index 0000000..01cf403 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/bloomed_bulb_flower.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/bloomed_bulb_flower", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/bloomed_muncher.json b/src/main/resources/assets/hem/models/item/bloomed_muncher.json new file mode 100644 index 0000000..1a1fdc1 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/bloomed_muncher.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/bloomed_muncher", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf.json b/src/main/resources/assets/hem/models/item/blueleaf.json new file mode 100644 index 0000000..b7c85e8 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/blueleafgrasstall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_blossomer.json b/src/main/resources/assets/hem/models/item/blueleaf_blossomer.json new file mode 100644 index 0000000..f414cef --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_blossomer.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafblossomer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_brown_cap.json b/src/main/resources/assets/hem/models/item/blueleaf_brown_cap.json new file mode 100644 index 0000000..942b277 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_brown_cap.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafbrowncap" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_butter_slump.json b/src/main/resources/assets/hem/models/item/blueleaf_butter_slump.json new file mode 100644 index 0000000..87551ec --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_butter_slump.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafbutterslump" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_cabbage_flower.json b/src/main/resources/assets/hem/models/item/blueleaf_cabbage_flower.json new file mode 100644 index 0000000..924bc6d --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_cabbage_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafyoungcabbageflowerr" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_cobblestone.json b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone.json new file mode 100644 index 0000000..1cb4440 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_cobblestone", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_slab.json b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_slab.json new file mode 100644 index 0000000..e6535a3 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_slab.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_cobblestone_slab", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_stairs.json b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_stairs.json new file mode 100644 index 0000000..e7f2b1d --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_stairs.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_cobblestone_stairs", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_wall.json b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_wall.json new file mode 100644 index 0000000..b0a0b29 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_cobblestone_wall.json @@ -0,0 +1,3 @@ +{ + "parent": "hem:block/blueleaf_cobblestone_wall_inventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_dead_log.json b/src/main/resources/assets/hem/models/item/blueleaf_dead_log.json new file mode 100644 index 0000000..68fb9b0 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_dead_log.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_dead_log", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_dirt_block.json b/src/main/resources/assets/hem/models/item/blueleaf_dirt_block.json new file mode 100644 index 0000000..18ad2ea --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_dirt_block.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_dirt_block", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_dirt_grass_block.json b/src/main/resources/assets/hem/models/item/blueleaf_dirt_grass_block.json new file mode 100644 index 0000000..930482e --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_dirt_grass_block.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_dirt_grass_block", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_fluorescent_leaves.json b/src/main/resources/assets/hem/models/item/blueleaf_fluorescent_leaves.json new file mode 100644 index 0000000..63aa87d --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_fluorescent_leaves.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_fluorescent_leaves", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_grass.json b/src/main/resources/assets/hem/models/item/blueleaf_grass.json new file mode 100644 index 0000000..b7c85e8 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_grass.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/blueleafgrasstall" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_grass_block.json b/src/main/resources/assets/hem/models/item/blueleaf_grass_block.json new file mode 100644 index 0000000..113637f --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_grass_block.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_grass_block", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_gravel_mud.json b/src/main/resources/assets/hem/models/item/blueleaf_gravel_mud.json new file mode 100644 index 0000000..518f817 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_gravel_mud.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_gravel_mud", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_green_cap.json b/src/main/resources/assets/hem/models/item/blueleaf_green_cap.json new file mode 100644 index 0000000..9ece656 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_green_cap.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafgreencap" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_lavender.json b/src/main/resources/assets/hem/models/item/blueleaf_lavender.json new file mode 100644 index 0000000..6d6d952 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_lavender.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/lavenderblueleaftop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_leaves.json b/src/main/resources/assets/hem/models/item/blueleaf_leaves.json new file mode 100644 index 0000000..76c807d --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_leaves.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_leaves", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_lily_pad.json b/src/main/resources/assets/hem/models/item/blueleaf_lily_pad.json new file mode 100644 index 0000000..fee0c97 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_lily_pad.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/lilypad" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_log.json b/src/main/resources/assets/hem/models/item/blueleaf_log.json new file mode 100644 index 0000000..82fb3c8 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_log.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_log", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_lush_leaves.json b/src/main/resources/assets/hem/models/item/blueleaf_lush_leaves.json new file mode 100644 index 0000000..dcbaf3b --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_lush_leaves.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_lush_leaves", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_mature_blossomer.json b/src/main/resources/assets/hem/models/item/blueleaf_mature_blossomer.json new file mode 100644 index 0000000..c1c44eb --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_mature_blossomer.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafmatureblossomer" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_mature_cabbage_flower.json b/src/main/resources/assets/hem/models/item/blueleaf_mature_cabbage_flower.json new file mode 100644 index 0000000..e6c7d81 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_mature_cabbage_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafmaturecabbageflower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_mud.json b/src/main/resources/assets/hem/models/item/blueleaf_mud.json new file mode 100644 index 0000000..519ddb6 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_mud.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_mud", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_red_cap.json b/src/main/resources/assets/hem/models/item/blueleaf_red_cap.json new file mode 100644 index 0000000..f91fe01 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_red_cap.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafredcap" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_redwood_leaves.json b/src/main/resources/assets/hem/models/item/blueleaf_redwood_leaves.json new file mode 100644 index 0000000..d5cecac --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_redwood_leaves.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_redwood_leaves", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_redwood_log.json b/src/main/resources/assets/hem/models/item/blueleaf_redwood_log.json new file mode 100644 index 0000000..01b14a5 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_redwood_log.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_redwood_log", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_sea_grass.json b/src/main/resources/assets/hem/models/item/blueleaf_sea_grass.json new file mode 100644 index 0000000..292d887 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_sea_grass.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_sea_grass", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_stone.json b/src/main/resources/assets/hem/models/item/blueleaf_stone.json new file mode 100644 index 0000000..5efe33a --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_stone.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_stone", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_stone_gravel.json b/src/main/resources/assets/hem/models/item/blueleaf_stone_gravel.json new file mode 100644 index 0000000..88d8e46 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_stone_gravel.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_stone_gravel", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_stone_slab.json b/src/main/resources/assets/hem/models/item/blueleaf_stone_slab.json new file mode 100644 index 0000000..4afe764 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_stone_slab.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_stone_slab", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_stone_stair.json b/src/main/resources/assets/hem/models/item/blueleaf_stone_stair.json new file mode 100644 index 0000000..822ccb4 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_stone_stair.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_stone_stair", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_stone_wall.json b/src/main/resources/assets/hem/models/item/blueleaf_stone_wall.json new file mode 100644 index 0000000..087a2a2 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_stone_wall.json @@ -0,0 +1,3 @@ +{ + "parent": "hem:block/blueleaf_stone_wall_inventory" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_tall_blooming_flower.json b/src/main/resources/assets/hem/models/item/blueleaf_tall_blooming_flower.json new file mode 100644 index 0000000..d077363 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_tall_blooming_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafbloomingflower" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_tall_grass.json b/src/main/resources/assets/hem/models/item/blueleaf_tall_grass.json new file mode 100644 index 0000000..f22caea --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_tall_grass.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleaftallgrasstop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_tall_sprout.json b/src/main/resources/assets/hem/models/item/blueleaf_tall_sprout.json new file mode 100644 index 0000000..d00dc93 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_tall_sprout.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/blueleafsprouttop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_wheat.json b/src/main/resources/assets/hem/models/item/blueleaf_wheat.json new file mode 100644 index 0000000..7d8ad10 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_wheat.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/wheat" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/blueleaf_wood.json b/src/main/resources/assets/hem/models/item/blueleaf_wood.json new file mode 100644 index 0000000..eefd552 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/blueleaf_wood.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/blueleaf_wood", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/bulb_flower.json b/src/main/resources/assets/hem/models/item/bulb_flower.json new file mode 100644 index 0000000..6f9d4ab --- /dev/null +++ b/src/main/resources/assets/hem/models/item/bulb_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/blueleafearlybulbflowertop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/butterfly_spawn_egg.json b/src/main/resources/assets/hem/models/item/butterfly_spawn_egg.json new file mode 100644 index 0000000..dcc615b --- /dev/null +++ b/src/main/resources/assets/hem/models/item/butterfly_spawn_egg.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/butterfly" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/dangling_fluorescent_leaves.json b/src/main/resources/assets/hem/models/item/dangling_fluorescent_leaves.json new file mode 100644 index 0000000..2ea1279 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/dangling_fluorescent_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/danglingfluorescentleaves" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/dormant_aged_emberleaf_military_bot_spawn_egg.json b/src/main/resources/assets/hem/models/item/dormant_aged_emberleaf_military_bot_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/dormant_aged_emberleaf_military_bot_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/dormant_emberleaf_military_bot_spawn_egg.json b/src/main/resources/assets/hem/models/item/dormant_emberleaf_military_bot_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/dormant_emberleaf_military_bot_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/emberleaf_military_bot_spawn_egg.json b/src/main/resources/assets/hem/models/item/emberleaf_military_bot_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/emberleaf_military_bot_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/emberleaf_military_robot_lower_half_spawn_egg.json b/src/main/resources/assets/hem/models/item/emberleaf_military_robot_lower_half_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/emberleaf_military_robot_lower_half_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/emberleaf_military_robot_upper_half_spawn_egg.json b/src/main/resources/assets/hem/models/item/emberleaf_military_robot_upper_half_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/emberleaf_military_robot_upper_half_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/fallen_leaves.json b/src/main/resources/assets/hem/models/item/fallen_leaves.json new file mode 100644 index 0000000..575e3ae --- /dev/null +++ b/src/main/resources/assets/hem/models/item/fallen_leaves.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/blueleafdefaultleavessparse" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/fluffalo_spawn_egg.json b/src/main/resources/assets/hem/models/item/fluffalo_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/fluffalo_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/fluffalo_tuft.json b/src/main/resources/assets/hem/models/item/fluffalo_tuft.json new file mode 100644 index 0000000..1d3ded6 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/fluffalo_tuft.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/fluffalotuft" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/gas_canister_612litre.json b/src/main/resources/assets/hem/models/item/gas_canister_612litre.json new file mode 100644 index 0000000..5b21928 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/gas_canister_612litre.json @@ -0,0 +1,7 @@ +{ + "parent": "hem:custom/canister612l", + "textures": { + "0": "hem:blocks/612lcanister", + "particle": "hem:items/612lcanister" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/giant_lily_pad.json b/src/main/resources/assets/hem/models/item/giant_lily_pad.json new file mode 100644 index 0000000..a96084c --- /dev/null +++ b/src/main/resources/assets/hem/models/item/giant_lily_pad.json @@ -0,0 +1,22 @@ +{ + "parent": "hem:block/giant_lily_pad", + "display": { + "thirdperson": { + "rotation": [ + 10, + -45, + 170 + ], + "translation": [ + 0, + 1.5, + -2.75 + ], + "scale": [ + 0.375, + 0.375, + 0.375 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/gold_fish_item.json b/src/main/resources/assets/hem/models/item/gold_fish_item.json new file mode 100644 index 0000000..1724e11 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/gold_fish_item.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/goldfish" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/gold_fish_spawn_egg.json b/src/main/resources/assets/hem/models/item/gold_fish_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/gold_fish_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/hot_air_balloon_item.json b/src/main/resources/assets/hem/models/item/hot_air_balloon_item.json new file mode 100644 index 0000000..d973ece --- /dev/null +++ b/src/main/resources/assets/hem/models/item/hot_air_balloon_item.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/hotairballoonitem" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/ladybug_spawn_egg.json b/src/main/resources/assets/hem/models/item/ladybug_spawn_egg.json new file mode 100644 index 0000000..7403659 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/ladybug_spawn_egg.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/ladybird" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/muncher.json b/src/main/resources/assets/hem/models/item/muncher.json new file mode 100644 index 0000000..00eac14 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/muncher.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/chompertop" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/muncher_sprout.json b/src/main/resources/assets/hem/models/item/muncher_sprout.json new file mode 100644 index 0000000..b65dde3 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/muncher_sprout.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:blocks/munchersprout" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/tiger_fish_item.json b/src/main/resources/assets/hem/models/item/tiger_fish_item.json new file mode 100644 index 0000000..9721561 --- /dev/null +++ b/src/main/resources/assets/hem/models/item/tiger_fish_item.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "hem:items/tigerfish" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/models/item/tiger_fish_spawn_egg.json b/src/main/resources/assets/hem/models/item/tiger_fish_spawn_egg.json new file mode 100644 index 0000000..7a2c6da --- /dev/null +++ b/src/main/resources/assets/hem/models/item/tiger_fish_spawn_egg.json @@ -0,0 +1,3 @@ +{ + "parent": "item/template_spawn_egg" +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/blue_leaves.json b/src/main/resources/assets/hem/particles/blue_leaves.json new file mode 100644 index 0000000..9dfff49 --- /dev/null +++ b/src/main/resources/assets/hem/particles/blue_leaves.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "hem:blue_leaves_1", + "hem:blue_leaves_2", + "hem:blue_leaves_3", + "hem:blue_leaves_4" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/blueleaf_ambience.json b/src/main/resources/assets/hem/particles/blueleaf_ambience.json new file mode 100644 index 0000000..46bde0a --- /dev/null +++ b/src/main/resources/assets/hem/particles/blueleaf_ambience.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "hem:blueleaf_ambience_1", + "hem:blueleaf_ambience_2", + "hem:blueleaf_ambience_3", + "hem:blueleaf_ambience_4" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/fluorescent_leaves_particles.json b/src/main/resources/assets/hem/particles/fluorescent_leaves_particles.json new file mode 100644 index 0000000..337237a --- /dev/null +++ b/src/main/resources/assets/hem/particles/fluorescent_leaves_particles.json @@ -0,0 +1,12 @@ +{ + "textures": [ + "hem:fluorescent_leaves_particles_1", + "hem:fluorescent_leaves_particles_2", + "hem:fluorescent_leaves_particles_3", + "hem:fluorescent_leaves_particles_4", + "hem:fluorescent_leaves_particles_5", + "hem:fluorescent_leaves_particles_6", + "hem:fluorescent_leaves_particles_7", + "hem:fluorescent_leaves_particles_8" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/lavender_particles.json b/src/main/resources/assets/hem/particles/lavender_particles.json new file mode 100644 index 0000000..5e9644b --- /dev/null +++ b/src/main/resources/assets/hem/particles/lavender_particles.json @@ -0,0 +1,9 @@ +{ + "textures": [ + "hem:lavender_particles_1", + "hem:lavender_particles_2", + "hem:lavender_particles_3", + "hem:lavender_particles_4", + "hem:lavender_particles_5" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/lily_pad_particles.json b/src/main/resources/assets/hem/particles/lily_pad_particles.json new file mode 100644 index 0000000..b1e13c2 --- /dev/null +++ b/src/main/resources/assets/hem/particles/lily_pad_particles.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "hem:lily_pad_particles_1", + "hem:lily_pad_particles_2", + "hem:lily_pad_particles_3", + "hem:lily_pad_particles_4" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/robot_damage.json b/src/main/resources/assets/hem/particles/robot_damage.json new file mode 100644 index 0000000..7f8927f --- /dev/null +++ b/src/main/resources/assets/hem/particles/robot_damage.json @@ -0,0 +1,12 @@ +{ + "textures": [ + "hem:robot_damage_1", + "hem:robot_damage_2", + "hem:robot_damage_3", + "hem:robot_damage_4", + "hem:robot_damage_5", + "hem:robot_damage_6", + "hem:robot_damage_7", + "hem:robot_damage_8" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/particles/severe_damage_particles.json b/src/main/resources/assets/hem/particles/severe_damage_particles.json new file mode 100644 index 0000000..3608bd3 --- /dev/null +++ b/src/main/resources/assets/hem/particles/severe_damage_particles.json @@ -0,0 +1,8 @@ +{ + "textures": [ + "hem:severe_damage_particles_1", + "hem:severe_damage_particles_2", + "hem:severe_damage_particles_3", + "hem:severe_damage_particles_4" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/textures/blocks/612lcanister.png b/src/main/resources/assets/hem/textures/blocks/612lcanister.png new file mode 100644 index 0000000..03debe0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/612lcanister.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/anthill.png b/src/main/resources/assets/hem/textures/blocks/anthill.png new file mode 100644 index 0000000..155228f Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/anthill.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/ants-sheet.png b/src/main/resources/assets/hem/textures/blocks/ants-sheet.png new file mode 100644 index 0000000..6068844 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/ants-sheet.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/ants-sheet.png.mcmeta b/src/main/resources/assets/hem/textures/blocks/ants-sheet.png.mcmeta new file mode 100644 index 0000000..2910908 --- /dev/null +++ b/src/main/resources/assets/hem/textures/blocks/ants-sheet.png.mcmeta @@ -0,0 +1,26 @@ +{ + "animation": { + "frametime": 2, + "interpolate": false, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafbloomingflower.png b/src/main/resources/assets/hem/textures/blocks/blueleafbloomingflower.png new file mode 100644 index 0000000..9586f06 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafbloomingflower.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafbloomingflowerbottom.png b/src/main/resources/assets/hem/textures/blocks/blueleafbloomingflowerbottom.png new file mode 100644 index 0000000..27d0a5b Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafbloomingflowerbottom.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafblossomer.png b/src/main/resources/assets/hem/textures/blocks/blueleafblossomer.png new file mode 100644 index 0000000..f6f9808 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafblossomer.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafbrowncap.png b/src/main/resources/assets/hem/textures/blocks/blueleafbrowncap.png new file mode 100644 index 0000000..871f1d6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafbrowncap.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafbutterslump.png b/src/main/resources/assets/hem/textures/blocks/blueleafbutterslump.png new file mode 100644 index 0000000..3062646 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafbutterslump.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogside.png b/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogside.png new file mode 100644 index 0000000..8e66138 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogside.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogsidecracked.png b/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogsidecracked.png new file mode 100644 index 0000000..c1fe264 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogsidecracked.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogtop.png b/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogtop.png new file mode 100644 index 0000000..946fb82 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdeadlogtop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleaves.png b/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleaves.png new file mode 100644 index 0000000..b271722 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleaves.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleavesdense.png b/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleavesdense.png new file mode 100644 index 0000000..aaccc35 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleavesdense.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleavessparse.png b/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleavessparse.png new file mode 100644 index 0000000..8ec8010 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdefaultleavessparse.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdirt.png b/src/main/resources/assets/hem/textures/blocks/blueleafdirt.png new file mode 100644 index 0000000..41ce647 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdirt.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafdirtcoarse.png b/src/main/resources/assets/hem/textures/blocks/blueleafdirtcoarse.png new file mode 100644 index 0000000..1026c22 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafdirtcoarse.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafearlybulbflowerbottom.png b/src/main/resources/assets/hem/textures/blocks/blueleafearlybulbflowerbottom.png new file mode 100644 index 0000000..b79f1b7 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafearlybulbflowerbottom.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafearlybulbflowertop.png b/src/main/resources/assets/hem/textures/blocks/blueleafearlybulbflowertop.png new file mode 100644 index 0000000..f582e9e Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafearlybulbflowertop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasscurly.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasscurly.png new file mode 100644 index 0000000..962242f Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasscurly.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrassmedium.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrassmedium.png new file mode 100644 index 0000000..58b27e7 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrassmedium.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrassshort.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrassshort.png new file mode 100644 index 0000000..f228611 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrassshort.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasssidedirt.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasssidedirt.png new file mode 100644 index 0000000..73d36b2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasssidedirt.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasssidestone.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasssidestone.png new file mode 100644 index 0000000..11adb0e Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasssidestone.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasssupershort.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasssupershort.png new file mode 100644 index 0000000..dd20f84 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasssupershort.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasstall.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstall.png new file mode 100644 index 0000000..b83ced7 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstall.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasstop.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstop.png new file mode 100644 index 0000000..9392e57 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopalternate.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopalternate.png new file mode 100644 index 0000000..86aad56 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopalternate.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopbright.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopbright.png new file mode 100644 index 0000000..1b09fe6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopbright.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopflower.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopflower.png new file mode 100644 index 0000000..eddf29c Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopflower.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopflowers.png b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopflowers.png new file mode 100644 index 0000000..7c90256 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgrasstopflowers.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafgreencap.png b/src/main/resources/assets/hem/textures/blocks/blueleafgreencap.png new file mode 100644 index 0000000..58a438c Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafgreencap.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafleaves.png b/src/main/resources/assets/hem/textures/blocks/blueleafleaves.png new file mode 100644 index 0000000..3e9e8f3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafleaves.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafleavesdark.png b/src/main/resources/assets/hem/textures/blocks/blueleafleavesdark.png new file mode 100644 index 0000000..128e2a6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafleavesdark.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafleavesfir.png b/src/main/resources/assets/hem/textures/blocks/blueleafleavesfir.png new file mode 100644 index 0000000..d0400e9 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafleavesfir.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafleavesscarse.png b/src/main/resources/assets/hem/textures/blocks/blueleafleavesscarse.png new file mode 100644 index 0000000..9c32b07 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafleavesscarse.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleaflogside.png b/src/main/resources/assets/hem/textures/blocks/blueleaflogside.png new file mode 100644 index 0000000..2eca12f Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleaflogside.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleaflogtop.png b/src/main/resources/assets/hem/textures/blocks/blueleaflogtop.png new file mode 100644 index 0000000..36342ff Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleaflogtop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleaflushleaves.png b/src/main/resources/assets/hem/textures/blocks/blueleaflushleaves.png new file mode 100644 index 0000000..6d62be8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleaflushleaves.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafmatureblossomer.png b/src/main/resources/assets/hem/textures/blocks/blueleafmatureblossomer.png new file mode 100644 index 0000000..cff720e Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafmatureblossomer.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafmaturecabbageflower.png b/src/main/resources/assets/hem/textures/blocks/blueleafmaturecabbageflower.png new file mode 100644 index 0000000..d546ef8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafmaturecabbageflower.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafmuncherclosed.png b/src/main/resources/assets/hem/textures/blocks/blueleafmuncherclosed.png new file mode 100644 index 0000000..5ed7e0a Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafmuncherclosed.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafredcap.png b/src/main/resources/assets/hem/textures/blocks/blueleafredcap.png new file mode 100644 index 0000000..2d792d5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafredcap.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafredwoodlogside.png b/src/main/resources/assets/hem/textures/blocks/blueleafredwoodlogside.png new file mode 100644 index 0000000..3195a0e Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafredwoodlogside.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafredwoodlogtop.png b/src/main/resources/assets/hem/textures/blocks/blueleafredwoodlogtop.png new file mode 100644 index 0000000..d3eb910 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafredwoodlogtop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafrottenlogside.png b/src/main/resources/assets/hem/textures/blocks/blueleafrottenlogside.png new file mode 100644 index 0000000..e374a40 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafrottenlogside.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafrottenlogtop.png b/src/main/resources/assets/hem/textures/blocks/blueleafrottenlogtop.png new file mode 100644 index 0000000..ce9bd1a Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafrottenlogtop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafseagrass.png b/src/main/resources/assets/hem/textures/blocks/blueleafseagrass.png new file mode 100644 index 0000000..36d7851 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafseagrass.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafseagrass.png.mcmeta b/src/main/resources/assets/hem/textures/blocks/blueleafseagrass.png.mcmeta new file mode 100644 index 0000000..34a3ec8 --- /dev/null +++ b/src/main/resources/assets/hem/textures/blocks/blueleafseagrass.png.mcmeta @@ -0,0 +1,14 @@ +{ + "animation": { + "frametime": 5, + "interpolate": false, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafsproutbottom.png b/src/main/resources/assets/hem/textures/blocks/blueleafsproutbottom.png new file mode 100644 index 0000000..f2f1f95 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafsproutbottom.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafsprouttop.png b/src/main/resources/assets/hem/textures/blocks/blueleafsprouttop.png new file mode 100644 index 0000000..bf2fb18 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafsprouttop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafstone.png b/src/main/resources/assets/hem/textures/blocks/blueleafstone.png new file mode 100644 index 0000000..ff758b1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafstone.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafstonecobble.png b/src/main/resources/assets/hem/textures/blocks/blueleafstonecobble.png new file mode 100644 index 0000000..3e6c01e Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafstonecobble.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafstonegemore.png b/src/main/resources/assets/hem/textures/blocks/blueleafstonegemore.png new file mode 100644 index 0000000..746bd57 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafstonegemore.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafstonegravel.png b/src/main/resources/assets/hem/textures/blocks/blueleafstonegravel.png new file mode 100644 index 0000000..ab5dee3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafstonegravel.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafstonemineralore.png b/src/main/resources/assets/hem/textures/blocks/blueleafstonemineralore.png new file mode 100644 index 0000000..af52cb0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafstonemineralore.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleaftallgrassbottom.png b/src/main/resources/assets/hem/textures/blocks/blueleaftallgrassbottom.png new file mode 100644 index 0000000..ae3e541 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleaftallgrassbottom.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleaftallgrasstop.png b/src/main/resources/assets/hem/textures/blocks/blueleaftallgrasstop.png new file mode 100644 index 0000000..d763557 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleaftallgrasstop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/blueleafyoungcabbageflowerr.png b/src/main/resources/assets/hem/textures/blocks/blueleafyoungcabbageflowerr.png new file mode 100644 index 0000000..f6b9fe5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/blueleafyoungcabbageflowerr.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/bulbflower.png b/src/main/resources/assets/hem/textures/blocks/bulbflower.png new file mode 100644 index 0000000..9b09e46 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/bulbflower.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/bulbflowerclose.png b/src/main/resources/assets/hem/textures/blocks/bulbflowerclose.png new file mode 100644 index 0000000..95df896 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/bulbflowerclose.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/danglingfluorescentleaves.png b/src/main/resources/assets/hem/textures/blocks/danglingfluorescentleaves.png new file mode 100644 index 0000000..416c02c Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/danglingfluorescentleaves.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/giantlilypad.png b/src/main/resources/assets/hem/textures/blocks/giantlilypad.png new file mode 100644 index 0000000..5e6e537 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/giantlilypad.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/grassycobble.png b/src/main/resources/assets/hem/textures/blocks/grassycobble.png new file mode 100644 index 0000000..7a6771f Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/grassycobble.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/grassycobbleside.png b/src/main/resources/assets/hem/textures/blocks/grassycobbleside.png new file mode 100644 index 0000000..5c607e4 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/grassycobbleside.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/lavenderblueleaf.png b/src/main/resources/assets/hem/textures/blocks/lavenderblueleaf.png new file mode 100644 index 0000000..5bcabb6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/lavenderblueleaf.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/lavenderblueleafbottom.png b/src/main/resources/assets/hem/textures/blocks/lavenderblueleafbottom.png new file mode 100644 index 0000000..c3ffa80 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/lavenderblueleafbottom.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/lavenderblueleaftop.png b/src/main/resources/assets/hem/textures/blocks/lavenderblueleaftop.png new file mode 100644 index 0000000..c721df0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/lavenderblueleaftop.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/leaves.png b/src/main/resources/assets/hem/textures/blocks/leaves.png new file mode 100644 index 0000000..411673b Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/leaves.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/leavesoverhang.png b/src/main/resources/assets/hem/textures/blocks/leavesoverhang.png new file mode 100644 index 0000000..12ed0df Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/leavesoverhang.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/lilypad.png b/src/main/resources/assets/hem/textures/blocks/lilypad.png new file mode 100644 index 0000000..ee1a8bc Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/lilypad.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/mud.png b/src/main/resources/assets/hem/textures/blocks/mud.png new file mode 100644 index 0000000..0eacb31 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/mud.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/muddygravelside.png b/src/main/resources/assets/hem/textures/blocks/muddygravelside.png new file mode 100644 index 0000000..1084a81 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/muddygravelside.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/munchersprout.png b/src/main/resources/assets/hem/textures/blocks/munchersprout.png new file mode 100644 index 0000000..27a7ac8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/munchersprout.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/openmuncher.png b/src/main/resources/assets/hem/textures/blocks/openmuncher.png new file mode 100644 index 0000000..e513de3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/openmuncher.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/pebblygrass.png b/src/main/resources/assets/hem/textures/blocks/pebblygrass.png new file mode 100644 index 0000000..ba9c079 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/pebblygrass.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/stonymud.png b/src/main/resources/assets/hem/textures/blocks/stonymud.png new file mode 100644 index 0000000..ba322fa Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/stonymud.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/wheat.png b/src/main/resources/assets/hem/textures/blocks/wheat.png new file mode 100644 index 0000000..7309c78 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/wheat.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/wheetbottom.png b/src/main/resources/assets/hem/textures/blocks/wheetbottom.png new file mode 100644 index 0000000..b8ea30c Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/wheetbottom.png differ diff --git a/src/main/resources/assets/hem/textures/blocks/wheettop.png b/src/main/resources/assets/hem/textures/blocks/wheettop.png new file mode 100644 index 0000000..629a187 Binary files /dev/null and b/src/main/resources/assets/hem/textures/blocks/wheettop.png differ diff --git a/src/main/resources/assets/hem/textures/entities/airboat.png b/src/main/resources/assets/hem/textures/entities/airboat.png new file mode 100644 index 0000000..739d2d5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/airboat.png differ diff --git a/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobot.png b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobot.png new file mode 100644 index 0000000..20d60a2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobot.png differ diff --git a/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotaged.png b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotaged.png new file mode 100644 index 0000000..350bf0d Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotaged.png differ diff --git a/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotawake.png b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotawake.png new file mode 100644 index 0000000..2c9da3b Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotawake.png differ diff --git a/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotdestroyed.png b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotdestroyed.png new file mode 100644 index 0000000..744b67e Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/emberleafmilitaryrobotdestroyed.png differ diff --git a/src/main/resources/assets/hem/textures/entities/fluffalo.png b/src/main/resources/assets/hem/textures/entities/fluffalo.png new file mode 100644 index 0000000..10c91a8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/fluffalo.png differ diff --git a/src/main/resources/assets/hem/textures/entities/giantbutterfly.png b/src/main/resources/assets/hem/textures/entities/giantbutterfly.png new file mode 100644 index 0000000..4c8028b Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/giantbutterfly.png differ diff --git a/src/main/resources/assets/hem/textures/entities/goldfish.png b/src/main/resources/assets/hem/textures/entities/goldfish.png new file mode 100644 index 0000000..f0ca5a5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/goldfish.png differ diff --git a/src/main/resources/assets/hem/textures/entities/hotairballoon.png b/src/main/resources/assets/hem/textures/entities/hotairballoon.png new file mode 100644 index 0000000..0650761 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/hotairballoon.png differ diff --git a/src/main/resources/assets/hem/textures/entities/ladybug.png b/src/main/resources/assets/hem/textures/entities/ladybug.png new file mode 100644 index 0000000..8fa9746 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/ladybug.png differ diff --git a/src/main/resources/assets/hem/textures/entities/tigerfish.png b/src/main/resources/assets/hem/textures/entities/tigerfish.png new file mode 100644 index 0000000..1234314 Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/tigerfish.png differ diff --git a/src/main/resources/assets/hem/textures/entities/tigerfishglowlayer.png b/src/main/resources/assets/hem/textures/entities/tigerfishglowlayer.png new file mode 100644 index 0000000..af9a5bc Binary files /dev/null and b/src/main/resources/assets/hem/textures/entities/tigerfishglowlayer.png differ diff --git a/src/main/resources/assets/hem/textures/items/612lcanister.png b/src/main/resources/assets/hem/textures/items/612lcanister.png new file mode 100644 index 0000000..03debe0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/612lcanister.png differ diff --git a/src/main/resources/assets/hem/textures/items/ant.png b/src/main/resources/assets/hem/textures/items/ant.png new file mode 100644 index 0000000..57fe97d Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/ant.png differ diff --git a/src/main/resources/assets/hem/textures/items/blueleafdefaultleavessparse.png b/src/main/resources/assets/hem/textures/items/blueleafdefaultleavessparse.png new file mode 100644 index 0000000..8ec8010 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/blueleafdefaultleavessparse.png differ diff --git a/src/main/resources/assets/hem/textures/items/blueleafearlybulbflowertop.png b/src/main/resources/assets/hem/textures/items/blueleafearlybulbflowertop.png new file mode 100644 index 0000000..f582e9e Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/blueleafearlybulbflowertop.png differ diff --git a/src/main/resources/assets/hem/textures/items/blueleafgrasstall.png b/src/main/resources/assets/hem/textures/items/blueleafgrasstall.png new file mode 100644 index 0000000..b83ced7 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/blueleafgrasstall.png differ diff --git a/src/main/resources/assets/hem/textures/items/butterfly.png b/src/main/resources/assets/hem/textures/items/butterfly.png new file mode 100644 index 0000000..9a0bc36 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/butterfly.png differ diff --git a/src/main/resources/assets/hem/textures/items/chompertop.png b/src/main/resources/assets/hem/textures/items/chompertop.png new file mode 100644 index 0000000..0fd68ae Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/chompertop.png differ diff --git a/src/main/resources/assets/hem/textures/items/danglingfluorescentleaves.png b/src/main/resources/assets/hem/textures/items/danglingfluorescentleaves.png new file mode 100644 index 0000000..416c02c Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/danglingfluorescentleaves.png differ diff --git a/src/main/resources/assets/hem/textures/items/fluffalotuft.png b/src/main/resources/assets/hem/textures/items/fluffalotuft.png new file mode 100644 index 0000000..20f189a Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/fluffalotuft.png differ diff --git a/src/main/resources/assets/hem/textures/items/goldfish.png b/src/main/resources/assets/hem/textures/items/goldfish.png new file mode 100644 index 0000000..099297d Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/goldfish.png differ diff --git a/src/main/resources/assets/hem/textures/items/hotairballoonitem.png b/src/main/resources/assets/hem/textures/items/hotairballoonitem.png new file mode 100644 index 0000000..c16732f Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/hotairballoonitem.png differ diff --git a/src/main/resources/assets/hem/textures/items/ladybird.png b/src/main/resources/assets/hem/textures/items/ladybird.png new file mode 100644 index 0000000..7728aa0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/ladybird.png differ diff --git a/src/main/resources/assets/hem/textures/items/lavenderblueleaftop.png b/src/main/resources/assets/hem/textures/items/lavenderblueleaftop.png new file mode 100644 index 0000000..c721df0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/lavenderblueleaftop.png differ diff --git a/src/main/resources/assets/hem/textures/items/lilypad.png b/src/main/resources/assets/hem/textures/items/lilypad.png new file mode 100644 index 0000000..ee1a8bc Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/lilypad.png differ diff --git a/src/main/resources/assets/hem/textures/items/tigerfish.png b/src/main/resources/assets/hem/textures/items/tigerfish.png new file mode 100644 index 0000000..08e7cf2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/tigerfish.png differ diff --git a/src/main/resources/assets/hem/textures/items/wheat.png b/src/main/resources/assets/hem/textures/items/wheat.png new file mode 100644 index 0000000..d9194d0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/wheat.png differ diff --git a/src/main/resources/assets/hem/textures/items/wheettop.png b/src/main/resources/assets/hem/textures/items/wheettop.png new file mode 100644 index 0000000..ffe215b Binary files /dev/null and b/src/main/resources/assets/hem/textures/items/wheettop.png differ diff --git a/src/main/resources/assets/hem/textures/logo.png b/src/main/resources/assets/hem/textures/logo.png new file mode 100644 index 0000000..d4f136c Binary files /dev/null and b/src/main/resources/assets/hem/textures/logo.png differ diff --git a/src/main/resources/assets/hem/textures/mob_effect/gooed.png b/src/main/resources/assets/hem/textures/mob_effect/gooed.png new file mode 100644 index 0000000..72919e0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/mob_effect/gooed.png differ diff --git a/src/main/resources/assets/hem/textures/particle/ambientparticle.png b/src/main/resources/assets/hem/textures/particle/ambientparticle.png new file mode 100644 index 0000000..7ed7965 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/ambientparticle.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_1.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_1.png new file mode 100644 index 0000000..46e8c56 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_2.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_2.png new file mode 100644 index 0000000..9fed88b Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_3.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_3.png new file mode 100644 index 0000000..7e2bc50 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_4.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_4.png new file mode 100644 index 0000000..046ddda Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_4.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_5.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_5.png new file mode 100644 index 0000000..33072f0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_5.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_6.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_6.png new file mode 100644 index 0000000..78bc3be Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_6.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_7.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_7.png new file mode 100644 index 0000000..41f9fe9 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_7.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blue_leaves_8.png b/src/main/resources/assets/hem/textures/particle/blue_leaves_8.png new file mode 100644 index 0000000..8b56694 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blue_leaves_8.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_1.png b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_1.png new file mode 100644 index 0000000..85b283b Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_2.png b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_2.png new file mode 100644 index 0000000..a52dc17 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_3.png b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_3.png new file mode 100644 index 0000000..61b237e Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_4.png b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_4.png new file mode 100644 index 0000000..1984f1a Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blueleaf_ambience_4.png differ diff --git a/src/main/resources/assets/hem/textures/particle/blueleaves.png b/src/main/resources/assets/hem/textures/particle/blueleaves.png new file mode 100644 index 0000000..d1c82e2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/blueleaves.png differ diff --git a/src/main/resources/assets/hem/textures/particle/damageparticlesheet.png b/src/main/resources/assets/hem/textures/particle/damageparticlesheet.png new file mode 100644 index 0000000..f90419c Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/damageparticlesheet.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_1.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_1.png new file mode 100644 index 0000000..2189d88 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_2.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_2.png new file mode 100644 index 0000000..6ed29d0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_3.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_3.png new file mode 100644 index 0000000..501c0ec Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_4.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_4.png new file mode 100644 index 0000000..956e828 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_4.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_5.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_5.png new file mode 100644 index 0000000..33072f0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_5.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_6.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_6.png new file mode 100644 index 0000000..78bc3be Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_6.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_7.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_7.png new file mode 100644 index 0000000..41f9fe9 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_7.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_8.png b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_8.png new file mode 100644 index 0000000..8b56694 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescent_leaves_particles_8.png differ diff --git a/src/main/resources/assets/hem/textures/particle/fluorescentleafs.png b/src/main/resources/assets/hem/textures/particle/fluorescentleafs.png new file mode 100644 index 0000000..25499e2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/fluorescentleafs.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavender_particles_1.png b/src/main/resources/assets/hem/textures/particle/lavender_particles_1.png new file mode 100644 index 0000000..c370569 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavender_particles_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavender_particles_2.png b/src/main/resources/assets/hem/textures/particle/lavender_particles_2.png new file mode 100644 index 0000000..d44efd8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavender_particles_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavender_particles_3.png b/src/main/resources/assets/hem/textures/particle/lavender_particles_3.png new file mode 100644 index 0000000..24ee226 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavender_particles_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavender_particles_4.png b/src/main/resources/assets/hem/textures/particle/lavender_particles_4.png new file mode 100644 index 0000000..57c9aff Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavender_particles_4.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavender_particles_5.png b/src/main/resources/assets/hem/textures/particle/lavender_particles_5.png new file mode 100644 index 0000000..03cc299 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavender_particles_5.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavender_particles_6.png b/src/main/resources/assets/hem/textures/particle/lavender_particles_6.png new file mode 100644 index 0000000..96eebf3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavender_particles_6.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lavenderblueleafparticles.png b/src/main/resources/assets/hem/textures/particle/lavenderblueleafparticles.png new file mode 100644 index 0000000..de3e619 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lavenderblueleafparticles.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lily_pad_particles_1.png b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_1.png new file mode 100644 index 0000000..c076ee3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lily_pad_particles_2.png b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_2.png new file mode 100644 index 0000000..514ecab Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lily_pad_particles_3.png b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_3.png new file mode 100644 index 0000000..5e981a1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lily_pad_particles_4.png b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_4.png new file mode 100644 index 0000000..86b72fd Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lily_pad_particles_4.png differ diff --git a/src/main/resources/assets/hem/textures/particle/lilypadparticles.png b/src/main/resources/assets/hem/textures/particle/lilypadparticles.png new file mode 100644 index 0000000..46e4921 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/lilypadparticles.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_1.png b/src/main/resources/assets/hem/textures/particle/robot_damage_1.png new file mode 100644 index 0000000..c1c2f95 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_2.png b/src/main/resources/assets/hem/textures/particle/robot_damage_2.png new file mode 100644 index 0000000..80c96ae Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_3.png b/src/main/resources/assets/hem/textures/particle/robot_damage_3.png new file mode 100644 index 0000000..a4d14dc Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_4.png b/src/main/resources/assets/hem/textures/particle/robot_damage_4.png new file mode 100644 index 0000000..bb09c95 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_4.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_5.png b/src/main/resources/assets/hem/textures/particle/robot_damage_5.png new file mode 100644 index 0000000..8217ad8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_5.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_6.png b/src/main/resources/assets/hem/textures/particle/robot_damage_6.png new file mode 100644 index 0000000..7d7b024 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_6.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_7.png b/src/main/resources/assets/hem/textures/particle/robot_damage_7.png new file mode 100644 index 0000000..a1118d5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_7.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robot_damage_8.png b/src/main/resources/assets/hem/textures/particle/robot_damage_8.png new file mode 100644 index 0000000..25b3c2c Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robot_damage_8.png differ diff --git a/src/main/resources/assets/hem/textures/particle/robotdamageparticles.png b/src/main/resources/assets/hem/textures/particle/robotdamageparticles.png new file mode 100644 index 0000000..99e3c7f Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/robotdamageparticles.png differ diff --git a/src/main/resources/assets/hem/textures/particle/severe_damage_particles_1.png b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_1.png new file mode 100644 index 0000000..a46a8b3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_1.png differ diff --git a/src/main/resources/assets/hem/textures/particle/severe_damage_particles_2.png b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_2.png new file mode 100644 index 0000000..0cf441d Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_2.png differ diff --git a/src/main/resources/assets/hem/textures/particle/severe_damage_particles_3.png b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_3.png new file mode 100644 index 0000000..2b62470 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_3.png differ diff --git a/src/main/resources/assets/hem/textures/particle/severe_damage_particles_4.png b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_4.png new file mode 100644 index 0000000..57980e6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/particle/severe_damage_particles_4.png differ diff --git a/src/main/resources/assets/hem/textures/screens/airboat_gas_cel_view.png b/src/main/resources/assets/hem/textures/screens/airboat_gas_cel_view.png new file mode 100644 index 0000000..8471cb0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/airboat_gas_cel_view.png differ diff --git a/src/main/resources/assets/hem/textures/screens/airshipheliumui.png b/src/main/resources/assets/hem/textures/screens/airshipheliumui.png new file mode 100644 index 0000000..3785f1a Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/airshipheliumui.png differ diff --git a/src/main/resources/assets/hem/textures/screens/altimeter.png b/src/main/resources/assets/hem/textures/screens/altimeter.png new file mode 100644 index 0000000..e37caa7 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/altimeter.png differ diff --git a/src/main/resources/assets/hem/textures/screens/gooed.png b/src/main/resources/assets/hem/textures/screens/gooed.png new file mode 100644 index 0000000..c077d0d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/gooed.png differ diff --git a/src/main/resources/assets/hem/textures/screens/gooed1.png b/src/main/resources/assets/hem/textures/screens/gooed1.png new file mode 100644 index 0000000..babed6e Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/gooed1.png differ diff --git a/src/main/resources/assets/hem/textures/screens/gooed2.png b/src/main/resources/assets/hem/textures/screens/gooed2.png new file mode 100644 index 0000000..2e053c2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/gooed2.png differ diff --git a/src/main/resources/assets/hem/textures/screens/gooed3.png b/src/main/resources/assets/hem/textures/screens/gooed3.png new file mode 100644 index 0000000..503c357 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/gooed3.png differ diff --git a/src/main/resources/assets/hem/textures/screens/heliumfilluibottom.png b/src/main/resources/assets/hem/textures/screens/heliumfilluibottom.png new file mode 100644 index 0000000..8c17cb3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/heliumfilluibottom.png differ diff --git a/src/main/resources/assets/hem/textures/screens/heliumfilluiprogress.png b/src/main/resources/assets/hem/textures/screens/heliumfilluiprogress.png new file mode 100644 index 0000000..467808a Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/heliumfilluiprogress.png differ diff --git a/src/main/resources/assets/hem/textures/screens/heliumfilluitop.png b/src/main/resources/assets/hem/textures/screens/heliumfilluitop.png new file mode 100644 index 0000000..341ac7b Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/heliumfilluitop.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage0.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage0.png new file mode 100644 index 0000000..8ba1b64 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage0.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage1.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage1.png new file mode 100644 index 0000000..c85046c Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage1.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage10.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage10.png new file mode 100644 index 0000000..bef7d62 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage10.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage11.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage11.png new file mode 100644 index 0000000..12cf4b1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage11.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage12.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage12.png new file mode 100644 index 0000000..48bf738 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage12.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage13.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage13.png new file mode 100644 index 0000000..223a00c Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage13.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage14.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage14.png new file mode 100644 index 0000000..4581f1f Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage14.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage15.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage15.png new file mode 100644 index 0000000..012469c Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage15.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage16.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage16.png new file mode 100644 index 0000000..c5c460d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage16.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage17.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage17.png new file mode 100644 index 0000000..e35f5c5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage17.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage18.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage18.png new file mode 100644 index 0000000..2f92333 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage18.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage19.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage19.png new file mode 100644 index 0000000..7318995 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage19.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage2.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage2.png new file mode 100644 index 0000000..e02d4bc Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage2.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage20.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage20.png new file mode 100644 index 0000000..b978124 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage20.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage21.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage21.png new file mode 100644 index 0000000..dff9e9d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage21.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage22.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage22.png new file mode 100644 index 0000000..09a58e1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage22.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage23.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage23.png new file mode 100644 index 0000000..f7600fb Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage23.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage24.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage24.png new file mode 100644 index 0000000..3cb4a03 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage24.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage25.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage25.png new file mode 100644 index 0000000..13c8eaa Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage25.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage26.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage26.png new file mode 100644 index 0000000..61e1436 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage26.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage27.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage27.png new file mode 100644 index 0000000..e508a16 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage27.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage28.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage28.png new file mode 100644 index 0000000..44dd8ce Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage28.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage29.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage29.png new file mode 100644 index 0000000..db87e5d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage29.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage3.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage3.png new file mode 100644 index 0000000..00fac08 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage3.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage30.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage30.png new file mode 100644 index 0000000..eeec9f7 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage30.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage31.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage31.png new file mode 100644 index 0000000..8647387 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage31.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage4.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage4.png new file mode 100644 index 0000000..f05bff3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage4.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage5.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage5.png new file mode 100644 index 0000000..fe6b21e Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage5.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage6.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage6.png new file mode 100644 index 0000000..f9b9174 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage6.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage7.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage7.png new file mode 100644 index 0000000..c03e21a Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage7.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage8.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage8.png new file mode 100644 index 0000000..17d1814 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage8.png differ diff --git a/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage9.png b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage9.png new file mode 100644 index 0000000..91de4be Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/hotairballoonpressureguage9.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometer.png b/src/main/resources/assets/hem/textures/screens/odometer.png new file mode 100644 index 0000000..032b491 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometer.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber0.png b/src/main/resources/assets/hem/textures/screens/odometernumber0.png new file mode 100644 index 0000000..f484415 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber0.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber1.png b/src/main/resources/assets/hem/textures/screens/odometernumber1.png new file mode 100644 index 0000000..87197dd Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber1.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber2.png b/src/main/resources/assets/hem/textures/screens/odometernumber2.png new file mode 100644 index 0000000..d251496 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber2.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber3.png b/src/main/resources/assets/hem/textures/screens/odometernumber3.png new file mode 100644 index 0000000..db0fbe1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber3.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber4.png b/src/main/resources/assets/hem/textures/screens/odometernumber4.png new file mode 100644 index 0000000..7011a50 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber4.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber5.png b/src/main/resources/assets/hem/textures/screens/odometernumber5.png new file mode 100644 index 0000000..422b07d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber5.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber6.png b/src/main/resources/assets/hem/textures/screens/odometernumber6.png new file mode 100644 index 0000000..33f5ec8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber6.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber7.png b/src/main/resources/assets/hem/textures/screens/odometernumber7.png new file mode 100644 index 0000000..03743a6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber7.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber8.png b/src/main/resources/assets/hem/textures/screens/odometernumber8.png new file mode 100644 index 0000000..c5fa2cb Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber8.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumber9.png b/src/main/resources/assets/hem/textures/screens/odometernumber9.png new file mode 100644 index 0000000..3de25bc Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumber9.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal0.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal0.png new file mode 100644 index 0000000..f69a87a Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal0.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal1.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal1.png new file mode 100644 index 0000000..fe4dbad Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal1.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal2.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal2.png new file mode 100644 index 0000000..9b0a906 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal2.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal3.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal3.png new file mode 100644 index 0000000..0a4d114 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal3.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal4.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal4.png new file mode 100644 index 0000000..205604d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal4.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal5.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal5.png new file mode 100644 index 0000000..6bb97c5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal5.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal6.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal6.png new file mode 100644 index 0000000..92bb34b Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal6.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal7.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal7.png new file mode 100644 index 0000000..a2e841f Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal7.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal8.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal8.png new file mode 100644 index 0000000..e22843b Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal8.png differ diff --git a/src/main/resources/assets/hem/textures/screens/odometernumberdecimal9.png b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal9.png new file mode 100644 index 0000000..3884b54 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/odometernumberdecimal9.png differ diff --git a/src/main/resources/assets/hem/textures/screens/pipe.png b/src/main/resources/assets/hem/textures/screens/pipe.png new file mode 100644 index 0000000..570e8d3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/pipe.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge0.png b/src/main/resources/assets/hem/textures/screens/speedgauge0.png new file mode 100644 index 0000000..730826d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge0.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge1.png b/src/main/resources/assets/hem/textures/screens/speedgauge1.png new file mode 100644 index 0000000..f754e54 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge1.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge10.png b/src/main/resources/assets/hem/textures/screens/speedgauge10.png new file mode 100644 index 0000000..bf960bd Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge10.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge11.png b/src/main/resources/assets/hem/textures/screens/speedgauge11.png new file mode 100644 index 0000000..b188cea Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge11.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge12.png b/src/main/resources/assets/hem/textures/screens/speedgauge12.png new file mode 100644 index 0000000..eafef48 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge12.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge13.png b/src/main/resources/assets/hem/textures/screens/speedgauge13.png new file mode 100644 index 0000000..aeacf4f Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge13.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge14.png b/src/main/resources/assets/hem/textures/screens/speedgauge14.png new file mode 100644 index 0000000..af9b186 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge14.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge15.png b/src/main/resources/assets/hem/textures/screens/speedgauge15.png new file mode 100644 index 0000000..e25c668 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge15.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge16.png b/src/main/resources/assets/hem/textures/screens/speedgauge16.png new file mode 100644 index 0000000..ea02707 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge16.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge17.png b/src/main/resources/assets/hem/textures/screens/speedgauge17.png new file mode 100644 index 0000000..06ad5b6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge17.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge18.png b/src/main/resources/assets/hem/textures/screens/speedgauge18.png new file mode 100644 index 0000000..124e935 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge18.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge19.png b/src/main/resources/assets/hem/textures/screens/speedgauge19.png new file mode 100644 index 0000000..585d441 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge19.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge2.png b/src/main/resources/assets/hem/textures/screens/speedgauge2.png new file mode 100644 index 0000000..7d2dbbb Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge2.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge20.png b/src/main/resources/assets/hem/textures/screens/speedgauge20.png new file mode 100644 index 0000000..a44e323 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge20.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge21.png b/src/main/resources/assets/hem/textures/screens/speedgauge21.png new file mode 100644 index 0000000..4445e83 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge21.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge22.png b/src/main/resources/assets/hem/textures/screens/speedgauge22.png new file mode 100644 index 0000000..1f7bc85 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge22.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge23.png b/src/main/resources/assets/hem/textures/screens/speedgauge23.png new file mode 100644 index 0000000..bc01fc1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge23.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge24.png b/src/main/resources/assets/hem/textures/screens/speedgauge24.png new file mode 100644 index 0000000..cfd0185 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge24.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge25.png b/src/main/resources/assets/hem/textures/screens/speedgauge25.png new file mode 100644 index 0000000..82f39ee Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge25.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge26.png b/src/main/resources/assets/hem/textures/screens/speedgauge26.png new file mode 100644 index 0000000..8828a71 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge26.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge27.png b/src/main/resources/assets/hem/textures/screens/speedgauge27.png new file mode 100644 index 0000000..ff435f1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge27.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge28.png b/src/main/resources/assets/hem/textures/screens/speedgauge28.png new file mode 100644 index 0000000..a4763e8 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge28.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge29.png b/src/main/resources/assets/hem/textures/screens/speedgauge29.png new file mode 100644 index 0000000..4d6a534 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge29.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge3.png b/src/main/resources/assets/hem/textures/screens/speedgauge3.png new file mode 100644 index 0000000..2006838 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge3.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge30.png b/src/main/resources/assets/hem/textures/screens/speedgauge30.png new file mode 100644 index 0000000..26a9c6d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge30.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge31.png b/src/main/resources/assets/hem/textures/screens/speedgauge31.png new file mode 100644 index 0000000..faa679d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge31.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge4.png b/src/main/resources/assets/hem/textures/screens/speedgauge4.png new file mode 100644 index 0000000..ff39285 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge4.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge5.png b/src/main/resources/assets/hem/textures/screens/speedgauge5.png new file mode 100644 index 0000000..59a74b0 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge5.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge6.png b/src/main/resources/assets/hem/textures/screens/speedgauge6.png new file mode 100644 index 0000000..96b4fe9 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge6.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge7.png b/src/main/resources/assets/hem/textures/screens/speedgauge7.png new file mode 100644 index 0000000..218728c Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge7.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge8.png b/src/main/resources/assets/hem/textures/screens/speedgauge8.png new file mode 100644 index 0000000..6c8156a Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge8.png differ diff --git a/src/main/resources/assets/hem/textures/screens/speedgauge9.png b/src/main/resources/assets/hem/textures/screens/speedgauge9.png new file mode 100644 index 0000000..ebc3a01 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/speedgauge9.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge0.png b/src/main/resources/assets/hem/textures/screens/tempgauge0.png new file mode 100644 index 0000000..e1c62ab Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge0.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge1.png b/src/main/resources/assets/hem/textures/screens/tempgauge1.png new file mode 100644 index 0000000..085fefa Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge1.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge10.png b/src/main/resources/assets/hem/textures/screens/tempgauge10.png new file mode 100644 index 0000000..93820f9 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge10.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge11.png b/src/main/resources/assets/hem/textures/screens/tempgauge11.png new file mode 100644 index 0000000..188a410 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge11.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge12.png b/src/main/resources/assets/hem/textures/screens/tempgauge12.png new file mode 100644 index 0000000..36496d3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge12.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge13.png b/src/main/resources/assets/hem/textures/screens/tempgauge13.png new file mode 100644 index 0000000..8833cfc Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge13.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge14.png b/src/main/resources/assets/hem/textures/screens/tempgauge14.png new file mode 100644 index 0000000..b0b18b6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge14.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge15.png b/src/main/resources/assets/hem/textures/screens/tempgauge15.png new file mode 100644 index 0000000..b9676ec Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge15.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge16.png b/src/main/resources/assets/hem/textures/screens/tempgauge16.png new file mode 100644 index 0000000..8a06fde Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge16.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge17.png b/src/main/resources/assets/hem/textures/screens/tempgauge17.png new file mode 100644 index 0000000..515df55 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge17.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge18.png b/src/main/resources/assets/hem/textures/screens/tempgauge18.png new file mode 100644 index 0000000..e74ab47 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge18.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge19.png b/src/main/resources/assets/hem/textures/screens/tempgauge19.png new file mode 100644 index 0000000..6f631d5 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge19.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge2.png b/src/main/resources/assets/hem/textures/screens/tempgauge2.png new file mode 100644 index 0000000..41da911 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge2.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge20.png b/src/main/resources/assets/hem/textures/screens/tempgauge20.png new file mode 100644 index 0000000..5b74c0b Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge20.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge21.png b/src/main/resources/assets/hem/textures/screens/tempgauge21.png new file mode 100644 index 0000000..726bc07 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge21.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge22.png b/src/main/resources/assets/hem/textures/screens/tempgauge22.png new file mode 100644 index 0000000..4a08718 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge22.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge23.png b/src/main/resources/assets/hem/textures/screens/tempgauge23.png new file mode 100644 index 0000000..d107f7f Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge23.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge24.png b/src/main/resources/assets/hem/textures/screens/tempgauge24.png new file mode 100644 index 0000000..309ff16 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge24.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge25.png b/src/main/resources/assets/hem/textures/screens/tempgauge25.png new file mode 100644 index 0000000..4085457 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge25.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge26.png b/src/main/resources/assets/hem/textures/screens/tempgauge26.png new file mode 100644 index 0000000..c51e1e1 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge26.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge27.png b/src/main/resources/assets/hem/textures/screens/tempgauge27.png new file mode 100644 index 0000000..e9b3b5c Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge27.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge28.png b/src/main/resources/assets/hem/textures/screens/tempgauge28.png new file mode 100644 index 0000000..76b32a2 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge28.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge29.png b/src/main/resources/assets/hem/textures/screens/tempgauge29.png new file mode 100644 index 0000000..5e03436 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge29.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge3.png b/src/main/resources/assets/hem/textures/screens/tempgauge3.png new file mode 100644 index 0000000..efb6b42 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge3.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge30.png b/src/main/resources/assets/hem/textures/screens/tempgauge30.png new file mode 100644 index 0000000..cf37626 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge30.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge31.png b/src/main/resources/assets/hem/textures/screens/tempgauge31.png new file mode 100644 index 0000000..4f7168d Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge31.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge4.png b/src/main/resources/assets/hem/textures/screens/tempgauge4.png new file mode 100644 index 0000000..b87b992 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge4.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge5.png b/src/main/resources/assets/hem/textures/screens/tempgauge5.png new file mode 100644 index 0000000..85f5ff3 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge5.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge6.png b/src/main/resources/assets/hem/textures/screens/tempgauge6.png new file mode 100644 index 0000000..8cd3167 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge6.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge7.png b/src/main/resources/assets/hem/textures/screens/tempgauge7.png new file mode 100644 index 0000000..71c28e6 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge7.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge8.png b/src/main/resources/assets/hem/textures/screens/tempgauge8.png new file mode 100644 index 0000000..de19b56 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge8.png differ diff --git a/src/main/resources/assets/hem/textures/screens/tempgauge9.png b/src/main/resources/assets/hem/textures/screens/tempgauge9.png new file mode 100644 index 0000000..9c76d25 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/tempgauge9.png differ diff --git a/src/main/resources/assets/hem/textures/screens/transparentgreen.png b/src/main/resources/assets/hem/textures/screens/transparentgreen.png new file mode 100644 index 0000000..4810693 Binary files /dev/null and b/src/main/resources/assets/hem/textures/screens/transparentgreen.png differ diff --git a/src/main/resources/data/forge/tags/blocks/solid_block.json b/src/main/resources/data/forge/tags/blocks/solid_block.json new file mode 100644 index 0000000..24ef3ac --- /dev/null +++ b/src/main/resources/data/forge/tags/blocks/solid_block.json @@ -0,0 +1,383 @@ +{ + "replace": false, + "values": [ + "minecraft:polished_blackstone_bricks", + "minecraft:lime_terracotta", + "minecraft:infested_mossy_stone_bricks", + "hem:blueleaf_wood", + "minecraft:pink_glazed_terracotta", + "minecraft:white_shulker_box", + "minecraft:prismarine", + "minecraft:gold_ore", + "minecraft:diamond_block", + "minecraft:smooth_quartz_stairs", + "minecraft:snow", + "minecraft:polished_andesite_stairs", + "minecraft:gray_concrete_powder", + "minecraft:blue_concrete_powder", + "minecraft:chiseled_polished_blackstone", + "minecraft:redstone_ore", + "minecraft:nether_brick_stairs", + "minecraft:black_shulker_box", + "minecraft:light_gray_shulker_box", + "minecraft:cobblestone", + "minecraft:frosted_ice", + "hem:blueleaf_stone", + "minecraft:dirt", + "minecraft:warped_hyphae", + "minecraft:blue_glazed_terracotta", + "minecraft:acacia_planks", + "minecraft:chiseled_red_sandstone", + "minecraft:jack_o_lantern", + "minecraft:infested_cracked_stone_bricks", + "minecraft:dead_brain_coral_block", + "minecraft:cyan_glazed_terracotta", + "minecraft:diorite_stairs", + "minecraft:red_wool", + "minecraft:barrel", + "minecraft:stone_bricks", + "minecraft:crimson_planks", + "minecraft:shroomlight", + "minecraft:granite_slab", + "minecraft:polished_blackstone", + "minecraft:red_terracotta", + "minecraft:dried_kelp_block", + "minecraft:slime_block", + "minecraft:bricks", + "minecraft:emerald_block", + "minecraft:purple_glazed_terracotta", + "hem:blueleaf_cobblestone", + "minecraft:red_mushroom_block", + "minecraft:sandstone_stairs", + "minecraft:andesite_wall", + "minecraft:quartz_stairs", + "minecraft:smoker", + "hem:blueleaf_redwood_log", + "minecraft:blackstone", + "minecraft:magenta_shulker_box", + "minecraft:red_glazed_terracotta", + "minecraft:prismarine_wall", + "minecraft:spruce_planks", + "minecraft:gray_shulker_box", + "minecraft:birch_leaves", + "minecraft:polished_blackstone_brick_wall", + "minecraft:purpur_slab", + "minecraft:granite_stairs", + "minecraft:smooth_quartz", + "minecraft:mushroom_stem", + "minecraft:andesite_stairs", + "minecraft:ice", + "minecraft:pink_terracotta", + "minecraft:blackstone_stairs", + "minecraft:cobblestone_stairs", + "minecraft:pink_shulker_box", + "minecraft:granite_wall", + "minecraft:red_sandstone_stairs", + "minecraft:magenta_glazed_terracotta", + "minecraft:magenta_concrete_powder", + "hem:blueleaf_stone_gravel", + "hem:blueleaf_dirt_block", + "minecraft:oak_stairs", + "minecraft:soul_soil", + "minecraft:cyan_shulker_box", + "minecraft:cut_red_sandstone", + "minecraft:nether_bricks", + "minecraft:soul_sand", + "minecraft:purple_wool", + "minecraft:chiseled_nether_bricks", + "minecraft:warped_nylium", + "minecraft:dark_prismarine", + "hem:blueleaf_grass_block", + "minecraft:oak_wood", + "minecraft:dark_oak_stairs", + "minecraft:jungle_stairs", + "minecraft:yellow_wool", + "minecraft:red_nether_bricks", + "minecraft:blue_wool", + "minecraft:polished_blackstone_brick_stairs", + "minecraft:gravel", + "minecraft:carved_pumpkin", + "minecraft:end_stone_bricks", + "minecraft:sea_lantern", + "minecraft:acacia_wood", + "minecraft:brown_concrete", + "minecraft:chain_command_block", + "minecraft:light_blue_glazed_terracotta", + "hem:blueleaf_lush_leaves", + "minecraft:jungle_wood", + "minecraft:red_sandstone_wall", + "minecraft:obsidian", + "minecraft:granite", + "minecraft:grass_block", + "minecraft:brain_coral_block", + "minecraft:end_stone_brick_stairs", + "minecraft:yellow_glazed_terracotta", + "minecraft:white_wool", + "minecraft:gray_concrete", + "minecraft:dead_horn_coral_block", + "minecraft:brown_terracotta", + "minecraft:horn_coral_block", + "minecraft:diorite_wall", + "minecraft:red_concrete_powder", + "minecraft:honeycomb_block", + "minecraft:spruce_log", + "minecraft:basalt", + "minecraft:blackstone_wall", + "minecraft:acacia_leaves", + "minecraft:mycelium", + "minecraft:lodestone", + "minecraft:coal_ore", + "minecraft:coal_block", + "minecraft:tnt", + "minecraft:light_gray_concrete", + "minecraft:light_blue_shulker_box", + "minecraft:crimson_stem", + "minecraft:crafting_table", + "minecraft:brown_glazed_terracotta", + "minecraft:orange_concrete_powder", + "minecraft:lime_glazed_terracotta", + "minecraft:light_gray_concrete_powder", + "minecraft:yellow_concrete", + "minecraft:netherrack", + "minecraft:smooth_red_sandstone_stairs", + "minecraft:green_wool", + "minecraft:acacia_stairs", + "minecraft:hopper", + "minecraft:red_nether_brick_stairs", + "minecraft:sponge", + "minecraft:infested_stone", + "minecraft:magma_block", + "minecraft:cyan_terracotta", + "minecraft:prismarine_brick_stairs", + "minecraft:respawn_anchor", + "minecraft:purpur_block", + "minecraft:nether_wart_block", + "minecraft:blue_ice", + "minecraft:stripped_jungle_log", + "minecraft:stripped_spruce_wood", + "minecraft:warped_stairs", + "minecraft:magenta_wool", + "minecraft:spruce_wood", + "minecraft:prismarine_stairs", + "minecraft:quartz_block", + "minecraft:purple_terracotta", + "minecraft:gray_wool", + "hem:blueleaf_stone_stair", + "hem:blueleaf_log", + "minecraft:light_blue_concrete_powder", + "minecraft:lapis_block", + "minecraft:polished_blackstone_wall", + "minecraft:stone_brick_wall", + "minecraft:orange_glazed_terracotta", + "minecraft:infested_cobblestone", + "minecraft:pink_wool", + "minecraft:oak_leaves", + "minecraft:stone_stairs", + "minecraft:sticky_piston", + "minecraft:purple_concrete_powder", + "minecraft:green_shulker_box", + "minecraft:brick_wall", + "minecraft:green_glazed_terracotta", + "minecraft:birch_log", + "minecraft:observer", + "minecraft:stripped_birch_log", + "minecraft:mossy_stone_brick_stairs", + "minecraft:pink_concrete_powder", + "minecraft:white_terracotta", + "minecraft:jungle_leaves", + "minecraft:wet_sponge", + "minecraft:white_concrete_powder", + "minecraft:crying_obsidian", + "minecraft:smooth_red_sandstone", + "minecraft:black_concrete", + "minecraft:dropper", + "minecraft:cyan_concrete_powder", + "minecraft:diorite", + "minecraft:stripped_dark_oak_log", + "minecraft:lime_concrete", + "minecraft:bone_block", + "minecraft:stripped_warped_hyphae", + "minecraft:diorite_slab", + "minecraft:chiseled_sandstone", + "minecraft:cactus", + "minecraft:stripped_jungle_wood", + "minecraft:dark_oak_log", + "minecraft:green_concrete", + "minecraft:purple_shulker_box", + "minecraft:mossy_stone_brick_wall", + "minecraft:orange_concrete", + "minecraft:light_gray_terracotta", + "minecraft:jungle_log", + "minecraft:red_concrete", + "minecraft:dark_oak_leaves", + "minecraft:sand", + "hem:blueleaf_redwood_leaves", + "minecraft:stripped_acacia_wood", + "minecraft:note_block", + "minecraft:purple_concrete", + "minecraft:birch_stairs", + "minecraft:gray_glazed_terracotta", + "minecraft:purpur_pillar", + "minecraft:ender_chest", + "minecraft:packed_ice", + "minecraft:andesite", + "minecraft:bedrock", + "minecraft:hay_block", + "minecraft:magenta_concrete", + "minecraft:nether_brick_wall", + "minecraft:pumpkin", + "minecraft:orange_wool", + "minecraft:iron_block", + "minecraft:crimson_hyphae", + "hem:blueleaf_fluorescent_leaves", + "minecraft:terracotta", + "minecraft:loom", + "minecraft:oak_log", + "hem:blueleaf_cobblestone_stairs", + "minecraft:redstone_block", + "minecraft:end_stone", + "minecraft:polished_diorite", + "minecraft:stripped_oak_log", + "minecraft:yellow_terracotta", + "minecraft:stripped_spruce_log", + "minecraft:spruce_leaves", + "minecraft:piston_head", + "minecraft:green_concrete_powder", + "minecraft:magenta_terracotta", + "minecraft:orange_shulker_box", + "minecraft:smooth_sandstone_stairs", + "minecraft:polished_granite", + "minecraft:honey_block", + "minecraft:beehive", + "minecraft:coarse_dirt", + "minecraft:cake", + "minecraft:gold_block", + "minecraft:mossy_cobblestone", + "minecraft:cracked_stone_bricks", + "minecraft:lime_concrete_powder", + "minecraft:diamond_ore", + "minecraft:sandstone_wall", + "minecraft:yellow_shulker_box", + "minecraft:birch_planks", + "minecraft:chiseled_stone_bricks", + "minecraft:polished_blackstone_stairs", + "minecraft:infested_chiseled_stone_bricks", + "minecraft:cyan_wool", + "minecraft:black_terracotta", + "minecraft:stripped_warped_stem", + "minecraft:cartography_table", + "minecraft:warped_stem", + "minecraft:quartz_bricks", + "minecraft:bubble_coral_block", + "minecraft:cyan_concrete", + "minecraft:warped_planks", + "minecraft:green_terracotta", + "minecraft:brick_stairs", + "minecraft:mossy_stone_bricks", + "minecraft:stripped_crimson_hyphae", + "minecraft:netherite_block", + "hem:blueleaf_cobblestone_wall", + "minecraft:crimson_nylium", + "minecraft:cracked_nether_bricks", + "minecraft:bookshelf", + "minecraft:brown_concrete_powder", + "minecraft:grass_path", + "minecraft:beacon", + "minecraft:red_shulker_box", + "minecraft:clay", + "hem:blueleaf_dirt_grass_block", + "minecraft:gray_terracotta", + "minecraft:brown_wool", + "minecraft:polished_basalt", + "hem:blueleaf_stone_wall", + "minecraft:dark_oak_wood", + "minecraft:emerald_ore", + "minecraft:fire_coral_block", + "minecraft:blast_furnace", + "minecraft:brown_shulker_box", + "minecraft:furnace", + "minecraft:dead_tube_coral_block", + "minecraft:sandstone", + "minecraft:lime_wool", + "minecraft:white_glazed_terracotta", + "minecraft:tube_coral_block", + "minecraft:repeating_command_block", + "minecraft:smooth_sandstone", + "minecraft:fletching_table", + "minecraft:ancient_debris", + "minecraft:stripped_birch_wood", + "minecraft:blue_shulker_box", + "minecraft:dead_bubble_coral_block", + "minecraft:dark_prismarine_stairs", + "hem:blueleaf_cobblestone_slab", + "minecraft:light_gray_wool", + "minecraft:nether_quartz_ore", + "minecraft:target", + "minecraft:lime_shulker_box", + "minecraft:stone", + "minecraft:red_sandstone", + "minecraft:stripped_dark_oak_wood", + "minecraft:shulker_box", + "minecraft:glowstone", + "minecraft:black_wool", + "minecraft:smooth_stone", + "minecraft:stripped_crimson_stem", + "minecraft:warped_wart_block", + "minecraft:farmland", + "minecraft:light_blue_wool", + "minecraft:melon", + "minecraft:quartz_pillar", + "minecraft:chiseled_quartz_block", + "minecraft:stone_brick_stairs", + "minecraft:black_concrete_powder", + "minecraft:acacia_log", + "minecraft:trapped_chest", + "minecraft:birch_wood", + "minecraft:white_concrete", + "minecraft:dead_fire_coral_block", + "minecraft:smithing_table", + "minecraft:orange_terracotta", + "minecraft:red_sand", + "minecraft:blue_terracotta", + "minecraft:infested_stone_bricks", + "minecraft:mossy_cobblestone_stairs", + "minecraft:jungle_planks", + "minecraft:lapis_ore", + "minecraft:stripped_oak_wood", + "minecraft:polished_granite_slab", + "minecraft:polished_granite_stairs", + "minecraft:iron_ore", + "minecraft:snow_block", + "minecraft:crimson_stairs", + "minecraft:piston", + "minecraft:light_blue_concrete", + "minecraft:light_blue_terracotta", + "minecraft:gilded_blackstone", + "minecraft:cut_sandstone", + "minecraft:cracked_polished_blackstone_bricks", + "minecraft:black_glazed_terracotta", + "minecraft:podzol", + "minecraft:stripped_acacia_log", + "minecraft:yellow_concrete_powder", + "minecraft:dispenser", + "minecraft:prismarine_bricks", + "minecraft:spruce_stairs", + "minecraft:command_block", + "minecraft:bee_nest", + "minecraft:light_gray_glazed_terracotta", + "minecraft:red_nether_brick_wall", + "minecraft:pink_concrete", + "minecraft:chest", + "minecraft:polished_diorite_stairs", + "minecraft:brown_mushroom_block", + "minecraft:redstone_lamp", + "minecraft:nether_gold_ore", + "minecraft:jukebox", + "minecraft:dark_oak_planks", + "minecraft:oak_planks", + "hem:blueleaf_stone_slab", + "minecraft:purpur_stairs", + "minecraft:blue_concrete", + "minecraft:polished_andesite" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/entity_types/vehicle_driver_seat.json b/src/main/resources/data/forge/tags/entity_types/vehicle_driver_seat.json new file mode 100644 index 0000000..828ff6c --- /dev/null +++ b/src/main/resources/data/forge/tags/entity_types/vehicle_driver_seat.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "hem:airboat", + "hem:hot_air_balloon" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/items/hem_fossilfuel.json b/src/main/resources/data/forge/tags/items/hem_fossilfuel.json new file mode 100644 index 0000000..b1090ce --- /dev/null +++ b/src/main/resources/data/forge/tags/items/hem_fossilfuel.json @@ -0,0 +1,41 @@ +{ + "replace": false, + "values": [ + "minecraft:stripped_jungle_log", + "minecraft:acacia_wood", + "minecraft:oak_log", + "minecraft:stripped_dark_oak_log", + "minecraft:spruce_wood", + "minecraft:stripped_oak_log", + "minecraft:stripped_spruce_log", + "minecraft:jungle_wood", + "minecraft:dark_oak_wood", + "minecraft:spruce_planks", + "minecraft:dark_oak_log", + "minecraft:jungle_planks", + "minecraft:jungle_log", + "minecraft:coal", + "minecraft:spruce_log", + "minecraft:birch_planks", + "minecraft:warped_hyphae", + "minecraft:stripped_warped_stem", + "minecraft:stripped_acacia_log", + "minecraft:charcoal", + "minecraft:acacia_planks", + "minecraft:warped_stem", + "minecraft:coal_block", + "minecraft:warped_planks", + "minecraft:crimson_stem", + "minecraft:birch_log", + "minecraft:crimson_planks", + "minecraft:oak_wood", + "minecraft:stripped_birch_log", + "minecraft:stripped_crimson_stem", + "minecraft:dark_oak_planks", + "minecraft:oak_planks", + "minecraft:crimson_hyphae", + "minecraft:lava_bucket", + "minecraft:acacia_log", + "minecraft:birch_wood" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hem/dimension/blueleaf.json b/src/main/resources/data/hem/dimension/blueleaf.json new file mode 100644 index 0000000..5bb7047 --- /dev/null +++ b/src/main/resources/data/hem/dimension/blueleaf.json @@ -0,0 +1,229 @@ +{ + "type": "hem:blueleaf", + "generator": { + "type": "minecraft:noise", + "seed": 4410637259638643003, + "biome_source": { + "type": "minecraft:multi_noise", + "seed": 4410637259638643003, + "temperature_noise": { + "firstOctave": -5.95, + "amplitudes": [ + 2, + 2 + ] + }, + "humidity_noise": { + "firstOctave": -5.95, + "amplitudes": [ + 2, + 2 + ] + }, + "altitude_noise": { + "firstOctave": -5.95, + "amplitudes": [ + 2, + 2 + ] + }, + "weirdness_noise": { + "firstOctave": -5.95, + "amplitudes": [ + 2, + 2 + ] + }, + "biomes": [ + { + "biome": "hem:blueleaf_plains", + "parameters": { + "temperature": 1, + "humidity": -1, + "altitude": 0.75, + "weirdness": -1.5, + "offset": 0 + } + }, + { + "biome": "hem:blueleaf_hayfever_fields", + "parameters": { + "temperature": 0.5, + "humidity": -0.5, + "altitude": -0.75, + "weirdness": 1.5, + "offset": 0 + } + }, + { + "biome": "hem:heightend_blueleaf_plains", + "parameters": { + "temperature": 0, + "humidity": 0, + "altitude": 0.75, + "weirdness": -1.5, + "offset": 0 + } + }, + { + "biome": "hem:lush_blueleaf_plains", + "parameters": { + "temperature": -0.5, + "humidity": 0.5, + "altitude": -0.75, + "weirdness": 1.5, + "offset": 0 + } + }, + { + "biome": "hem:lush_blueleaf_marsh", + "parameters": { + "temperature": -1, + "humidity": 1, + "altitude": 0.75, + "weirdness": -1.5, + "offset": 0 + } + } + ] + }, + "settings": { + "name": "hem:blueleaf", + "bedrock_roof_position": -10, + "bedrock_floor_position": 0, + "sea_level": 63, + "disable_mob_generation": false, + "default_block": { + "Name": "hem:blueleaf_stone" + }, + "default_fluid": { + "Name": "minecraft:water", + "Properties": { + "level": "0" + } + }, + "noise": { + "min_y": 0, + "height": 256, + "density_factor": 1, + "density_offset": -0.46875, + "size_horizontal": 1, + "size_vertical": 2, + "simplex_surface_noise": true, + "random_density_offset": true, + "island_noise_override": false, + "amplified": false, + "sampling": { + "xz_scale": 1, + "y_scale": 1, + "xz_factor": 80, + "y_factor": 160 + }, + "bottom_slide": { + "target": -30, + "size": 0, + "offset": 0 + }, + "top_slide": { + "target": -10, + "size": 3, + "offset": 0 + } + }, + "structures": { + "structures": { + "minecraft:bastion_remnant": { + "spacing": 27, + "separation": 4, + "salt": 30084232 + }, + "minecraft:buried_treasure": { + "spacing": 1, + "separation": 0, + "salt": 0 + }, + "minecraft:desert_pyramid": { + "spacing": 32, + "separation": 8, + "salt": 14357617 + }, + "minecraft:endcity": { + "spacing": 20, + "separation": 11, + "salt": 10387313 + }, + "minecraft:fortress": { + "spacing": 27, + "separation": 4, + "salt": 30084232 + }, + "minecraft:igloo": { + "spacing": 32, + "separation": 8, + "salt": 14357618 + }, + "minecraft:jungle_pyramid": { + "spacing": 32, + "separation": 8, + "salt": 14357619 + }, + "minecraft:mansion": { + "spacing": 80, + "separation": 20, + "salt": 10387319 + }, + "minecraft:mineshaft": { + "spacing": 1, + "separation": 0, + "salt": 0 + }, + "minecraft:monument": { + "spacing": 32, + "separation": 5, + "salt": 10387313 + }, + "minecraft:nether_fossil": { + "spacing": 2, + "separation": 1, + "salt": 14357921 + }, + "minecraft:ocean_ruin": { + "spacing": 20, + "separation": 8, + "salt": 14357621 + }, + "minecraft:pillager_outpost": { + "spacing": 32, + "separation": 8, + "salt": 165745296 + }, + "minecraft:ruined_portal": { + "spacing": 40, + "separation": 15, + "salt": 34222645 + }, + "minecraft:shipwreck": { + "spacing": 24, + "separation": 4, + "salt": 165745295 + }, + "minecraft:stronghold": { + "spacing": 1, + "separation": 0, + "salt": 0 + }, + "minecraft:swamp_hut": { + "spacing": 32, + "separation": 8, + "salt": 14357620 + }, + "minecraft:village": { + "spacing": 32, + "separation": 8, + "salt": 10387312 + } + } + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/hem/dimension_type/blueleaf.json b/src/main/resources/data/hem/dimension_type/blueleaf.json new file mode 100644 index 0000000..54aac52 --- /dev/null +++ b/src/main/resources/data/hem/dimension_type/blueleaf.json @@ -0,0 +1,17 @@ +{ + "ultrawarm": false, + "natural": true, + "piglin_safe": false, + "respawn_anchor_works": true, + "bed_works": true, + "has_raids": true, + "has_skylight": true, + "has_ceiling": false, + "coordinate_scale": 1, + "ambient_light": 0, + "logical_height": 256, + "infiniburn": "minecraft:infiniburn_overworld", + "min_y": 0, + "height": 256, + "effects": "hem:blueleaf" +} \ No newline at end of file diff --git a/src/main/resources/data/hem/recipes/craft_blue_cobble.json b/src/main/resources/data/hem/recipes/craft_blue_cobble.json new file mode 100644 index 0000000..26c44d8 --- /dev/null +++ b/src/main/resources/data/hem/recipes/craft_blue_cobble.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + { + "item": "hem:blueleaf_stone_gravel" + }, + { + "item": "hem:blueleaf_stone_gravel" + }, + { + "item": "hem:blueleaf_stone_gravel" + }, + { + "item": "hem:blueleaf_stone_gravel" + } + ], + "result": { + "item": "hem:blueleaf_cobblestone", + "count": 2 + } +} \ No newline at end of file diff --git a/src/main/resources/data/hem/recipes/smelt_blue_cobble.json b/src/main/resources/data/hem/recipes/smelt_blue_cobble.json new file mode 100644 index 0000000..36f0841 --- /dev/null +++ b/src/main/resources/data/hem/recipes/smelt_blue_cobble.json @@ -0,0 +1,12 @@ +{ + "group": "hals_exploration_mod", + "type": "minecraft:smelting", + "experience": 1, + "cookingtime": 60, + "ingredient": { + "item": "hem:blueleaf_cobblestone" + }, + "result": { + "item": "hem:blueleaf_stone" + } +} \ No newline at end of file diff --git a/src/main/resources/data/hem/structures/11x11floatingislandundertree.nbt b/src/main/resources/data/hem/structures/11x11floatingislandundertree.nbt new file mode 100644 index 0000000..ff9a389 Binary files /dev/null and b/src/main/resources/data/hem/structures/11x11floatingislandundertree.nbt differ diff --git a/src/main/resources/data/hem/structures/11x11generaltree.nbt b/src/main/resources/data/hem/structures/11x11generaltree.nbt new file mode 100644 index 0000000..959cbf6 Binary files /dev/null and b/src/main/resources/data/hem/structures/11x11generaltree.nbt differ diff --git a/src/main/resources/data/hem/structures/11x17x11chunkmunch.nbt b/src/main/resources/data/hem/structures/11x17x11chunkmunch.nbt new file mode 100644 index 0000000..4151f60 Binary files /dev/null and b/src/main/resources/data/hem/structures/11x17x11chunkmunch.nbt differ diff --git a/src/main/resources/data/hem/structures/15x15_4swamptree.nbt b/src/main/resources/data/hem/structures/15x15_4swamptree.nbt new file mode 100644 index 0000000..29d6cf5 Binary files /dev/null and b/src/main/resources/data/hem/structures/15x15_4swamptree.nbt differ diff --git a/src/main/resources/data/hem/structures/15x15_4swamptree2.nbt b/src/main/resources/data/hem/structures/15x15_4swamptree2.nbt new file mode 100644 index 0000000..78d2403 Binary files /dev/null and b/src/main/resources/data/hem/structures/15x15_4swamptree2.nbt differ diff --git a/src/main/resources/data/hem/structures/15x15generalfloatingisland.nbt b/src/main/resources/data/hem/structures/15x15generalfloatingisland.nbt new file mode 100644 index 0000000..b7e20c0 Binary files /dev/null and b/src/main/resources/data/hem/structures/15x15generalfloatingisland.nbt differ diff --git a/src/main/resources/data/hem/structures/15x15generaltree.nbt b/src/main/resources/data/hem/structures/15x15generaltree.nbt new file mode 100644 index 0000000..7cc6ba6 Binary files /dev/null and b/src/main/resources/data/hem/structures/15x15generaltree.nbt differ diff --git a/src/main/resources/data/hem/structures/15x15lushtree.nbt b/src/main/resources/data/hem/structures/15x15lushtree.nbt new file mode 100644 index 0000000..9b2c3e1 Binary files /dev/null and b/src/main/resources/data/hem/structures/15x15lushtree.nbt differ diff --git a/src/main/resources/data/hem/structures/5x5floatingisland.nbt b/src/main/resources/data/hem/structures/5x5floatingisland.nbt new file mode 100644 index 0000000..c4b3f09 Binary files /dev/null and b/src/main/resources/data/hem/structures/5x5floatingisland.nbt differ diff --git a/src/main/resources/data/hem/structures/5x5floatingislandfragments.nbt b/src/main/resources/data/hem/structures/5x5floatingislandfragments.nbt new file mode 100644 index 0000000..3004a08 Binary files /dev/null and b/src/main/resources/data/hem/structures/5x5floatingislandfragments.nbt differ diff --git a/src/main/resources/data/hem/structures/5x5lushshrub.nbt b/src/main/resources/data/hem/structures/5x5lushshrub.nbt new file mode 100644 index 0000000..f355265 Binary files /dev/null and b/src/main/resources/data/hem/structures/5x5lushshrub.nbt differ diff --git a/src/main/resources/data/hem/structures/5x5neatlushtree.nbt b/src/main/resources/data/hem/structures/5x5neatlushtree.nbt new file mode 100644 index 0000000..83ef7a3 Binary files /dev/null and b/src/main/resources/data/hem/structures/5x5neatlushtree.nbt differ diff --git a/src/main/resources/data/hem/structures/5x5swampstructure.nbt b/src/main/resources/data/hem/structures/5x5swampstructure.nbt new file mode 100644 index 0000000..1a63984 Binary files /dev/null and b/src/main/resources/data/hem/structures/5x5swampstructure.nbt differ diff --git a/src/main/resources/data/hem/structures/anthill.nbt b/src/main/resources/data/hem/structures/anthill.nbt new file mode 100644 index 0000000..f5dfa38 Binary files /dev/null and b/src/main/resources/data/hem/structures/anthill.nbt differ diff --git a/src/main/resources/data/hem/structures/boulder1.nbt b/src/main/resources/data/hem/structures/boulder1.nbt new file mode 100644 index 0000000..53cefcb Binary files /dev/null and b/src/main/resources/data/hem/structures/boulder1.nbt differ diff --git a/src/main/resources/data/hem/structures/boulder2.nbt b/src/main/resources/data/hem/structures/boulder2.nbt new file mode 100644 index 0000000..018ac82 Binary files /dev/null and b/src/main/resources/data/hem/structures/boulder2.nbt differ diff --git a/src/main/resources/data/hem/structures/boulder3.nbt b/src/main/resources/data/hem/structures/boulder3.nbt new file mode 100644 index 0000000..56db00c Binary files /dev/null and b/src/main/resources/data/hem/structures/boulder3.nbt differ diff --git a/src/main/resources/data/hem/structures/boulder4.nbt b/src/main/resources/data/hem/structures/boulder4.nbt new file mode 100644 index 0000000..33e3551 Binary files /dev/null and b/src/main/resources/data/hem/structures/boulder4.nbt differ diff --git a/src/main/resources/data/hem/structures/bush1.nbt b/src/main/resources/data/hem/structures/bush1.nbt new file mode 100644 index 0000000..e73908f Binary files /dev/null and b/src/main/resources/data/hem/structures/bush1.nbt differ diff --git a/src/main/resources/data/hem/structures/bush2.nbt b/src/main/resources/data/hem/structures/bush2.nbt new file mode 100644 index 0000000..c3f2818 Binary files /dev/null and b/src/main/resources/data/hem/structures/bush2.nbt differ diff --git a/src/main/resources/data/hem/structures/giantlilypad.nbt b/src/main/resources/data/hem/structures/giantlilypad.nbt new file mode 100644 index 0000000..03d46d8 Binary files /dev/null and b/src/main/resources/data/hem/structures/giantlilypad.nbt differ diff --git a/src/main/resources/data/hem/structures/lilypad.nbt b/src/main/resources/data/hem/structures/lilypad.nbt new file mode 100644 index 0000000..ea5c0e5 Binary files /dev/null and b/src/main/resources/data/hem/structures/lilypad.nbt differ diff --git a/src/main/resources/data/hem/structures/muncherclosed.nbt b/src/main/resources/data/hem/structures/muncherclosed.nbt new file mode 100644 index 0000000..705ca31 Binary files /dev/null and b/src/main/resources/data/hem/structures/muncherclosed.nbt differ diff --git a/src/main/resources/data/hem/structures/muncheropen.nbt b/src/main/resources/data/hem/structures/muncheropen.nbt new file mode 100644 index 0000000..327546b Binary files /dev/null and b/src/main/resources/data/hem/structures/muncheropen.nbt differ diff --git a/src/main/resources/data/hem/structures/seagrass.nbt b/src/main/resources/data/hem/structures/seagrass.nbt new file mode 100644 index 0000000..b77e0a6 Binary files /dev/null and b/src/main/resources/data/hem/structures/seagrass.nbt differ diff --git a/src/main/resources/data/hem/structures/wall1.nbt b/src/main/resources/data/hem/structures/wall1.nbt new file mode 100644 index 0000000..d0adde6 Binary files /dev/null and b/src/main/resources/data/hem/structures/wall1.nbt differ diff --git a/src/main/resources/data/hem/structures/wall2.nbt b/src/main/resources/data/hem/structures/wall2.nbt new file mode 100644 index 0000000..9be39da Binary files /dev/null and b/src/main/resources/data/hem/structures/wall2.nbt differ diff --git a/src/main/resources/data/hem/structures/wall3.nbt b/src/main/resources/data/hem/structures/wall3.nbt new file mode 100644 index 0000000..9cf88f8 Binary files /dev/null and b/src/main/resources/data/hem/structures/wall3.nbt differ diff --git a/src/main/resources/data/hem/structures/wall4.nbt b/src/main/resources/data/hem/structures/wall4.nbt new file mode 100644 index 0000000..4521b7f Binary files /dev/null and b/src/main/resources/data/hem/structures/wall4.nbt differ diff --git a/src/main/resources/data/hem/structures/wall5.nbt b/src/main/resources/data/hem/structures/wall5.nbt new file mode 100644 index 0000000..5fea145 Binary files /dev/null and b/src/main/resources/data/hem/structures/wall5.nbt differ diff --git a/src/main/resources/data/hem/structures/waterloggedgrass.nbt b/src/main/resources/data/hem/structures/waterloggedgrass.nbt new file mode 100644 index 0000000..932e3d6 Binary files /dev/null and b/src/main/resources/data/hem/structures/waterloggedgrass.nbt differ diff --git a/src/main/resources/data/hem/structures/waterloggedleaves3x3.nbt b/src/main/resources/data/hem/structures/waterloggedleaves3x3.nbt new file mode 100644 index 0000000..df5d30a Binary files /dev/null and b/src/main/resources/data/hem/structures/waterloggedleaves3x3.nbt differ diff --git a/src/main/resources/data/hem/tags/entity_types/hem_altitude_vehicles.json b/src/main/resources/data/hem/tags/entity_types/hem_altitude_vehicles.json new file mode 100644 index 0000000..53bede0 --- /dev/null +++ b/src/main/resources/data/hem/tags/entity_types/hem_altitude_vehicles.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "hem:airboat" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hem/tags/entity_types/hem_heat_vehicles.json b/src/main/resources/data/hem/tags/entity_types/hem_heat_vehicles.json new file mode 100644 index 0000000..828ff6c --- /dev/null +++ b/src/main/resources/data/hem/tags/entity_types/hem_heat_vehicles.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "hem:airboat", + "hem:hot_air_balloon" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hem/tags/entity_types/hem_odometer_vehicles.json b/src/main/resources/data/hem/tags/entity_types/hem_odometer_vehicles.json new file mode 100644 index 0000000..53bede0 --- /dev/null +++ b/src/main/resources/data/hem/tags/entity_types/hem_odometer_vehicles.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "hem:airboat" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hem/tags/entity_types/hem_pressure_vehicles.json b/src/main/resources/data/hem/tags/entity_types/hem_pressure_vehicles.json new file mode 100644 index 0000000..828ff6c --- /dev/null +++ b/src/main/resources/data/hem/tags/entity_types/hem_pressure_vehicles.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "hem:airboat", + "hem:hot_air_balloon" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/hem/tags/entity_types/hem_speed_vehicles.json b/src/main/resources/data/hem/tags/entity_types/hem_speed_vehicles.json new file mode 100644 index 0000000..53bede0 --- /dev/null +++ b/src/main/resources/data/hem/tags/entity_types/hem_speed_vehicles.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "hem:airboat" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/items/stone_tool_materials.json b/src/main/resources/data/minecraft/tags/items/stone_tool_materials.json new file mode 100644 index 0000000..482e894 --- /dev/null +++ b/src/main/resources/data/minecraft/tags/items/stone_tool_materials.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "hem:blueleaf_cobblestone" + ] +} \ No newline at end of file diff --git a/src/main/resources/hem.mixin.json b/src/main/resources/hem.mixin.json new file mode 100644 index 0000000..a482f3c --- /dev/null +++ b/src/main/resources/hem.mixin.json @@ -0,0 +1,12 @@ +{ + "required": true, + "package": "studio.halbear.hem_custom.mixin", + "compatibilityLevel": "JAVA_8", + "client": [ + "CameraMixins" + ], + "injectors": { + "defaultRequire": 1 + }, + "refmap": "hem.mixin-refmap.json" +} diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png new file mode 100644 index 0000000..d4f136c Binary files /dev/null and b/src/main/resources/logo.png differ diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..79a907b --- /dev/null +++ b/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "hem mod resources", + "pack_format": 6 + } +} \ No newline at end of file