diff --git a/common/src/main/java/net/hydra/jojomod/client/ClientUtil.java b/common/src/main/java/net/hydra/jojomod/client/ClientUtil.java index c9f409aef..b9f1cb80a 100644 --- a/common/src/main/java/net/hydra/jojomod/client/ClientUtil.java +++ b/common/src/main/java/net/hydra/jojomod/client/ClientUtil.java @@ -7,6 +7,8 @@ import net.hydra.jojomod.access.IPermaCasting; import net.hydra.jojomod.access.IPlayerEntity; import net.hydra.jojomod.client.gui.*; +import net.hydra.jojomod.entity.stand.RattEntity; +import net.hydra.jojomod.mixin.StandUserEntity; import net.zetalasis.client.shader.D4CShaderFX; import net.zetalasis.client.shader.callback.RenderCallbackRegistry; import net.hydra.jojomod.entity.D4CCloneEntity; @@ -167,6 +169,15 @@ public static int getOutlineColor(Entity entity) { if (player != null) { StandUser standComp = ((StandUser) player); StandPowers powers = standComp.roundabout$getStandPowers(); + if (entity instanceof RattEntity) { + if (((StandEntity) entity).getUser() != null) { + if (((StandEntity) entity).getUser().isCrouching()) { + return 12978493; + } + } + } + + if (powers.getGoBeyondTarget() != null && powers.getGoBeyondTarget().is(entity)) { return 10978493; } else if (powers.isPiloting()) { diff --git a/common/src/main/java/net/hydra/jojomod/client/ModStrayModels.java b/common/src/main/java/net/hydra/jojomod/client/ModStrayModels.java index 97f1d50b8..534ca73bf 100644 --- a/common/src/main/java/net/hydra/jojomod/client/ModStrayModels.java +++ b/common/src/main/java/net/hydra/jojomod/client/ModStrayModels.java @@ -1,9 +1,12 @@ package net.hydra.jojomod.client; +import net.hydra.jojomod.client.models.stand.RattModel; import net.hydra.jojomod.client.models.worn_stand.HeyYaModel; +import net.hydra.jojomod.client.models.worn_stand.RattShoulderModel; import net.hydra.jojomod.client.models.worn_stand.SoftAndWetShootingArmModel; public class ModStrayModels { public static SoftAndWetShootingArmModel SHOOTING_ARM; public static HeyYaModel HEY_YA; + public static RattShoulderModel RATT_SHOULDER; } diff --git a/common/src/main/java/net/hydra/jojomod/client/StandIcons.java b/common/src/main/java/net/hydra/jojomod/client/StandIcons.java index a37327073..39af52421 100644 --- a/common/src/main/java/net/hydra/jojomod/client/StandIcons.java +++ b/common/src/main/java/net/hydra/jojomod/client/StandIcons.java @@ -26,6 +26,8 @@ public class StandIcons { public static final ResourceLocation IN_BUBBLE_OVERLAY = new ResourceLocation(Roundabout.MOD_ID, "textures/misc/in_bubble.png"); + public static final ResourceLocation RATT_SCOPE_OVERLAY = new ResourceLocation(Roundabout.MOD_ID, + "textures/misc/ratt_scope.png"); public static final ResourceLocation NO_FACE_LAYER = new ResourceLocation(Roundabout.MOD_ID, "textures/entity/other_layers/faceless.png"); public static final ResourceLocation STONE_HEAD_OVERLAY = new ResourceLocation(Roundabout.MOD_ID, diff --git a/common/src/main/java/net/hydra/jojomod/client/models/layers/ModEntityRendererClient.java b/common/src/main/java/net/hydra/jojomod/client/models/layers/ModEntityRendererClient.java index c66e97059..bac415674 100644 --- a/common/src/main/java/net/hydra/jojomod/client/models/layers/ModEntityRendererClient.java +++ b/common/src/main/java/net/hydra/jojomod/client/models/layers/ModEntityRendererClient.java @@ -16,6 +16,7 @@ public class ModEntityRendererClient { public static final ModelLayerLocation MAGICIANS_RED_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "magicians_red"), "main"); public static final ModelLayerLocation MAGICIANS_RED_OVA_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "magicians_red_ova"), "main"); public static final ModelLayerLocation D4C_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "d4c"), "main"); + public static final ModelLayerLocation RATT_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "ratt"), "main"); public static final ModelLayerLocation SOFT_AND_WET_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "soft_and_wet"), "main"); public static final ModelLayerLocation SOFT_AND_WET_KING_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "soft_and_wet_king"), "main"); public static final ModelLayerLocation SOFT_AND_WET_DROWNED_LAYER = new ModelLayerLocation(new ResourceLocation(Roundabout.MOD_ID, "soft_and_wet_drowned"), "main"); diff --git a/common/src/main/java/net/hydra/jojomod/client/models/layers/RattShoulderLayer.java b/common/src/main/java/net/hydra/jojomod/client/models/layers/RattShoulderLayer.java new file mode 100644 index 000000000..4b25336bd --- /dev/null +++ b/common/src/main/java/net/hydra/jojomod/client/models/layers/RattShoulderLayer.java @@ -0,0 +1,150 @@ +package net.hydra.jojomod.client.models.layers; + +import com.google.common.collect.Maps; +import com.mojang.blaze3d.vertex.PoseStack; +import net.hydra.jojomod.Roundabout; +import net.hydra.jojomod.access.IPlayerEntity; +import net.hydra.jojomod.client.ClientUtil; +import net.hydra.jojomod.client.ModStrayModels; +import net.hydra.jojomod.entity.visages.JojoNPC; +import net.hydra.jojomod.event.powers.StandUser; +import net.hydra.jojomod.event.powers.TimeStop; +import net.hydra.jojomod.item.MaskItem; +import net.hydra.jojomod.mixin.PlayerEntity; +import net.hydra.jojomod.stand.powers.PowersHeyYa; +import net.hydra.jojomod.stand.powers.PowersRatt; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.EntityRenderDispatcher; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.client.renderer.entity.LivingEntityRenderer; +import net.minecraft.client.renderer.entity.layers.RenderLayer; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import org.joml.Quaternionf; +import org.joml.Vector3f; + +import java.util.Map; + +public class RattShoulderLayer> extends RenderLayer { + private static final Map ARMOR_LOCATION_CACHE = Maps.newHashMap(); + private final EntityRenderDispatcher dispatcher; + public RattShoulderLayer(EntityRendererProvider.Context context, LivingEntityRenderer livingEntityRenderer) { + super(livingEntityRenderer); + this.dispatcher = context.getEntityRenderDispatcher(); + } + + float scale = 1; + @Override + public void render(PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, T entity, float var5, float var6, float var7, float partialTicks, float var9, float var10) { + if (ClientUtil.canSeeStands(ClientUtil.getPlayer())) { + LivingEntity livent = entity; + if (!entity.isInvisible()) { + if (entity != null) { + if (entity instanceof JojoNPC jnp && jnp.host != null) { + livent = jnp.host; + } + StandUser user = ((StandUser) livent); + int heyTicks = user.roundabout$getRattShoulderVanishTicks(); + boolean hasHeyYaOut = (user.roundabout$getActive() && user.roundabout$getStandPowers() instanceof PowersRatt); + /* all of this code is copied from hey ya! */ + if (heyTicks > 0 || hasHeyYaOut) { + byte skin = user.roundabout$getStandSkin(); + if (user.roundabout$getLastStandSkin() != skin){ + user.roundabout$setLastStandSkin(skin); + heyTicks = 0; + user.roundabout$setRattShoulderVanishTicks(0); + } + + float heyFull = 0; + float fixedPartial = partialTicks - (int) partialTicks; + if (((TimeStop)entity.level()).CanTimeStopEntity(entity)){ + fixedPartial = 0; + } + if (hasHeyYaOut){ + heyFull = heyTicks+fixedPartial; + heyFull = Math.min(heyFull/10,1f); + } else { + heyFull = heyTicks-fixedPartial; + heyFull = Math.max(heyFull/10,0); + } + poseStack.pushPose(); + + if (hasHeyYaOut) { + /* idlePos == 0 is shoulder, 1 is head */ + if (((PowersRatt) user.roundabout$getStandPowers()).scopeLevel != 0) { + getParentModel().rightArm.translateAndRotate(poseStack); + poseStack.scale(0.35F, 0.35F, 0.35F); + poseStack.rotateAround(new Quaternionf().fromAxisAngleDeg(new Vector3f(1, 0, 0), -90), 0, 0, -1); + poseStack.translate(0.35F, -1.3F, 0.6F); + // poseStack.translate(0.3F, 0F, -3F); + } else { + if (user.roundabout$getIdlePos() == 0) { + getParentModel().body.translateAndRotate(poseStack); + poseStack.translate(0.35F, -0.4F, 0F); + /* additional check for armor, cancels the check if you have a visage */ + boolean bl1 = false; + if (user instanceof Player) { + ItemStack chestplate = ((Player) user).getInventory().getArmor(2); + String name = chestplate.getItem().toString(); + if (!name.equals("air") && !getUserVisage(((Entity) user))) { + poseStack.translate(0.0F, -0.1F, 0.0F); + bl1 = true; + } + } + if (!bl1) { + poseStack.translate(0.05F, 0.05F, 0.0F); + poseStack.rotateAround(new Quaternionf().fromAxisAngleDeg(new Vector3f(0, 0, 1), 10), 0, 0, 0); + } + } else { + getParentModel().head.translateAndRotate(poseStack); + poseStack.translate(0F, -0.9F, 0F); + /* additional check for armor, cancels the check if you have a visage */ + if (user instanceof Player) { + ItemStack chestplate = ((Player) user).getInventory().getArmor(3); + String name = chestplate.getItem().toString(); + if (!name.equals("air") && !getUserVisage(((Entity) user))) { + poseStack.translate(0.0F, -0.1F, 0.0F); + } + } + } + poseStack.scale(0.3F, 0.3F, 0.3F); + } + // The first value goes to the right (negative) and left (positive) + // The second value is correlated with up (negative) and down (positive) + // the third is further and closer, positive is back negative is forward + } + + boolean isHurt = livent.hurtTime > 0; + float r = isHurt ? 1.0F : 1.0F; + float g = isHurt ? 0.0F : 1.0F; + float b = isHurt ? 0.0F : 1.0F; + if (user.roundabout$getRattShoulderVanishTicks() != 0) { + ModStrayModels.RATT_SHOULDER.render(livent, partialTicks, poseStack, bufferSource, packedLight, + r, g, b, heyFull, skin); + } + poseStack.popPose(); + + } + } + } + } + } + + public boolean getUserVisage(Entity entity) { + if (entity instanceof Player play) { + IPlayerEntity pl = ((IPlayerEntity) play); + ItemStack visage = pl.roundabout$getMaskSlot(); + if (visage != null && !visage.isEmpty()) { + if (visage.getItem() instanceof MaskItem MI) { + return true; + } + } + } + return false; + } +} diff --git a/common/src/main/java/net/hydra/jojomod/client/models/stand/RattModel.java b/common/src/main/java/net/hydra/jojomod/client/models/stand/RattModel.java new file mode 100644 index 000000000..4eef9db3c --- /dev/null +++ b/common/src/main/java/net/hydra/jojomod/client/models/stand/RattModel.java @@ -0,0 +1,150 @@ +package net.hydra.jojomod.client.models.stand;// Made with Blockbench 4.12.5 +// Exported for Minecraft version 1.17 or later with Mojang mappings +// Paste this class into your mod and generate all required imports + + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.hydra.jojomod.Roundabout; +import net.hydra.jojomod.client.ClientUtil; +import net.hydra.jojomod.client.models.layers.animations.HeyYaAnimations; +import net.hydra.jojomod.client.models.stand.StandModel; +import net.hydra.jojomod.entity.stand.JusticeEntity; +import net.hydra.jojomod.entity.stand.RattEntity; +import net.hydra.jojomod.event.powers.StandUser; +import net.hydra.jojomod.event.powers.TimeStop; +import net.hydra.jojomod.stand.powers.PowersHeyYa; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.phys.Vec2; +import net.minecraft.world.phys.Vec3; + +public class RattModel extends StandModel { + // This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor +// public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation("modid", "ratt"), "main"); + private final ModelPart stand; + private final ModelPart head; + private final ModelPart Neck; + private final ModelPart Jaw; + private final ModelPart Barrel; + private final ModelPart IDK; + private final ModelPart LeftLeg; + private final ModelPart RightLeg; + + public RattModel(ModelPart root) { + this.stand = root.getChild("stand"); + this.head = this.stand.getChild("Rotating"); + this.Neck = this.head.getChild("Neck"); + this.Jaw = this.head.getChild("Jaw"); + this.Barrel = this.head.getChild("Barrel"); + this.IDK = this.head.getChild("IDK"); + this.LeftLeg = this.stand.getChild("LeftLeg"); + this.RightLeg = this.stand.getChild("RightLeg"); + } + + + + public static LayerDefinition getTexturedModelData() { + MeshDefinition meshdefinition = new MeshDefinition(); + PartDefinition partdefinition = meshdefinition.getRoot(); + + PartDefinition stand = partdefinition.addOrReplaceChild("stand", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F)); + + PartDefinition Rotating = stand.addOrReplaceChild("Rotating", CubeListBuilder.create().texOffs(0, 19).addBox(-3.0F, -9.0F, -3.5F, 6.0F, 8.0F, 6.0F, new CubeDeformation(0.0F)) + .texOffs(48, 24).addBox(-1.0F, -6.0F, -4.65F, 2.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(0, 46).addBox(-2.0F, -7.0F, -4.0F, 4.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)) + .texOffs(48, 18).addBox(-1.5F, -4.5F, 1.0F, 3.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -10.0F, 0.5F)); + + PartDefinition Neck = Rotating.addOrReplaceChild("Neck", CubeListBuilder.create().texOffs(38, 0).addBox(-3.5F, -2.0F, -1.0F, 7.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(38, 8).addBox(-3.0F, -2.1F, 0.0F, 6.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)) + .texOffs(42, 36).addBox(-3.0F, -1.7F, 1.75F, 6.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(38, 5).addBox(-5.0F, -2.25F, 0.0F, 10.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 1.0F, -0.5F)); + + PartDefinition Jaw = Rotating.addOrReplaceChild("Jaw", CubeListBuilder.create(), PartPose.offset(0.0F, 1.0F, -0.5F)); + + PartDefinition cube_r1 = Jaw.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(20, 39).addBox(-1.0F, -1.0F, 1.0F, 1.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)) + .texOffs(18, 39).addBox(0.5F, -1.0F, 1.0F, 1.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)) + .texOffs(16, 39).addBox(1.75F, -1.0F, 1.0F, 1.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)) + .texOffs(38, 18).addBox(-2.25F, -1.0F, 1.0F, 1.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.25F, 0.25F, -4.25F, 0.48F, 0.0F, 0.0F)); + + PartDefinition Jaw_r1 = Jaw.addOrReplaceChild("Jaw_r1", CubeListBuilder.create().texOffs(0, 39).addBox(-2.0F, -2.0F, -3.0F, 4.0F, 3.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.25F, 0.48F, 0.0F, 0.0F)); + + PartDefinition Jaw_r2 = Jaw.addOrReplaceChild("Jaw_r2", CubeListBuilder.create().texOffs(0, 33).addBox(-3.0F, -2.0F, -3.0F, 6.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.48F, 0.0F, 0.0F)); + + PartDefinition Barrel = Rotating.addOrReplaceChild("Barrel", CubeListBuilder.create().texOffs(24, 31).addBox(-0.5F, 1.25F, 0.0F, 1.0F, 1.0F, 8.0F, new CubeDeformation(0.0F)) + .texOffs(24, 19).addBox(-1.0F, -0.75F, 0.0F, 2.0F, 2.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, -3.0F, 2.0F)); + + PartDefinition Berrel2 = Barrel.addOrReplaceChild("Berrel2", CubeListBuilder.create().texOffs(1, 1).addBox(-0.5F, -0.5F, -14.0F, 1.0F, 1.0F, 17.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.25F, 10.0F)); + + PartDefinition IDK = Rotating.addOrReplaceChild("IDK", CubeListBuilder.create().texOffs(20, 33).addBox(-0.5F, 0.5F, -1.0F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)) + .texOffs(20, 37).addBox(-0.5F, 2.5F, 0.0F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); + + PartDefinition LeftLeg = stand.addOrReplaceChild("LeftLeg", CubeListBuilder.create(), PartPose.offset(4.0F, -10.0F, 0.75F)); + + PartDefinition Plate_r1 = LeftLeg.addOrReplaceChild("Plate_r1", CubeListBuilder.create().texOffs(48, 39).addBox(0.0F, -3.0F, -1.0F, 1.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.25F, 1.75F, -0.75F, 0.0F, 0.0F, -0.3491F)); + + PartDefinition LB = LeftLeg.addOrReplaceChild("LB", CubeListBuilder.create(), PartPose.offsetAndRotation(-0.25F, 1.0F, 1.25F, 0.0F, -1.5708F, 0.0F)); + + PartDefinition LBLegIsolate = LB.addOrReplaceChild("LBLegIsolate", CubeListBuilder.create(), PartPose.offset(0.15F, 0.5F, -0.5F)); + + PartDefinition LBLeg_r1 = LBLegIsolate.addOrReplaceChild("LBLeg_r1", CubeListBuilder.create().texOffs(32, 45).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 10.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.49F, -0.1925F, -0.3444F)); + + PartDefinition LBPlate = LB.addOrReplaceChild("LBPlate", CubeListBuilder.create().texOffs(32, 40).addBox(-1.75F, -0.75F, -2.45F, 4.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(2.75F, 6.75F, -3.65F)); + + PartDefinition LF = LeftLeg.addOrReplaceChild("LF", CubeListBuilder.create(), PartPose.offset(0.0F, 0.5F, -0.65F)); + + PartDefinition LFLegIsolate = LF.addOrReplaceChild("LFLegIsolate", CubeListBuilder.create(), PartPose.offset(0.65F, 1.0F, -0.6F)); + + PartDefinition LFLeg_r1 = LFLegIsolate.addOrReplaceChild("LFLeg_r1", CubeListBuilder.create().texOffs(16, 45).addBox(-1.0F, -2.0F, -1.0F, 2.0F, 10.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.49F, -0.1925F, -0.3444F)); + + PartDefinition LFPlate = LF.addOrReplaceChild("LFPlate", CubeListBuilder.create().texOffs(38, 13).addBox(-1.5F, -1.25F, -2.15F, 4.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(3.0F, 7.75F, -4.1F)); + + PartDefinition RightLeg = stand.addOrReplaceChild("RightLeg", CubeListBuilder.create(), PartPose.offset(-4.0F, -10.0F, 0.75F)); + + PartDefinition Plate_r2 = RightLeg.addOrReplaceChild("Plate_r2", CubeListBuilder.create().texOffs(48, 39).mirror().addBox(-1.0F, -3.0F, -1.0F, 1.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(-1.25F, 1.75F, -0.75F, 0.0F, 0.0F, 0.3491F)); + + PartDefinition RB = RightLeg.addOrReplaceChild("RB", CubeListBuilder.create(), PartPose.offsetAndRotation(0.25F, 1.0F, 1.25F, 0.0F, 1.5708F, 0.0F)); + + PartDefinition RBLegIsolate = RB.addOrReplaceChild("RBLegIsolate", CubeListBuilder.create(), PartPose.offset(-0.15F, 0.5F, -0.5F)); + + PartDefinition RBLeg_r1 = RBLegIsolate.addOrReplaceChild("RBLeg_r1", CubeListBuilder.create().texOffs(40, 45).mirror().addBox(-1.0F, -2.0F, -1.0F, 2.0F, 10.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.49F, 0.1925F, 0.3444F)); + + PartDefinition RBPlate = RB.addOrReplaceChild("RBPlate", CubeListBuilder.create().texOffs(16, 40).mirror().addBox(-2.25F, -0.75F, -2.45F, 4.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-2.75F, 6.75F, -3.65F)); + + PartDefinition RF = RightLeg.addOrReplaceChild("RF", CubeListBuilder.create(), PartPose.offset(0.0F, 0.5F, -0.65F)); + + PartDefinition RFLegIsolate = RF.addOrReplaceChild("RFLegIsolate", CubeListBuilder.create(), PartPose.offset(-0.65F, 1.0F, -0.6F)); + + PartDefinition RFLeg_r1 = RFLegIsolate.addOrReplaceChild("RFLeg_r1", CubeListBuilder.create().texOffs(24, 45).mirror().addBox(-1.0F, -2.0F, -1.0F, 2.0F, 10.0F, 2.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -0.49F, 0.1925F, 0.3444F)); + + PartDefinition RFPlate = RF.addOrReplaceChild("RFPlate", CubeListBuilder.create().texOffs(42, 31).mirror().addBox(-2.5F, -1.25F, -2.15F, 4.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).mirror(false), PartPose.offset(-3.0F, 7.75F, -4.1F)); + + return LayerDefinition.create(meshdefinition, 64, 64); + } + + + public static ResourceLocation base = new ResourceLocation(Roundabout.MOD_ID, + "textures/stand/ratt/anime.png"); + public ResourceLocation getTextureLocation(Entity context, byte skin){ + return base; + } + + @Override + public ModelPart root() { + return stand; + } + + @Override + public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + stand.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + +} \ No newline at end of file diff --git a/common/src/main/java/net/hydra/jojomod/client/models/stand/renderers/RattRenderer.java b/common/src/main/java/net/hydra/jojomod/client/models/stand/renderers/RattRenderer.java new file mode 100644 index 000000000..b1693423f --- /dev/null +++ b/common/src/main/java/net/hydra/jojomod/client/models/stand/renderers/RattRenderer.java @@ -0,0 +1,49 @@ +package net.hydra.jojomod.client.models.stand.renderers; + +import com.mojang.blaze3d.vertex.PoseStack; +import net.hydra.jojomod.Roundabout; +import net.hydra.jojomod.client.models.layers.ModEntityRendererClient; +import net.hydra.jojomod.client.models.stand.CinderellaModel; +import net.hydra.jojomod.client.models.stand.RattModel; +import net.hydra.jojomod.entity.stand.CinderellaEntity; +import net.hydra.jojomod.entity.stand.KillerQueenEntity; +import net.hydra.jojomod.entity.stand.RattEntity; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.entity.EntityRendererProvider; +import net.minecraft.resources.ResourceLocation; +import org.jetbrains.annotations.Nullable; + +public class RattRenderer extends StandRenderer { + + private static final ResourceLocation PART_4_SKIN = new ResourceLocation(Roundabout.MOD_ID,"textures/stand/ratt/anime.png"); + private static final ResourceLocation MANGA_SKIN = new ResourceLocation(Roundabout.MOD_ID,"textures/stand/ratt/manga.png"); + + public RattRenderer(EntityRendererProvider.Context context) { + super(context, new RattModel<>(context.bakeLayer(ModEntityRendererClient.RATT_LAYER)), 0f); + } + + @Override public ResourceLocation getTextureLocation(RattEntity entity) { + return main_skin; + } + + private static final ResourceLocation main_skin = new ResourceLocation(Roundabout.MOD_ID,"textures/stand/ratt/anime.png"); + + + @Override + public void render(RattEntity mobEntity, float f, float g, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i) { + float factor = 0.5F + (mobEntity.getSizePercent()/2); + if (mobEntity.isBaby()) { + matrixStack.scale(0.5f*factor, 0.5f*factor, 0.5f*factor); + } else { + matrixStack.scale(0.8f * factor, 0.8f * factor, 0.8f * factor); + } + super.render(mobEntity, f, g, matrixStack, vertexConsumerProvider, i); + } + + @Nullable + @Override + protected RenderType getRenderType(RattEntity entity, boolean showBody, boolean translucent, boolean showOutline) { + return super.getRenderType(entity, showBody, true, showOutline); + } +} diff --git a/common/src/main/java/net/hydra/jojomod/client/models/worn_stand/RattShoulderModel.java b/common/src/main/java/net/hydra/jojomod/client/models/worn_stand/RattShoulderModel.java new file mode 100644 index 000000000..a473beb33 --- /dev/null +++ b/common/src/main/java/net/hydra/jojomod/client/models/worn_stand/RattShoulderModel.java @@ -0,0 +1,83 @@ +package net.hydra.jojomod.client.models.worn_stand; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.hydra.jojomod.Roundabout; +import net.hydra.jojomod.client.ClientUtil; +import net.hydra.jojomod.client.models.PsuedoHierarchicalModel; +import net.hydra.jojomod.client.models.layers.animations.HeyYaAnimations; +import net.hydra.jojomod.client.models.stand.RattModel; +import net.hydra.jojomod.event.powers.StandUser; +import net.hydra.jojomod.event.powers.TimeStop; +import net.hydra.jojomod.stand.powers.PowersHeyYa; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.*; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; + +public class RattShoulderModel extends PsuedoHierarchicalModel { + // This layer location should be baked with EntityRendererProvider.Context in the entity renderer and passed into this model's constructor + private final ModelPart stand; + private final ModelPart Root; + + public RattShoulderModel() { + super(RenderType::entityTranslucent); + + this.Root = createBodyLayer().bakeRoot(); + this.stand = Root.getChild("stand"); + } + + public static LayerDefinition createBodyLayer() { + return RattModel.getTexturedModelData(); + } + @Override + public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { + stand.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); + } + + @Override + public ModelPart root() { + return Root; + } + + @Override + public void setupAnim(Entity var1, float pAgeInTicks) { + + } + public static ResourceLocation base = new ResourceLocation(Roundabout.MOD_ID, + "textures/stand/ratt/anime.png"); + + public ResourceLocation getTextureLocation(Entity context, byte skin){ + switch (skin) + { + default -> {return base;} + } + } + + + public void render(Entity context, PoseStack poseStack, MultiBufferSource bufferSource, int light) { + VertexConsumer consumer = bufferSource.getBuffer(RenderType.entityCutoutNoCull(getTextureLocation(context, (byte)0))); + root().render(poseStack, consumer, light, OverlayTexture.NO_OVERLAY); + } + public void render(Entity context, float partialTicks, PoseStack poseStack, MultiBufferSource bufferSource, + int light, float r, float g, float b, float alpha, byte skin) { + if (context instanceof LivingEntity LE) { + this.root().getAllParts().forEach(ModelPart::resetPose); + if (((TimeStop)context.level()).CanTimeStopEntity(context) || ClientUtil.checkIfGamePaused()){ + partialTicks = 0; + } + StandUser user = ((StandUser) LE); + VertexConsumer consumer = bufferSource.getBuffer(RenderType.entityTranslucent(getTextureLocation(context, skin))); + + root().render(poseStack, consumer, light, OverlayTexture.NO_OVERLAY, r, g, b, alpha); + } + } + +} + diff --git a/common/src/main/java/net/hydra/jojomod/entity/ModEntities.java b/common/src/main/java/net/hydra/jojomod/entity/ModEntities.java index 33d271234..d5c0216d5 100644 --- a/common/src/main/java/net/hydra/jojomod/entity/ModEntities.java +++ b/common/src/main/java/net/hydra/jojomod/entity/ModEntities.java @@ -30,6 +30,7 @@ public class ModEntities { public static EntityType MAGICIANS_RED; public static EntityType MAGICIANS_RED_OVA; public static EntityType D4C; + public static EntityType RATT; public static EntityType GREEN_DAY; public static EntityType SOFT_AND_WET; public static EntityType SOFT_AND_WET_KING; diff --git a/common/src/main/java/net/hydra/jojomod/entity/stand/RattEntity.java b/common/src/main/java/net/hydra/jojomod/entity/stand/RattEntity.java new file mode 100644 index 000000000..a23ab8aec --- /dev/null +++ b/common/src/main/java/net/hydra/jojomod/entity/stand/RattEntity.java @@ -0,0 +1,117 @@ +package net.hydra.jojomod.entity.stand; + +import net.hydra.jojomod.event.index.OffsetIndex; +import net.hydra.jojomod.event.index.PowerIndex; +import net.hydra.jojomod.event.powers.StandUser; +import net.hydra.jojomod.stand.powers.PowersRatt; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.*; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.Vec3; + +public class RattEntity extends StandEntity { + public RattEntity(EntityType entityType, Level world) {super(entityType, world);} + + public static final byte + ANIME_SKIN = 1, + MANGA_SKIN = 2; + + public Component getSkinName(byte skinId) { + return getSkinNameT(skinId); + } + + public static Component getSkinNameT(byte skinId){ + if (skinId == MANGA_SKIN) { + return Component.translatable("skins.roundabout.ratt.manga"); + } + return Component.translatable("skins.roundabout.ratt.anime"); + } + + public byte MotionState = PowersRatt.SHOULDER; + public Vec3 Placement = null; + + @Override + public void tick() { + + if (getUser() != null) { + if (!this.getUserData(this.getUser()).roundabout$getActive()) { + this.remove(RemovalReason.DISCARDED); // might not be the best method + } + } + + switch (MotionState) { + case PowersRatt.SHOULDER -> { + UpdateState(OffsetIndex.FOLLOW); + } + + case PowersRatt.MOVING -> { + UpdateState(OffsetIndex.LOOSE); + Vec3 target = getStandOffsetVector(getUser()); + if (Placement != null) { + target = Placement; + } + + UpdatePos(this.getPosition(0).lerp(target,0.8)); + + + if (getPosition(0).distanceTo(target) < 0.2) { + UpdatePos(target); + if (target == Placement) { + UpdateMotionState(PowersRatt.PLACED); + } else { + UpdateMotionState(PowersRatt.SHOULDER); + } + } + } + + case PowersRatt.PLACED -> { + UpdateState(OffsetIndex.LOOSE); + if (!getPosition(0).equals(Placement)) { + UpdatePos(Placement); + } + } + } + super.tick(); + } + + + + + public void UpdatePos(Vec3 v) { + if (this.getUser() != null) { + ((StandUser) this.getUser()).roundabout$getStandPowers().tryPosPowerPacket(PowerIndex.POWER_2,v); + } + } + public void UpdateMotionState(byte s) { + if (this.getUser() != null) { + MotionState = s; + ((StandUser) this.getUser()).roundabout$getStandPowers().tryIntPowerPacket(PowerIndex.POWER_1,(int) s); + } + } + public void UpdateState(byte s) { + if (this.getUser() != null) { + ((StandUser) this.getUser()).roundabout$getStandPowers().tryIntPowerPacket(PowerIndex.POWER_2,(int) s); + } + } + + + + + @Override + public void setupAnimationStates() { + super.setupAnimationStates(); + /* if (this.getUser() != null) { + if (this.getAnimation() == DEFACE) { + this.deface.startIfStopped(this.tickCount); + } else { + this.deface.stop(); + } + if (this.getAnimation() == VISAGES) { + this.visages.startIfStopped(this.tickCount); + } else { + this.visages.stop(); + } + }*/ + } +} + diff --git a/common/src/main/java/net/hydra/jojomod/event/powers/StandUser.java b/common/src/main/java/net/hydra/jojomod/event/powers/StandUser.java index 847bfb8f3..7581ea4af 100644 --- a/common/src/main/java/net/hydra/jojomod/event/powers/StandUser.java +++ b/common/src/main/java/net/hydra/jojomod/event/powers/StandUser.java @@ -90,6 +90,8 @@ public interface StandUser { AnimationState roundabout$getHeyYaAnimation2(); int roundabout$getHeyYaVanishTicks(); void roundabout$setHeyYaVanishTicks(int set); + int roundabout$getRattShoulderVanishTicks(); + void roundabout$setRattShoulderVanishTicks(int set); boolean roundabout$getActive(); boolean roundabout$getMainhandOverride(); diff --git a/common/src/main/java/net/hydra/jojomod/item/ModItems.java b/common/src/main/java/net/hydra/jojomod/item/ModItems.java index d4bbac8d5..2385e0465 100644 --- a/common/src/main/java/net/hydra/jojomod/item/ModItems.java +++ b/common/src/main/java/net/hydra/jojomod/item/ModItems.java @@ -27,6 +27,8 @@ public class ModItems { public static Item STAND_DISC_MAGICIANS_RED; public static Item STAND_DISC_D4C; public static Item MAX_STAND_DISC_D4C; + public static Item STAND_DISC_RATT; + public static Item MAX_STAND_DISC_RATT; public static Item STAND_DISC_GREEN_DAY; public static Item MAX_STAND_DISC_GREEN_DAY; public static Item STAND_DISC_SOFT_AND_WET; diff --git a/common/src/main/java/net/hydra/jojomod/mixin/HudRendering.java b/common/src/main/java/net/hydra/jojomod/mixin/HudRendering.java index 1a44e5b3d..0d83e2b5c 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/HudRendering.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/HudRendering.java @@ -15,6 +15,7 @@ import net.hydra.jojomod.event.powers.stand.PowersSoftAndWet; import net.hydra.jojomod.event.powers.visagedata.JosukePartEightVisage; import net.hydra.jojomod.item.MaskItem; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.hydra.jojomod.util.config.ConfigManager; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Font; @@ -88,6 +89,13 @@ protected void renderTextureOverlay(GuiGraphics p_282304_, ResourceLocation p_28 this.renderTextureOverlay($$1, StandIcons.GASOLINE_OVERLAY, overlay2); } } + if (((StandUser) this.minecraft.player ).roundabout$getStandPowers() instanceof PowersRatt) { + if ( ((StandUser) this.minecraft.player).roundabout$getStandPowers().scopeLevel != 0 ) { + RenderSystem.enableBlend(); + this.renderTextureOverlay($$1, StandIcons.RATT_SCOPE_OVERLAY, 0.99F); + RenderSystem.disableBlend(); + } + } if (this.minecraft.options.getCameraType().isFirstPerson()) { StandUser user = ((StandUser) this.minecraft.player); if (user.roundabout$isBubbleEncased()){ diff --git a/common/src/main/java/net/hydra/jojomod/mixin/InputEvents.java b/common/src/main/java/net/hydra/jojomod/mixin/InputEvents.java index a7803c36b..e3e0b6b23 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/InputEvents.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/InputEvents.java @@ -15,6 +15,7 @@ import net.hydra.jojomod.entity.D4CCloneEntity; import net.hydra.jojomod.entity.corpses.FallenMob; import net.hydra.jojomod.entity.stand.D4CEntity; +import net.hydra.jojomod.entity.stand.RattEntity; import net.hydra.jojomod.entity.stand.StandEntity; import net.hydra.jojomod.event.index.PacketDataIndex; import net.hydra.jojomod.event.index.Poses; @@ -106,6 +107,13 @@ public void roundaboutAttack(CallbackInfoReturnable ci) { } } + if ($$0 instanceof RattEntity) { + if (((StandEntity) $$0).getUser() != null) { + if (((RattEntity) $$0).getUser().isCrouching()) { + ci.setReturnValue(true); + } + } + } if (powers.getGoBeyondTarget() != null && powers.getGoBeyondTarget().is($$0)) { ci.setReturnValue(true); return; diff --git a/common/src/main/java/net/hydra/jojomod/mixin/StandUserEntity.java b/common/src/main/java/net/hydra/jojomod/mixin/StandUserEntity.java index ac7fa17f5..200a2773f 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/StandUserEntity.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/StandUserEntity.java @@ -27,6 +27,7 @@ import net.hydra.jojomod.networking.ModPacketHandler; import net.hydra.jojomod.sound.ModSounds; import net.hydra.jojomod.stand.powers.PowersHeyYa; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.hydra.jojomod.util.MainUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.BlockParticleOption; @@ -1772,6 +1773,22 @@ public float roundaboutGetMaxStoredDamage(){ roundabout$heyYaVanishTicks = Mth.clamp(set,0,10); } + @Unique + public int roundabout$RattShoulderVanishTicks = 0; + + @Unique + @Override + public int roundabout$getRattShoulderVanishTicks(){ + return roundabout$RattShoulderVanishTicks; + } + @Unique + @Override + public void roundabout$setRattShoulderVanishTicks(int set){ + roundabout$RattShoulderVanishTicks = Mth.clamp(set,0,10); + } + + + @Unique public AnimationState roundabout$heyYaAnimation2 = new AnimationState(); @@ -3334,6 +3351,14 @@ protected int decreaseAirSupply(int $$0) { } else { roundabout$setHeyYaVanishTicks(roundabout$getHeyYaVanishTicks()-1); } + /** RattShoulder fade ticks*/ + if (roundabout$getActive() && roundabout$getStandPowers() instanceof PowersRatt && + ((PowersRatt)roundabout$getStandPowers()).isRattState(PowersRatt.SHOULDER) + ){ + roundabout$setRattShoulderVanishTicks(roundabout$getRattShoulderVanishTicks()+1); + } else { + roundabout$setRattShoulderVanishTicks(0); + } /**Soft and Wet Bubble Encase launch*/ diff --git a/common/src/main/java/net/hydra/jojomod/mixin/ZHumanoidMobRenderer.java b/common/src/main/java/net/hydra/jojomod/mixin/ZHumanoidMobRenderer.java index c92d2ab88..40c55b4ef 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/ZHumanoidMobRenderer.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/ZHumanoidMobRenderer.java @@ -2,6 +2,7 @@ import net.hydra.jojomod.client.FacelessLayer; import net.hydra.jojomod.client.models.layers.HeyYaLayer; +import net.hydra.jojomod.client.models.layers.RattShoulderLayer; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.HumanoidMobRenderer; @@ -22,6 +23,7 @@ public ZHumanoidMobRenderer(EntityRendererProvider.Context $$0, M $$1, float $$2 private void roundabout$renderHumanoidMobRenderer(EntityRendererProvider.Context $$0, HumanoidModel $$1, float $$2, float $$3, float $$4, float $$5, CallbackInfo ci) { this.addLayer(new FacelessLayer<>($$0, this)); this.addLayer(new HeyYaLayer<>($$0, this)); + this.addLayer(new RattShoulderLayer<>($$0, this)); } } diff --git a/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandLayer.java b/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandLayer.java index ff33b8769..28dc0e365 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandLayer.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandLayer.java @@ -9,6 +9,7 @@ import net.hydra.jojomod.entity.visages.JojoNPC; import net.hydra.jojomod.event.powers.StandUser; import net.hydra.jojomod.event.powers.TimeStop; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ArmedModel; import net.minecraft.client.model.EntityModel; @@ -82,7 +83,13 @@ public ZItemInHandLayer(RenderLayerParent $$0) { } LivingEntity host = entity; - if (entity instanceof JojoNPC jnpc && jnpc.host != null && ((StandUser)jnpc.host).roundabout$getEffectiveCombatMode()){ + if ( ((StandUser)host).roundabout$getStandPowers() instanceof PowersRatt) { + if ( ((StandUser)host).roundabout$getStandPowers().scopeLevel != 0 ) { + ci.cancel(); + } + } + + if (entity instanceof JojoNPC jnpc && jnpc.host != null && ((StandUser)jnpc.host).roundabout$getEffectiveCombatMode()){ host = jnpc.host; } if (host != null && ((StandUser)host).roundabout$getEffectiveCombatMode() && !host.isUsingItem()){ diff --git a/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandRenderer.java b/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandRenderer.java index 3575de928..df773c1ec 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandRenderer.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/ZItemInHandRenderer.java @@ -14,6 +14,7 @@ import net.hydra.jojomod.item.GlaiveItem; import net.hydra.jojomod.item.ModItems; import net.hydra.jojomod.item.StandArrowItem; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.hydra.jojomod.util.MainUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.model.EntityModel; @@ -102,6 +103,12 @@ public void renderItem(LivingEntity livingEntity, ItemStack itemStack, ItemDispl return; } } + if (user.roundabout$getStandPowers() instanceof PowersRatt) { + if (user.roundabout$getStandPowers().scopeLevel != 0) { + ci.cancel(); + return; + } + } if (powers.isPiloting()){ StandEntity stand = powers.getPilotingStand(); float aan = $$3.getAttackAnim($$0); diff --git a/common/src/main/java/net/hydra/jojomod/mixin/ZPlayerRender.java b/common/src/main/java/net/hydra/jojomod/mixin/ZPlayerRender.java index 6155927b8..b75e46893 100644 --- a/common/src/main/java/net/hydra/jojomod/mixin/ZPlayerRender.java +++ b/common/src/main/java/net/hydra/jojomod/mixin/ZPlayerRender.java @@ -4,14 +4,11 @@ import net.hydra.jojomod.Roundabout; import net.hydra.jojomod.access.*; import net.hydra.jojomod.client.*; -import net.hydra.jojomod.client.models.layers.HeyYaLayer; -import net.hydra.jojomod.client.models.layers.ShootingArmLayer; +import net.hydra.jojomod.client.models.layers.*; import net.hydra.jojomod.client.models.layers.visages.VisagePartLayer; import net.hydra.jojomod.client.models.visages.OVAEnyaModel; import net.hydra.jojomod.client.models.visages.renderers.OVAEnyaRenderer; import net.hydra.jojomod.entity.ModEntities; -import net.hydra.jojomod.client.models.layers.StoneLayer; -import net.hydra.jojomod.client.models.layers.KnifeLayer; import net.hydra.jojomod.entity.visages.JojoNPC; import net.hydra.jojomod.client.models.visages.PlayerLikeModel; import net.hydra.jojomod.client.models.visages.renderers.PlayerLikeRenderer; @@ -25,6 +22,7 @@ import net.hydra.jojomod.event.powers.visagedata.VisageData; import net.hydra.jojomod.item.MaskItem; import net.hydra.jojomod.item.ModItems; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.minecraft.client.Minecraft; import net.minecraft.client.model.*; import net.minecraft.client.model.geom.ModelLayers; @@ -78,6 +76,7 @@ private void roundaboutRenderKnives(EntityRendererProvider.Context $$0, boolean this.addLayer(new FacelessLayer<>($$0, this)); this.addLayer(new ShootingArmLayer<>($$0, this)); this.addLayer(new HeyYaLayer<>($$0, this)); + this.addLayer(new RattShoulderLayer<>($$0, this)); this.addLayer(new VisagePartLayer<>($$0, this)); /**Access to slim and not slim models simultaneously*/ roundabout$otherModel = new PlayerModel<>($$0.bakeLayer($$1 ? ModelLayers.PLAYER : ModelLayers.PLAYER_SLIM), $$1); @@ -129,10 +128,18 @@ private void setModelProperties(AbstractClientPlayer $$0) { setModelProperties($$0); } - @Inject(method = "getArmPose", at = @At(value = "HEAD")) + @Inject(method = "getArmPose", at = @At(value = "HEAD"),cancellable = true) private static void roundabout$GetArmPose(AbstractClientPlayer $$0, InteractionHand $$1, CallbackInfoReturnable ci) { ACP = $$0; IH = $$1; + // ratt scope spyglass hand position + if ($$1.equals(InteractionHand.MAIN_HAND)) { + if (((StandUser) (Player) $$0).roundabout$getStandPowers() instanceof PowersRatt) { + if (((StandUser) (Player) $$0).roundabout$getStandPowers().scopeLevel != 0) { + ci.setReturnValue(HumanoidModel.ArmPose.SPYGLASS); + } + } + } } @ModifyVariable(method = "getArmPose", at = @At(value = "STORE"),ordinal = 0) private static ItemStack roundabout$GetArmPose2(ItemStack $$0) { diff --git a/common/src/main/java/net/hydra/jojomod/stand/powers/PowersRatt.java b/common/src/main/java/net/hydra/jojomod/stand/powers/PowersRatt.java new file mode 100644 index 000000000..35154be72 --- /dev/null +++ b/common/src/main/java/net/hydra/jojomod/stand/powers/PowersRatt.java @@ -0,0 +1,308 @@ +package net.hydra.jojomod.stand.powers; + +import net.hydra.jojomod.Roundabout; +import net.hydra.jojomod.client.ClientUtil; +import net.hydra.jojomod.client.StandIcons; +import net.hydra.jojomod.entity.ModEntities; +import net.hydra.jojomod.entity.stand.RattEntity; +import net.hydra.jojomod.entity.stand.StandEntity; +import net.hydra.jojomod.event.index.OffsetIndex; +import net.hydra.jojomod.event.index.PowerIndex; +import net.hydra.jojomod.event.index.SoundIndex; +import net.hydra.jojomod.event.powers.StandPowers; +import net.hydra.jojomod.event.powers.StandUser; +import net.hydra.jojomod.sound.ModSounds; +import net.minecraft.ChatFormatting; +import net.minecraft.client.gui.GuiGraphics; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundEvent; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.level.ClipContext; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; +import net.minecraft.world.phys.Vec3; + +import java.util.Arrays; +import java.util.List; + +public class PowersRatt extends NewDashPreset { + public PowersRatt(LivingEntity self) { + super(self); + } + + + + @Override + public StandPowers generateStandPowers(LivingEntity entity) { + return new PowersRatt(entity); + } + + + @Override + public StandEntity getNewStandEntity(){return ModEntities.RATT.create(this.getSelf().level());} + + public static int MaxLerpTime = 25; + public static float PlacementRange = 5.0F; + + public static final byte + SHOULDER = 0, + MOVING = 1, + PLACED = 2; + + + public boolean active = false; + @Override + public boolean canSummonStandAsEntity() { + return active; + } + + public byte getRattState() { + RattEntity RE = (RattEntity) getStandUserSelf().roundabout$getStand(); + if (RE != null) { + return RE.MotionState; + } else if (this.getStandUserSelf().roundabout$getActive()) { + return SHOULDER; + } + return -1; + } + public void setRattState(byte b) { + RattEntity RE = (RattEntity) getStandUserSelf().roundabout$getStand(); + if (RE != null) { + RE.UpdateMotionState(b); + } + } + public boolean isRattState(byte b) { + RattEntity RE = (RattEntity) getStandUserSelf().roundabout$getStand(); + if (RE != null) { + return RE.MotionState == b; + } else if (b == SHOULDER) { + return true; + } + return false; + } + public void setRattPlacement(Vec3 b) { + RattEntity RE = (RattEntity) getStandUserSelf().roundabout$getStand(); + if (RE != null) { + RE.Placement = b; + } + } + + private BlockHitResult getValidPlacement(){ + Vec3 vec3d = this.getSelf().getEyePosition(0); + Vec3 vec3d2 = this.getSelf().getViewVector(0); + Vec3 vec3d3 = vec3d.add(vec3d2.x * PlacementRange, vec3d2.y * PlacementRange, vec3d2.z * PlacementRange); + BlockHitResult blockHit = this.getSelf().level().clip(new ClipContext(vec3d, vec3d3, + ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this.getSelf())); + if (blockHit.getType() == HitResult.Type.BLOCK && blockHit.getDirection() == Direction.UP){ + return blockHit; + } + return null; + } + + + + @Override + public void renderIcons(GuiGraphics context, int x, int y) { + ClientUtil.fx.roundabout$onGUI(context); + + switch(getRattState()) { + case SHOULDER -> { + ResourceLocation ScopeIcon = StandIcons.STAR_PLATINUM_SCOPE; + if (scopeLevel == 1) { + ScopeIcon = StandIcons.STAR_PLATINUM_SCOPE_1; + } + if (scopeLevel == 2) { + ScopeIcon = StandIcons.STAR_PLATINUM_SCOPE_2; + } + setSkillIcon(context, x, y, 1, ScopeIcon, PowerIndex.SKILL_1); + setSkillIcon(context,x,y,2,StandIcons.JUSTICE_PILOT,PowerIndex.SKILL_2); + } + case MOVING, PLACED -> { + setSkillIcon(context,x,y,1,StandIcons.NONE, PowerIndex.SKILL_1); + setSkillIcon(context,x,y,2,StandIcons.JUSTICE_PILOT_EXIT,PowerIndex.SKILL_2); + } + } + setSkillIcon(context,x,y,3,StandIcons.DODGE,PowerIndex.GLOBAL_DASH); + + } + + + @Override + public boolean tryPower(int move, boolean forced) { + switch(move) { + case PowerIndex.POWER_1 -> { + active = true; + if (!this.isClient()) { + this.getStandUserSelf().roundabout$summonStand(this.getSelf().level(), true, false); + } + } + case PowerIndex.POWER_1_SNEAK -> { + active = false; + } + } + return super.tryPower(move, forced); + } + @Override + public boolean tryPosPower(int move, boolean forced, Vec3 pos) { + if (move == PowerIndex.POWER_2) { + if (this.getStandEntity(this.getSelf()) != null) { + this.getStandEntity(this.getSelf()).setPos(pos); + } + } + return true; + } + + @Override + public boolean tryIntPower(int move, boolean forced, int chargeTime) { + if (this.getStandEntity(this.getSelf()) != null) { + if (move == PowerIndex.POWER_2) { + this.getStandEntity(this.getSelf()).setOffsetType((byte) chargeTime); + } else if (move == PowerIndex.POWER_1) { + ((RattEntity) this.getStandEntity(this.getSelf())).MotionState = (byte) chargeTime; + } + } + return true; + } + + + @Override + public void tickPower() { + StandEntity SE = getStandEntity(this.getSelf()); + if ( SE != null && SE.getOffsetType() == OffsetIndex.FOLLOW) { + if (active) { + Deploy(); + } else { + if (!this.getSelf().level().isClientSide()) { + SE.remove(Entity.RemovalReason.DISCARDED); + } + } + } + super.tickPower(); + } + + + @Override + public void powerActivate(PowerContext context) { + + switch (context) + { + case SKILL_1_NORMAL -> { + if (isRattState(SHOULDER)) { + RattScope(); + } + } + case SKILL_2_NORMAL -> { + if (isRattState(SHOULDER) ) { + if (getValidPlacement() != null) { + Deploy(); + } + } else { + Recall(); + } + } + + case SKILL_3_NORMAL -> { + dash(); + } + } + } + + public void RattScope() { + /* will eventually add some sort of scope overlay */ + int nl = scopeLevel + 1; + if (nl == 2) { + setScopeLevel(0); + } else { + setScopeLevel(nl); + this.getSelf().playSound(ModSounds.STAR_PLATINUM_SCOPE_EVENT, 1.0F, (float) (0.98F + (Math.random() * 0.04F))); + } + + } + + public void Deploy() { + RattEntity RE = (RattEntity) this.getStandUserSelf().roundabout$getStand(); + if (RE != null) { + if (getValidPlacement() != null) { + setRattState(MOVING); + setRattPlacement(getValidPlacement().getLocation().subtract(0,0.1,0)); + } + } else { + tryPower(PowerIndex.POWER_1,true); + tryPowerPacket(PowerIndex.POWER_1); + } + } + public void Recall() { + RattEntity RE = (RattEntity) this.getStandUserSelf().roundabout$getStand(); + if (RE != null) { + setRattState(MOVING); + setRattPlacement(null); + tryPower(PowerIndex.POWER_1_SNEAK,true); + tryPowerPacket(PowerIndex.POWER_1_SNEAK); + } + } + + + @Override + public boolean isAttackIneptVisually(byte activeP, int slot) { + switch (activeP) { + case PowerIndex.SKILL_2 -> { + return getValidPlacement() == null && isRattState(SHOULDER); + } + } + return super.isAttackIneptVisually(activeP, slot); + } + + /** if = -1, not melt dodging */ + public int meltDodgeTicks = -1; + + + + @Override + public boolean canScope() { + return getStandUserSelf().roundabout$getActive() && isRattState(SHOULDER); + } + + @Override + public List getSkinList() { + return Arrays.asList( + RattEntity.ANIME_SKIN + ); + } + + + + + public Component getPosName(byte posID) { + if (posID == 1) { + return Component.translatable("idle.roundabout.ratt_1"); + } else { + return Component.translatable("idle.roundabout.ratt_2"); + } + } + + @Override + protected Byte getSummonSound() {return SoundIndex.SUMMON_SOUND;} + public SoundEvent getSoundFromByte(byte soundChoice){ + byte bt = ((StandUser)this.getSelf()).roundabout$getStandSkin(); + if (soundChoice == SoundIndex.SUMMON_SOUND) { + return ModSounds.SUMMON_SOUND_EVENT; + } + return super.getSoundFromByte(soundChoice); + } + + @Override + public boolean isWip(){ + return true; + } + @Override + public Component ifWipListDevStatus(){ + return Component.translatable( "roundabout.dev_status.active").withStyle(ChatFormatting.AQUA); + } + @Override + public Component ifWipListDev(){ + return Component.literal( "Prisma").withStyle(ChatFormatting.YELLOW); + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/roundabout/lang/en_us.json b/common/src/main/resources/assets/roundabout/lang/en_us.json index 4dafc3712..c4d809c8a 100644 --- a/common/src/main/resources/assets/roundabout/lang/en_us.json +++ b/common/src/main/resources/assets/roundabout/lang/en_us.json @@ -52,6 +52,8 @@ "item.roundabout.soft_and_wet_disc": "Stand Disc", "item.roundabout.cinderella_disc": "Stand Disc", "item.roundabout.hey_ya_disc": "Stand Disc", + "item.roundabout.ratt_disc": "Stand Disc", + "item.roundabout.max_ratt_disc": "Stand Disc+", "item.roundabout.max_star_platinum_disc": "Stand Disc+", "item.roundabout.magicians_red_disc": "Stand Disc", "item.roundabout.killer_queen_disc": "Stand Disc", @@ -71,6 +73,8 @@ "item.roundabout.the_world_disc.desc": "The World", "item.roundabout.justice_disc.desc": "Justice", "item.roundabout.cinderella_disc.desc": "Cinderella", + "item.roundabout.max_ratt_disc.desc": "Ratt", + "item.roundabout.ratt_disc.desc": "Ratt", "item.roundabout.hey_ya_disc.desc": "Hey Ya!", "item.roundabout.none_disc.desc": "None", @@ -501,6 +505,9 @@ "sounds.roundabout.cinderella_fail": "Uh oh", "sounds.roundabout.cinderella_visage_creation": "Mechanical whirl", + "sounds.roundabout.ratt_summon": "Stand Summoned", + + "sounds.roundabout.arcade_impale": "[Arcade Impale]", "sounds.roundabout.arcade_long_ts": "[Stop Time]", "sounds.roundabout.arcade_muda": "[Arcade Muda]", @@ -831,6 +838,9 @@ "idle.roundabout.hey_ya_1": "Forward", "idle.roundabout.hey_ya_2": "Facing", + "idle.roundabout.ratt_1": "Head", + "idle.roundabout.ratt_2": "Shoulder", + "skins.roundabout.star_platinum.base": "Part 3", "skins.roundabout.star_platinum.manga": "Manga", "skins.roundabout.star_platinum.manga_purple": "Manga Purple", @@ -935,6 +945,9 @@ "skins.roundabout.cinderella.manga": "Manga", "skins.roundabout.cinderella.zombie": "Infected", + "skins.roundabout.ratt.anime" : "Anime", + "skins.roundabout.ratt.manga" : "Manga", + "skins.roundabout.hey_ya.manga": "Manga", "skins.roundabout.hey_ya.gothic": "Gothic", "skins.roundabout.hey_ya.volume_2": "Vol 2", diff --git a/common/src/main/resources/assets/roundabout/models/item/max_ratt_disc.json b/common/src/main/resources/assets/roundabout/models/item/max_ratt_disc.json new file mode 100644 index 000000000..ff64898cd --- /dev/null +++ b/common/src/main/resources/assets/roundabout/models/item/max_ratt_disc.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/template_music_disc", + "textures": { + "layer0": "roundabout:item/max_ratt_disc" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/roundabout/models/item/ratt_disc.json b/common/src/main/resources/assets/roundabout/models/item/ratt_disc.json new file mode 100644 index 000000000..2bfa4aa81 --- /dev/null +++ b/common/src/main/resources/assets/roundabout/models/item/ratt_disc.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/template_music_disc", + "textures": { + "layer0": "roundabout:item/ratt_disc" + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/roundabout/sounds/ratt_scope.ogg b/common/src/main/resources/assets/roundabout/sounds/ratt_scope.ogg new file mode 100644 index 000000000..97c1f421c Binary files /dev/null and b/common/src/main/resources/assets/roundabout/sounds/ratt_scope.ogg differ diff --git a/common/src/main/resources/assets/roundabout/sounds/ratt_summon.ogg b/common/src/main/resources/assets/roundabout/sounds/ratt_summon.ogg new file mode 100644 index 000000000..5a7a2fe52 Binary files /dev/null and b/common/src/main/resources/assets/roundabout/sounds/ratt_summon.ogg differ diff --git a/common/src/main/resources/assets/roundabout/textures/item/max_ratt_disc.png b/common/src/main/resources/assets/roundabout/textures/item/max_ratt_disc.png new file mode 100644 index 000000000..580903848 Binary files /dev/null and b/common/src/main/resources/assets/roundabout/textures/item/max_ratt_disc.png differ diff --git a/common/src/main/resources/assets/roundabout/textures/item/ratt_disc.png b/common/src/main/resources/assets/roundabout/textures/item/ratt_disc.png new file mode 100644 index 000000000..cc953f92e Binary files /dev/null and b/common/src/main/resources/assets/roundabout/textures/item/ratt_disc.png differ diff --git a/common/src/main/resources/assets/roundabout/textures/misc/ratt_scope.png b/common/src/main/resources/assets/roundabout/textures/misc/ratt_scope.png new file mode 100644 index 000000000..d2efe2b01 Binary files /dev/null and b/common/src/main/resources/assets/roundabout/textures/misc/ratt_scope.png differ diff --git a/common/src/main/resources/assets/roundabout/textures/stand/ratt/anime.png b/common/src/main/resources/assets/roundabout/textures/stand/ratt/anime.png new file mode 100644 index 000000000..7b398486d Binary files /dev/null and b/common/src/main/resources/assets/roundabout/textures/stand/ratt/anime.png differ diff --git a/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntities.java b/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntities.java index 9121025af..07f9e70ac 100644 --- a/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntities.java +++ b/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntities.java @@ -255,6 +255,13 @@ public class FabricEntities { EntityType.Builder.of(GreenDayEntity::new, MobCategory.MISC). sized(0.75f, 2.05f).clientTrackingRange(12).build(Roundabout.MOD_ID+":green_day") ); + public static final EntityType RATT = + Registry.register( + BuiltInRegistries.ENTITY_TYPE, + Roundabout.location("ratt"), + EntityType.Builder.of(RattEntity::new, MobCategory.MISC). + sized(0.75f, 2.05f).clientTrackingRange(12).build(Roundabout.MOD_ID+":ratt") + ); public static final EntityType SOFT_AND_WET_DROWNED = Registry.register( BuiltInRegistries.ENTITY_TYPE, @@ -462,6 +469,7 @@ public static void register() { ModEntities.MAGICIANS_RED_OVA = MAGICIANS_RED_OVA; ModEntities.D4C = D4C; ModEntities.GREEN_DAY = GREEN_DAY; + ModEntities.RATT = RATT; ModEntities.SOFT_AND_WET = SOFT_AND_WET; ModEntities.SOFT_AND_WET_DROWNED = SOFT_AND_WET_DROWNED; ModEntities.SOFT_AND_WET_DEBUT = SOFT_AND_WET_DEBUT; @@ -548,7 +556,8 @@ public static void register() { FabricDefaultAttributeRegistry.register(MAGICIANS_RED, StandEntity.createStandAttributes()); FabricDefaultAttributeRegistry.register(MAGICIANS_RED_OVA, StandEntity.createStandAttributes()); FabricDefaultAttributeRegistry.register(D4C, StandEntity.createStandAttributes()); - FabricDefaultAttributeRegistry.register(GREEN_DAY, StandEntity.createStandAttributes()); + FabricDefaultAttributeRegistry.register(GREEN_DAY, StandEntity.createStandAttributes()); FabricDefaultAttributeRegistry.register(GREEN_DAY, StandEntity.createStandAttributes()); + FabricDefaultAttributeRegistry.register(RATT, StandEntity.createStandAttributes()); FabricDefaultAttributeRegistry.register(SOFT_AND_WET, StandEntity.createStandAttributes()); FabricDefaultAttributeRegistry.register(SOFT_AND_WET_DROWNED, StandEntity.createStandAttributes()); FabricDefaultAttributeRegistry.register(SOFT_AND_WET_DEBUT, StandEntity.createStandAttributes()); diff --git a/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntityClient.java b/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntityClient.java index 35f1ee471..2e96dc0f8 100644 --- a/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntityClient.java +++ b/fabric/src/main/java/net/hydra/jojomod/registry/FabricEntityClient.java @@ -12,6 +12,7 @@ import net.hydra.jojomod.client.models.visages.*; import net.hydra.jojomod.client.models.visages.renderers.*; import net.hydra.jojomod.client.models.worn_stand.HeyYaModel; +import net.hydra.jojomod.client.models.worn_stand.RattShoulderModel; import net.hydra.jojomod.client.models.worn_stand.SoftAndWetShootingArmModel; import net.hydra.jojomod.client.models.substand.renderers.D4CCloneRenderer; import net.hydra.jojomod.client.models.substand.renderers.FogCloneRenderer; @@ -56,6 +57,7 @@ public static void register() { EntityRendererRegistry.register(FabricEntities.MAGICIANS_RED_OVA, MagiciansRedOVARenderer::new); EntityRendererRegistry.register(FabricEntities.D4C, D4CRenderer::new); EntityRendererRegistry.register(FabricEntities.GREEN_DAY, GreenDayRenderer::new); + EntityRendererRegistry.register(FabricEntities.RATT, RattRenderer::new); EntityRendererRegistry.register(FabricEntities.SOFT_AND_WET, SoftAndWetRenderer::new); EntityRendererRegistry.register(FabricEntities.SOFT_AND_WET_KING, SoftAndWetKingRenderer::new); EntityRendererRegistry.register(FabricEntities.SOFT_AND_WET_KILLER_QUEEN, SoftAndWetKillerQueenRenderer::new); @@ -117,6 +119,7 @@ public static void register() { EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.D4C_LAYER, D4CModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.GREEN_DAY_LAYER, GreenDayModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.SOFT_AND_WET_LAYER, SoftAndWetModel::getTexturedModelData); + EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.RATT_LAYER, RattModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.SOFT_AND_WET_KING_LAYER, SoftAndWetKingModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.SOFT_AND_WET_DROWNED_LAYER, SoftAndWetDrownedModel::getTexturedModelData); EntityModelLayerRegistry.registerModelLayer(ModEntityRendererClient.SOFT_AND_WET_DEBUT_LAYER, SoftAndWetDebutModel::getTexturedModelData); @@ -153,5 +156,6 @@ public static void register() { ModStrayModels.SHOOTING_ARM = new SoftAndWetShootingArmModel(); ModStrayModels.HEY_YA = new HeyYaModel(); + ModStrayModels.RATT_SHOULDER = new RattShoulderModel(); } } \ No newline at end of file diff --git a/fabric/src/main/java/net/hydra/jojomod/registry/FabricItems.java b/fabric/src/main/java/net/hydra/jojomod/registry/FabricItems.java index 8adde9b21..159f5c960 100644 --- a/fabric/src/main/java/net/hydra/jojomod/registry/FabricItems.java +++ b/fabric/src/main/java/net/hydra/jojomod/registry/FabricItems.java @@ -13,6 +13,7 @@ import net.hydra.jojomod.stand.powers.PowersD4C; import net.hydra.jojomod.stand.powers.PowersGreenDay; import net.hydra.jojomod.stand.powers.PowersHeyYa; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; @@ -48,6 +49,10 @@ public class FabricItems { new StandDiscItem(new Item.Properties().stacksTo(1), new PowersD4C(null))); public static Item MAX_STAND_DISC_D4C = registerItem("max_d4c_disc", new MaxStandDiscItem(new Item.Properties().stacksTo(1), new PowersD4C(null))); + public static Item STAND_DISC_RATT = registerItem("ratt_disc", + new StandDiscItem(new Item.Properties().stacksTo(1), new PowersRatt(null))); + public static Item MAX_STAND_DISC_RATT = registerItem("max_ratt_disc", + new MaxStandDiscItem(new Item.Properties().stacksTo(1), new PowersRatt(null))); public static Item STAND_DISC_GREEN_DAY = registerItem("green_day_disc", new StandDiscItem(new Item.Properties().stacksTo(1), new PowersGreenDay(null))); public static Item MAX_STAND_DISC_GREEN_DAY = registerItem("max_green_day_disc", @@ -326,6 +331,8 @@ public static void putDiscNBT(Item IT, CreativeModeTab.Output entries){ entries.accept(MAX_STAND_DISC_D4C); entries.accept(STAND_DISC_GREEN_DAY); entries.accept(MAX_STAND_DISC_GREEN_DAY); + entries.accept(STAND_DISC_RATT); + entries.accept(MAX_STAND_DISC_RATT); @@ -402,6 +409,9 @@ public static void register(){ ((MaxStandDiscItem)MAX_STAND_DISC_D4C).baseDisc = ((StandDiscItem)STAND_DISC_D4C); ModItems.MAX_STAND_DISC_D4C = MAX_STAND_DISC_D4C; ModItems.STAND_DISC_D4C = STAND_DISC_D4C; + ModItems.STAND_DISC_RATT = STAND_DISC_RATT; + ModItems.MAX_STAND_DISC_RATT = MAX_STAND_DISC_RATT; + ((MaxStandDiscItem)MAX_STAND_DISC_RATT).baseDisc = ((StandDiscItem)STAND_DISC_RATT); ModItems.MAX_STAND_DISC_GREEN_DAY = MAX_STAND_DISC_GREEN_DAY; ModItems.STAND_DISC_GREEN_DAY = STAND_DISC_GREEN_DAY; ((MaxStandDiscItem)MAX_STAND_DISC_GREEN_DAY).baseDisc = ((StandDiscItem)STAND_DISC_GREEN_DAY); diff --git a/fabric/src/main/java/net/hydra/jojomod/registry/FabricSounds.java b/fabric/src/main/java/net/hydra/jojomod/registry/FabricSounds.java index 27c7d9cc7..db03e70be 100644 --- a/fabric/src/main/java/net/hydra/jojomod/registry/FabricSounds.java +++ b/fabric/src/main/java/net/hydra/jojomod/registry/FabricSounds.java @@ -200,6 +200,7 @@ public static void register(){ addSound(ModSounds.CINDERELLA_FAIL_ID, ModSounds.CINDERELLA_FAIL_EVENT); addSound(ModSounds.CINDERELLA_VISAGE_CREATION_ID, ModSounds.CINDERELLA_VISAGE_CREATION_EVENT); + addSound(ModSounds.THE_WORLD_OVER_HEAVEN_ID, ModSounds.THE_WORLD_OVER_HEAVEN_EVENT); addSound(ModSounds.UNLOCK_SKIN_ID, ModSounds.UNLOCK_SKIN_EVENT); diff --git a/forge/src/main/java/net/hydra/jojomod/registry/ClientForgeEvents.java b/forge/src/main/java/net/hydra/jojomod/registry/ClientForgeEvents.java index 84aa2ac2d..c8a3a3f91 100644 --- a/forge/src/main/java/net/hydra/jojomod/registry/ClientForgeEvents.java +++ b/forge/src/main/java/net/hydra/jojomod/registry/ClientForgeEvents.java @@ -16,6 +16,7 @@ import net.hydra.jojomod.client.models.visages.*; import net.hydra.jojomod.client.models.visages.renderers.*; import net.hydra.jojomod.client.models.worn_stand.HeyYaModel; +import net.hydra.jojomod.client.models.worn_stand.RattShoulderModel; import net.hydra.jojomod.client.models.worn_stand.SoftAndWetShootingArmModel; import net.hydra.jojomod.client.models.substand.renderers.D4CCloneRenderer; import net.hydra.jojomod.client.models.substand.renderers.FogCloneRenderer; @@ -58,6 +59,7 @@ public static void registerRenderers(EntityRenderersEvent.RegisterRenderers even event.registerEntityRenderer(ForgeEntities.KILLER_QUEEN.get(), KillerQueenRenderer::new); event.registerEntityRenderer(ForgeEntities.D4C.get(), D4CRenderer::new); event.registerEntityRenderer(ForgeEntities.GREEN_DAY.get(), GreenDayRenderer::new); + event.registerEntityRenderer(ForgeEntities.RATT.get(), RattRenderer::new); event.registerEntityRenderer(ForgeEntities.SOFT_AND_WET.get(), SoftAndWetRenderer::new); event.registerEntityRenderer(ForgeEntities.SOFT_AND_WET_DROWNED.get(), SoftAndWetDrownedRenderer::new); event.registerEntityRenderer(ForgeEntities.SOFT_AND_WET_DEBUT.get(), SoftAndWetDebutRenderer::new); @@ -157,8 +159,10 @@ public static void registerLayerDefinitions(EntityRenderersEvent.RegisterLayerDe event.registerLayerDefinition(ModEntityRendererClient.STAND_FIRE_LAYER, StandFireRenderer::createBodyLayer); event.registerLayerDefinition(ModEntityRendererClient.MR_SPIN_LAYER, MagiciansRedSpinEffectLayer::createLayer); event.registerLayerDefinition(ModEntityRendererClient.GREEN_DAY_LAYER, GreenDayModel::getTexturedModelData); + event.registerLayerDefinition(ModEntityRendererClient.RATT_LAYER, RattModel::getTexturedModelData); ModStrayModels.SHOOTING_ARM = new SoftAndWetShootingArmModel(); ModStrayModels.HEY_YA = new HeyYaModel(); + ModStrayModels.RATT_SHOULDER = new RattShoulderModel(); //BlockEntityRenderers.register(ModBlocks.STAND_FIRE_BLOCK_ENTITY, StandFireRenderer::new); } @SubscribeEvent diff --git a/forge/src/main/java/net/hydra/jojomod/registry/ForgeEntities.java b/forge/src/main/java/net/hydra/jojomod/registry/ForgeEntities.java index ef0c728cc..6ac8b11d1 100644 --- a/forge/src/main/java/net/hydra/jojomod/registry/ForgeEntities.java +++ b/forge/src/main/java/net/hydra/jojomod/registry/ForgeEntities.java @@ -202,6 +202,12 @@ public class ForgeEntities { clientTrackingRange(10). build(new ResourceLocation(Roundabout.MOD_ID, "green_day").toString()) ); + public static final RegistryObject> RATT = + ENTITY_TYPES.register("ratt", () -> + EntityType.Builder.of(RattEntity::new, MobCategory.MISC).sized(0.75F, 2.05f). + clientTrackingRange(10). + build(new ResourceLocation(Roundabout.MOD_ID, "ratt").toString()) + ); public static final RegistryObject> SOFT_AND_WET = ENTITY_TYPES.register("soft_and_wet", () -> EntityType.Builder.of(SoftAndWetEntity::new, MobCategory.MISC).sized(0.75F, 2.05f). diff --git a/forge/src/main/java/net/hydra/jojomod/registry/ForgeEvents.java b/forge/src/main/java/net/hydra/jojomod/registry/ForgeEvents.java index 43df76712..649d1a5ee 100644 --- a/forge/src/main/java/net/hydra/jojomod/registry/ForgeEvents.java +++ b/forge/src/main/java/net/hydra/jojomod/registry/ForgeEvents.java @@ -48,6 +48,7 @@ public static void entityAttributes(EntityAttributeCreationEvent event) { event.put(ForgeEntities.JUSTICE.get(), StandEntity.createStandAttributes().build()); event.put(ForgeEntities.JUSTICE_PIRATE.get(), StandEntity.createStandAttributes().build()); event.put(ForgeEntities.D4C.get(), StandEntity.createStandAttributes().build()); + event.put(ForgeEntities.RATT.get(), StandEntity.createStandAttributes().build()); event.put(ForgeEntities.GREEN_DAY.get(), StandEntity.createStandAttributes().build()); event.put(ForgeEntities.SOFT_AND_WET.get(), StandEntity.createStandAttributes().build()); event.put(ForgeEntities.SOFT_AND_WET_KING.get(), StandEntity.createStandAttributes().build()); @@ -235,6 +236,8 @@ public static void registerRoundaboutBridge(FMLCommonSetupEvent event){ ModItems.MAX_STAND_DISC_D4C = ForgeItems.MAX_STAND_DISC_D4C.get(); ModItems.STAND_DISC_GREEN_DAY = ForgeItems.STAND_DISC_GREEN_DAY.get(); ((MaxStandDiscItem)ForgeItems.MAX_STAND_DISC_GREEN_DAY.get()).baseDisc = ((StandDiscItem)ForgeItems.STAND_DISC_GREEN_DAY.get()); + ModItems.STAND_DISC_RATT = ForgeItems.STAND_DISC_RATT.get(); + ((MaxStandDiscItem)ForgeItems.MAX_STAND_DISC_RATT.get()).baseDisc = ((StandDiscItem)ForgeItems.STAND_DISC_RATT.get()); ModItems.MAX_STAND_DISC_D4C = ForgeItems.MAX_STAND_DISC_GREEN_DAY.get(); ModItems.STAND_DISC_SOFT_AND_WET = ForgeItems.STAND_DISC_SOFT_AND_WET.get(); ((MaxStandDiscItem)ForgeItems.MAX_STAND_DISC_SOFT_AND_WET.get()).baseDisc = ((StandDiscItem)ForgeItems.STAND_DISC_SOFT_AND_WET.get()); @@ -335,6 +338,7 @@ public static void registerRoundaboutBridge(FMLCommonSetupEvent event){ ModEntities.MAGICIANS_RED_OVA = ForgeEntities.MAGICIANS_RED_OVA.get(); ModEntities.D4C = ForgeEntities.D4C.get(); ModEntities.GREEN_DAY = ForgeEntities.GREEN_DAY.get(); + ModEntities.RATT = ForgeEntities.RATT.get(); ModEntities.SOFT_AND_WET = ForgeEntities.SOFT_AND_WET.get(); ModEntities.SOFT_AND_WET_KING = ForgeEntities.SOFT_AND_WET_KING.get(); ModEntities.SOFT_AND_WET_DROWNED = ForgeEntities.SOFT_AND_WET_DROWNED.get(); diff --git a/forge/src/main/java/net/hydra/jojomod/registry/ForgeItems.java b/forge/src/main/java/net/hydra/jojomod/registry/ForgeItems.java index a2ab86726..a94720361 100644 --- a/forge/src/main/java/net/hydra/jojomod/registry/ForgeItems.java +++ b/forge/src/main/java/net/hydra/jojomod/registry/ForgeItems.java @@ -7,6 +7,7 @@ import net.hydra.jojomod.stand.powers.PowersD4C; import net.hydra.jojomod.stand.powers.PowersGreenDay; import net.hydra.jojomod.stand.powers.PowersHeyYa; +import net.hydra.jojomod.stand.powers.PowersRatt; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.item.*; import net.minecraft.world.item.alchemy.Potion; @@ -426,6 +427,10 @@ public class ForgeItems { () -> new StandDiscItem(new Item.Properties().stacksTo(1), new PowersGreenDay(null)))); public static final RegistryObject MAX_STAND_DISC_GREEN_DAY = addToWIPTab(ITEMS.register("max_green_day_disc", () -> new MaxStandDiscItem(new Item.Properties().stacksTo(1), new PowersGreenDay(null)))); + public static final RegistryObject STAND_DISC_RATT = addToWIPTab(ITEMS.register("ratt_disc", + () -> new StandDiscItem(new Item.Properties().stacksTo(1), new PowersRatt(null)))); + public static final RegistryObject MAX_STAND_DISC_RATT = addToWIPTab(ITEMS.register("max_ratt_disc", + () -> new MaxStandDiscItem(new Item.Properties().stacksTo(1), new PowersRatt(null)))); public static final RegistryObject WORTHY_ARROW = addToTab(ITEMS.register("worthy_arrow", () -> new WorthyArrowItem(new Item.Properties().stacksTo(1)))); public static final RegistryObject LUCKY_LIPSTICK = addToTab(ITEMS.register("lucky_lipstick",