Upload source code, added esa crystal, Esa golem glitched

This commit is contained in:
theamazing0 2023-07-21 14:37:21 -04:00
commit 73d8546a95
25 changed files with 3642 additions and 0 deletions

40
.gitignore vendored Normal file
View File

@ -0,0 +1,40 @@
# gradle
.gradle/
build/
out/
classes/
# eclipse
*.launch
# idea
.idea/
*.iml
*.ipr
*.iws
# vscode
.settings/
.vscode/
bin/
.classpath
.project
# macos
*.DS_Store
# fabric
run/
# java
hs_err_*.log
replay_*.log
*.hprof
*.jfr

104
build.gradle Normal file
View File

@ -0,0 +1,104 @@
plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
}
version = project.mod_version
group = project.maven_group
base {
archivesName = project.archives_base_name
}
repositories {
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
}
}
loom {
runs {
// This adds a new gradle task that runs the datagen API: "gradlew runDatagen"
datagen {
inherit server
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.modid=esa"
runDir "build/datagen"
}
}
}
// Add the generated resources to the main source set
sourceSets {
main {
resources {
srcDirs += [
'src/main/generated'
]
}
}
}
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
modImplementation 'software.bernie.geckolib:geckolib-fabric-1.20:4.2'
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}"}
}
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

17
gradle.properties Normal file
View File

@ -0,0 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.9
loader_version=0.14.21
# Mod Properties
mod_version=1.0.0
maven_group=studio.meaningless
archives_base_name=esa
# Dependencies
fabric_version=0.86.0+1.20.1

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

248
gradlew vendored Executable file
View File

@ -0,0 +1,248 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# 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 ;; #(
MSYS* | 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
if ! command -v java >/dev/null 2>&1
then
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
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
gradlew.bat vendored Normal file
View File

@ -0,0 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@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=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@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="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
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 execute
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
: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 %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 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!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

10
settings.gradle Normal file
View File

@ -0,0 +1,10 @@
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
mavenCentral()
gradlePluginPortal()
}
}

View File

@ -0,0 +1,46 @@
package studio.meaningless.esa;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.Items;
import net.minecraft.item.SpawnEggItem;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import studio.meaningless.esa.entity.ModEntities;
import studio.meaningless.esa.entity.custom.EsaGolemEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Esa implements ModInitializer {
// For printing logs
public static final Logger LOGGER = LoggerFactory.getLogger("esa");
// Custom Items
public static final Item ESA_CRYSTAL = Registry.register(Registries.ITEM, new Identifier("esa", "esa_crystal"),
new Item(new FabricItemSettings()));
// Spawn Eggs
public static final Item ESA_GOLEM_SPAWN_EGG = Registry.register(Registries.ITEM,
new Identifier("esa", "esa_golem_spawn_egg"),
new SpawnEggItem(ModEntities.ESA_GOLEM, 0x19BA5D, 0x26158, new FabricItemSettings()));
@Override
public void onInitialize() {
LOGGER.info("Esa Initializing");
// Modify Item Groups
// Add items to Ingredients
ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(content -> {
content.addAfter(Items.AMETHYST_SHARD, ESA_CRYSTAL);
});
// Add Items To Spawn Eggs
ItemGroupEvents.modifyEntriesEvent(ItemGroups.SPAWN_EGGS).register(content -> {
content.add(ESA_GOLEM_SPAWN_EGG);
});
// Register Entities
FabricDefaultAttributeRegistry.register(ModEntities.ESA_GOLEM, EsaGolemEntity.setAttributes());
}
}

View File

@ -0,0 +1,15 @@
package studio.meaningless.esa;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import studio.meaningless.esa.entity.ModEntities;
import studio.meaningless.esa.entity.client.EsaGolemRenderer;
public class EsaClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
EntityRendererRegistry.register(ModEntities.ESA_GOLEM, EsaGolemRenderer::new);
}
}

View File

