Skip to content

Commit

Permalink
feat: update to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sekwah41 committed May 5, 2022
1 parent b68e7d3 commit b4b4354
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 24 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<SubstitutionLogEntity> {
public class SubstitutionLogRenderer extends MobRenderer<SubstitutionLogEntity, SubstitutionLogModel<SubstitutionLogEntity>> {
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;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {


Expand Down Expand Up @@ -45,7 +44,7 @@ public Direction copy(Direction value) {
}
};

private static final DeferredRegister<DataSerializerEntry> DATA_SERIALIZERS = DeferredRegister.create(ForgeRegistries.DATA_SERIALIZERS, MOD_ID);
private static final DeferredRegister<DataSerializerEntry> DATA_SERIALIZERS = DeferredRegister.create(ForgeRegistries.Keys.DATA_SERIALIZERS, NarutoMod.MOD_ID);

public static final RegistryObject<DataSerializerEntry> ATTACH_FACE_ENTRY = DATA_SERIALIZERS.register("attach_face", () -> new DataSerializerEntry(ATTACH_FACE));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

public class SubstitutionLogEntity extends Mob {

private int aliveTicks = 20;

public SubstitutionLogEntity(EntityType<SubstitutionLogEntity> p_21368_, Level p_21369_) {
super(p_21368_, p_21369_);
}
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -17,16 +18,20 @@ public class NarutoRegistries {
private static IForgeRegistry<Ability> ABILITY;
private static IForgeRegistry<Clans> CLANS;

public static void init(RegistryEvent.NewRegistry event) {
public static void init(NewRegistryEvent event) {
RegistryBuilder<Ability> 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> clans = new RegistryBuilder<>();
clans.setName(new ResourceLocation(NarutoMod.MOD_ID, "clans"));
clans.setType(Clans.class);
CLANS = clans.create();
event.create(clans, (registry) -> {
CLANS = registry;
});

}
}
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit b4b4354

Please sign in to comment.