Skip to content

Commit

Permalink
refactor moment
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Nov 28, 2024
1 parent c0358f4 commit 9feb405
Show file tree
Hide file tree
Showing 48 changed files with 115 additions and 114 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ hi
- Significantly optimized Sculk Sensor rendering with the `Minecraft Live Tendrils` resource pack.
- Fixed many recipe unlocks being broken in 1.21.2+.
- Added `WWBlockLootHelper` to significantly clean up block loot datagen.
- Refactored Wilder Wild's rendering-related classes to be consistent with Vanilla's naming scheme and structure.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import net.frozenblock.wilderwild.client.WWModelLayers;
import net.frozenblock.wilderwild.client.WWParticleEngine;
import net.frozenblock.wilderwild.client.WWTints;
import net.frozenblock.wilderwild.client.debug.OstrichDebugRenderer;
import net.frozenblock.wilderwild.entity.render.easter.WilderEasterEggs;
import net.frozenblock.wilderwild.client.renderer.debug.OstrichDebugRenderer;
import net.frozenblock.wilderwild.client.WilderEasterEggs;
import net.frozenblock.wilderwild.networking.WWClientNetworking;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.PackType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.frozenblock.wilderwild.block.entity.GeyserBlockEntity;
import net.frozenblock.wilderwild.block.property.GeyserStage;
import net.frozenblock.wilderwild.block.property.GeyserType;
import net.frozenblock.wilderwild.block.state.properties.GeyserStage;
import net.frozenblock.wilderwild.block.state.properties.GeyserType;
import net.frozenblock.wilderwild.registry.WWBlockEntityTypes;
import net.frozenblock.wilderwild.registry.WWBlockStateProperties;
import net.frozenblock.wilderwild.registry.WWSounds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.mojang.serialization.MapCodec;
import java.util.List;
import net.frozenblock.lib.math.api.AdvancedMath;
import net.frozenblock.wilderwild.block.property.FlowerColor;
import net.frozenblock.wilderwild.block.state.properties.FlowerColor;
import net.frozenblock.wilderwild.registry.WWBlockStateProperties;
import net.frozenblock.wilderwild.registry.WWBlocks;
import net.minecraft.core.BlockPos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import java.util.Map;
import java.util.Optional;
import net.frozenblock.lib.block.api.shape.FrozenShapes;
import net.frozenblock.wilderwild.block.property.BubbleDirection;
import net.frozenblock.wilderwild.block.state.properties.BubbleDirection;
import net.frozenblock.wilderwild.config.WWBlockConfig;
import net.frozenblock.wilderwild.registry.WWBlockStateProperties;
import net.frozenblock.wilderwild.registry.WWParticleTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import net.frozenblock.lib.wind.api.WindDisturbanceLogic;
import net.frozenblock.lib.wind.api.WindManager;
import net.frozenblock.wilderwild.block.GeyserBlock;
import net.frozenblock.wilderwild.block.property.GeyserStage;
import net.frozenblock.wilderwild.block.property.GeyserType;
import net.frozenblock.wilderwild.block.state.properties.GeyserStage;
import net.frozenblock.wilderwild.block.state.properties.GeyserType;
import net.frozenblock.wilderwild.mod_compat.FrozenLibIntegration;
import net.frozenblock.wilderwild.particle.options.WindParticleOptions;
import net.frozenblock.wilderwild.registry.WWBlockEntityTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.block.property;
package net.frozenblock.wilderwild.block.state.properties;

import java.util.Optional;
import net.minecraft.core.Direction;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.block.property;
package net.frozenblock.wilderwild.block.state.properties;

import net.minecraft.util.StringRepresentable;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.block.property;
package net.frozenblock.wilderwild.block.state.properties;

import net.minecraft.util.StringRepresentable;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.block.property;
package net.frozenblock.wilderwild.block.state.properties;