@ -0,0 +1,11 @@
package studio.meaningless.esa;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
public class EsaDataGenerator implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
}
}

View File

@ -0,0 +1,19 @@
package studio.meaningless.esa.entity;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import studio.meaningless.esa.entity.custom.EsaGolemEntity;
public class ModEntities {
public static final EntityType<EsaGolemEntity> ESA_GOLEM = Registry.register(
Registries.ENTITY_TYPE, new Identifier("esa", "esa_golem"),
FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, EsaGolemEntity::new)
// Add Hitbox for Esa Golem
// TODO fix hitbox size
.dimensions(EntityDimensions.fixed(1f, 1.5f)).build());
}

View File

@ -0,0 +1,35 @@
package studio.meaningless.esa.entity.client;
import net.minecraft.util.Identifier;
import software.bernie.geckolib.model.GeoModel;
import studio.meaningless.esa.entity.custom.EsaGolemEntity;
public class EsaGolemModel extends GeoModel<EsaGolemEntity> {
@Override
public Identifier getModelResource(EsaGolemEntity animatable) {
return new Identifier("esa", "geo/esa_golem.geo.json");
}
@Override
public Identifier getTextureResource(EsaGolemEntity animatable) {
return new Identifier("esa", "textures/entity/esa_golem.png");
}
@Override
public Identifier getAnimationResource(EsaGolemEntity animatable) {
return new Identifier("esa", "animations/esa_golem.animation.json");
}
// TODO Figure out if this is neccessary
// @Override
// public void setCustomAnimations(EsaGolemEntity animatable, long instanceId, AnimationState<EsaGolemEntity> animationState) {
// CoreGeoBone head = getAnimationProcessor().getBone("head");
// if (head != null) {
// EntityModelData entityData = animationState.getData(DataTickets.ENTITY_MODEL_DATA);
// head.setRotX(entityData.headPitch() * MathHelper.RADIANS_PER_DEGREE);
// head.setRotY(entityData.netHeadYaw() * MathHelper.RADIANS_PER_DEGREE);
// }
// }
}

View File

@ -0,0 +1,26 @@
package studio.meaningless.esa.entity.client;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.util.math.MatrixStack;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
import studio.meaningless.esa.entity.custom.EsaGolemEntity;
public class EsaGolemRenderer extends GeoEntityRenderer<EsaGolemEntity> {
public EsaGolemRenderer(EntityRendererFactory.Context renderManager) {
super(renderManager, new EsaGolemModel());
}
// TODO Check if this is necessary
// @Override
// public Identifier getTextureLocation(EsaGolemEntity animatable) {
// return new Identifier("esa", "textures/entity/esa_golem.png");
// }
@Override
public void render(EsaGolemEntity entity, float entityYaw, float partialTick,
MatrixStack poseStack, VertexConsumerProvider bufferSource, int packedLight) {
poseStack.scale(2.5f, 2.5f, 2.5f);
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
}
}

View File

