diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/animation/gecko/condition/ConditionArmor.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/animation/gecko/condition/ConditionArmor.java index 43135ee12..f2a07dcf0 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/animation/gecko/condition/ConditionArmor.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/animation/gecko/condition/ConditionArmor.java @@ -25,6 +25,16 @@ public class ConditionArmor { private final Map> idTest = Maps.newHashMap(); private final Map>> tagTest = Maps.newHashMap(); + @Nullable + public static EquipmentSlot getType(String type) { + for (EquipmentSlot equipmentslot : EquipmentSlot.values()) { + if (equipmentslot.getName().equals(type)) { + return equipmentslot; + } + } + return null; + } + public void addTest(String name) { Matcher matcherId = ID_PRE_REG.matcher(name); if (matcherId.find()) { @@ -114,15 +124,4 @@ private String doTagTest(EntityMaid maid, EquipmentSlot slot) { } return tagListTest.stream().filter(item::is).findFirst().map(itemTagKey -> slot.getName() + "#" + itemTagKey.location()).orElse(EMPTY); } - - - @Nullable - public static EquipmentSlot getType(String type) { - for (EquipmentSlot equipmentslot : EquipmentSlot.values()) { - if (equipmentslot.getName().equals(type)) { - return equipmentslot; - } - } - return null; - } } \ No newline at end of file diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/event/MaidSoundFreqEvent.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/event/MaidSoundFreqEvent.java index 78bfa99b2..2c6f305ba 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/event/MaidSoundFreqEvent.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/event/MaidSoundFreqEvent.java @@ -1,9 +1,7 @@ package com.github.tartaricacid.touhoulittlemaid.client.event; -import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid; import com.github.tartaricacid.touhoulittlemaid.client.sound.data.MaidSoundInstance; import com.github.tartaricacid.touhoulittlemaid.config.subconfig.InGameMaidConfig; -import net.minecraft.resources.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.sound.PlaySoundEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/gui/entity/detail/MaidModelDetailsGui.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/gui/entity/detail/MaidModelDetailsGui.java index cd37b9cde..524300283 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/gui/entity/detail/MaidModelDetailsGui.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/gui/entity/detail/MaidModelDetailsGui.java @@ -10,9 +10,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRenderDispatcher; -import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.entity.vehicle.Minecart; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ChatBubbleRenderer.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ChatBubbleRenderer.java index e9936ca47..3cd3d5626 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ChatBubbleRenderer.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ChatBubbleRenderer.java @@ -28,9 +28,9 @@ import java.util.function.Consumer; public class ChatBubbleRenderer { - private static final List> TMP_CHAT_BUBBLES = Lists.newArrayList(); protected static final RenderStateShard.TransparencyStateShard NO_TRANSPARENCY = new RenderStateShard.TransparencyStateShard("no_transparency", RenderSystem::disableBlend, () -> { }); + private static final List> TMP_CHAT_BUBBLES = Lists.newArrayList(); private static final String LEFT_ARROW = "left_arrow"; private static final String MIDDLE_ARROW = "middle_arrow"; private static final String RIGHT_ARROW = "right_arrow"; diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityChairRenderer.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityChairRenderer.java index a007cf463..0ab9da587 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityChairRenderer.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityChairRenderer.java @@ -36,14 +36,14 @@ public void render(Entity entity, float entityYaw, float partialTick, PoseStack } } - public void setMainInfo(ChairModelInfo mainInfo) { - this.mainInfo = mainInfo; - } - public ChairModelInfo getMainInfo() { return mainInfo; } + public void setMainInfo(ChairModelInfo mainInfo) { + this.mainInfo = mainInfo; + } + @Override public float getHeightScale(Object entity) { return mainInfo.getRenderEntityScale(); diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityMaidRenderer.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityMaidRenderer.java index 7ad6291db..1e9d4ce6c 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityMaidRenderer.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/GeckoEntityMaidRenderer.java @@ -43,14 +43,14 @@ public void render(Entity entity, float entityYaw, float partialTick, PoseStack } } - public void setMainInfo(MaidModelInfo mainInfo) { - this.mainInfo = mainInfo; - } - public MaidModelInfo getMainInfo() { return mainInfo; } + public void setMainInfo(MaidModelInfo mainInfo) { + this.mainInfo = mainInfo; + } + @Override public float getHeightScale(Object entity) { return mainInfo.getRenderEntityScale(); diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ReplaceExperienceOrbRenderer.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ReplaceExperienceOrbRenderer.java index 57a50ecad..e3f0d6a39 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ReplaceExperienceOrbRenderer.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/ReplaceExperienceOrbRenderer.java @@ -30,6 +30,10 @@ public ReplaceExperienceOrbRenderer(EntityRendererProvider.Context context) { this.vanillaRender = new ExperienceOrbRenderer(context); } + private static void vertex(VertexConsumer pConsumer, Matrix4f pMatrix, Matrix3f pMatrixNormal, float pX, float pY, int pRed, int pGreen, int pBlue, float pTexU, float pTexV, int pPackedLight) { + pConsumer.vertex(pMatrix, pX, pY, 0.0F).color(pRed, pGreen, pBlue, 128).uv(pTexU, pTexV).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(pPackedLight).normal(pMatrixNormal, 0.0F, 1.0F, 0.0F).endVertex(); + } + protected int getBlockLightLevel(ExperienceOrb pEntity, BlockPos pPos) { return Mth.clamp(super.getBlockLightLevel(pEntity, pPos) + 7, 0, 15); } @@ -66,10 +70,6 @@ private void renderPointItem(ExperienceOrb orb, float pEntityYaw, float partialT super.render(orb, pEntityYaw, partialTicks, poseStack, buffer, packedLight); } - private static void vertex(VertexConsumer pConsumer, Matrix4f pMatrix, Matrix3f pMatrixNormal, float pX, float pY, int pRed, int pGreen, int pBlue, float pTexU, float pTexV, int pPackedLight) { - pConsumer.vertex(pMatrix, pX, pY, 0.0F).color(pRed, pGreen, pBlue, 128).uv(pTexU, pTexV).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(pPackedLight).normal(pMatrixNormal, 0.0F, 1.0F, 0.0F).endVertex(); - } - public ResourceLocation getTextureLocation(ExperienceOrb pEntity) { return POINT_ITEM_TEXTURE; } diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/geckolayer/GeckoLayerMaidBackpack.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/geckolayer/GeckoLayerMaidBackpack.java index 4a16e723b..46fe98d0a 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/geckolayer/GeckoLayerMaidBackpack.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/client/renderer/entity/geckolayer/GeckoLayerMaidBackpack.java @@ -41,6 +41,11 @@ public GeckoLayerMaidBackpack(GeckoEntityMaidRenderer entityRendererIn, EntityMo bigModel = new MaidBackpackBigModel(modelSet.bakeLayer(MaidBackpackBigModel.LAYER)); } + protected static void renderColoredCutoutModel(EntityModel pModel, ResourceLocation pTextureLocation, PoseStack pPoseStack, MultiBufferSource pBuffer, int pPackedLight, T pEntity, float pRed, float pGreen, float pBlue) { + VertexConsumer vertexconsumer = pBuffer.getBuffer(RenderType.entityCutoutNoCull(pTextureLocation)); + pModel.renderToBuffer(pPoseStack, vertexconsumer, pPackedLight, LivingEntityRenderer.getOverlayCoords(pEntity, 0.0F), pRed, pGreen, pBlue, 1.0F); + } + @Override public void render(PoseStack poseStack, MultiBufferSource bufferIn, int packedLightIn, T livingEntity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { if (livingEntity instanceof EntityMaid maid && this.entityRenderer.getGeoModel() != null) { @@ -68,11 +73,6 @@ public void render(PoseStack poseStack, MultiBufferSource bufferIn, int packedLi } } - protected static void renderColoredCutoutModel(EntityModel pModel, ResourceLocation pTextureLocation, PoseStack pPoseStack, MultiBufferSource pBuffer, int pPackedLight, T pEntity, float pRed, float pGreen, float pBlue) { - VertexConsumer vertexconsumer = pBuffer.getBuffer(RenderType.entityCutoutNoCull(pTextureLocation)); - pModel.renderToBuffer(pPoseStack, vertexconsumer, pPackedLight, LivingEntityRenderer.getOverlayCoords(pEntity, 0.0F), pRed, pGreen, pBlue, 1.0F); - } - protected void translateToBackpack(PoseStack poseStack, GeoModel geoModel) { int size = geoModel.backpackBones.size(); for (int i = 0; i < size - 1; i++) { diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/ai/goal/MaidTemptGoal.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/ai/goal/MaidTemptGoal.java index e71a56e0a..44cc4d9d1 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/ai/goal/MaidTemptGoal.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/ai/goal/MaidTemptGoal.java @@ -12,18 +12,18 @@ public class MaidTemptGoal extends Goal { private static final TargetingConditions TEMP_TARGETING = TargetingConditions.forNonCombat().range(10).ignoreLineOfSight(); - private final TargetingConditions targetingConditions; protected final PathfinderMob mob; + private final TargetingConditions targetingConditions; private final double speedModifier; + private final Ingredient items; + private final boolean canScare; + @Nullable + protected EntityMaid maid; private double px; private double py; private double pz; - @Nullable - protected EntityMaid maid; private int calmDown; private boolean isRunning; - private final Ingredient items; - private final boolean canScare; public MaidTemptGoal(PathfinderMob mob, double speedModifier, Ingredient items, boolean canScare) { this.mob = mob; diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/passive/EntityMaid.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/passive/EntityMaid.java index 83b4dc757..5cc863618 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/passive/EntityMaid.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/entity/passive/EntityMaid.java @@ -61,7 +61,10 @@ import net.minecraft.stats.Stats; import net.minecraft.tags.TagKey; import net.minecraft.util.Mth; -import net.minecraft.world.*; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.MenuProvider; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.Brain; diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/geckolib3/core/manager/SingletonAnimationFactory.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/geckolib3/core/manager/SingletonAnimationFactory.java index 568fa2284..6a7db15ee 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/geckolib3/core/manager/SingletonAnimationFactory.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/geckolib3/core/manager/SingletonAnimationFactory.java @@ -3,7 +3,6 @@ import com.github.tartaricacid.touhoulittlemaid.geckolib3.core.IAnimatable; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/network/message/SendEffectMessage.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/network/message/SendEffectMessage.java index 0dc9b36b3..1285ccebe 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/network/message/SendEffectMessage.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/network/message/SendEffectMessage.java @@ -88,15 +88,15 @@ public EffectData(String descriptionId, int amplifier, int duration, int categor this.category = category; } + public static EffectData fromBytes(FriendlyByteBuf buf) { + return new EffectData(buf.readUtf(), buf.readInt(), buf.readInt(), buf.readInt()); + } + public void toBytes(FriendlyByteBuf buf) { buf.writeUtf(this.descriptionId); buf.writeInt(this.amplifier); buf.writeInt(this.duration); buf.writeInt(this.category); } - - public static EffectData fromBytes(FriendlyByteBuf buf) { - return new EffectData(buf.readUtf(), buf.readInt(), buf.readInt(), buf.readInt()); - } } } \ No newline at end of file diff --git a/src/main/java/com/github/tartaricacid/touhoulittlemaid/util/ItemsUtil.java b/src/main/java/com/github/tartaricacid/touhoulittlemaid/util/ItemsUtil.java index 8571e0f78..ce4498ead 100644 --- a/src/main/java/com/github/tartaricacid/touhoulittlemaid/util/ItemsUtil.java +++ b/src/main/java/com/github/tartaricacid/touhoulittlemaid/util/ItemsUtil.java @@ -5,7 +5,6 @@ import com.github.tartaricacid.touhoulittlemaid.inventory.handler.BaubleItemHandler; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntList; -import net.minecraft.world.Containers; import net.minecraft.world.entity.Entity; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler;