diff --git a/build.gradle b/build.gradle index 8a00b557..fe92f9ab 100644 --- a/build.gradle +++ b/build.gradle @@ -155,12 +155,12 @@ dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.18.1-39.0.10' + minecraft 'net.minecraftforge:forge:1.18.2-40.0.24' implementation 'org.spongepowered:mixin:0.8.5' annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' - implementation fg.deobf("com.sekwah:SekCLib:0.2.0") + implementation fg.deobf("com.sekwah:SekCLib:0.3.0") // Trick intellij to allow for better editing in here for the discord task // compile "org.apache.httpcomponents:httpmime:4.5.13" //implementation fg.deobf("curse.maven:torohealth-damage-indicators-245733:3556931") diff --git a/src/main/java/com/sekwah/narutomod/client/renderer/entity/SubstitutionLogRenderer.java b/src/main/java/com/sekwah/narutomod/client/renderer/entity/SubstitutionLogRenderer.java index c3995fd9..b94efcb4 100644 --- a/src/main/java/com/sekwah/narutomod/client/renderer/entity/SubstitutionLogRenderer.java +++ b/src/main/java/com/sekwah/narutomod/client/renderer/entity/SubstitutionLogRenderer.java @@ -12,34 +12,30 @@ import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.EntityRenderer; import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.client.renderer.texture.OverlayTexture; import net.minecraft.core.BlockPos; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.monster.Slime; -public class SubstitutionLogRenderer extends EntityRenderer { +public class SubstitutionLogRenderer extends MobRenderer> { public static final ResourceLocation SUBSTITUTION_LOG = new ResourceLocation("narutomod", "textures/entity/jutsu/substitution_log.png"); - private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(SUBSTITUTION_LOG); - private final SubstitutionLogModel model; public SubstitutionLogRenderer(EntityRendererProvider.Context manager) { - super(manager); - this.model = new SubstitutionLogModel(manager.bakeLayer(SubstitutionLogModel.LAYER_LOCATION)); + super(manager, new SubstitutionLogModel(manager.bakeLayer(SubstitutionLogModel.LAYER_LOCATION)), 0.5F); + this.shadowRadius = 0.5F; } - @Override - public void render(SubstitutionLogEntity substitutionLogEntity, float p_114486_, float partial, PoseStack poseStack, MultiBufferSource multiBufferSource, int p_114490_) { - VertexConsumer vertexconsumer = multiBufferSource.getBuffer(RENDER_TYPE); - poseStack.pushPose(); - poseStack.scale(-1.0F, -1.0F, 1.0F); - poseStack.translate(0.0D, (double)-1.501F, 0.0D); - this.model.renderToBuffer(poseStack, vertexconsumer, p_114490_, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); - poseStack.popPose(); - super.render(substitutionLogEntity, p_114486_, partial, poseStack, multiBufferSource, p_114490_); + public void render(SubstitutionLogEntity p_115976_, float p_115977_, float p_115978_, PoseStack p_115979_, MultiBufferSource p_115980_, int p_115981_) { + this.shadowRadius = 0.3F; + super.render(p_115976_, p_115977_, p_115978_, p_115979_, p_115980_, p_115981_); } @Override - public ResourceLocation getTextureLocation(SubstitutionLogEntity p_114482_) { + public ResourceLocation getTextureLocation(SubstitutionLogEntity entity) { return SUBSTITUTION_LOG; } diff --git a/src/main/java/com/sekwah/narutomod/entity/NarutoDataSerialisers.java b/src/main/java/com/sekwah/narutomod/entity/NarutoDataSerialisers.java index 880ee976..ccf2fac6 100644 --- a/src/main/java/com/sekwah/narutomod/entity/NarutoDataSerialisers.java +++ b/src/main/java/com/sekwah/narutomod/entity/NarutoDataSerialisers.java @@ -1,5 +1,6 @@ package com.sekwah.narutomod.entity; +import com.sekwah.narutomod.NarutoMod; import com.sekwah.narutomod.util.StateUtils; import net.minecraft.core.Direction; import net.minecraft.network.FriendlyByteBuf; @@ -11,8 +12,6 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; -import static com.sekwah.narutomod.NarutoMod.MOD_ID; - public class NarutoDataSerialisers { @@ -45,7 +44,7 @@ public Direction copy(Direction value) { } }; - private static final DeferredRegister DATA_SERIALIZERS = DeferredRegister.create(ForgeRegistries.DATA_SERIALIZERS, MOD_ID); + private static final DeferredRegister DATA_SERIALIZERS = DeferredRegister.create(ForgeRegistries.Keys.DATA_SERIALIZERS, NarutoMod.MOD_ID); public static final RegistryObject ATTACH_FACE_ENTRY = DATA_SERIALIZERS.register("attach_face", () -> new DataSerializerEntry(ATTACH_FACE)); diff --git a/src/main/java/com/sekwah/narutomod/entity/SubstitutionLogEntity.java b/src/main/java/com/sekwah/narutomod/entity/SubstitutionLogEntity.java index d7b680c9..4e558c7e 100644 --- a/src/main/java/com/sekwah/narutomod/entity/SubstitutionLogEntity.java +++ b/src/main/java/com/sekwah/narutomod/entity/SubstitutionLogEntity.java @@ -12,6 +12,8 @@ public class SubstitutionLogEntity extends Mob { + private int aliveTicks = 20; + public SubstitutionLogEntity(EntityType p_21368_, Level p_21369_) { super(p_21368_, p_21369_); } @@ -23,6 +25,15 @@ public boolean hurt(DamageSource pSource, float pAmount) { return super.hurt(pSource, pAmount); } + @Override + public void tick() { + super.tick(); + this.aliveTicks--; + if(this.aliveTicks <= 0) { + this.kill(); + } + } + public SubstitutionLogEntity(Level worldIn) { this(NarutoEntities.SUBSTITUTION_LOG.get(), worldIn); } diff --git a/src/main/java/com/sekwah/narutomod/registries/NarutoRegistries.java b/src/main/java/com/sekwah/narutomod/registries/NarutoRegistries.java index fceeb6c3..707368fc 100644 --- a/src/main/java/com/sekwah/narutomod/registries/NarutoRegistries.java +++ b/src/main/java/com/sekwah/narutomod/registries/NarutoRegistries.java @@ -6,6 +6,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.registries.IForgeRegistry; +import net.minecraftforge.registries.NewRegistryEvent; import net.minecraftforge.registries.RegistryBuilder; /** @@ -17,16 +18,20 @@ public class NarutoRegistries { private static IForgeRegistry ABILITY; private static IForgeRegistry CLANS; - public static void init(RegistryEvent.NewRegistry event) { + public static void init(NewRegistryEvent event) { RegistryBuilder abilities = new RegistryBuilder<>(); abilities.setName(new ResourceLocation(NarutoMod.MOD_ID, "abilities")); abilities.setType(Ability.class); - ABILITY = abilities.create(); + event.create(abilities, (registry) -> { + ABILITY = registry; + }); RegistryBuilder clans = new RegistryBuilder<>(); clans.setName(new ResourceLocation(NarutoMod.MOD_ID, "clans")); clans.setType(Clans.class); - CLANS = clans.create(); + event.create(clans, (registry) -> { + CLANS = registry; + }); } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index f502046b..007e501e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -32,6 +32,6 @@ A mod that adds new items and other features to the game that are from/based on [[dependencies.narutomod]] modId="sekclib" mandatory=true - versionRange="[0.2.0,)" + versionRange="[0.3.0,)" ordering="NONE" side="BOTH"