@ -0,0 +1,91 @@
package studio.meaningless.esa.entity.custom;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.ai.goal.ActiveTargetGoal;
import net.minecraft.entity.ai.goal.MeleeAttackGoal;
import net.minecraft.entity.ai.goal.WanderAroundFarGoal;
import net.minecraft.entity.attribute.DefaultAttributeContainer;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.passive.AnimalEntity;
import net.minecraft.entity.passive.PassiveEntity;
// import net.minecraft.entity.mob.ZombieEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.world.World;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.core.animation.AnimatableManager;
import software.bernie.geckolib.core.animation.Animation;
import software.bernie.geckolib.core.animation.AnimationController;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.core.animation.RawAnimation;
import software.bernie.geckolib.core.object.PlayState;
import software.bernie.geckolib.util.GeckoLibUtil;
// public class EsaGolemEntity extends HostileEntity implements GeoEntity {
public class EsaGolemEntity extends AnimalEntity implements GeoEntity {
// public class EsaGolemEntity extends ZombieEntity implements GeoEntity {
private AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
// Set attributes of the mob
public static DefaultAttributeContainer.Builder setAttributes() {
// return HostileEntity.createMobAttributes()
return AnimalEntity.createMobAttributes()
.add(EntityAttributes.GENERIC_MAX_HEALTH, 200.0D)
.add(EntityAttributes.GENERIC_ATTACK_DAMAGE, 10.0f)
.add(EntityAttributes.GENERIC_ATTACK_SPEED, 140.0f) // cooldown between attacks
.add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 3f) // default player is 0.1
// .add(EntityAttributes.GENERIC_MOVEMENT_SPEED, 0.05f) // default player is 0.1
.add(EntityAttributes.GENERIC_FOLLOW_RANGE, 15.0)
.add(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, 0.8) // 1.0 is 100%, 0 is 0%
.add(EntityAttributes.GENERIC_ATTACK_KNOCKBACK, 1.5) // ravager is 1.5
.add(EntityAttributes.GENERIC_ARMOR, 15); // default for iron armor is 15
}
// Add goals (for mob ai)
@Override
protected void initGoals() {
this.goalSelector.add(2, new WanderAroundFarGoal(this, 1.0));
this.goalSelector.add(1, new MeleeAttackGoal(this, 0.5, false));
this.targetSelector.add(1, new ActiveTargetGoal<PlayerEntity>((MobEntity)this, PlayerEntity.class, true));
}
public EsaGolemEntity(EntityType<? extends AnimalEntity> entityType, World world) {
// public EsaGolemEntity(EntityType<? extends ZombieEntity> entityType, World world) {
super(entityType, world);
}
// Geckolib stuff
@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return cache;
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllerRegistrar) {
controllerRegistrar.add(new AnimationController<>(this, "controller", 0, this::predicate));
}
private PlayState predicate(AnimationState tAnimationState) {
if (tAnimationState.isMoving()) {
tAnimationState.getController()
.setAnimation(RawAnimation.begin().then("animation.esa_golem.walk", Animation.LoopType.LOOP));
return PlayState.CONTINUE;
}
tAnimationState.getController()
.setAnimation(RawAnimation.begin().then("animation.esa_golem.idle", Animation.LoopType.LOOP));
return PlayState.CONTINUE;
}
@Override
public PassiveEntity createChild(ServerWorld var1, PassiveEntity var2) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'createChild'");
}
}

View File