import net.frozenblock.wilderwild.registry.WWSounds;
import net.minecraft.sounds.SoundEvent;
Expand Down
54 changes: 27 additions & 27 deletions src/main/java/net/frozenblock/wilderwild/client/WWModelLayers.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.frozenblock.wilderwild.WWConstants;
import net.frozenblock.wilderwild.entity.render.blockentity.DisplayLanternBlockEntityRenderer;
import net.frozenblock.wilderwild.entity.render.blockentity.HangingTendrilBlockEntityRenderer;
import net.frozenblock.wilderwild.entity.render.blockentity.SculkSensorBlockEntityRenderer;
import net.frozenblock.wilderwild.entity.render.blockentity.StoneChestBlockEntityRenderer;
import net.frozenblock.wilderwild.entity.render.model.CrabModel;
import net.frozenblock.wilderwild.entity.render.model.JellyfishModel;
import net.frozenblock.wilderwild.entity.render.model.OstrichInbredModel;
import net.frozenblock.wilderwild.entity.render.model.OstrichModel;
import net.frozenblock.wilderwild.entity.render.model.ScorchedModel;
import net.frozenblock.wilderwild.entity.render.model.TumbleweedModel;
import net.frozenblock.wilderwild.entity.render.renderer.CrabRenderer;
import net.frozenblock.wilderwild.entity.render.renderer.FireflyRenderer;
import net.frozenblock.wilderwild.entity.render.renderer.JellyfishRenderer;
import net.frozenblock.wilderwild.entity.render.renderer.OstrichRenderer;
import net.frozenblock.wilderwild.entity.render.renderer.ScorchedRenderer;
import net.frozenblock.wilderwild.entity.render.renderer.TumbleweedRenderer;
import net.frozenblock.wilderwild.client.renderer.blockentity.DisplayLanternRenderer;
import net.frozenblock.wilderwild.client.renderer.blockentity.HangingTendrilRenderer;
import net.frozenblock.wilderwild.client.renderer.blockentity.SculkSensorRenderer;
import net.frozenblock.wilderwild.client.renderer.blockentity.StoneChestRenderer;
import net.frozenblock.wilderwild.client.model.CrabModel;
import net.frozenblock.wilderwild.client.model.JellyfishModel;
import net.frozenblock.wilderwild.client.model.OstrichInbredModel;
import net.frozenblock.wilderwild.client.model.OstrichModel;
import net.frozenblock.wilderwild.client.model.ScorchedModel;
import net.frozenblock.wilderwild.client.model.TumbleweedModel;
import net.frozenblock.wilderwild.client.renderer.entity.CrabRenderer;
import net.frozenblock.wilderwild.client.renderer.entity.FireflyRenderer;
import net.frozenblock.wilderwild.client.renderer.entity.JellyfishRenderer;
import net.frozenblock.wilderwild.client.renderer.entity.OstrichRenderer;
import net.frozenblock.wilderwild.client.renderer.entity.ScorchedRenderer;
import net.frozenblock.wilderwild.client.renderer.entity.TumbleweedRenderer;
import net.frozenblock.wilderwild.registry.WWBlockEntityTypes;
import net.frozenblock.wilderwild.registry.WWEntityTypes;
import net.minecraft.client.model.geom.ModelLayerLocation;
Expand Down Expand Up @@ -90,19 +90,19 @@ public static void init() {
EntityRendererRegistry.register(WWEntityTypes.SCULK_SPREADER, NoopRenderer::new);
EntityRendererRegistry.register(WWEntityTypes.FALLING_LEAVES, NoopRenderer::new);

BlockEntityRenderers.register(BlockEntityType.SCULK_SENSOR, SculkSensorBlockEntityRenderer::new);
BlockEntityRenderers.register(BlockEntityType.CALIBRATED_SCULK_SENSOR, SculkSensorBlockEntityRenderer::new);
EntityModelLayerRegistry.registerModelLayer(SCULK_SENSOR, SculkSensorBlockEntityRenderer::getTexturedModelData);
BlockEntityRenderers.register(BlockEntityType.SCULK_SENSOR, SculkSensorRenderer::new);
BlockEntityRenderers.register(BlockEntityType.CALIBRATED_SCULK_SENSOR, SculkSensorRenderer::new);
EntityModelLayerRegistry.registerModelLayer(SCULK_SENSOR, SculkSensorRenderer::getTexturedModelData);

BlockEntityRenderers.register(WWBlockEntityTypes.HANGING_TENDRIL, HangingTendrilBlockEntityRenderer::new);
EntityModelLayerRegistry.registerModelLayer(HANGING_TENDRIL, HangingTendrilBlockEntityRenderer::getTexturedModelData);
BlockEntityRenderers.register(WWBlockEntityTypes.HANGING_TENDRIL, HangingTendrilRenderer::new);
EntityModelLayerRegistry.registerModelLayer(HANGING_TENDRIL, HangingTendrilRenderer::getTexturedModelData);

BlockEntityRenderers.register(WWBlockEntityTypes.DISPLAY_LANTERN, DisplayLanternBlockEntityRenderer::new);
EntityModelLayerRegistry.registerModelLayer(DISPLAY_LANTERN, DisplayLanternBlockEntityRenderer::getTexturedModelData);
BlockEntityRenderers.register(WWBlockEntityTypes.DISPLAY_LANTERN, DisplayLanternRenderer::new);
EntityModelLayerRegistry.registerModelLayer(DISPLAY_LANTERN, DisplayLanternRenderer::getTexturedModelData);

BlockEntityRenderers.register(WWBlockEntityTypes.STONE_CHEST, StoneChestBlockEntityRenderer::new);
EntityModelLayerRegistry.registerModelLayer(STONE_CHEST, StoneChestBlockEntityRenderer::createSingleBodyLayer);
EntityModelLayerRegistry.registerModelLayer(DOUBLE_STONE_CHEST_LEFT, StoneChestBlockEntityRenderer::createDoubleBodyLeftLayer);
EntityModelLayerRegistry.registerModelLayer(DOUBLE_STONE_CHEST_RIGHT, StoneChestBlockEntityRenderer::createDoubleBodyRightLayer);
BlockEntityRenderers.register(WWBlockEntityTypes.STONE_CHEST, StoneChestRenderer::new);
EntityModelLayerRegistry.registerModelLayer(STONE_CHEST, StoneChestRenderer::createSingleBodyLayer);
EntityModelLayerRegistry.registerModelLayer(DOUBLE_STONE_CHEST_LEFT, StoneChestRenderer::createDoubleBodyLeftLayer);
EntityModelLayerRegistry.registerModelLayer(DOUBLE_STONE_CHEST_RIGHT, StoneChestRenderer::createDoubleBodyRightLayer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.easter;
package net.frozenblock.wilderwild.client;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.frozenblock.lib.entity.api.rendering.EntityTextureOverride;
import net.frozenblock.wilderwild.WWConstants;
import net.frozenblock.wilderwild.entity.render.animation.WilderWarden;
import net.frozenblock.wilderwild.client.animation.definitions.impl.WilderWarden;
import net.minecraft.world.entity.EntityType;

@Environment(EnvType.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.animation;
package net.frozenblock.wilderwild.client.animation.definitions;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand All @@ -26,7 +26,7 @@
import net.minecraft.client.animation.KeyframeAnimations;

@Environment(EnvType.CLIENT)
public final class CrabAnimations {
public final class CrabAnimation {

public static final AnimationDefinition CRAB_DIG = AnimationDefinition.Builder.withLength(4.75f)
.addAnimation("body",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.animation;
package net.frozenblock.wilderwild.client.animation.definitions;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand All @@ -29,7 +29,7 @@
* Put custom Allay animations in here. for example, dancing, swimming. Not for overrides
*/
@Environment(EnvType.CLIENT)
public final class CustomAllayAnimations {
public final class WWAllayAnimation {

public static final AnimationDefinition DANCING = AnimationDefinition.Builder.withLength(2.75F).looping()
.addAnimation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.animation;
package net.frozenblock.wilderwild.client.animation.definitions;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand All @@ -31,7 +31,7 @@
* Put custom Warden animations in here. for example, death, flying, swimming. Not for overrides.
*/
@Environment(EnvType.CLIENT)
public final class CustomWardenAnimations {
public final class WWWardenAnimation {

public static final AnimationDefinition WARDEN_DIG = AnimationDefinition.Builder.withLength(5.167667f)
.addAnimation("body",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.animation;
package net.frozenblock.wilderwild.client.animation.definitions.impl;

import net.minecraft.world.entity.AnimationState;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.animation;
package net.frozenblock.wilderwild.client.animation.definitions.impl;

import net.minecraft.world.entity.AnimationState;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.animation;
package net.frozenblock.wilderwild.client.animation.definitions.impl;

import java.util.List;
import net.minecraft.client.model.geom.ModelPart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.model;
package net.frozenblock.wilderwild.client.model;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.frozenblock.wilderwild.entity.Crab;
import net.frozenblock.wilderwild.entity.render.animation.CrabAnimations;
import net.frozenblock.wilderwild.client.animation.definitions.CrabAnimation;
import net.minecraft.client.model.HierarchicalModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
Expand Down Expand Up @@ -120,9 +120,9 @@ public void prepareMobModel(@NotNull T entity, float limbSwing, float limbSwingA
@Override
public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.root().getAllParts().forEach(ModelPart::resetPose);
this.animate(entity.hidingAnimationState, CrabAnimations.CRAB_EMERGE_WAIT, ageInTicks);
this.animate(entity.diggingAnimationState, CrabAnimations.CRAB_DIG, ageInTicks);
this.animate(entity.emergingAnimationState, CrabAnimations.CRAB_EMERGE, ageInTicks);
this.animate(entity.hidingAnimationState, CrabAnimation.CRAB_EMERGE_WAIT, ageInTicks);
this.animate(entity.diggingAnimationState, CrabAnimation.CRAB_DIG, ageInTicks);
this.animate(entity.emergingAnimationState, CrabAnimation.CRAB_EMERGE, ageInTicks);
bobClaw(this.main_claw, ageInTicks, 2F);
bobClaw(this.left_claw, ageInTicks, -2F);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.model;
package net.frozenblock.wilderwild.client.model;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.model;
package net.frozenblock.wilderwild.client.model;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.model;
package net.frozenblock.wilderwild.client.model;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.model;
package net.frozenblock.wilderwild.client.model;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.model;
package net.frozenblock.wilderwild.client.model;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.blockentity;
package net.frozenblock.wilderwild.client.renderer.blockentity;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.frozenblock.wilderwild.block.entity.DisplayLanternBlockEntity;
import net.frozenblock.wilderwild.client.WWModelLayers;
import net.frozenblock.wilderwild.entity.render.renderer.FireflyRenderer;
import net.frozenblock.wilderwild.client.renderer.entity.FireflyRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.geom.builders.LayerDefinition;
import net.minecraft.client.model.geom.builders.MeshDefinition;
Expand All @@ -38,10 +38,10 @@
import org.jetbrains.annotations.NotNull;

@Environment(EnvType.CLIENT)
public class DisplayLanternBlockEntityRenderer<T extends DisplayLanternBlockEntity> implements BlockEntityRenderer<T> {
public class DisplayLanternRenderer<T extends DisplayLanternBlockEntity> implements BlockEntityRenderer<T> {
private final ItemRenderer itemRenderer;

public DisplayLanternBlockEntityRenderer(@NotNull Context ctx) {
public DisplayLanternRenderer(@NotNull Context ctx) {
ctx.bakeLayer(WWModelLayers.DISPLAY_LANTERN);
this.itemRenderer = ctx.getItemRenderer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
*/

package net.frozenblock.wilderwild.entity.render.blockentity;
package net.frozenblock.wilderwild.client.renderer.blockentity;

import com.mojang.blaze3d.vertex.PoseStack;
import net.fabricmc.api.EnvType;
Expand All @@ -33,9 +33,9 @@
import org.jetbrains.annotations.NotNull;

@Environment(EnvType.CLIENT)
public class HangingTendrilBlockEntityRenderer<T extends HangingTendrilBlockEntity> extends BillboardBlockEntityRenderer<T> {
public class HangingTendrilRenderer<T extends HangingTendrilBlockEntity> extends BillboardBlockEntityRenderer<T> {

public HangingTendrilBlockEntityRenderer(@NotNull Context ctx) {
public HangingTendrilRenderer(@NotNull Context ctx) {
super(ctx);
}

Expand Down
Loading

0 comments on commit 9feb405

Please sign in to comment.