@ -0,0 +1,15 @@
package studio.meaningless.esa.mixin;
import net.minecraft.server.MinecraftServer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(MinecraftServer.class)
public class ExampleMixin {
@Inject(at = @At("HEAD"), method = "loadWorld")
private void init(CallbackInfo info) {
// This code is injected into the start of MinecraftServer.loadWorld()V
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,254 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.unknown",
"texture_width": 128,
"texture_height": 128,
"visible_bounds_width": 3,
"visible_bounds_height": 3.5,
"visible_bounds_offset": [0, 1.25, 0]
},
"bones": [
{
"name": "StoneMonster",
"pivot": [-1, 9, 0],
"rotation": [0, -90, 0]
},
{
"name": "body",
"parent": "StoneMonster",
"pivot": [-2, 11, -3]
},
{
"name": "mainbody",
"parent": "body",
"pivot": [0.52296, 5.83807, -3]
},
{
"name": "upperbody",
"parent": "mainbody",
"pivot": [-1.05669, 11.56195, -4],
"cubes": [
{"origin": [-4.05669, 10.56195, -7], "size": [6, 9, 13], "pivot": [-1.05669, 14.56195, -1], "rotation": [0, 0, -10], "uv": [0, 0]},
{"origin": [-5.05669, 10.56195, -6], "size": [1, 7, 11], "pivot": [-1.05669, 14.56195, -1], "rotation": [0, 0, -10], "uv": [21, 30]},
{"origin": [1.94331, 10.56195, -6], "size": [1, 8, 11], "pivot": [-1.05669, 14.56195, -1], "rotation": [0, 0, -10], "uv": [27, 11]}
]
},
{
"name": "head",
"parent": "upperbody",
"pivot": [-2.47704, 17.83807, 0]
},
{
"name": "head2",
"parent": "head",
"pivot": [-6.47704, -1.16193, -3],
"cubes": [
{"origin": [-8.47704, 17.83807, -4], "size": [7, 5, 7], "uv": [40, 0]},
{"origin": [-9.47704, 17.83807, -3], "size": [1, 4, 5], "uv": [34, 30]}
]
},
{
"name": "mouth",
"parent": "head",
"pivot": [-6.47704, -1.16193, -3]
},
{
"name": "jaw",
"parent": "mouth",
"pivot": [-3.47704, 17.83807, -3],
"rotation": [0, 0, -12.5],
"cubes": [
{"origin": [-8.51875, 16.92626, -4], "size": [5, 1, 7], "pivot": [-4.47704, 17.83807, 2], "rotation": [0, 0, 12.5], "uv": [40, 12]}
]
},
{
"name": "lowerbody",
"parent": "mainbody",
"pivot": [1.94331, 6.56195, -3],
"cubes": [
{"origin": [-3.05669, 5.56195, -6], "size": [5, 7, 11], "pivot": [-1.05669, 8.56195, -1], "rotation": [0, 0, 7.5], "uv": [0, 22]},
{"origin": [-4.05669, 6.56195, -5], "size": [1, 4, 9], "pivot": [-1.05669, 8.56195, -1], "rotation": [0, 0, 7.5], "uv": [47, 35]},
{"origin": [1.94331, 6.56195, -5], "size": [1, 5, 9], "pivot": [-1.05669, 8.56195, -1], "rotation": [0, 0, 7.5], "uv": [36, 39]}
]
},
{
"name": "limbs",
"parent": "body",
"pivot": [-7.47704, -1.16193, -3]
},
{
"name": "arms",
"parent": "limbs",
"pivot": [-1.47704, 15.83807, -2]
},
{
"name": "Rarm",
"parent": "arms",
"pivot": [-0.47704, 15.83807, 9]
},
{
"name": "Rupperarm",
"parent": "Rarm",
"pivot": [-1.47704, 17.83807, -7],
"cubes": [
{"origin": [-3.47704, 12.83807, -12], "size": [5, 5, 6], "uv": [45, 24]},
{"origin": [-4.47704, 13.83807, -11], "size": [1, 3, 3], "uv": [10, 53]},
{"origin": [1.52296, 13.83807, -11], "size": [1, 3, 3], "uv": [47, 35]},
{"origin": [-2.47704, 13.83807, -13], "size": [3, 3, 1], "uv": [24, 57]}
]
},
{
"name": "Rarmspikes",
"parent": "Rupperarm",
"pivot": [-7.47704, -1.16193, -3],
"cubes": [
{"origin": [-2.47704, 17.83807, -11], "size": [3, 2, 3], "uv": [43, 55]},
{"origin": [-1.47704, 18.83807, -10], "size": [1, 6, 1], "uv": [40, 12]},
{"origin": [-1.47704, 17.83807, -12], "size": [2, 1, 1], "uv": [0, 31]}
]
},
{
"name": "Rmiddlearm",
"parent": "Rarm",
"pivot": [-0.47704, 11.83807, -9],
"cubes": [
{"origin": [-2.47704, 8.83807, -11], "size": [3, 6, 3], "pivot": [-1.47704, 10.83807, -9], "rotation": [0, 0, 12.5], "uv": [25, 0]},
{"origin": [-3.47704, 9.83807, -10], "size": [1, 2, 1], "pivot": [-1.47704, 10.83807, -9], "rotation": [0, 0, 12.5], "uv": [42, 0]},
{"origin": [0.52296, 9.83807, -10], "size": [1, 2, 1], "pivot": [-1.47704, 10.83807, -9], "rotation": [0, 0, 12.5], "uv": [36, 8]}
]
},
{
"name": "Rhand",
"parent": "Rarm",
"pivot": [-1.47704, 7.83807, -9],
"cubes": [
{"origin": [-3.12636, 3.76696, -11], "size": [2, 6, 3], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [0, 53]},
{"origin": [-2.12636, 4.76696, -12], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [36, 58]},
{"origin": [-1.12636, 4.76696, -10], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [58, 35]},
{"origin": [-2.12636, 4.76696, -8], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [32, 58]},
{"origin": [-4.12636, 4.76696, -10], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [55, 57]}
]
},
{
"name": "Larm",
"parent": "arms",
"pivot": [-0.47704, 15.83807, 9]
},
{
"name": "Lupperarm",
"parent": "Larm",
"pivot": [-1.47704, 15.83807, 8],
"cubes": [
{"origin": [-3.47704, 12.83807, 5], "size": [5, 5, 6], "uv": [0, 42]},
{"origin": [-4.47704, 13.83807, 7], "size": [1, 3, 3], "uv": [37, 0]},
{"origin": [1.52296, 13.83807, 7], "size": [1, 3, 3], "uv": [21, 27]},
{"origin": [-2.47704, 13.83807, 11], "size": [3, 3, 1], "uv": [51, 20]}
]
},
{
"name": "Larmspikes",
"parent": "Lupperarm",
"pivot": [-7.47704, -1.16193, -3],
"cubes": [
{"origin": [-2.47704, 17.83807, 7], "size": [3, 2, 3], "uv": [34, 53]},
{"origin": [-0.47704, 19.83807, 9], "size": [1, 2, 1], "uv": [47, 41]},
{"origin": [-1.47704, 18.83807, 8], "size": [1, 7, 1], "uv": [0, 40]},
{"origin": [-1.47704, 17.83807, 10], "size": [2, 1, 1], "uv": [21, 25]}
]
},
{
"name": "Lmiddlearm",
"parent": "Larm",
"pivot": [-1.47704, 10.83807, 8],
"cubes": [
{"origin": [-2.47704, 8.83807, 7], "size": [3, 6, 3], "pivot": [-1.47704, 10.83807, -9], "rotation": [0, 0, 12.5], "uv": [0, 0]},
{"origin": [-3.47704, 9.83807, 8], "size": [1, 2, 1], "pivot": [-1.47704, 10.83807, -9], "rotation": [0, 0, 12.5], "uv": [7, 22]},
{"origin": [0.52296, 9.83807, 8], "size": [1, 2, 1], "pivot": [-1.47704, 10.83807, -9], "rotation": [0, 0, 12.5], "uv": [9, 0]}
]
},
{
"name": "Lhand",
"parent": "Larm",
"pivot": [-1.47704, 7.83807, 8],
"cubes": [
{"origin": [-3.12636, 3.76696, 7], "size": [2, 6, 3], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [0, 22]},
{"origin": [-4.12636, 4.76696, 8], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [16, 44]},
{"origin": [-2.12636, 4.76696, 10], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [41, 30]},
{"origin": [-2.12636, 4.76696, 6], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [16, 40]},
{"origin": [-1.12636, 4.76696, 8], "size": [1, 3, 1], "pivot": [-1.47704, 7.83807, -9], "rotation": [0, 0, 30], "uv": [34, 30]}
]
},
{
"name": "legs",
"parent": "limbs",
"pivot": [-7.47704, -1.16193, -3]
},
{
"name": "Rleg",
"parent": "legs",
"pivot": [-0.47704, 5.83807, -3]
},
{
"name": "Rupperleg",
"parent": "Rleg",
"pivot": [-0.47704, 3.83807, -3],
"cubes": [
{"origin": [-2.47704, 1.83807, -5], "size": [4, 4, 4], "pivot": [-0.47704, 3.83807, -3], "rotation": [0, 0, 12.5], "uv": [52, 49]},
{"origin": [-3.47704, 2.83807, -4], "size": [1, 1, 2], "pivot": [-0.47704, 3.83807, -3], "rotation": [0, 0, 12.5], "uv": [30, 48]},
{"origin": [1.52296, 2.83807, -4], "size": [1, 1, 2], "pivot": [-0.47704, 3.83807, -3], "rotation": [0, 0, 12.5], "uv": [47, 41]}
]
},
{
"name": "Rlowerleg",
"parent": "Rleg",
"pivot": [-1.47704, 0.83807, -3],
"cubes": [
{"origin": [-1.47704, -0.16193, -4], "size": [2, 3, 2], "pivot": [-1.47704, 0.83807, -3], "rotation": [0, 0, -15], "uv": [16, 57]}
]
},
{
"name": "Rfoot",
"parent": "Rleg",
"pivot": [0.52296, -0.16193, -3],
"cubes": [
{"origin": [-2.47704, -0.16193, -4], "size": [3, 1, 2], "uv": [25, 9]}
]
},
{
"name": "Lleg",
"parent": "legs",
"pivot": [1.52296, 5.83807, 1]
},
{
"name": "Lupperleg",
"parent": "Lleg",
"pivot": [-0.43151, 3.83807, -2.91371],
"cubes": [
{"origin": [-2.43151, 1.83807, 0.08629], "size": [4, 4, 4], "pivot": [-0.43151, 3.83807, -2.91371], "rotation": [0, 0, 12.5], "uv": [18, 49]},
{"origin": [-3.43151, 2.83807, 1.08629], "size": [1, 1, 2], "pivot": [-0.43151, 3.83807, -2.91371], "rotation": [0, 0, 12.5], "uv": [34, 0]},
{"origin": [1.56849, 2.83807, 1.08629], "size": [1, 1, 2], "pivot": [-0.43151, 3.83807, -2.91371], "rotation": [0, 0, 12.5], "uv": [21, 22]}
]
},
{
"name": "Llowerlleg",
"parent": "Lleg",
"pivot": [-1.43151, 0.83807, -2.91371],
"cubes": [
{"origin": [-1.43151, -0.16193, 1.08629], "size": [2, 3, 2], "pivot": [-1.43151, 0.83807, -2.91371], "rotation": [0, 0, -15], "uv": [57, 12]}
]
},
{
"name": "Lfoot",
"parent": "Lleg",
"pivot": [0.56849, -1.16193, -2.91371],
"cubes": [
{"origin": [-2.43151, -0.16193, 1.08629], "size": [3, 1, 2], "uv": [0, 9]}
]
}
]
}
]
}

View File

@ -0,0 +1,4 @@
{
"item.esa.esa_crystal": "Esa Crystal",
"item.esa.esa_golem_spawn_egg": "Esa Golem Spawn Egg"
}

View File

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "esa:item/esa_crystal"
}
}

View File

@ -0,0 +1,3 @@
{
"parent": "item/template_spawn_egg"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

View File

@ -0,0 +1,11 @@
{
"required": true,
"package": "studio.meaningless.esa.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
}
}

View File

@ -0,0 +1,41 @@
{
"schemaVersion": 1,
"id": "esa",
"version": "${version}",
"name": "Esa",
"description": "This is an example description! Tell everyone what your mod is about!",
"authors": [
"Me!"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "MIT",
"icon": "assets/esa/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"studio.meaningless.esa.Esa"
],
"client": [
"studio.meaningless.esa.EsaClient"
],
"fabric-datagen": [
"studio.meaningless.esa.EsaModDataGenerator"
]
},
"mixins": [
"esa.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.21",
"minecraft": "~1.20.1",
"java": ">=17",
"fabric-api": "*",
"geckolib": ">=4.2"
},
"suggests": {
"another-mod": "*"
}
}