diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5cc731..8d5df03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,31 +1,41 @@ -name: build -on: [ pull_request, push ] +# Automatically build the project and run any configured tests for every push and submitted pull request. +# This can help catch issues that only occur on certain platforms or Java versions, and provides a first line of defense against bad commits. + +name: Build Winterly +on: [pull_request, push] jobs: build: strategy: matrix: - java: [ 17 ] - os: [ ubuntu-22.04 ] + # Use these Java versions + java: [ + 17, # Current Java LTS & minimum supported by Minecraft + ] + # Run on these operating systems + os: [windows-latest, macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Validate gradle wrapper + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 - name: Setup JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} - distribution: 'microsoft' - - name: Make gradle wrapper executable + distribution: 'zulu' + cache: gradle + - name: Make Gradle Wrapper Executable if: ${{ runner.os != 'Windows' }} run: chmod +x ./gradlew - - name: build + - name: Build run: ./gradlew build - name: Capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} - uses: actions/upload-artifact@v3 + if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS + uses: actions/upload-artifact@v4 with: name: Artifacts - path: build/libs/ + path: | + fabric/build/libs/ + neoforge/build/libs/ diff --git a/.github/workflows/publish-curseforge.yml b/.github/workflows/publish-curseforge.yml deleted file mode 100644 index a2aa82a..0000000 --- a/.github/workflows/publish-curseforge.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: publish-curseforge - -on: - release: - types: - - published - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Change wrapper permissions - run: chmod +x ./gradlew - - name: Build artifacts - run: ./gradlew build - - name: publish artifacts - uses: Kir-Antipov/mc-publish@v3.3.0 - with: - curseforge-id: 552628 - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - - files: | - build/libs/!(*-@(dev|sources|javadoc)).jar - build/libs/*-@(dev|sources|javadoc).jar - - version-type: beta - loaders: | - fabric - quilt - - game-version-filter: releases - - dependencies: | - fabric-api - cloth-config - trinkets - - java: | - 17 - - retry-attempts: 2 - retry-delay: 10000 - fail-mode: fail diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml deleted file mode 100644 index a249d69..0000000 --- a/.github/workflows/publish-github.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: publish-github - -on: - release: - types: - - published - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Change wrapper permissions - run: chmod +x ./gradlew - - name: Build artifacts - run: ./gradlew build - - name: Upload assets to GitHub - uses: AButler/upload-release-assets@v2.0 - with: - files: 'build/libs/*' - repo-token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/publish-modrinth.yml b/.github/workflows/publish-modrinth.yml deleted file mode 100644 index 4e3644c..0000000 --- a/.github/workflows/publish-modrinth.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: publish-modrinth - -on: - release: - types: - - published - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Change wrapper permissions - run: chmod +x ./gradlew - - name: Build artifacts - run: ./gradlew build - - name: publish artifacts - uses: Kir-Antipov/mc-publish@v3.3.0 - with: - modrinth-id: CEvDfomf - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - files: | - build/libs/!(*-@(dev|sources|javadoc)).jar - build/libs/*-@(dev|sources|javadoc).jar - - version-type: beta - loaders: | - fabric - quilt - - game-version-filter: releases - - dependencies: | - fabric-api - cloth-config - trinkets - - java: | - 17 - - retry-attempts: 2 - retry-delay: 10000 - fail-mode: fail diff --git a/.gitignore b/.gitignore index 4010a36..8dee9d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,40 @@ -# gradle - +# Gradle .gradle/ build/ out/ +output/ classes/ +libs/ -# brachyura - -.brachyura/ -buildscript/build/ - -# eclipse - +# Eclipse *.launch +.classpath +.project -# idea - +# IntelliJ IDEA .idea/ *.iml *.ipr *.iws -# vscode - +# Visual Studio Code .settings/ .vscode/ bin/ -.classpath -.project - -# macos +# macOS *.DS_Store -# fabric - +# Minecraft/Fabric run/ -# netbeans +# Java +hs_err_*.log +replay_*.log +*.hprof +*.jfr -netbeans/ \ No newline at end of file +# Misc +.metadata +.settings +.architectury-transformer \ No newline at end of file diff --git a/README.md b/README.md index e92c2c9..d9508ff 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Winterly - + [![CurseForge Downloads](https://cf.way2muchnoise.eu/full_winterly_downloads.svg)](https://curseforge.com/minecraft/mc-mods/winterly) [![MC Versions](https://cf.way2muchnoise.eu/versions/winterly.svg)](https://curseforge.com/minecraft/mc-mods/winterly) diff --git a/build.gradle b/build.gradle index 61cdc8a..d965887 100644 --- a/build.gradle +++ b/build.gradle @@ -1,73 +1,79 @@ plugins { - id "fabric-loom" version "1.4-SNAPSHOT" + id "architectury-plugin" version "3.4-SNAPSHOT" + id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false } -version = project.mod_version -group = project.maven_group - -repositories { - maven { - url "https://api.modrinth.com/maven" - content { includeGroup "maven.modrinth" } - } - maven { url "https://maven.ladysnake.org/releases" } //CCA - maven { url "https://maven.terraformersmc.com" } //trinkets - maven { url "https://maven.wispforest.io" } //owo-lib - maven { url "https://maven.shedaniel.me/" } //cloth-config +architectury { + minecraft = rootProject.minecraft_version } -dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" +subprojects { + apply plugin: "dev.architectury.loom" - modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api}" - modImplementation "dev.emi:trinkets:${project.trinkets_version}" + loom { + silentMojangMappingsLicense() + } - // we don't include these because trinkets already does it - modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}" - modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}" + dependencies { + minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" + mappings loom.officialMojangMappings() + } - modImplementation include("dev.onyxstudios.cardinal-components-api:cardinal-components-world:${project.cca_version}") + repositories { + maven { + name "NeoForged" + url "https://maven.neoforged.net/releases/" + } + } - // use modApi when owo lib is compatible with mc version - modApi "io.wispforest:owo-lib:${project.owo_lib}" + processResources { + def expandProps = [ + "name": rootProject.mod_name, + "version": rootProject.mod_version, + "description": rootProject.mod_description, + "id": rootProject.mod_id, + "homepage_url": rootProject.homepage_url, + "sources_url": rootProject.sources_url, + "issue_tracker_url": rootProject.issue_tracker_url, + "license": rootProject.license, + "minecraft_version": rootProject.minecraft_version, + "minecraft_version_range": rootProject.minecraft_version_range, + "minecraft_version_range_fabric": rootProject.minecraft_version_range_fabric, + "fabric_loader_version": rootProject.fabric_loader_version, + "fabric_version": rootProject.fabric_api_version, + "neoforge_version": rootProject.neoforge_version, + "neoforge_version_range": rootProject.neoforge_version_range + ] - modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}") { exclude(group: "net.fabricmc.fabric-api") } - modApi "com.terraformersmc:modmenu:${project.modmenu_version}" + filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', '*.mixins.json']) { + expand expandProps + } - modLocalRuntime "maven.modrinth:here-be-no-dragons:1.0.0" - modLocalRuntime "dev.emi:emi-fabric:1.0.29+1.20.4" + inputs.properties(expandProps) + } } -loom { - accessWidenerPath = file("src/main/resources/winterly.accesswidener") -} +allprojects { + apply plugin: "java" + apply plugin: "architectury-plugin" + apply plugin: "maven-publish" -base { - archivesName = project.archives_base_name -} + base { + archivesName = rootProject.archives_base_name + } -processResources { - inputs.property "version", project.version - filesMatching("fabric.mod.json") { - expand "version": project.version - } -} + version = rootProject.mod_version + group = rootProject.maven_group -tasks.withType(JavaCompile).configureEach { - it.options.encoding = "UTF-8" - it.options.release = 17 -} + repositories { + } -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - withSourcesJar() -} + tasks.withType(JavaCompile) { + options.encoding = "UTF-8" + options.release = 17 + } -jar { - from("LICENSE") { - rename { "${it}_${project.base.archivesName.get()}"} - } + java { + withSourcesJar() + } } diff --git a/common/build.gradle b/common/build.gradle new file mode 100644 index 0000000..64e73f8 --- /dev/null +++ b/common/build.gradle @@ -0,0 +1,16 @@ +architectury { + common(rootProject.enabled_platforms.split(",")) +} + +loom { + accessWidenerPath = file("src/main/resources/${project(":common").properties.mod_id}.accesswidener") +} + +dependencies { + // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies + // Do NOT use other classes from fabric loader + modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" + modCompileOnly ("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}") { exclude(group: "net.fabricmc.fabric-api") } + // Remove the next line if you don't want to depend on the API + //modApi "dev.architectury:architectury:${rootProject.architectury_version}" +} diff --git a/common/src/main/java/winterly/Winterly.java b/common/src/main/java/winterly/Winterly.java new file mode 100644 index 0000000..0d0b971 --- /dev/null +++ b/common/src/main/java/winterly/Winterly.java @@ -0,0 +1,18 @@ +package winterly; + +import net.minecraft.resources.ResourceLocation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import winterly.config.WinterlyClothConfig; +import winterly.config.WinterlyConfig; + +public class Winterly { + public static final String MOD_ID = "winterly"; + public static final Logger LOGGER = LoggerFactory.getLogger("Winterly"); + public static WinterlyConfig config = WinterlyClothConfig.init(); + + public static ResourceLocation id(String path) { + return new ResourceLocation(MOD_ID, path); + } + +} diff --git a/common/src/main/java/winterly/block/CommonFrozenFlowerBlock.java b/common/src/main/java/winterly/block/CommonFrozenFlowerBlock.java new file mode 100644 index 0000000..200c6e1 --- /dev/null +++ b/common/src/main/java/winterly/block/CommonFrozenFlowerBlock.java @@ -0,0 +1,177 @@ +package winterly.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.tags.BlockTags; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.pathfinder.PathComputationType; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.Nullable; +import winterly.data.CachedFlowers; +import winterly.registry.CommonWinterlyBlocks; + +import java.util.Objects; + +@SuppressWarnings("deprecation") +public class CommonFrozenFlowerBlock extends Block { + public static final IntegerProperty LAYERS = IntegerProperty.create("layers", 0, 8); + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + + protected static final VoxelShape[] LAYERS_TO_SHAPE = new VoxelShape[] { + Block.box(5.0, 0.0, 5.0, 11.0, 10.0, 11.0), + Block.box(0.0, 0.0, 0.0, 16.0, 2.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 4.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 6.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 8.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 10.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 12.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 14.0, 16.0), + Block.box(0.0, 0.0, 0.0, 16.0, 16.0, 16.0) + }; + + public CommonFrozenFlowerBlock(Properties settings) { + super(settings); + this.registerDefaultState(this.stateDefinition.any().setValue(LAYERS, 0).setValue(PERSISTENT, false)); + } + + @Override + public SoundType getSoundType(BlockState state) { + if(state.getValue(LAYERS) == 0) { + return SoundType.GRASS; + } + else { + return SoundType.SNOW; + } + } + + @Override + public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) { + if(type.equals(PathComputationType.LAND)) { + return state.getValue(LAYERS) < 5; + } + else return false; + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return LAYERS_TO_SHAPE[state.getValue(LAYERS)]; + } + + @Override + public VoxelShape getCollisionShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + if(state.getValue(LAYERS).equals(0) || state.getValue(LAYERS).equals(1)) { + return Shapes.empty(); + } + else { + return LAYERS_TO_SHAPE[state.getValue(LAYERS) - 1]; + } + } + + @Override + public VoxelShape getBlockSupportShape(BlockState state, BlockGetter world, BlockPos pos) { + return LAYERS_TO_SHAPE[state.getValue(LAYERS)]; + } + + @Override + public VoxelShape getVisualShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return LAYERS_TO_SHAPE[state.getValue(LAYERS)]; + } + + @Override + public boolean useShapeForLightOcclusion(BlockState state) { + return true; + } + + @Override + public float getShadeBrightness(BlockState state, BlockGetter world, BlockPos pos) { + return state.getValue(LAYERS) == 8 ? 0.2F : 1.0F; + } + + @Override + public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { + BlockPos down = pos.below(); + return this.canPlantOnTop(world.getBlockState(down)); + } + + protected boolean canPlantOnTop(BlockState floor) { + return floor.is(BlockTags.DIRT) || floor.is(Blocks.FARMLAND); + } + + @Override + public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { + return !state.canSurvive(world, pos) ? Blocks.AIR.defaultBlockState() : super.updateShape(state, direction, neighborState, world, pos, neighborPos); + } + + @Override + public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + if (world.getBrightness(LightLayer.BLOCK, pos) > 11) { + dropResources(state, world, pos); + if(state.getValue(LAYERS) != 0) { + var cachedFlower = CachedFlowers.getFlower(world, pos); + world.setBlockAndUpdate(pos, Objects.requireNonNullElse(cachedFlower, this).defaultBlockState()); + } + } + } + + @Override + public void destroy(LevelAccessor world, BlockPos pos, BlockState state) { + super.destroy(world, pos, state); + + if(state.getValue(LAYERS) != 0 && world instanceof ServerLevel server) { + var cachedFlower = CachedFlowers.getFlower(server, pos); + world.setBlock(pos, Objects.requireNonNullElse(cachedFlower, this).defaultBlockState(), Block.UPDATE_ALL); + } + } + + @Override + public boolean canBeReplaced(BlockState state, BlockPlaceContext context) { + int layers = state.getValue(LAYERS); + + if(layers == 8) { + return false; + } + if(context.getItemInHand().is(Blocks.SNOW.asItem())) { + if(layers == 0) { + return true; + } + else { + return context.getClickedFace() == Direction.UP; + } + } + return false; + } + + @Nullable + @Override + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + BlockState state = ctx.getLevel().getBlockState(ctx.getClickedPos()); + if(state.is(Blocks.SNOW) || state.is(CommonWinterlyBlocks.FROZEN_GRASS)) { + return defaultBlockState().setValue(LAYERS, 1).setValue(PERSISTENT, true); + } + else { + return super.getStateForPlacement(ctx); + } + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(LAYERS); + builder.add(PERSISTENT); + } +} diff --git a/common/src/main/java/winterly/block/CommonFrozenGrassBlock.java b/common/src/main/java/winterly/block/CommonFrozenGrassBlock.java new file mode 100644 index 0000000..0f45c62 --- /dev/null +++ b/common/src/main/java/winterly/block/CommonFrozenGrassBlock.java @@ -0,0 +1,59 @@ +package winterly.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.SnowLayerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; + +public class CommonFrozenGrassBlock extends SnowLayerBlock { + public static final BooleanProperty PERSISTENT = BlockStateProperties.PERSISTENT; + + public CommonFrozenGrassBlock(Properties settings) { + super(settings); + this.registerDefaultState(this.stateDefinition.any().setValue(LAYERS, 1).setValue(PERSISTENT, false)); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + super.createBlockStateDefinition(builder); + builder.add(PERSISTENT); + } + + @Override + public boolean canBeReplaced(BlockState state, BlockPlaceContext context) { + int layers = state.getValue(LAYERS); + + if(layers == 8 || context.getItemInHand().is(this.asItem())) { + return false; + } + if(context.getItemInHand().is(Blocks.SNOW.asItem())) { + return context.getClickedFace() == Direction.UP; + } + + return layers == 1; + } + + @Override + public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + if (world.getBrightness(LightLayer.BLOCK, pos) > 11) { + dropResources(state, world, pos); + world.setBlockAndUpdate(pos, Blocks.SHORT_GRASS.defaultBlockState()); + } + } + + @Override + public void destroy(LevelAccessor world, BlockPos pos, BlockState state) { + super.destroy(world, pos, state); + world.setBlock(pos, Blocks.SHORT_GRASS.defaultBlockState(), Block.UPDATE_ALL); + } +} diff --git a/common/src/main/java/winterly/block/GarlandLightsBlock.java b/common/src/main/java/winterly/block/GarlandLightsBlock.java new file mode 100644 index 0000000..7cc729c --- /dev/null +++ b/common/src/main/java/winterly/block/GarlandLightsBlock.java @@ -0,0 +1,81 @@ +package winterly.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.Nullable; + +@SuppressWarnings("deprecation") +public class GarlandLightsBlock extends Block { + public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING; + + private static final VoxelShape EAST_SHAPE = box(0, 3, 0, 1, 13, 16); + private static final VoxelShape WEST_SHAPE = box(15, 3, 0, 16, 13, 16); + private static final VoxelShape SOUTH_SHAPE = box(0, 3, 0, 16, 13, 1); + private static final VoxelShape NORTH_SHAPE = box(0, 3, 15, 16, 13, 16); + + public GarlandLightsBlock(Properties settings) { + super(settings); + this.registerDefaultState(defaultBlockState().setValue(FACING, Direction.NORTH)); + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return switch (state.getValue(FACING)) { + case NORTH -> NORTH_SHAPE; + case SOUTH -> SOUTH_SHAPE; + case WEST -> WEST_SHAPE; + default -> EAST_SHAPE; + }; + } + + @Override + public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { + Direction direction = state.getValue(FACING); + return this.canPlaceOn(world, pos.relative(direction.getOpposite())); + } + + private boolean canPlaceOn(BlockGetter world, BlockPos pos) { + BlockState state = world.getBlockState(pos); + return !state.isAir(); + } + + @Nullable + @Override + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + if (!ctx.replacingClickedOnBlock()) { + BlockState state = ctx.getLevel().getBlockState(ctx.getClickedPos().relative(ctx.getClickedFace().getOpposite())); + if (state.is(this) && state.getValue(FACING) == ctx.getClickedFace()) { + return null; + } + } + + BlockState state = this.defaultBlockState(); + LevelReader world = ctx.getLevel(); + BlockPos pos = ctx.getClickedPos(); + + for(Direction direction : ctx.getNearestLookingDirections()) { + if (direction.getAxis().isHorizontal()) { + state = state.setValue(FACING, direction.getOpposite()); + if (state.canSurvive(world, pos)) { + return state; + } + } + } + return null; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING); + } +} diff --git a/common/src/main/java/winterly/block/GiftBoxBlock.java b/common/src/main/java/winterly/block/GiftBoxBlock.java new file mode 100644 index 0000000..2dea296 --- /dev/null +++ b/common/src/main/java/winterly/block/GiftBoxBlock.java @@ -0,0 +1,140 @@ +package winterly.block; + +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.locale.Language; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.Style; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.enchantment.EnchantmentHelper; +import net.minecraft.world.item.enchantment.Enchantments; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.EntityBlock; +import net.minecraft.world.level.block.ShulkerBoxBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.Nullable; +import winterly.Winterly; +import winterly.block.entity.GiftBoxBlockEntity; +import winterly.block.entity.GiftBoxBlockEntityData; +import winterly.data.GiftBoxData; + +import java.util.List; + +@SuppressWarnings("deprecation") +public class GiftBoxBlock extends Block implements EntityBlock { + public static final VoxelShape SHAPE = box(4, 0, 4, 12, 8, 12); + + public GiftBoxBlock(Properties settings) { + super(settings); + } + + @Nullable + @Override + public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { + return new GiftBoxBlockEntity(pos, state); + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return GiftBoxBlock.SHAPE; + } + + @Override + public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + super.setPlacedBy(world, pos, state, placer, stack); + + if(world.getBlockEntity(pos) instanceof GiftBoxBlockEntityData entity) { + entity.load(stack.getOrCreateTag()); + } + } + + @Override + public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) { + super.playerWillDestroy(world, pos, state, player); + + if(!world.isClientSide && world.getBlockEntity(pos) instanceof GiftBoxBlockEntityData entity) { + ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND); + if(!EnchantmentHelper.getEnchantments(stack).containsKey(Enchantments.SILK_TOUCH)) { + if(entity.getStacks().isEmpty()) { + popResource(world, pos, new ItemStack(this.asItem())); + } + else { + entity.getStacks().forEach(st -> popResource(world, pos, st)); + } + } + else { + ItemStack box = new ItemStack(this); + + if(!entity.getStacks().isEmpty()) { + var nbt = new CompoundTag(); + entity.saveAdditional(nbt); + box.setTag(nbt); + } + popResource(world, pos, box); + } + } + return state; + } + + @Override + public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + if(!world.isClientSide && world.getBlockEntity(pos) instanceof GiftBoxBlockEntityData entity) { + var stack = player.getItemInHand(hand); + + if(!stack.isEmpty() && entity.getStacks().size() < Winterly.config.getGiftBoxCapacity()) { + if(stack.getItem() instanceof BlockItem blockItem) { + if(blockItem.getBlock() instanceof ShulkerBoxBlock || blockItem.getBlock() instanceof GiftBoxBlock) { + return InteractionResult.PASS; + } + } + entity.getStacks().add(stack.copy()); + player.setItemInHand(hand, ItemStack.EMPTY); + world.playSound(null, pos, SoundEvents.BUNDLE_INSERT, SoundSource.BLOCKS, 1, 1); + return InteractionResult.SUCCESS; + } + } + return super.use(state, world, pos, player, hand, hit); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter world, List tooltip, TooltipFlag options) { + super.appendHoverText(stack, world, tooltip, options); + + if(stack.getOrCreateTag().contains("giftBoxData")) { + var gift = GiftBoxData.fromNbt(stack.getOrCreateTag().getCompound("giftBoxData")); + + gift.stacks.forEach(st -> { + String name = Language.getInstance().getOrDefault(st.getDescriptionId()); + tooltip.add(Component.nullToEmpty("- " + name + " x" + st.getCount()).toFlatList(Style.EMPTY.withColor(ChatFormatting.GRAY)).get(0)); + }); + } + else { + Language lang = Language.getInstance(); + String key = "description.winterly.gift_box."; + + for(int i = 0; i <= 32; i++) { + if(lang.has(key + i)) { + tooltip.add(Component.translatable(key + i).toFlatList(Style.EMPTY.withColor(ChatFormatting.GRAY)).get(0)); + } + if(!lang.has(key + (i + 1))) { + break; + } + } + } + } +} diff --git a/common/src/main/java/winterly/block/IcicleBlock.java b/common/src/main/java/winterly/block/IcicleBlock.java new file mode 100644 index 0000000..b7d9703 --- /dev/null +++ b/common/src/main/java/winterly/block/IcicleBlock.java @@ -0,0 +1,120 @@ +package winterly.block; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; +import net.minecraft.world.level.block.SimpleWaterloggedBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.BooleanProperty; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.material.FluidState; +import net.minecraft.world.level.material.Fluids; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.Nullable; +import winterly.registry.CommonWinterlyBlocks; + +import java.util.List; + +@SuppressWarnings("deprecation") +public class IcicleBlock extends Block implements SimpleWaterloggedBlock { + public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED; + public static final DirectionProperty FACING = BlockStateProperties.FACING; + + public static final VoxelShape NORTH_SHAPE = box(3, 3, 9, 13, 13, 16); + public static final VoxelShape SOUTH_SHAPE = box(3, 3, 0, 13, 13, 7); + public static final VoxelShape EAST_SHAPE = box(0, 3, 3, 7, 13, 13); + public static final VoxelShape WEST_SHAPE = box(13, 3, 3, 16, 13, 13); + public static final VoxelShape UP_SHAPE = box(3, 0, 3, 13, 7, 13); + public static final VoxelShape DOWN_SHAPE = box(3, 9, 3, 13, 16, 13); + + public IcicleBlock(Properties settings) { + super(settings); + this.registerDefaultState(this.defaultBlockState().setValue(WATERLOGGED, Boolean.FALSE).setValue(FACING, Direction.DOWN)); + } + + @Override + public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { + Direction direction = state.getValue(FACING); + BlockPos blockPos = pos.relative(direction.getOpposite()); + BlockState blockState = world.getBlockState(blockPos); + return !blockState.isAir() && !blockState.is(this); + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + Direction direction = state.getValue(FACING); + return switch (direction) { + case NORTH -> NORTH_SHAPE; + case SOUTH -> SOUTH_SHAPE; + case EAST -> EAST_SHAPE; + case WEST -> WEST_SHAPE; + case DOWN -> DOWN_SHAPE; + default -> UP_SHAPE; + }; + } + + @Override + public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) { + if (state.getValue(WATERLOGGED)) { + world.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(world)); + } + return direction == state.getValue(FACING).getOpposite() && !state.canSurvive(world, pos) + ? Blocks.AIR.defaultBlockState() + : super.updateShape(state, direction, neighborState, world, pos, neighborPos); + } + + @Nullable + @Override + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + LevelAccessor world = ctx.getLevel(); + BlockPos pos = ctx.getClickedPos(); + return this.defaultBlockState() + .setValue(WATERLOGGED, world.getFluidState(pos).getType() == Fluids.WATER) + .setValue(FACING, ctx.getClickedFace()); + } + + @Override + public BlockState rotate(BlockState state, Rotation rotation) { + return state.setValue(FACING, rotation.rotate(state.getValue(FACING))); + } + + @Override + public BlockState mirror(BlockState state, Mirror mirror) { + return state.rotate(mirror.getRotation(state.getValue(FACING))); + } + + @Override + public FluidState getFluidState(BlockState state) { + return state.getValue(WATERLOGGED) ? Fluids.WATER.getSource(false) : super.getFluidState(state); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(WATERLOGGED, FACING); + } + + @Environment(EnvType.CLIENT) + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter world, List tooltip, TooltipFlag options) { + if(this.equals(CommonWinterlyBlocks.ICICLE)) { + tooltip.add(Component.translatable("tag.winterly.placeable").withStyle(ChatFormatting.GRAY)); + } + super.appendHoverText(stack, world, tooltip, options); + } +} diff --git a/common/src/main/java/winterly/block/SnowballWallBlock.java b/common/src/main/java/winterly/block/SnowballWallBlock.java new file mode 100644 index 0000000..b4d179b --- /dev/null +++ b/common/src/main/java/winterly/block/SnowballWallBlock.java @@ -0,0 +1,41 @@ +package winterly.block; + +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; + +@SuppressWarnings("deprecation") +public class SnowballWallBlock extends HorizontalDirectionalBlock { + private static final VoxelShape SHAPE = box(4, 0, 4, 12, 12, 12); + + public SnowballWallBlock(Properties settings) { + super(settings); + } + + @Override + protected MapCodec codec() { + return null; + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return SHAPE; + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + return this.defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite()); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING); + } +} diff --git a/common/src/main/java/winterly/block/SnowguyBlock.java b/common/src/main/java/winterly/block/SnowguyBlock.java new file mode 100644 index 0000000..b323b11 --- /dev/null +++ b/common/src/main/java/winterly/block/SnowguyBlock.java @@ -0,0 +1,57 @@ +package winterly.block; + +import com.mojang.serialization.MapCodec; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.ChatFormatting; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.HorizontalDirectionalBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +@SuppressWarnings("deprecation") +public class SnowguyBlock extends HorizontalDirectionalBlock { + public static final VoxelShape SHAPE = box(4, 0, 4, 12, 14, 12); + + public SnowguyBlock(Properties settings) { + super(settings); + } + + @Override + protected MapCodec codec() { + return null; + } + + @Override + public VoxelShape getShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context) { + return SHAPE; + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext ctx) { + return this.defaultBlockState().setValue(FACING, ctx.getHorizontalDirection().getOpposite()); + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder builder) { + builder.add(FACING); + } + + @Environment(EnvType.CLIENT) + @Override + public void appendHoverText(ItemStack stack, @Nullable BlockGetter world, List tooltip, TooltipFlag options) { + tooltip.add(Component.translatable("tag.winterly.placeable").withStyle(ChatFormatting.GRAY)); + super.appendHoverText(stack, world, tooltip, options); + } +} diff --git a/common/src/main/java/winterly/block/base/BasePaneBlock.java b/common/src/main/java/winterly/block/base/BasePaneBlock.java new file mode 100644 index 0000000..d736ad8 --- /dev/null +++ b/common/src/main/java/winterly/block/base/BasePaneBlock.java @@ -0,0 +1,10 @@ +package winterly.block.base; + +import net.minecraft.world.level.block.IronBarsBlock; + +public class BasePaneBlock extends IronBarsBlock { + + public BasePaneBlock(Properties settings) { + super(settings); + } +} diff --git a/common/src/main/java/winterly/block/base/BaseStairsBlock.java b/common/src/main/java/winterly/block/base/BaseStairsBlock.java new file mode 100644 index 0000000..9baa8b2 --- /dev/null +++ b/common/src/main/java/winterly/block/base/BaseStairsBlock.java @@ -0,0 +1,11 @@ +package winterly.block.base; + +import net.minecraft.world.level.block.StairBlock; +import net.minecraft.world.level.block.state.BlockState; + +public class BaseStairsBlock extends StairBlock { + + public BaseStairsBlock(BlockState base, Properties settings) { + super(base, settings); + } +} diff --git a/common/src/main/java/winterly/block/entity/GiftBoxBlockEntity.java b/common/src/main/java/winterly/block/entity/GiftBoxBlockEntity.java new file mode 100644 index 0000000..ed2acac --- /dev/null +++ b/common/src/main/java/winterly/block/entity/GiftBoxBlockEntity.java @@ -0,0 +1,38 @@ +package winterly.block.entity; + +import winterly.data.GiftBoxData; +import winterly.registry.CommonWinterlyBlockEntities; + +import java.util.ArrayList; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +public class GiftBoxBlockEntity extends BlockEntity implements GiftBoxBlockEntityData { + public ArrayList stacks = new ArrayList<>(); + + public GiftBoxBlockEntity(BlockPos pos, BlockState state) { + super(CommonWinterlyBlockEntities.GIFT_BOX_BLOCK_ENTITY, pos, state); + } + + @Override + public ArrayList getStacks() { + return this.stacks; + } + + @Override + public void saveAdditional(CompoundTag nbt) { + super.saveAdditional(nbt); + nbt.put("giftBoxData", GiftBoxData.toNbt(this)); + } + + @Override + public void load(CompoundTag nbt) { + super.load(nbt); + var data = GiftBoxData.fromNbt(nbt.getCompound("giftBoxData")); + this.stacks = data.stacks; + } + +} diff --git a/common/src/main/java/winterly/block/entity/GiftBoxBlockEntityData.java b/common/src/main/java/winterly/block/entity/GiftBoxBlockEntityData.java new file mode 100644 index 0000000..3fe98e6 --- /dev/null +++ b/common/src/main/java/winterly/block/entity/GiftBoxBlockEntityData.java @@ -0,0 +1,12 @@ +package winterly.block.entity; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.ItemStack; + +import java.util.ArrayList; + +public interface GiftBoxBlockEntityData { + ArrayList getStacks(); + void saveAdditional(CompoundTag nbt); + void load(CompoundTag nbt); +} diff --git a/common/src/main/java/winterly/client/WinterlyModelLayers.java b/common/src/main/java/winterly/client/WinterlyModelLayers.java new file mode 100644 index 0000000..6a8ecc4 --- /dev/null +++ b/common/src/main/java/winterly/client/WinterlyModelLayers.java @@ -0,0 +1,14 @@ +package winterly.client; + +import net.minecraft.client.model.geom.ModelLayerLocation; + +import static winterly.Winterly.id; + +public class WinterlyModelLayers { + public static final ModelLayerLocation SANTA_HAT_LAYER = of("santa_hat"); + public static final ModelLayerLocation SCARF_LAYER = of("scarf"); + + private static ModelLayerLocation of(String name){ + return new ModelLayerLocation(id(name), "main"); + } +} diff --git a/common/src/main/java/winterly/client/model/SantaHatModel.java b/common/src/main/java/winterly/client/model/SantaHatModel.java new file mode 100644 index 0000000..a80a600 --- /dev/null +++ b/common/src/main/java/winterly/client/model/SantaHatModel.java @@ -0,0 +1,40 @@ +package winterly.client.model; + +import com.google.common.collect.ImmutableList; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.*; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.CubeListBuilder; +import net.minecraft.client.model.geom.builders.LayerDefinition; +import net.minecraft.client.model.geom.builders.MeshDefinition; +import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.client.renderer.RenderType; + +public class SantaHatModel extends Model { + public final ModelPart hat; + + public SantaHatModel(ModelPart root) { + super(RenderType::entityCutoutNoCull); + this.hat = root.getChild("hat"); + } + + public static LayerDefinition getTexturedModelData() { + MeshDefinition modelData = new MeshDefinition(); + PartDefinition modelPartData = modelData.getRoot(); + + PartDefinition hat = modelPartData.addOrReplaceChild("hat", CubeListBuilder.create().texOffs(27, 14).addBox(-4.0F, -8.0F, 7.0F, 3.0F, 3.0F, 3.0F), PartPose.offset(0.0F, 24.0F, 0.0F)); + + hat.addOrReplaceChild("cube_1", CubeListBuilder.create().texOffs(0, 27).addBox(-3.0F, -5.0F, 0.0F, 6.0F, 4.0F, 8.0F), PartPose.offsetAndRotation(0.0F, -8.0F, 0.0F, -0.3491F, 0.0F, 0.0F)); + hat.addOrReplaceChild("cube_2", CubeListBuilder.create().texOffs(0, 14).addBox(-4.5F, -3.0F, -3.5F, 9.0F, 4.0F, 9.0F), PartPose.offsetAndRotation(0.0F, -8.0F, 0.0F, -0.5236F, 0.0F, 0.0F)); + hat.addOrReplaceChild("cube_3", CubeListBuilder.create().texOffs(0, 0).addBox(-5.5F, 0.0F, -4.5F, 11.0F, 3.0F, 11.0F), PartPose.offsetAndRotation(0.0F, -8.0F, 0.0F, -0.2618F, 0.0F, 0.0F)); + + return LayerDefinition.create(modelData, 64, 64); + } + + @Override + public void renderToBuffer(PoseStack matrices, VertexConsumer vertices, int light, int overlay, float r, float g, float b, float a) { + ImmutableList.of(this.hat).forEach((part) -> part.render(matrices, vertices, light, overlay, r, g, b, a)); + } +} diff --git a/common/src/main/java/winterly/client/model/ScarfModel.java b/common/src/main/java/winterly/client/model/ScarfModel.java new file mode 100644 index 0000000..40ff91e --- /dev/null +++ b/common/src/main/java/winterly/client/model/ScarfModel.java @@ -0,0 +1,39 @@ +package winterly.client.model; + +import com.google.common.collect.ImmutableList; +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.*; +import net.minecraft.client.model.geom.ModelPart; +import net.minecraft.client.model.geom.PartPose; +import net.minecraft.client.model.geom.builders.CubeDeformation; +import net.minecraft.client.model.geom.builders.CubeListBuilder; +import net.minecraft.client.model.geom.builders.LayerDefinition; +import net.minecraft.client.model.geom.builders.MeshDefinition; +import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.client.renderer.RenderType; + +public class ScarfModel extends Model { + public final ModelPart scarf; + + public ScarfModel(ModelPart root) { + super(RenderType::entityCutoutNoCull); + this.scarf = root.getChild("scarf"); + } + + public static LayerDefinition getTexturedModelData() { + MeshDefinition modelData = new MeshDefinition(); + PartDefinition modelPartData = modelData.getRoot(); + + PartDefinition scarf = modelPartData.addOrReplaceChild("scarf", CubeListBuilder.create().texOffs(0, 0).addBox(-5.0F, -1.0F, -5.0F, 10.0F, 3.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); + scarf.addOrReplaceChild("back_hanger", CubeListBuilder.create().texOffs(0, 13).addBox(-5.0F, 3.0F, 3.0F, 5.0F, 16.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.rotation(0.3491F, 0.0F, 0.0F)); + scarf.addOrReplaceChild("front_hanger", CubeListBuilder.create().texOffs(0, 13).addBox(-1.0F, 2.0F, -4.0F, 5.0F, 16.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.rotation(0.0F, -0.2618F, 0.0F)); + + return LayerDefinition.create(modelData, 64, 64); + } + + @Override + public void renderToBuffer(PoseStack matrices, VertexConsumer vertices, int light, int overlay, float r, float g, float b, float a) { + ImmutableList.of(this.scarf).forEach((part) -> part.render(matrices, vertices, light, overlay, r, g, b, a)); + } +} diff --git a/src/main/java/winterly/client/model/WinterlyModels.java b/common/src/main/java/winterly/client/model/WinterlyModels.java similarity index 53% rename from src/main/java/winterly/client/model/WinterlyModels.java rename to common/src/main/java/winterly/client/model/WinterlyModels.java index 9103190..f41c51b 100644 --- a/src/main/java/winterly/client/model/WinterlyModels.java +++ b/common/src/main/java/winterly/client/model/WinterlyModels.java @@ -1,15 +1,15 @@ package winterly.client.model; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.model.ModelPart; -import net.minecraft.client.render.entity.model.EntityModelLayer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.geom.ModelLayerLocation; +import net.minecraft.client.model.geom.ModelPart; import winterly.client.WinterlyModelLayers; public class WinterlyModels { public static final ScarfModel SCARF_MODEL = new ScarfModel(getModelPart(WinterlyModelLayers.SCARF_LAYER)); public static final SantaHatModel SANTA_HAT_MODEL = new SantaHatModel(getModelPart(WinterlyModelLayers.SANTA_HAT_LAYER)); - public static ModelPart getModelPart(EntityModelLayer layer){ - return MinecraftClient.getInstance().getEntityModelLoader().getModelPart(layer); + public static ModelPart getModelPart(ModelLayerLocation layer){ + return Minecraft.getInstance().getEntityModels().bakeLayer(layer); } } diff --git a/common/src/main/java/winterly/client/render/DecorationFeatureRenderer.java b/common/src/main/java/winterly/client/render/DecorationFeatureRenderer.java new file mode 100644 index 0000000..b0f1636 --- /dev/null +++ b/common/src/main/java/winterly/client/render/DecorationFeatureRenderer.java @@ -0,0 +1,26 @@ +package winterly.client.render; + +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.RenderLayerParent; +import net.minecraft.client.renderer.entity.layers.RenderLayer; +import net.minecraft.world.entity.LivingEntity; +import winterly.extension.DecoratedMob; + +public class DecorationFeatureRenderer> extends RenderLayer { + + public DecorationFeatureRenderer(RenderLayerParent context) { + super(context); + } + + @Override + public void render(PoseStack matrices, MultiBufferSource vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { + if(entity instanceof DecoratedMob decorated) { + if(decorated.winterly$decorated()) { + MobDecorationRenderer renderer = MobDecorationRenderers.getRenderer(decorated.winterly$getIndex()); + renderer.render(this.getParentModel(), matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch); + } + } + } +} diff --git a/common/src/main/java/winterly/client/render/MobDecorationRenderer.java b/common/src/main/java/winterly/client/render/MobDecorationRenderer.java new file mode 100644 index 0000000..211b690 --- /dev/null +++ b/common/src/main/java/winterly/client/render/MobDecorationRenderer.java @@ -0,0 +1,16 @@ +package winterly.client.render; + +import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.world.entity.LivingEntity; + +public abstract class MobDecorationRenderer { + public final String texture; + + public MobDecorationRenderer(String texture) { + this.texture = texture; + } + + abstract public void render(HumanoidModel contextModel, PoseStack matrices, MultiBufferSource vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch); +} diff --git a/src/main/java/winterly/client/render/MobDecorationRenderers.java b/common/src/main/java/winterly/client/render/MobDecorationRenderers.java similarity index 100% rename from src/main/java/winterly/client/render/MobDecorationRenderers.java rename to common/src/main/java/winterly/client/render/MobDecorationRenderers.java diff --git a/common/src/main/java/winterly/client/render/SantaHatRenderer.java b/common/src/main/java/winterly/client/render/SantaHatRenderer.java new file mode 100644 index 0000000..40a9ddd --- /dev/null +++ b/common/src/main/java/winterly/client/render/SantaHatRenderer.java @@ -0,0 +1,25 @@ +package winterly.client.render; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.world.entity.LivingEntity; +import winterly.Winterly; +import winterly.client.model.WinterlyModels; + +public class SantaHatRenderer extends MobDecorationRenderer { + + public SantaHatRenderer(String texture) { + super(texture); + } + + @Override + public void render(HumanoidModel contextModel, PoseStack matrices, MultiBufferSource vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { + WinterlyModels.SANTA_HAT_MODEL.hat.copyFrom(contextModel.head); + VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + texture + ".png"))); + WinterlyModels.SANTA_HAT_MODEL.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + } +} diff --git a/common/src/main/java/winterly/client/render/ScarfRenderer.java b/common/src/main/java/winterly/client/render/ScarfRenderer.java new file mode 100644 index 0000000..48c597d --- /dev/null +++ b/common/src/main/java/winterly/client/render/ScarfRenderer.java @@ -0,0 +1,25 @@ +package winterly.client.render; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.world.entity.LivingEntity; +import winterly.Winterly; +import winterly.client.model.WinterlyModels; + +public class ScarfRenderer extends MobDecorationRenderer { + + public ScarfRenderer(String texture) { + super(texture); + } + + @Override + public void render(HumanoidModel contextModel, PoseStack matrices, MultiBufferSource vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { + WinterlyModels.SCARF_MODEL.scarf.copyFrom(contextModel.body); + VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + texture + ".png"))); + WinterlyModels.SCARF_MODEL.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + } +} diff --git a/src/main/java/winterly/config/WinterlyClientConfig.java b/common/src/main/java/winterly/config/WinterlyClientConfig.java similarity index 86% rename from src/main/java/winterly/config/WinterlyClientConfig.java rename to common/src/main/java/winterly/config/WinterlyClientConfig.java index b752e15..e09e985 100644 --- a/src/main/java/winterly/config/WinterlyClientConfig.java +++ b/common/src/main/java/winterly/config/WinterlyClientConfig.java @@ -6,8 +6,8 @@ import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.text.Text; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.network.chat.Component; import winterly.Winterly; @Environment(EnvType.CLIENT) @@ -30,10 +30,10 @@ public static void setupEntries(ConfigCategory category, ConfigEntryBuilder buil .setSaveConsumer(newValue -> config.maxGiftBoxCapacity = newValue) .build()); - category.addEntry(builder.startBooleanToggle(text("option.update_checker_enabled"), config.updateCheckerEnabled) - .setDefaultValue(true) - .setSaveConsumer(newValue -> config.updateCheckerEnabled = newValue) - .build()); +// category.addEntry(builder.startBooleanToggle(text("option.update_checker_enabled"), config.updateCheckerEnabled) +// .setDefaultValue(true) +// .setSaveConsumer(newValue -> config.updateCheckerEnabled = newValue) +// .build()); category.addEntry(builder.startBooleanToggle(text("option.generate_underground_icicles"), config.generateUndergroundIcicles) .setDefaultValue(true) @@ -56,7 +56,7 @@ public static void setupEntries(ConfigCategory category, ConfigEntryBuilder buil .build()); category.addEntry(builder.startBooleanToggle(text("option.mob_decorations.enabled"), config.mobDecorations.enabled) - .setDefaultValue(false) + .setDefaultValue(true) .setSaveConsumer(newValue -> config.mobDecorations.enabled = newValue) .build()); @@ -71,7 +71,7 @@ public static void setupEntries(ConfigCategory category, ConfigEntryBuilder buil .build()); } - private static Text text(String key) { - return Text.translatable("config.winterly." + key); + private static Component text(String key) { + return Component.translatable("config.winterly." + key); } } diff --git a/src/main/java/winterly/config/WinterlyClothConfig.java b/common/src/main/java/winterly/config/WinterlyClothConfig.java similarity index 100% rename from src/main/java/winterly/config/WinterlyClothConfig.java rename to common/src/main/java/winterly/config/WinterlyClothConfig.java diff --git a/src/main/java/winterly/config/WinterlyConfig.java b/common/src/main/java/winterly/config/WinterlyConfig.java similarity index 93% rename from src/main/java/winterly/config/WinterlyConfig.java rename to common/src/main/java/winterly/config/WinterlyConfig.java index 6dc1233..f93275b 100644 --- a/src/main/java/winterly/config/WinterlyConfig.java +++ b/common/src/main/java/winterly/config/WinterlyConfig.java @@ -14,7 +14,7 @@ public int getGiftBoxCapacity() { } public static class MobDecorationsConfig { - public boolean enabled = false; + public boolean enabled = true; public boolean onlyInWinter = true; public int chance = 15; } diff --git a/common/src/main/java/winterly/data/CachedFlowers.java b/common/src/main/java/winterly/data/CachedFlowers.java new file mode 100644 index 0000000..f6d316d --- /dev/null +++ b/common/src/main/java/winterly/data/CachedFlowers.java @@ -0,0 +1,49 @@ +package winterly.data; + +import org.jetbrains.annotations.Nullable; + +import java.util.LinkedHashMap; +import java.util.Map; +import net.minecraft.core.BlockPos; +import net.minecraft.resources.ResourceKey; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; + +public class CachedFlowers { + public static CachedFlowers instance = new CachedFlowers(); + + public Map, Map> data = new LinkedHashMap<>(); + + public static Block getFlower(Level world, BlockPos pos) { + return instance.getFlowerImpl(world, pos); + } + + @Nullable + public Block getFlowerImpl(Level world, BlockPos pos) { + var map = data.get(world.dimension()); + if(map != null) { + return map.get(pos); + } + else { + var newMap = new LinkedHashMap(); + data.put(world.dimension(), newMap); + return null; + } + } + + public static void cacheFlower(Level world, BlockPos pos, Block flower) { + instance.cacheFlowerImpl(world, pos, flower); + } + + public void cacheFlowerImpl(Level world, BlockPos pos, Block flower) { + var map = data.get(world.dimension()); + if(map != null) { + map.put(pos, flower); + } + else { + var newMap = new LinkedHashMap(); + newMap.put(pos, flower); + data.put(world.dimension(), newMap); + } + } +} diff --git a/common/src/main/java/winterly/data/GiftBoxData.java b/common/src/main/java/winterly/data/GiftBoxData.java new file mode 100644 index 0000000..307c44f --- /dev/null +++ b/common/src/main/java/winterly/data/GiftBoxData.java @@ -0,0 +1,48 @@ +package winterly.data; + +import winterly.block.entity.GiftBoxBlockEntity; + +import java.util.ArrayList; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.ItemStack; +import winterly.block.entity.GiftBoxBlockEntityData; + +public class GiftBoxData { + public ArrayList stacks = new ArrayList<>(); + + public static GiftBoxData fromNbt(CompoundTag nbt) { + GiftBoxData gift = new GiftBoxData(); + + int size = nbt.getInt("size"); + for(int i = 0; i < size; i++) { + CompoundTag entryNbt = nbt.getCompound(String.valueOf(i)); + + var item = BuiltInRegistries.ITEM.getOptional(new ResourceLocation(entryNbt.getString("item"))); + if(item.isPresent()) { + ItemStack temp = new ItemStack(item.get(), entryNbt.getInt("count")); + temp.setTag((CompoundTag)entryNbt.get("nbt")); + gift.stacks.add(temp); + } + } + + return gift; + } + + public static CompoundTag toNbt(GiftBoxBlockEntityData entity) { + CompoundTag nbt = new CompoundTag(); + nbt.putInt("size", entity.getStacks().size()); + + for(int i = 0; i < entity.getStacks().size(); i++) { + ItemStack stack = entity.getStacks().get(i); + CompoundTag entryNbt = new CompoundTag(); + entryNbt.putString("item", BuiltInRegistries.ITEM.getKey(stack.getItem()).toString()); + entryNbt.put("nbt", stack.getOrCreateTag()); + entryNbt.putInt("count", stack.getCount()); + + nbt.put(Integer.toString(i), entryNbt); + } + return nbt; + } +} diff --git a/src/main/java/winterly/extension/DecoratedMob.java b/common/src/main/java/winterly/extension/DecoratedMob.java similarity index 100% rename from src/main/java/winterly/extension/DecoratedMob.java rename to common/src/main/java/winterly/extension/DecoratedMob.java diff --git a/common/src/main/java/winterly/item/CommonSantaHatItem.java b/common/src/main/java/winterly/item/CommonSantaHatItem.java new file mode 100644 index 0000000..cb92187 --- /dev/null +++ b/common/src/main/java/winterly/item/CommonSantaHatItem.java @@ -0,0 +1,29 @@ +package winterly.item; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; +import java.util.List; + +public class CommonSantaHatItem extends Item { + public final String color; + + public CommonSantaHatItem(Item.Properties settings, String color) { + super(settings); + this.color = color; + } + + @Environment(EnvType.CLIENT) + @Override + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag context) { + tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.nullToEmpty(" ")); + super.appendHoverText(stack, world, tooltip, context); + } +} diff --git a/common/src/main/java/winterly/item/CommonScarfItem.java b/common/src/main/java/winterly/item/CommonScarfItem.java new file mode 100644 index 0000000..93e6bdc --- /dev/null +++ b/common/src/main/java/winterly/item/CommonScarfItem.java @@ -0,0 +1,30 @@ +package winterly.item; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class CommonScarfItem extends Item { + public final String color; + + public CommonScarfItem(Item.Properties settings, String color) { + super(settings); + this.color = color; + } + + @Environment(EnvType.CLIENT) + @Override + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag context) { + tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY)); + tooltip.add(Component.nullToEmpty(" ")); + super.appendHoverText(stack, world, tooltip, context); + } +} diff --git a/common/src/main/java/winterly/item/tool/CryomarbleAxeItem.java b/common/src/main/java/winterly/item/tool/CryomarbleAxeItem.java new file mode 100644 index 0000000..3f51116 --- /dev/null +++ b/common/src/main/java/winterly/item/tool/CryomarbleAxeItem.java @@ -0,0 +1,22 @@ +package winterly.item.tool; + +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.AxeItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Tier; + +public class CryomarbleAxeItem extends AxeItem { + + public CryomarbleAxeItem(Tier material, float attackDamage, float attackSpeed, Properties settings) { + super(material, attackDamage, attackSpeed, settings); + } + + @Override + public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + target.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 60, 0)); + return super.hurtEnemy(stack, target, attacker); + } +} + diff --git a/common/src/main/java/winterly/item/tool/CryomarbleHoeItem.java b/common/src/main/java/winterly/item/tool/CryomarbleHoeItem.java new file mode 100644 index 0000000..ca1c653 --- /dev/null +++ b/common/src/main/java/winterly/item/tool/CryomarbleHoeItem.java @@ -0,0 +1,21 @@ +package winterly.item.tool; + +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.HoeItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Tier; + +public class CryomarbleHoeItem extends HoeItem { + + public CryomarbleHoeItem(Tier material, int attackDamage, float attackSpeed, Properties settings) { + super(material, attackDamage, attackSpeed, settings); + } + + @Override + public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + target.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 60, 0)); + return super.hurtEnemy(stack, target, attacker); + } +} diff --git a/common/src/main/java/winterly/item/tool/CryomarblePickaxeItem.java b/common/src/main/java/winterly/item/tool/CryomarblePickaxeItem.java new file mode 100644 index 0000000..f5d7504 --- /dev/null +++ b/common/src/main/java/winterly/item/tool/CryomarblePickaxeItem.java @@ -0,0 +1,22 @@ +package winterly.item.tool; + +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.PickaxeItem; +import net.minecraft.world.item.Tier; + +public class CryomarblePickaxeItem extends PickaxeItem { + + public CryomarblePickaxeItem(Tier material, int attackDamage, float attackSpeed, Properties settings) { + super(material, attackDamage, attackSpeed, settings); + } + + @Override + public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + target.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 60, 0)); + return super.hurtEnemy(stack, target, attacker); + } +} + diff --git a/common/src/main/java/winterly/item/tool/CryomarbleShovelItem.java b/common/src/main/java/winterly/item/tool/CryomarbleShovelItem.java new file mode 100644 index 0000000..d1ef523 --- /dev/null +++ b/common/src/main/java/winterly/item/tool/CryomarbleShovelItem.java @@ -0,0 +1,22 @@ +package winterly.item.tool; + +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.ShovelItem; +import net.minecraft.world.item.Tier; + +public class CryomarbleShovelItem extends ShovelItem { + + public CryomarbleShovelItem(Tier material, float attackDamage, float attackSpeed, Properties settings) { + super(material, attackDamage, attackSpeed, settings); + } + + @Override + public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + target.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 60, 0)); + return super.hurtEnemy(stack, target, attacker); + } +} + diff --git a/common/src/main/java/winterly/item/tool/CryomarbleSwordItem.java b/common/src/main/java/winterly/item/tool/CryomarbleSwordItem.java new file mode 100644 index 0000000..58478d6 --- /dev/null +++ b/common/src/main/java/winterly/item/tool/CryomarbleSwordItem.java @@ -0,0 +1,21 @@ +package winterly.item.tool; + +import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.SwordItem; +import net.minecraft.world.item.Tier; + +public class CryomarbleSwordItem extends SwordItem { + + public CryomarbleSwordItem(Tier toolMaterial, int attackDamage, float attackSpeed, Properties settings) { + super(toolMaterial, attackDamage, attackSpeed, settings); + } + + @Override + public boolean hurtEnemy(ItemStack stack, LivingEntity target, LivingEntity attacker) { + target.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, 60, 0)); + return super.hurtEnemy(stack, target, attacker); + } +} diff --git a/src/main/java/winterly/mixin/WinterlyMixins.java b/common/src/main/java/winterly/mixin/WinterlyMixins.java similarity index 100% rename from src/main/java/winterly/mixin/WinterlyMixins.java rename to common/src/main/java/winterly/mixin/WinterlyMixins.java diff --git a/common/src/main/java/winterly/mixin/common/BlockStateMixin.java b/common/src/main/java/winterly/mixin/common/BlockStateMixin.java new file mode 100644 index 0000000..736efb1 --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/BlockStateMixin.java @@ -0,0 +1,58 @@ +package winterly.mixin.common; + +import com.google.common.collect.ImmutableMap; +import com.mojang.serialization.MapCodec; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateHolder; +import net.minecraft.world.level.block.state.properties.Property; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.registry.CommonWinterlyBlocks; + +@Mixin(BlockBehaviour.BlockStateBase.class) +public abstract class BlockStateMixin extends StateHolder { + + protected BlockStateMixin(Block owner, ImmutableMap, Comparable> entries, MapCodec codec) { + super(owner, entries, codec); + } + + @Shadow + public abstract boolean is(Block block); + + @Shadow + @Final + private float destroySpeed; + + @Inject(method = "getDestroySpeed", at = @At("HEAD"), cancellable = true) + void getHardness(BlockGetter world, BlockPos pos, CallbackInfoReturnable cir) { + if(is(CommonWinterlyBlocks.FROZEN_FLOWER)) { + if(getValue(CommonFrozenFlowerBlock.LAYERS) == 0) { + cir.setReturnValue(0.0F); + } + else { + cir.setReturnValue(destroySpeed); + } + } + } + + @Inject(method = "requiresCorrectToolForDrops", at = @At("HEAD"), cancellable = true) + void isToolRequired(CallbackInfoReturnable cir) { + if(is(CommonWinterlyBlocks.FROZEN_FLOWER)) { + if(getValue(CommonFrozenFlowerBlock.LAYERS) == 0) { + cir.setReturnValue(false); + } + else { + cir.setReturnValue(true); + } + } + } +} diff --git a/common/src/main/java/winterly/mixin/common/FreezeTopLayerMixin.java b/common/src/main/java/winterly/mixin/common/FreezeTopLayerMixin.java new file mode 100644 index 0000000..a72472d --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/FreezeTopLayerMixin.java @@ -0,0 +1,58 @@ +package winterly.mixin.common; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.WorldGenLevel; +import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.FlowerBlock; +import net.minecraft.world.level.block.SnowyDirtBlock; +import net.minecraft.world.level.block.TallFlowerBlock; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.levelgen.feature.SnowAndFreezeFeature; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; +import winterly.Winterly; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.registry.CommonWinterlyBlocks; + +@Mixin(SnowAndFreezeFeature.class) +public abstract class FreezeTopLayerMixin { + + @Redirect(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/biome/Biome;shouldSnow(Lnet/minecraft/world/level/LevelReader;Lnet/minecraft/core/BlockPos;)Z")) + boolean canSetIce(Biome biome, LevelReader view, BlockPos pos) { + + if(!biome.warmEnoughToRain(pos) && (pos.getY() >= view.getMinBuildHeight() && pos.getY() < view.getMaxBuildHeight() && view.getBrightness(LightLayer.BLOCK, pos) < 10)) { + BlockState state = view.getBlockState(pos); + if(view instanceof WorldGenLevel world) { + + if (Winterly.config.generateFrozenGrass && (state.is(Blocks.SHORT_GRASS) || state.is(Blocks.FERN) || state.is(Blocks.LARGE_FERN) || state.is(Blocks.TALL_GRASS))) { + world.setBlock(pos, CommonWinterlyBlocks.FROZEN_GRASS.defaultBlockState(), 3); + BlockState floor = world.getBlockState(pos.below()); + if (floor.hasProperty(SnowyDirtBlock.SNOWY)) { + world.setBlock(pos.below(), floor.setValue(SnowyDirtBlock.SNOWY, Boolean.TRUE), 2); + } + if(state.is(Blocks.LARGE_FERN) || state.is(Blocks.TALL_GRASS)) { + world.setBlock(pos.above(), Blocks.AIR.defaultBlockState(), 2); + } + return false; + } + else if(Winterly.config.generateFrozenFlowers && (state.getBlock() instanceof FlowerBlock || state.getBlock() instanceof TallFlowerBlock)) { + world.setBlock(pos, CommonWinterlyBlocks.FROZEN_FLOWER.defaultBlockState().setValue(CommonFrozenFlowerBlock.LAYERS, 1), 3); + BlockState floor = world.getBlockState(pos.below()); + if (floor.hasProperty(SnowyDirtBlock.SNOWY)) { + world.setBlock(pos.below(), floor.setValue(SnowyDirtBlock.SNOWY, Boolean.TRUE), 2); + } + if(state.getBlock() instanceof TallFlowerBlock) { + world.setBlock(pos.above(), Blocks.AIR.defaultBlockState(), 2); + } + return false; + } + } + } + + return biome.shouldSnow(view, pos); + } +} diff --git a/common/src/main/java/winterly/mixin/common/MiningToolItemMixin.java b/common/src/main/java/winterly/mixin/common/MiningToolItemMixin.java new file mode 100644 index 0000000..8de4ae1 --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/MiningToolItemMixin.java @@ -0,0 +1,56 @@ +package winterly.mixin.common; + +import net.minecraft.tags.BlockTags; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.DiggerItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.registry.CommonWinterlyBlocks; + +@Mixin(DiggerItem.class) +public abstract class MiningToolItemMixin { + + @Shadow + @Final + private TagKey blocks; + + @Shadow + @Final + protected float speed; + + @Inject(method = "isCorrectToolForDrops", at = @At("HEAD"), cancellable = true) + void isSuitableFor(BlockState state, CallbackInfoReturnable cir) { + if(blocks.equals(BlockTags.MINEABLE_WITH_SHOVEL)) { + if(state.is(CommonWinterlyBlocks.FROZEN_FLOWER)) { + if(state.getValue(CommonFrozenFlowerBlock.LAYERS) != 0) { + cir.setReturnValue(true); + } + else { + cir.setReturnValue(false); + } + } + } + } + + @Inject(method = "getDestroySpeed", at = @At("HEAD"), cancellable = true) + void getMiningSpeedMultiplier(ItemStack stack, BlockState state, CallbackInfoReturnable cir) { + if(blocks.equals(BlockTags.MINEABLE_WITH_SHOVEL)) { + if(state.is(CommonWinterlyBlocks.FROZEN_FLOWER)) { + if(state.getValue(CommonFrozenFlowerBlock.LAYERS) != 0) { + cir.setReturnValue(speed); + } + else { + cir.setReturnValue(1.0F); + } + } + } + } +} diff --git a/common/src/main/java/winterly/mixin/common/ServerWorldMixin.java b/common/src/main/java/winterly/mixin/common/ServerWorldMixin.java new file mode 100644 index 0000000..8e0aafd --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/ServerWorldMixin.java @@ -0,0 +1,42 @@ +package winterly.mixin.common; + +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.biome.Biome; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.FlowerBlock; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; +import winterly.Winterly; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.data.CachedFlowers; +import winterly.registry.CommonWinterlyBlocks; + +@Mixin(ServerLevel.class) +public abstract class ServerWorldMixin { + + @Redirect(method = "tickPrecipitation", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/biome/Biome;shouldSnow(Lnet/minecraft/world/level/LevelReader;Lnet/minecraft/core/BlockPos;)Z")) + boolean canSetSnow(Biome biome, LevelReader view, BlockPos pos) { + + if(!biome.warmEnoughToRain(pos) && (pos.getY() >= view.getMinBuildHeight() && pos.getY() < view.getMaxBuildHeight() && view.getBrightness(LightLayer.BLOCK, pos) < 10)) { + BlockState state = view.getBlockState(pos); + if(view instanceof Level world) { + if (state.is(Blocks.SHORT_GRASS) && Winterly.config.generateFrozenGrass) { + world.setBlockAndUpdate(pos, CommonWinterlyBlocks.FROZEN_GRASS.defaultBlockState()); + return false; + } + else if(state.getBlock() instanceof FlowerBlock && Winterly.config.generateFrozenFlowers) { + world.setBlockAndUpdate(pos, CommonWinterlyBlocks.FROZEN_FLOWER.defaultBlockState().setValue(CommonFrozenFlowerBlock.LAYERS, 1)); + CachedFlowers.cacheFlower(((Level) view), pos, state.getBlock()); + return false; + } + } + } + return biome.shouldSnow(view, pos); + } +} diff --git a/common/src/main/java/winterly/mixin/common/SkeletonExtension.java b/common/src/main/java/winterly/mixin/common/SkeletonExtension.java new file mode 100644 index 0000000..c1e7fe9 --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/SkeletonExtension.java @@ -0,0 +1,77 @@ +package winterly.mixin.common; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.SpawnGroupData; +import net.minecraft.world.entity.monster.AbstractSkeleton; +import net.minecraft.world.entity.monster.Skeleton; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.ServerLevelAccessor; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import winterly.Winterly; +import winterly.extension.DecoratedMob; +import winterly.util.HolidayUtils; + +@Mixin(Skeleton.class) +public abstract class SkeletonExtension extends AbstractSkeleton implements DecoratedMob { + private static final EntityDataAccessor winterly$DECORATED = SynchedEntityData.defineId(Skeleton.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor winterly$INDEX = SynchedEntityData.defineId(Skeleton.class, EntityDataSerializers.INT); + + protected SkeletonExtension(EntityType entityType, Level world) { + super(entityType, world); + } + + @Override + public boolean winterly$decorated() { + return getEntityData().get(winterly$DECORATED); + } + + @Override + public int winterly$getIndex() { + return getEntityData().get(winterly$INDEX); + } + + @Inject(method = "defineSynchedData", at = @At("TAIL")) + void initData(CallbackInfo ci) { + getEntityData().define(winterly$DECORATED, false); + getEntityData().define(winterly$INDEX, 0); + } + + @Inject(method = "addAdditionalSaveData", at = @At("TAIL")) + void write(CompoundTag nbt, CallbackInfo ci) { + nbt.putBoolean("WinterlyDecorated", getEntityData().get(winterly$DECORATED)); + nbt.putInt("WinterlyIndex", getEntityData().get(winterly$INDEX)); + } + + @Inject(method = "readAdditionalSaveData", at = @At("TAIL")) + void read(CompoundTag nbt, CallbackInfo ci) { + getEntityData().set(winterly$DECORATED, nbt.getBoolean("WinterlyDecorated")); + getEntityData().set(winterly$INDEX, nbt.getInt("WinterlyIndex")); + } + + @Override + public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData, CompoundTag entityNbt){ + entityData = super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt); + if(!spawnReason.equals(MobSpawnType.SPAWNER) && !spawnReason.equals(MobSpawnType.CHUNK_GENERATION)) { + if(Winterly.config.mobDecorations.enabled && HolidayUtils.isWinterHolidays() || !Winterly.config.mobDecorations.onlyInWinter) { + if(!this.level().dimension().equals(Level.NETHER)) { + int chance = Winterly.config.mobDecorations.chance; + if(chance > 0 && Math.random() < (double)chance / 100) { + getEntityData().set(winterly$DECORATED, true); + getEntityData().set(winterly$INDEX, world.getRandom().nextInt(5)); + } + } + } + } + return entityData; + } + +} diff --git a/common/src/main/java/winterly/mixin/common/SnowBlockMixin.java b/common/src/main/java/winterly/mixin/common/SnowBlockMixin.java new file mode 100644 index 0000000..d49d53e --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/SnowBlockMixin.java @@ -0,0 +1,37 @@ +package winterly.mixin.common; + +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.FlowerBlock; +import net.minecraft.world.level.block.SnowLayerBlock; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.block.CommonFrozenGrassBlock; +import winterly.registry.CommonWinterlyBlocks; + +@Mixin(SnowLayerBlock.class) +public abstract class SnowBlockMixin { + + @Inject(method = "getStateForPlacement", at = @At("HEAD"), cancellable = true) + void getPlacementState(BlockPlaceContext ctx, CallbackInfoReturnable cir) { + BlockState state = ctx.getLevel().getBlockState(ctx.getClickedPos()); + if(state.is(CommonWinterlyBlocks.FROZEN_GRASS)) { + int layers = state.getValue(SnowLayerBlock.LAYERS); + cir.setReturnValue(state.setValue(SnowLayerBlock.LAYERS, Math.min(8, layers + 1)).setValue(CommonFrozenGrassBlock.PERSISTENT, true)); + } + else if(state.is(CommonWinterlyBlocks.FROZEN_FLOWER)) { + int layers = state.getValue(CommonFrozenFlowerBlock.LAYERS); + cir.setReturnValue(state.setValue(CommonFrozenFlowerBlock.LAYERS, Math.min(8, layers + 1)).setValue(CommonFrozenGrassBlock.PERSISTENT, true)); + } + else if(state.is(Blocks.SHORT_GRASS)) { + cir.setReturnValue(CommonWinterlyBlocks.FROZEN_GRASS.defaultBlockState().setValue(CommonFrozenGrassBlock.PERSISTENT, true)); + } + else if(state.getBlock() instanceof FlowerBlock) { + cir.setReturnValue(CommonWinterlyBlocks.FROZEN_FLOWER.defaultBlockState().setValue(CommonFrozenFlowerBlock.LAYERS, 1).setValue(CommonFrozenFlowerBlock.PERSISTENT, true)); + } + } +} diff --git a/src/main/java/winterly/mixin/common/SnowyBlockMixin.java b/common/src/main/java/winterly/mixin/common/SnowyBlockMixin.java similarity index 50% rename from src/main/java/winterly/mixin/common/SnowyBlockMixin.java rename to common/src/main/java/winterly/mixin/common/SnowyBlockMixin.java index c6b4b2f..a8df495 100644 --- a/src/main/java/winterly/mixin/common/SnowyBlockMixin.java +++ b/common/src/main/java/winterly/mixin/common/SnowyBlockMixin.java @@ -1,20 +1,20 @@ package winterly.mixin.common; -import net.minecraft.block.BlockState; -import net.minecraft.block.SnowyBlock; +import net.minecraft.world.level.block.SnowyDirtBlock; +import net.minecraft.world.level.block.state.BlockState; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import winterly.block.FrozenFlowerBlock; -import winterly.registry.WinterlyBlocks; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.registry.CommonWinterlyBlocks; -@Mixin(SnowyBlock.class) +@Mixin(SnowyDirtBlock.class) public abstract class SnowyBlockMixin { - @Inject(method = "isSnow", at = @At("HEAD"), cancellable = true) + @Inject(method = "isSnowySetting", at = @At("HEAD"), cancellable = true) private static void iSnow(BlockState state, CallbackInfoReturnable cir) { - if(state.isOf(WinterlyBlocks.FROZEN_FLOWER) && state.get(FrozenFlowerBlock.LAYERS) >= 1) { + if(state.is(CommonWinterlyBlocks.FROZEN_FLOWER) && state.getValue(CommonFrozenFlowerBlock.LAYERS) >= 1) { cir.setReturnValue(true); } } diff --git a/common/src/main/java/winterly/mixin/common/SpreadableBlockMixin.java b/common/src/main/java/winterly/mixin/common/SpreadableBlockMixin.java new file mode 100644 index 0000000..8b373c0 --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/SpreadableBlockMixin.java @@ -0,0 +1,23 @@ +package winterly.mixin.common; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.SpreadingSnowyDirtBlock; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import winterly.registry.CommonWinterlyBlocks; + +@Mixin(SpreadingSnowyDirtBlock.class) +public abstract class SpreadableBlockMixin { + + @Inject(method = "canBeGrass", at = @At("HEAD"), cancellable = true) + private static void canSurvive(BlockState state, LevelReader world, BlockPos pos, CallbackInfoReturnable cir) { + BlockState up = world.getBlockState(pos.above()); + if(up.is(CommonWinterlyBlocks.FROZEN_GRASS) || up.is(CommonWinterlyBlocks.FROZEN_FLOWER)) { + cir.setReturnValue(true); + } + } +} diff --git a/common/src/main/java/winterly/mixin/common/ZombieExtension.java b/common/src/main/java/winterly/mixin/common/ZombieExtension.java new file mode 100644 index 0000000..bf1b1d1 --- /dev/null +++ b/common/src/main/java/winterly/mixin/common/ZombieExtension.java @@ -0,0 +1,77 @@ +package winterly.mixin.common; + +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.syncher.EntityDataAccessor; +import net.minecraft.network.syncher.EntityDataSerializers; +import net.minecraft.network.syncher.SynchedEntityData; +import net.minecraft.world.DifficultyInstance; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.MobSpawnType; +import net.minecraft.world.entity.SpawnGroupData; +import net.minecraft.world.entity.monster.Monster; +import net.minecraft.world.entity.monster.Zombie; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.ServerLevelAccessor; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import winterly.Winterly; +import winterly.extension.DecoratedMob; +import winterly.util.HolidayUtils; + +@Mixin(Zombie.class) +public abstract class ZombieExtension extends Monster implements DecoratedMob { + private static final EntityDataAccessor winterly$DECORATED = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.BOOLEAN); + private static final EntityDataAccessor winterly$INDEX = SynchedEntityData.defineId(Zombie.class, EntityDataSerializers.INT); + + protected ZombieExtension(EntityType entityType, Level world) { + super(entityType, world); + } + + @Override + public boolean winterly$decorated() { + return getEntityData().get(winterly$DECORATED); + } + + @Override + public int winterly$getIndex() { + return getEntityData().get(winterly$INDEX); + } + + @Inject(method = "defineSynchedData", at = @At("TAIL")) + void initData(CallbackInfo ci) { + getEntityData().define(winterly$DECORATED, false); + getEntityData().define(winterly$INDEX, 0); + } + + @Inject(method = "addAdditionalSaveData", at = @At("TAIL")) + void write(CompoundTag nbt, CallbackInfo ci) { + nbt.putBoolean("WinterlyDecorated", getEntityData().get(winterly$DECORATED)); + nbt.putInt("WinterlyIndex", getEntityData().get(winterly$INDEX)); + } + + @Inject(method = "readAdditionalSaveData", at = @At("TAIL")) + void read(CompoundTag nbt, CallbackInfo ci) { + getEntityData().set(winterly$DECORATED, nbt.getBoolean("WinterlyDecorated")); + getEntityData().set(winterly$INDEX, nbt.getInt("WinterlyIndex")); + } + + @Inject(method = "finalizeSpawn", at = @At("RETURN")) + void initialize(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, SpawnGroupData entityData, CompoundTag entityNbt, CallbackInfoReturnable cir) { + if(!spawnReason.equals(MobSpawnType.SPAWNER) && !spawnReason.equals(MobSpawnType.CHUNK_GENERATION) && !isBaby()) { + if(Winterly.config.mobDecorations.enabled && HolidayUtils.isWinterHolidays() || !Winterly.config.mobDecorations.onlyInWinter) { + if(!this.level().dimension().equals(Level.NETHER)) { + int chance = Winterly.config.mobDecorations.chance; + if(chance > 0 && Math.random() < (double)chance / 100) { + getEntityData().set(winterly$DECORATED, true); + getEntityData().set(winterly$INDEX, world.getRandom().nextInt(5)); + } + } + + } + } + } + +} diff --git a/common/src/main/java/winterly/registry/CommonWinterlyBlockEntities.java b/common/src/main/java/winterly/registry/CommonWinterlyBlockEntities.java new file mode 100644 index 0000000..6655380 --- /dev/null +++ b/common/src/main/java/winterly/registry/CommonWinterlyBlockEntities.java @@ -0,0 +1,8 @@ +package winterly.registry; + +import net.minecraft.world.level.block.entity.BlockEntityType; +import winterly.block.entity.GiftBoxBlockEntity; + +public class CommonWinterlyBlockEntities { + public static BlockEntityType GIFT_BOX_BLOCK_ENTITY; +} diff --git a/common/src/main/java/winterly/registry/CommonWinterlyBlocks.java b/common/src/main/java/winterly/registry/CommonWinterlyBlocks.java new file mode 100644 index 0000000..4ab3550 --- /dev/null +++ b/common/src/main/java/winterly/registry/CommonWinterlyBlocks.java @@ -0,0 +1,52 @@ +package winterly.registry; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.level.block.Block; + +import java.util.LinkedHashMap; +import java.util.Map; + +@SuppressWarnings("unused") +public abstract class CommonWinterlyBlocks { + public static final Map ITEMS = new LinkedHashMap<>(); + public static final Map BLOCKS = new LinkedHashMap<>(); + +// public static final Block RED_SOCK = add("red_sock", new SockBlock(copyOf(CANDLE).sounds(BlockSoundGroup.WOOL))); +// public static final Block GREEN_SOCK = add("green_sock", new SockBlock(copyOf(CANDLE).sounds(BlockSoundGroup.WOOL))); +// public static final Block BLUE_SOCK = add("blue_sock", new SockBlock(copyOf(CANDLE).sounds(BlockSoundGroup.WOOL))); + + public static Block ICICLE; + public static Block ICICLE_BLOCK; + public static Block PACKED_ICICLE_BLOCK; + public static Block ICICLE_PANE; + public static Block ICICLE_BARS; + public static Block CRYOMARBLE_BLOCK; + public static Block SNOWGUY; + public static Block SNOWBALL_WALL; + public static Block DENSE_SNOW; + public static Block DENSE_SNOW_STAIRS; + public static Block DENSE_SNOW_SLAB; + + public static Block SNOW_BRICKS; + public static Block SNOW_BRICK_STAIRS; + public static Block SNOW_BRICK_SLAB; + public static Block FROZEN_GRASS; + public static Block FROZEN_FLOWER; + + public static Block RAW_CRYOMARBLE_SHARD; + + public static Block RED_GIFT_BOX; + public static Block ORANGE_GIFT_BOX; + public static Block YELLOW_GIFT_BOX; + public static Block GREEN_GIFT_BOX; + public static Block CYAN_GIFT_BOX; + public static Block BLUE_GIFT_BOX; + public static Block PURPLE_GIFT_BOX; + public static Block BLACK_GIFT_BOX; + public static Block WHITE_GIFT_BOX; + + public static Block GARLAND_LIGHTS; + public static Block RAINY_GARLAND_LIGHTS; + +} diff --git a/common/src/main/java/winterly/registry/CommonWinterlyItems.java b/common/src/main/java/winterly/registry/CommonWinterlyItems.java new file mode 100644 index 0000000..d316d9f --- /dev/null +++ b/common/src/main/java/winterly/registry/CommonWinterlyItems.java @@ -0,0 +1,44 @@ +package winterly.registry; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; + +import java.util.LinkedHashMap; +import java.util.Map; + +@SuppressWarnings("unused") +public class CommonWinterlyItems { + public static final Map ITEMS = new LinkedHashMap<>(); + + // public static final Item GINGERBREAD_MAN = add("gingerbread_man", new Item(settings().food(new FoodComponent.Builder().hunger(3).saturationModifier(0.5F).build()))); +// public static final Item EDIBLE_SNOW = add("edible_snow", new Item(settings().food(new FoodComponent.Builder().hunger(1).saturationModifier(0.1F).statusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 120, 0), 0.5F).statusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 120, 1), 0.5F).build()))); +// public static final Item PISS_SNOW = add("yellow_snow", new Item(settings().food(new FoodComponent.Builder().hunger(1).saturationModifier(0F).statusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 200, 0), 0.9F).statusEffect(new StatusEffectInstance(StatusEffects.POISON, 80, 1), 0.8F).build()))); + public static Item RED_CANDY_CANE; + public static Item GREEN_CANDY_CANE; + public static Item BLUE_CANDY_CANE; +// public static final Item YELLOW_CANDY_CANE = add("yellow_candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); +// public static final Item CANDY_CANE = add("candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); +// public static final Item MULLED_WINE = add("mulled_wine", new Item(settings().food(new FoodComponent.Builder().hunger(4).saturationModifier(0.2F).build()))); +// public static final Item EGGNOG = add("eggnog", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.4F).statusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 200, 0), 0.2F).build()))); +// public static final Item COCOA = add("cocoa", new Item(settings().food(new FoodComponent.Builder().hunger(4).saturationModifier(0.5F).build()))); +// public static final Item KIDS_CHAMPAGNE = add("kids_champagne", new Item(settings().food(new FoodComponent.Builder().hunger(10).saturationModifier(0.1F).statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 100, 0), 0.3F).statusEffect(new StatusEffectInstance(StatusEffects.ABSORPTION, 400, 0), 0.3F).statusEffect(new StatusEffectInstance(StatusEffects.INSTANT_HEALTH, 0, 0), 0.3F).build()))); + + public static Item CRYOMARBLE_SHARD; + public static Item CRYOMARBLE; + + public static Item CRYOMARBLE_SWORD; + public static Item CRYOMARBLE_SHOVEL; + public static Item CRYOMARBLE_PICKAXE; + public static Item CRYOMARBLE_AXE; + public static Item CRYOMARBLE_HOE; + + public static Item RED_SANTA_HAT; + public static Item BLUE_SANTA_HAT; + + public static Item WHITE_SCARF; + public static Item RED_SCARF; + public static Item GREEN_SCARF; + public static Item BLUE_SCARF; + public static Item RAINBOW_SCARF; +} + diff --git a/common/src/main/java/winterly/util/HolidayUtils.java b/common/src/main/java/winterly/util/HolidayUtils.java new file mode 100644 index 0000000..7bd46b7 --- /dev/null +++ b/common/src/main/java/winterly/util/HolidayUtils.java @@ -0,0 +1,16 @@ +package winterly.util; + +import java.time.LocalDate; + +public final class HolidayUtils { + + public static boolean isWinterHolidays() { + LocalDate date = LocalDate.now(); + int month = date.getMonth().getValue(); + + if(month == 12 && date.getDayOfMonth() >= 25) { + return true; + } + return month == 1 && date.getDayOfMonth() <= 7; + } +} diff --git a/src/main/java/winterly/util/UpdateChecker.java b/common/src/main/java/winterly/util/UpdateChecker.java similarity index 89% rename from src/main/java/winterly/util/UpdateChecker.java rename to common/src/main/java/winterly/util/UpdateChecker.java index 36f9867..d83b94b 100644 --- a/src/main/java/winterly/util/UpdateChecker.java +++ b/common/src/main/java/winterly/util/UpdateChecker.java @@ -5,8 +5,9 @@ import com.google.gson.annotations.SerializedName; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.SharedConstants; -import net.minecraft.text.Text; -import net.minecraft.util.Language; +import net.minecraft.locale.Language; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.MutableComponent; import winterly.Winterly; import java.io.FileNotFoundException; @@ -28,7 +29,7 @@ public class UpdateChecker { private static Instant lastCheck = Instant.now().minus(4, ChronoUnit.HOURS); private static String cachedLatest = "0"; public static boolean updated = false; - public static Text text = null; + public static MutableComponent text = null; public static boolean check() { if(Winterly.config.updateCheckerEnabled) { @@ -39,12 +40,12 @@ public static boolean check() { var remoteNum = Integer.parseInt(remote.replaceAll("\\.", "")); if(remoteNum > localNum) { - String temp = Language.getInstance().get("itemGroup.winterly.items.button.updated"); + String temp = Language.getInstance().getOrDefault("itemGroup.winterly.items.button.updated"); temp = temp.replaceAll("%local_version%", local); temp = temp.replaceAll("%remote_version%", remote); - text = Text.of(temp); + text = Component.literal(temp); updated = true; } } @@ -90,7 +91,7 @@ static Optional> getModrinthVersions() { var array = new ArrayList(); Arrays.asList(versions).forEach(version -> { - if(version.gameVersions.contains(SharedConstants.getGameVersion().getName())) array.add(version); + if(version.gameVersions.contains(SharedConstants.getCurrentVersion().getName())) array.add(version); }); return Optional.of(array); diff --git a/common/src/main/java/winterly/worldgen/CryomarbleFeature.java b/common/src/main/java/winterly/worldgen/CryomarbleFeature.java new file mode 100644 index 0000000..fecfc35 --- /dev/null +++ b/common/src/main/java/winterly/worldgen/CryomarbleFeature.java @@ -0,0 +1,57 @@ +package winterly.worldgen; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.level.WorldGenLevel; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; +import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; +import winterly.Winterly; +import winterly.block.IcicleBlock; +import winterly.registry.CommonWinterlyBlocks; + +public class CryomarbleFeature extends Feature { + + public CryomarbleFeature() { + super(NoneFeatureConfiguration.CODEC); + } + + @Override + public boolean place(FeaturePlaceContext context) { + if(!Winterly.config.generateCryomarble) return false; + WorldGenLevel world = context.level(); + BlockPos origin = context.origin(); + + for(int i = -20; i < 20; i++) { + BlockPos newOrigin = new BlockPos(origin.getX(), i, origin.getZ()); + if(world.getBlockState(newOrigin).isAir()) { + origin = newOrigin; + break; + } + } + if(context.random().nextInt(16) != 0) return false; + + int spawned = 0; + + for(int x = -3; x < 3; x++) { + for(int z = -3; z < 3; z++) { + for(int y = -3; y < 3; y++) { + int xPos = origin.getX() + x; + int zPos = origin.getZ() + z; + int yPos = origin.getY() + y; + BlockPos pos = new BlockPos(xPos, yPos, zPos); + if(context.random().nextInt(Math.abs(x) + Math.abs(y) + Math.abs(z) + 1) == 0) { + if(world.isEmptyBlock(pos) && isStone(world.getBlockState(pos.below()))) { + if(spawned < 3) { + world.setBlock(pos, CommonWinterlyBlocks.RAW_CRYOMARBLE_SHARD.defaultBlockState().setValue(IcicleBlock.FACING, Direction.UP), Block.UPDATE_ALL); + spawned++; + }else return true; + } + } + } + } + } + return true; + } +} diff --git a/common/src/main/java/winterly/worldgen/UndergroundIcicleFeature.java b/common/src/main/java/winterly/worldgen/UndergroundIcicleFeature.java new file mode 100644 index 0000000..08e1448 --- /dev/null +++ b/common/src/main/java/winterly/worldgen/UndergroundIcicleFeature.java @@ -0,0 +1,45 @@ +package winterly.worldgen; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.WorldGenLevel; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; +import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; +import winterly.Winterly; +import winterly.registry.CommonWinterlyBlocks; + +public class UndergroundIcicleFeature extends Feature { + + public UndergroundIcicleFeature() { + super(NoneFeatureConfiguration.CODEC); + } + + @Override + public boolean place(FeaturePlaceContext context) { + if(!Winterly.config.generateUndergroundIcicles) return false; + boolean generated = false; + int randomY = context.random().nextInt(100) - 50; + + for (int x = 0; x < 10; x++) { + for (int z = 0; z < 10; z++) { + for (int y = 0; y < 10; y++) { + int xPos = context.origin().getX() + x; + int zPos = context.origin().getZ() + z; + int yPos = randomY + y; + BlockPos pos = new BlockPos(xPos, yPos, zPos); + WorldGenLevel world = context.level(); + if(context.random().nextInt(4) == 0) { + if(world.isEmptyBlock(pos)) { + if(isStone(world.getBlockState(pos.above()))) { + world.setBlock(pos, CommonWinterlyBlocks.ICICLE.defaultBlockState(), Block.UPDATE_ALL); + generated = true; + } + } + } + } + } + } + return generated; + } +} diff --git a/src/main/resources/assets/winterly/blockstates/black_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/black_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/black_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/black_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/blue_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/blue_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/blue_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/blue_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/cryomarble_block.json b/common/src/main/resources/assets/winterly/blockstates/cryomarble_block.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/cryomarble_block.json rename to common/src/main/resources/assets/winterly/blockstates/cryomarble_block.json diff --git a/src/main/resources/assets/winterly/blockstates/cyan_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/cyan_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/cyan_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/cyan_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/dense_snow.json b/common/src/main/resources/assets/winterly/blockstates/dense_snow.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/dense_snow.json rename to common/src/main/resources/assets/winterly/blockstates/dense_snow.json diff --git a/src/main/resources/assets/winterly/blockstates/dense_snow_slab.json b/common/src/main/resources/assets/winterly/blockstates/dense_snow_slab.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/dense_snow_slab.json rename to common/src/main/resources/assets/winterly/blockstates/dense_snow_slab.json diff --git a/src/main/resources/assets/winterly/blockstates/dense_snow_stairs.json b/common/src/main/resources/assets/winterly/blockstates/dense_snow_stairs.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/dense_snow_stairs.json rename to common/src/main/resources/assets/winterly/blockstates/dense_snow_stairs.json diff --git a/src/main/resources/assets/winterly/blockstates/frozen_flower.json b/common/src/main/resources/assets/winterly/blockstates/frozen_flower.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/frozen_flower.json rename to common/src/main/resources/assets/winterly/blockstates/frozen_flower.json diff --git a/src/main/resources/assets/winterly/blockstates/frozen_grass.json b/common/src/main/resources/assets/winterly/blockstates/frozen_grass.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/frozen_grass.json rename to common/src/main/resources/assets/winterly/blockstates/frozen_grass.json diff --git a/src/main/resources/assets/winterly/blockstates/garland_lights.json b/common/src/main/resources/assets/winterly/blockstates/garland_lights.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/garland_lights.json rename to common/src/main/resources/assets/winterly/blockstates/garland_lights.json diff --git a/src/main/resources/assets/winterly/blockstates/green_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/green_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/green_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/green_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/icicle.json b/common/src/main/resources/assets/winterly/blockstates/icicle.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/icicle.json rename to common/src/main/resources/assets/winterly/blockstates/icicle.json diff --git a/src/main/resources/assets/winterly/blockstates/icicle_bars.json b/common/src/main/resources/assets/winterly/blockstates/icicle_bars.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/icicle_bars.json rename to common/src/main/resources/assets/winterly/blockstates/icicle_bars.json diff --git a/src/main/resources/assets/winterly/blockstates/icicle_block.json b/common/src/main/resources/assets/winterly/blockstates/icicle_block.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/icicle_block.json rename to common/src/main/resources/assets/winterly/blockstates/icicle_block.json diff --git a/src/main/resources/assets/winterly/blockstates/icicle_pane.json b/common/src/main/resources/assets/winterly/blockstates/icicle_pane.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/icicle_pane.json rename to common/src/main/resources/assets/winterly/blockstates/icicle_pane.json diff --git a/src/main/resources/assets/winterly/blockstates/orange_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/orange_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/orange_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/orange_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/packed_icicle_block.json b/common/src/main/resources/assets/winterly/blockstates/packed_icicle_block.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/packed_icicle_block.json rename to common/src/main/resources/assets/winterly/blockstates/packed_icicle_block.json diff --git a/src/main/resources/assets/winterly/blockstates/purple_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/purple_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/purple_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/purple_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/rainy_garland_lights.json b/common/src/main/resources/assets/winterly/blockstates/rainy_garland_lights.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/rainy_garland_lights.json rename to common/src/main/resources/assets/winterly/blockstates/rainy_garland_lights.json diff --git a/src/main/resources/assets/winterly/blockstates/raw_cryomarble_shard.json b/common/src/main/resources/assets/winterly/blockstates/raw_cryomarble_shard.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/raw_cryomarble_shard.json rename to common/src/main/resources/assets/winterly/blockstates/raw_cryomarble_shard.json diff --git a/src/main/resources/assets/winterly/blockstates/red_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/red_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/red_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/red_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/snow_brick_slab.json b/common/src/main/resources/assets/winterly/blockstates/snow_brick_slab.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/snow_brick_slab.json rename to common/src/main/resources/assets/winterly/blockstates/snow_brick_slab.json diff --git a/src/main/resources/assets/winterly/blockstates/snow_brick_stairs.json b/common/src/main/resources/assets/winterly/blockstates/snow_brick_stairs.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/snow_brick_stairs.json rename to common/src/main/resources/assets/winterly/blockstates/snow_brick_stairs.json diff --git a/src/main/resources/assets/winterly/blockstates/snow_bricks.json b/common/src/main/resources/assets/winterly/blockstates/snow_bricks.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/snow_bricks.json rename to common/src/main/resources/assets/winterly/blockstates/snow_bricks.json diff --git a/src/main/resources/assets/winterly/blockstates/snowball_wall.json b/common/src/main/resources/assets/winterly/blockstates/snowball_wall.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/snowball_wall.json rename to common/src/main/resources/assets/winterly/blockstates/snowball_wall.json diff --git a/src/main/resources/assets/winterly/blockstates/snowguy.json b/common/src/main/resources/assets/winterly/blockstates/snowguy.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/snowguy.json rename to common/src/main/resources/assets/winterly/blockstates/snowguy.json diff --git a/src/main/resources/assets/winterly/blockstates/white_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/white_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/white_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/white_gift_box.json diff --git a/src/main/resources/assets/winterly/blockstates/yellow_gift_box.json b/common/src/main/resources/assets/winterly/blockstates/yellow_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/blockstates/yellow_gift_box.json rename to common/src/main/resources/assets/winterly/blockstates/yellow_gift_box.json diff --git a/src/main/resources/assets/winterly/icon.png b/common/src/main/resources/assets/winterly/icon.png similarity index 100% rename from src/main/resources/assets/winterly/icon.png rename to common/src/main/resources/assets/winterly/icon.png diff --git a/src/main/resources/assets/winterly/lang/en_us.json b/common/src/main/resources/assets/winterly/lang/en_us.json similarity index 97% rename from src/main/resources/assets/winterly/lang/en_us.json rename to common/src/main/resources/assets/winterly/lang/en_us.json index f9cc3c1..2dced3f 100644 --- a/src/main/resources/assets/winterly/lang/en_us.json +++ b/common/src/main/resources/assets/winterly/lang/en_us.json @@ -63,12 +63,11 @@ "config.winterly.title": "Winterly Config", "config.winterly.general": "General", "config.winterly.option.max_gift_box_capacity": "Max Gift Box Capacity", - "config.winterly.option.update_checker_enabled": "Update Checker Enabled", "config.winterly.option.generate_underground_icicles": "Generate Underground Icicles", "config.winterly.option.generate_cryomarble": "Generate Cryomarble", "config.winterly.option.generate_frozen_grass": "Generate Frozen Grass", "config.winterly.option.generate_frozen_flowers": "Generate Frozen Flowers", "config.winterly.option.mob_decorations.enabled": "Mob Decorations Enabled", - "config.winterly.option.mob_decorations.only_in_winter": "Mob Decorations Only in Winter", + "config.winterly.option.mob_decorations.only_in_winter": "Mob Decorations Only in Winter Holidays", "config.winterly.option.mob_decorations.chance": "Mob Decorations Chance" } diff --git a/src/main/resources/assets/winterly/lang/ru_ru.json b/common/src/main/resources/assets/winterly/lang/ru_ru.json similarity index 97% rename from src/main/resources/assets/winterly/lang/ru_ru.json rename to common/src/main/resources/assets/winterly/lang/ru_ru.json index 1c10f2d..28671b7 100644 --- a/src/main/resources/assets/winterly/lang/ru_ru.json +++ b/common/src/main/resources/assets/winterly/lang/ru_ru.json @@ -63,12 +63,11 @@ "config.winterly.title": "Настройки Winterly", "config.winterly.general": "Общее", "config.winterly.option.max_gift_box_capacity": "Максимальная вместимость подарочной коробки", - "config.winterly.option.update_checker_enabled": "Проверка обновлений включена", "config.winterly.option.generate_underground_icicles": "Генерировать подземные сосульки", "config.winterly.option.generate_cryomarble": "Генерировать криомрамор", "config.winterly.option.generate_frozen_grass": "Генерировать замороженную траву", "config.winterly.option.generate_frozen_flowers": "Генерировать замороженные цветы", "config.winterly.option.mob_decorations.enabled": "Украшения мобов включены", - "config.winterly.option.mob_decorations.only_in_winter": "Украшать мобов только зимой", + "config.winterly.option.mob_decorations.only_in_winter": "Украшать мобов только в зимние праздники", "config.winterly.option.mob_decorations.chance": "Шанс украсить моба" } diff --git a/src/main/resources/assets/winterly/lang/zh_cn.json b/common/src/main/resources/assets/winterly/lang/zh_cn.json similarity index 97% rename from src/main/resources/assets/winterly/lang/zh_cn.json rename to common/src/main/resources/assets/winterly/lang/zh_cn.json index be69d26..af23a78 100644 --- a/src/main/resources/assets/winterly/lang/zh_cn.json +++ b/common/src/main/resources/assets/winterly/lang/zh_cn.json @@ -63,7 +63,6 @@ "config.winterly.title": "Winterly配置", "config.winterly.general": "常规", "config.winterly.option.max_gift_box_capacity": "Max Gift Box Capacity", - "config.winterly.option.update_checker_enabled": "Update Checker Enabled", "config.winterly.option.generate_underground_icicles": "Generate Underground Icicles", "config.winterly.option.generate_cryomarble": "Generate Cryomarble", "config.winterly.option.generate_frozen_grass": "Generate Frozen Grass", diff --git a/src/main/resources/assets/winterly/models/block/base/garland_lights_model.json b/common/src/main/resources/assets/winterly/models/block/base/garland_lights_model.json similarity index 94% rename from src/main/resources/assets/winterly/models/block/base/garland_lights_model.json rename to common/src/main/resources/assets/winterly/models/block/base/garland_lights_model.json index baf6c9c..e90937a 100644 --- a/src/main/resources/assets/winterly/models/block/base/garland_lights_model.json +++ b/common/src/main/resources/assets/winterly/models/block/base/garland_lights_model.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "ambientocclusion": false, "textures": { "lights": "winterly:block/garland_lights", diff --git a/src/main/resources/assets/winterly/models/block/base/gift_box_model.json b/common/src/main/resources/assets/winterly/models/block/base/gift_box_model.json similarity index 98% rename from src/main/resources/assets/winterly/models/block/base/gift_box_model.json rename to common/src/main/resources/assets/winterly/models/block/base/gift_box_model.json index e1f5ec5..96a293f 100644 --- a/src/main/resources/assets/winterly/models/block/base/gift_box_model.json +++ b/common/src/main/resources/assets/winterly/models/block/base/gift_box_model.json @@ -1,9 +1,7 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", - "texture_size": [ - 32, - 32 - ], + "texture_size": [32, 32], "textures": { "box": "winterly:block/black_gift_box", "particle": "winterly:block/black_gift_box_particle" diff --git a/src/main/resources/assets/winterly/models/block/black_gift_box.json b/common/src/main/resources/assets/winterly/models/block/black_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/black_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/black_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/blue_gift_box.json b/common/src/main/resources/assets/winterly/models/block/blue_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/blue_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/blue_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/cryomarble_block.json b/common/src/main/resources/assets/winterly/models/block/cryomarble_block.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/cryomarble_block.json rename to common/src/main/resources/assets/winterly/models/block/cryomarble_block.json diff --git a/src/main/resources/assets/winterly/models/block/cyan_gift_box.json b/common/src/main/resources/assets/winterly/models/block/cyan_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/cyan_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/cyan_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/dense_snow.json b/common/src/main/resources/assets/winterly/models/block/dense_snow.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/dense_snow.json rename to common/src/main/resources/assets/winterly/models/block/dense_snow.json diff --git a/src/main/resources/assets/winterly/models/block/dense_snow_slab.json b/common/src/main/resources/assets/winterly/models/block/dense_snow_slab.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/dense_snow_slab.json rename to common/src/main/resources/assets/winterly/models/block/dense_snow_slab.json diff --git a/src/main/resources/assets/winterly/models/block/dense_snow_slab_top.json b/common/src/main/resources/assets/winterly/models/block/dense_snow_slab_top.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/dense_snow_slab_top.json rename to common/src/main/resources/assets/winterly/models/block/dense_snow_slab_top.json diff --git a/src/main/resources/assets/winterly/models/block/dense_snow_stairs.json b/common/src/main/resources/assets/winterly/models/block/dense_snow_stairs.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/dense_snow_stairs.json rename to common/src/main/resources/assets/winterly/models/block/dense_snow_stairs.json diff --git a/src/main/resources/assets/winterly/models/block/dense_snow_stairs_inner.json b/common/src/main/resources/assets/winterly/models/block/dense_snow_stairs_inner.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/dense_snow_stairs_inner.json rename to common/src/main/resources/assets/winterly/models/block/dense_snow_stairs_inner.json diff --git a/src/main/resources/assets/winterly/models/block/dense_snow_stairs_outer.json b/common/src/main/resources/assets/winterly/models/block/dense_snow_stairs_outer.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/dense_snow_stairs_outer.json rename to common/src/main/resources/assets/winterly/models/block/dense_snow_stairs_outer.json diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower.json similarity index 95% rename from src/main/resources/assets/winterly/models/block/frozen_flower.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower.json index 9139695..17b0ecc 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_10.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_10.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_10.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_10.json index 76648b2..5859fed 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_10.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_10.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_12.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_12.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_12.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_12.json index 2165d8b..9153d9a 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_12.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_12.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_14.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_14.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_14.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_14.json index 762a46e..4d81a6a 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_14.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_14.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_2.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_2.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_2.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_2.json index e3c6c06..a554e72 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_2.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_2.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_4.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_4.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_4.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_4.json index 76a8ed6..5983dc9 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_4.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_4.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_6.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_6.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_6.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_6.json index 8d65b50..7442469 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_6.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_6.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_flower_8.json b/common/src/main/resources/assets/winterly/models/block/frozen_flower_8.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_flower_8.json rename to common/src/main/resources/assets/winterly/models/block/frozen_flower_8.json index b6b3e1a..5ebf6f8 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_flower_8.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_flower_8.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "flower": "winterly:block/frozen_flower", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_10.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_10.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_10.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_10.json index 175a16a..b18c15a 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_10.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_10.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_12.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_12.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_12.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_12.json index acc2a45..13d5a5d 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_12.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_12.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_14.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_14.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_14.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_14.json index 4b76bb1..28e9c4a 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_14.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_14.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_2.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_2.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_2.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_2.json index c954a03..c815672 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_2.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_2.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_4.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_4.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_4.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_4.json index bb265b3..380d880 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_4.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_4.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_6.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_6.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_6.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_6.json index 144afbc..7573a54 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_6.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_6.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/frozen_grass_8.json b/common/src/main/resources/assets/winterly/models/block/frozen_grass_8.json similarity index 97% rename from src/main/resources/assets/winterly/models/block/frozen_grass_8.json rename to common/src/main/resources/assets/winterly/models/block/frozen_grass_8.json index 0b39ce2..a998eb6 100644 --- a/src/main/resources/assets/winterly/models/block/frozen_grass_8.json +++ b/common/src/main/resources/assets/winterly/models/block/frozen_grass_8.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "credit": "Made in Blockbench by PinkGoosik", "textures": { "grass": "winterly:block/frozen_grass", diff --git a/src/main/resources/assets/winterly/models/block/garland_lights.json b/common/src/main/resources/assets/winterly/models/block/garland_lights.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/garland_lights.json rename to common/src/main/resources/assets/winterly/models/block/garland_lights.json diff --git a/src/main/resources/assets/winterly/models/block/green_gift_box.json b/common/src/main/resources/assets/winterly/models/block/green_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/green_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/green_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/icicle_1.json b/common/src/main/resources/assets/winterly/models/block/icicle_1.json similarity index 72% rename from src/main/resources/assets/winterly/models/block/icicle_1.json rename to common/src/main/resources/assets/winterly/models/block/icicle_1.json index 74445ec..c2a39ed 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_1.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_1.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/tinted_cross", "textures": { "cross": "winterly:block/icicle_1" diff --git a/src/main/resources/assets/winterly/models/block/icicle_2.json b/common/src/main/resources/assets/winterly/models/block/icicle_2.json similarity index 72% rename from src/main/resources/assets/winterly/models/block/icicle_2.json rename to common/src/main/resources/assets/winterly/models/block/icicle_2.json index adce84a..0987d09 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_2.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_2.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/tinted_cross", "textures": { "cross": "winterly:block/icicle_2" diff --git a/src/main/resources/assets/winterly/models/block/icicle_3.json b/common/src/main/resources/assets/winterly/models/block/icicle_3.json similarity index 72% rename from src/main/resources/assets/winterly/models/block/icicle_3.json rename to common/src/main/resources/assets/winterly/models/block/icicle_3.json index b453962..f64910f 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_3.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_3.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/tinted_cross", "textures": { "cross": "winterly:block/icicle_3" diff --git a/src/main/resources/assets/winterly/models/block/icicle_bars_cap.json b/common/src/main/resources/assets/winterly/models/block/icicle_bars_cap.json similarity index 79% rename from src/main/resources/assets/winterly/models/block/icicle_bars_cap.json rename to common/src/main/resources/assets/winterly/models/block/icicle_bars_cap.json index cebd4ac..a1decf2 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_bars_cap.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_bars_cap.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/iron_bars_cap", "textures": { "bars": "winterly:block/icicle_bars", diff --git a/src/main/resources/assets/winterly/models/block/icicle_bars_cap_alt.json b/common/src/main/resources/assets/winterly/models/block/icicle_bars_cap_alt.json similarity index 80% rename from src/main/resources/assets/winterly/models/block/icicle_bars_cap_alt.json rename to common/src/main/resources/assets/winterly/models/block/icicle_bars_cap_alt.json index 2793d31..390ce7d 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_bars_cap_alt.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_bars_cap_alt.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/iron_bars_cap_alt", "textures": { "bars": "winterly:block/icicle_bars", diff --git a/src/main/resources/assets/winterly/models/block/icicle_bars_post.json b/common/src/main/resources/assets/winterly/models/block/icicle_bars_post.json similarity index 77% rename from src/main/resources/assets/winterly/models/block/icicle_bars_post.json rename to common/src/main/resources/assets/winterly/models/block/icicle_bars_post.json index c23ddfd..ae72f79 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_bars_post.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_bars_post.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/iron_bars_post", "textures": { "bars": "winterly:block/icicle_bars", diff --git a/src/main/resources/assets/winterly/models/block/icicle_bars_post_ends.json b/common/src/main/resources/assets/winterly/models/block/icicle_bars_post_ends.json similarity index 77% rename from src/main/resources/assets/winterly/models/block/icicle_bars_post_ends.json rename to common/src/main/resources/assets/winterly/models/block/icicle_bars_post_ends.json index 67045ab..609d960 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_bars_post_ends.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_bars_post_ends.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/iron_bars_post_ends", "textures": { "edge": "winterly:block/icicle_bars", diff --git a/src/main/resources/assets/winterly/models/block/icicle_bars_side.json b/common/src/main/resources/assets/winterly/models/block/icicle_bars_side.json similarity index 79% rename from src/main/resources/assets/winterly/models/block/icicle_bars_side.json rename to common/src/main/resources/assets/winterly/models/block/icicle_bars_side.json index 6d4a6a4..2cb9fcd 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_bars_side.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_bars_side.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/iron_bars_side", "textures": { "bars": "winterly:block/icicle_bars", diff --git a/src/main/resources/assets/winterly/models/block/icicle_bars_side_alt.json b/common/src/main/resources/assets/winterly/models/block/icicle_bars_side_alt.json similarity index 80% rename from src/main/resources/assets/winterly/models/block/icicle_bars_side_alt.json rename to common/src/main/resources/assets/winterly/models/block/icicle_bars_side_alt.json index fa9573f..c313920 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_bars_side_alt.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_bars_side_alt.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/iron_bars_side_alt", "textures": { "bars": "winterly:block/icicle_bars", diff --git a/src/main/resources/assets/winterly/models/block/icicle_block.json b/common/src/main/resources/assets/winterly/models/block/icicle_block.json similarity index 69% rename from src/main/resources/assets/winterly/models/block/icicle_block.json rename to common/src/main/resources/assets/winterly/models/block/icicle_block.json index 591b54e..12af2ff 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_block.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_block.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "block/cube_all", "textures": { "all": "winterly:block/icicle_block" diff --git a/src/main/resources/assets/winterly/models/block/icicle_pane_noside.json b/common/src/main/resources/assets/winterly/models/block/icicle_pane_noside.json similarity index 72% rename from src/main/resources/assets/winterly/models/block/icicle_pane_noside.json rename to common/src/main/resources/assets/winterly/models/block/icicle_pane_noside.json index 3a1319f..476a6a0 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_pane_noside.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_pane_noside.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "block/template_glass_pane_noside", "textures": { "pane": "winterly:block/icicle_block" diff --git a/src/main/resources/assets/winterly/models/block/icicle_pane_noside_alt.json b/common/src/main/resources/assets/winterly/models/block/icicle_pane_noside_alt.json similarity index 73% rename from src/main/resources/assets/winterly/models/block/icicle_pane_noside_alt.json rename to common/src/main/resources/assets/winterly/models/block/icicle_pane_noside_alt.json index dcae39f..c9b7912 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_pane_noside_alt.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_pane_noside_alt.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "block/template_glass_pane_noside_alt", "textures": { "pane": "winterly:block/icicle_block" diff --git a/src/main/resources/assets/winterly/models/block/icicle_pane_post.json b/common/src/main/resources/assets/winterly/models/block/icicle_pane_post.json similarity index 78% rename from src/main/resources/assets/winterly/models/block/icicle_pane_post.json rename to common/src/main/resources/assets/winterly/models/block/icicle_pane_post.json index d87d740..8112da9 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_pane_post.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_pane_post.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "block/template_glass_pane_post", "textures": { "pane": "winterly:block/icicle_block", diff --git a/src/main/resources/assets/winterly/models/block/icicle_pane_side.json b/common/src/main/resources/assets/winterly/models/block/icicle_pane_side.json similarity index 78% rename from src/main/resources/assets/winterly/models/block/icicle_pane_side.json rename to common/src/main/resources/assets/winterly/models/block/icicle_pane_side.json index c34241f..d387c81 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_pane_side.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_pane_side.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "block/template_glass_pane_side", "textures": { "pane": "winterly:block/icicle_block", diff --git a/src/main/resources/assets/winterly/models/block/icicle_pane_side_alt.json b/common/src/main/resources/assets/winterly/models/block/icicle_pane_side_alt.json similarity index 79% rename from src/main/resources/assets/winterly/models/block/icicle_pane_side_alt.json rename to common/src/main/resources/assets/winterly/models/block/icicle_pane_side_alt.json index 00cb631..d1a76cf 100644 --- a/src/main/resources/assets/winterly/models/block/icicle_pane_side_alt.json +++ b/common/src/main/resources/assets/winterly/models/block/icicle_pane_side_alt.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "block/template_glass_pane_side_alt", "textures": { "pane": "winterly:block/icicle_block", diff --git a/src/main/resources/assets/winterly/models/block/orange_gift_box.json b/common/src/main/resources/assets/winterly/models/block/orange_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/orange_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/orange_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/packed_icicle_block.json b/common/src/main/resources/assets/winterly/models/block/packed_icicle_block.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/packed_icicle_block.json rename to common/src/main/resources/assets/winterly/models/block/packed_icicle_block.json diff --git a/src/main/resources/assets/winterly/models/block/purple_gift_box.json b/common/src/main/resources/assets/winterly/models/block/purple_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/purple_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/purple_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/rainy_garland_lights.json b/common/src/main/resources/assets/winterly/models/block/rainy_garland_lights.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/rainy_garland_lights.json rename to common/src/main/resources/assets/winterly/models/block/rainy_garland_lights.json diff --git a/src/main/resources/assets/winterly/models/block/raw_cryomarble_shard.json b/common/src/main/resources/assets/winterly/models/block/raw_cryomarble_shard.json similarity index 74% rename from src/main/resources/assets/winterly/models/block/raw_cryomarble_shard.json rename to common/src/main/resources/assets/winterly/models/block/raw_cryomarble_shard.json index 312d3d2..5b3f88b 100644 --- a/src/main/resources/assets/winterly/models/block/raw_cryomarble_shard.json +++ b/common/src/main/resources/assets/winterly/models/block/raw_cryomarble_shard.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "parent": "block/tinted_cross", "textures": { "cross": "winterly:block/raw_cryomarble_shard" diff --git a/src/main/resources/assets/winterly/models/block/red_gift_box.json b/common/src/main/resources/assets/winterly/models/block/red_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/red_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/red_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/snow_brick_slab.json b/common/src/main/resources/assets/winterly/models/block/snow_brick_slab.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snow_brick_slab.json rename to common/src/main/resources/assets/winterly/models/block/snow_brick_slab.json diff --git a/src/main/resources/assets/winterly/models/block/snow_brick_slab_top.json b/common/src/main/resources/assets/winterly/models/block/snow_brick_slab_top.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snow_brick_slab_top.json rename to common/src/main/resources/assets/winterly/models/block/snow_brick_slab_top.json diff --git a/src/main/resources/assets/winterly/models/block/snow_brick_stairs.json b/common/src/main/resources/assets/winterly/models/block/snow_brick_stairs.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snow_brick_stairs.json rename to common/src/main/resources/assets/winterly/models/block/snow_brick_stairs.json diff --git a/src/main/resources/assets/winterly/models/block/snow_brick_stairs_inner.json b/common/src/main/resources/assets/winterly/models/block/snow_brick_stairs_inner.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snow_brick_stairs_inner.json rename to common/src/main/resources/assets/winterly/models/block/snow_brick_stairs_inner.json diff --git a/src/main/resources/assets/winterly/models/block/snow_brick_stairs_outer.json b/common/src/main/resources/assets/winterly/models/block/snow_brick_stairs_outer.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snow_brick_stairs_outer.json rename to common/src/main/resources/assets/winterly/models/block/snow_brick_stairs_outer.json diff --git a/src/main/resources/assets/winterly/models/block/snow_bricks.json b/common/src/main/resources/assets/winterly/models/block/snow_bricks.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snow_bricks.json rename to common/src/main/resources/assets/winterly/models/block/snow_bricks.json diff --git a/src/main/resources/assets/winterly/models/block/snowball_wall.json b/common/src/main/resources/assets/winterly/models/block/snowball_wall.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/snowball_wall.json rename to common/src/main/resources/assets/winterly/models/block/snowball_wall.json diff --git a/src/main/resources/assets/winterly/models/block/snowguy.json b/common/src/main/resources/assets/winterly/models/block/snowguy.json similarity index 99% rename from src/main/resources/assets/winterly/models/block/snowguy.json rename to common/src/main/resources/assets/winterly/models/block/snowguy.json index 8e8654e..bc33496 100644 --- a/src/main/resources/assets/winterly/models/block/snowguy.json +++ b/common/src/main/resources/assets/winterly/models/block/snowguy.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:cutout", "textures": { "guy": "winterly:block/snowguy_model", "particle": "winterly:block/snow_bricks" diff --git a/src/main/resources/assets/winterly/models/block/white_gift_box.json b/common/src/main/resources/assets/winterly/models/block/white_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/white_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/white_gift_box.json diff --git a/src/main/resources/assets/winterly/models/block/yellow_gift_box.json b/common/src/main/resources/assets/winterly/models/block/yellow_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/block/yellow_gift_box.json rename to common/src/main/resources/assets/winterly/models/block/yellow_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/black_gift_box.json b/common/src/main/resources/assets/winterly/models/item/black_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/black_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/black_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/blue_candy_cane.json b/common/src/main/resources/assets/winterly/models/item/blue_candy_cane.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/blue_candy_cane.json rename to common/src/main/resources/assets/winterly/models/item/blue_candy_cane.json diff --git a/src/main/resources/assets/winterly/models/item/blue_gift_box.json b/common/src/main/resources/assets/winterly/models/item/blue_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/blue_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/blue_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/blue_santa_hat.json b/common/src/main/resources/assets/winterly/models/item/blue_santa_hat.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/blue_santa_hat.json rename to common/src/main/resources/assets/winterly/models/item/blue_santa_hat.json diff --git a/src/main/resources/assets/winterly/models/item/blue_scarf.json b/common/src/main/resources/assets/winterly/models/item/blue_scarf.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/blue_scarf.json rename to common/src/main/resources/assets/winterly/models/item/blue_scarf.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble.json b/common/src/main/resources/assets/winterly/models/item/cryomarble.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_axe.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_axe.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_axe.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_axe.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_block.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_block.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_block.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_block.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_hoe.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_hoe.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_hoe.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_hoe.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_pickaxe.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_pickaxe.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_pickaxe.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_pickaxe.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_shard.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_shard.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_shard.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_shard.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_shovel.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_shovel.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_shovel.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_shovel.json diff --git a/src/main/resources/assets/winterly/models/item/cryomarble_sword.json b/common/src/main/resources/assets/winterly/models/item/cryomarble_sword.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cryomarble_sword.json rename to common/src/main/resources/assets/winterly/models/item/cryomarble_sword.json diff --git a/src/main/resources/assets/winterly/models/item/cyan_gift_box.json b/common/src/main/resources/assets/winterly/models/item/cyan_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/cyan_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/cyan_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/dense_snow.json b/common/src/main/resources/assets/winterly/models/item/dense_snow.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/dense_snow.json rename to common/src/main/resources/assets/winterly/models/item/dense_snow.json diff --git a/src/main/resources/assets/winterly/models/item/dense_snow_slab.json b/common/src/main/resources/assets/winterly/models/item/dense_snow_slab.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/dense_snow_slab.json rename to common/src/main/resources/assets/winterly/models/item/dense_snow_slab.json diff --git a/src/main/resources/assets/winterly/models/item/dense_snow_stairs.json b/common/src/main/resources/assets/winterly/models/item/dense_snow_stairs.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/dense_snow_stairs.json rename to common/src/main/resources/assets/winterly/models/item/dense_snow_stairs.json diff --git a/src/main/resources/assets/winterly/models/item/frozen_flower.json b/common/src/main/resources/assets/winterly/models/item/frozen_flower.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/frozen_flower.json rename to common/src/main/resources/assets/winterly/models/item/frozen_flower.json diff --git a/src/main/resources/assets/winterly/models/item/frozen_grass.json b/common/src/main/resources/assets/winterly/models/item/frozen_grass.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/frozen_grass.json rename to common/src/main/resources/assets/winterly/models/item/frozen_grass.json diff --git a/src/main/resources/assets/winterly/models/item/garland_lights.json b/common/src/main/resources/assets/winterly/models/item/garland_lights.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/garland_lights.json rename to common/src/main/resources/assets/winterly/models/item/garland_lights.json diff --git a/src/main/resources/assets/winterly/models/item/green_candy_cane.json b/common/src/main/resources/assets/winterly/models/item/green_candy_cane.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/green_candy_cane.json rename to common/src/main/resources/assets/winterly/models/item/green_candy_cane.json diff --git a/src/main/resources/assets/winterly/models/item/green_gift_box.json b/common/src/main/resources/assets/winterly/models/item/green_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/green_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/green_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/green_scarf.json b/common/src/main/resources/assets/winterly/models/item/green_scarf.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/green_scarf.json rename to common/src/main/resources/assets/winterly/models/item/green_scarf.json diff --git a/src/main/resources/assets/winterly/models/item/icicle.json b/common/src/main/resources/assets/winterly/models/item/icicle.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/icicle.json rename to common/src/main/resources/assets/winterly/models/item/icicle.json diff --git a/src/main/resources/assets/winterly/models/item/icicle_bars.json b/common/src/main/resources/assets/winterly/models/item/icicle_bars.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/icicle_bars.json rename to common/src/main/resources/assets/winterly/models/item/icicle_bars.json diff --git a/src/main/resources/assets/winterly/models/item/icicle_block.json b/common/src/main/resources/assets/winterly/models/item/icicle_block.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/icicle_block.json rename to common/src/main/resources/assets/winterly/models/item/icicle_block.json diff --git a/src/main/resources/assets/winterly/models/item/icicle_pane.json b/common/src/main/resources/assets/winterly/models/item/icicle_pane.json similarity index 69% rename from src/main/resources/assets/winterly/models/item/icicle_pane.json rename to common/src/main/resources/assets/winterly/models/item/icicle_pane.json index 10ff442..aaafcde 100644 --- a/src/main/resources/assets/winterly/models/item/icicle_pane.json +++ b/common/src/main/resources/assets/winterly/models/item/icicle_pane.json @@ -1,4 +1,5 @@ { + "render_type": "minecraft:translucent", "parent": "item/generated", "textures": { "layer0": "winterly:block/icicle_block" diff --git a/src/main/resources/assets/winterly/models/item/orange_gift_box.json b/common/src/main/resources/assets/winterly/models/item/orange_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/orange_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/orange_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/packed_icicle_block.json b/common/src/main/resources/assets/winterly/models/item/packed_icicle_block.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/packed_icicle_block.json rename to common/src/main/resources/assets/winterly/models/item/packed_icicle_block.json diff --git a/src/main/resources/assets/winterly/models/item/purple_gift_box.json b/common/src/main/resources/assets/winterly/models/item/purple_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/purple_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/purple_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/rainbow_scarf.json b/common/src/main/resources/assets/winterly/models/item/rainbow_scarf.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/rainbow_scarf.json rename to common/src/main/resources/assets/winterly/models/item/rainbow_scarf.json diff --git a/src/main/resources/assets/winterly/models/item/rainy_garland_lights.json b/common/src/main/resources/assets/winterly/models/item/rainy_garland_lights.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/rainy_garland_lights.json rename to common/src/main/resources/assets/winterly/models/item/rainy_garland_lights.json diff --git a/src/main/resources/assets/winterly/models/item/raw_cryomarble_shard.json b/common/src/main/resources/assets/winterly/models/item/raw_cryomarble_shard.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/raw_cryomarble_shard.json rename to common/src/main/resources/assets/winterly/models/item/raw_cryomarble_shard.json diff --git a/src/main/resources/assets/winterly/models/item/red_candy_cane.json b/common/src/main/resources/assets/winterly/models/item/red_candy_cane.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/red_candy_cane.json rename to common/src/main/resources/assets/winterly/models/item/red_candy_cane.json diff --git a/src/main/resources/assets/winterly/models/item/red_gift_box.json b/common/src/main/resources/assets/winterly/models/item/red_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/red_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/red_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/red_santa_hat.json b/common/src/main/resources/assets/winterly/models/item/red_santa_hat.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/red_santa_hat.json rename to common/src/main/resources/assets/winterly/models/item/red_santa_hat.json diff --git a/src/main/resources/assets/winterly/models/item/red_scarf.json b/common/src/main/resources/assets/winterly/models/item/red_scarf.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/red_scarf.json rename to common/src/main/resources/assets/winterly/models/item/red_scarf.json diff --git a/src/main/resources/assets/winterly/models/item/snow_brick_slab.json b/common/src/main/resources/assets/winterly/models/item/snow_brick_slab.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/snow_brick_slab.json rename to common/src/main/resources/assets/winterly/models/item/snow_brick_slab.json diff --git a/src/main/resources/assets/winterly/models/item/snow_brick_stairs.json b/common/src/main/resources/assets/winterly/models/item/snow_brick_stairs.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/snow_brick_stairs.json rename to common/src/main/resources/assets/winterly/models/item/snow_brick_stairs.json diff --git a/src/main/resources/assets/winterly/models/item/snow_bricks.json b/common/src/main/resources/assets/winterly/models/item/snow_bricks.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/snow_bricks.json rename to common/src/main/resources/assets/winterly/models/item/snow_bricks.json diff --git a/src/main/resources/assets/winterly/models/item/snowball_wall.json b/common/src/main/resources/assets/winterly/models/item/snowball_wall.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/snowball_wall.json rename to common/src/main/resources/assets/winterly/models/item/snowball_wall.json diff --git a/src/main/resources/assets/winterly/models/item/snowguy.json b/common/src/main/resources/assets/winterly/models/item/snowguy.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/snowguy.json rename to common/src/main/resources/assets/winterly/models/item/snowguy.json diff --git a/src/main/resources/assets/winterly/models/item/white_gift_box.json b/common/src/main/resources/assets/winterly/models/item/white_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/white_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/white_gift_box.json diff --git a/src/main/resources/assets/winterly/models/item/white_scarf.json b/common/src/main/resources/assets/winterly/models/item/white_scarf.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/white_scarf.json rename to common/src/main/resources/assets/winterly/models/item/white_scarf.json diff --git a/src/main/resources/assets/winterly/models/item/yellow_gift_box.json b/common/src/main/resources/assets/winterly/models/item/yellow_gift_box.json similarity index 100% rename from src/main/resources/assets/winterly/models/item/yellow_gift_box.json rename to common/src/main/resources/assets/winterly/models/item/yellow_gift_box.json diff --git a/src/main/resources/assets/winterly/textures/block/black_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/black_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/black_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/black_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/black_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/black_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/black_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/black_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/blue_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/blue_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/blue_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/blue_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/blue_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/blue_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/blue_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/blue_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/cryomarble_block.png b/common/src/main/resources/assets/winterly/textures/block/cryomarble_block.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/cryomarble_block.png rename to common/src/main/resources/assets/winterly/textures/block/cryomarble_block.png diff --git a/src/main/resources/assets/winterly/textures/block/cyan_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/cyan_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/cyan_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/cyan_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/cyan_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/cyan_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/cyan_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/cyan_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/dense_snow.png b/common/src/main/resources/assets/winterly/textures/block/dense_snow.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/dense_snow.png rename to common/src/main/resources/assets/winterly/textures/block/dense_snow.png diff --git a/src/main/resources/assets/winterly/textures/block/frozen_flower.png b/common/src/main/resources/assets/winterly/textures/block/frozen_flower.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/frozen_flower.png rename to common/src/main/resources/assets/winterly/textures/block/frozen_flower.png diff --git a/src/main/resources/assets/winterly/textures/block/frozen_grass.png b/common/src/main/resources/assets/winterly/textures/block/frozen_grass.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/frozen_grass.png rename to common/src/main/resources/assets/winterly/textures/block/frozen_grass.png diff --git a/src/main/resources/assets/winterly/textures/block/garland_lights.png b/common/src/main/resources/assets/winterly/textures/block/garland_lights.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/garland_lights.png rename to common/src/main/resources/assets/winterly/textures/block/garland_lights.png diff --git a/src/main/resources/assets/winterly/textures/block/garland_lights.png.mcmeta b/common/src/main/resources/assets/winterly/textures/block/garland_lights.png.mcmeta similarity index 100% rename from src/main/resources/assets/winterly/textures/block/garland_lights.png.mcmeta rename to common/src/main/resources/assets/winterly/textures/block/garland_lights.png.mcmeta diff --git a/src/main/resources/assets/winterly/textures/block/green_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/green_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/green_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/green_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/green_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/green_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/green_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/green_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/icicle_1.png b/common/src/main/resources/assets/winterly/textures/block/icicle_1.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/icicle_1.png rename to common/src/main/resources/assets/winterly/textures/block/icicle_1.png diff --git a/src/main/resources/assets/winterly/textures/block/icicle_2.png b/common/src/main/resources/assets/winterly/textures/block/icicle_2.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/icicle_2.png rename to common/src/main/resources/assets/winterly/textures/block/icicle_2.png diff --git a/src/main/resources/assets/winterly/textures/block/icicle_3.png b/common/src/main/resources/assets/winterly/textures/block/icicle_3.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/icicle_3.png rename to common/src/main/resources/assets/winterly/textures/block/icicle_3.png diff --git a/src/main/resources/assets/winterly/textures/block/icicle_bars.png b/common/src/main/resources/assets/winterly/textures/block/icicle_bars.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/icicle_bars.png rename to common/src/main/resources/assets/winterly/textures/block/icicle_bars.png diff --git a/src/main/resources/assets/winterly/textures/block/icicle_block.png b/common/src/main/resources/assets/winterly/textures/block/icicle_block.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/icicle_block.png rename to common/src/main/resources/assets/winterly/textures/block/icicle_block.png diff --git a/src/main/resources/assets/winterly/textures/block/orange_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/orange_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/orange_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/orange_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/orange_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/orange_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/orange_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/orange_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/packed_icicle_block.png b/common/src/main/resources/assets/winterly/textures/block/packed_icicle_block.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/packed_icicle_block.png rename to common/src/main/resources/assets/winterly/textures/block/packed_icicle_block.png diff --git a/src/main/resources/assets/winterly/textures/block/purple_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/purple_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/purple_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/purple_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/purple_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/purple_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/purple_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/purple_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png b/common/src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png rename to common/src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png diff --git a/src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png.mcmeta b/common/src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png.mcmeta similarity index 100% rename from src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png.mcmeta rename to common/src/main/resources/assets/winterly/textures/block/rainy_garland_lights.png.mcmeta diff --git a/src/main/resources/assets/winterly/textures/block/raw_cryomarble_shard.png b/common/src/main/resources/assets/winterly/textures/block/raw_cryomarble_shard.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/raw_cryomarble_shard.png rename to common/src/main/resources/assets/winterly/textures/block/raw_cryomarble_shard.png diff --git a/src/main/resources/assets/winterly/textures/block/red_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/red_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/red_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/red_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/red_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/red_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/red_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/red_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/snow_bricks.png b/common/src/main/resources/assets/winterly/textures/block/snow_bricks.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/snow_bricks.png rename to common/src/main/resources/assets/winterly/textures/block/snow_bricks.png diff --git a/src/main/resources/assets/winterly/textures/block/snowball_wall.png b/common/src/main/resources/assets/winterly/textures/block/snowball_wall.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/snowball_wall.png rename to common/src/main/resources/assets/winterly/textures/block/snowball_wall.png diff --git a/src/main/resources/assets/winterly/textures/block/snowguy_model.png b/common/src/main/resources/assets/winterly/textures/block/snowguy_model.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/snowguy_model.png rename to common/src/main/resources/assets/winterly/textures/block/snowguy_model.png diff --git a/src/main/resources/assets/winterly/textures/block/white_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/white_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/white_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/white_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/white_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/white_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/white_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/white_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/block/yellow_gift_box.png b/common/src/main/resources/assets/winterly/textures/block/yellow_gift_box.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/yellow_gift_box.png rename to common/src/main/resources/assets/winterly/textures/block/yellow_gift_box.png diff --git a/src/main/resources/assets/winterly/textures/block/yellow_gift_box_particle.png b/common/src/main/resources/assets/winterly/textures/block/yellow_gift_box_particle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/block/yellow_gift_box_particle.png rename to common/src/main/resources/assets/winterly/textures/block/yellow_gift_box_particle.png diff --git a/src/main/resources/assets/winterly/textures/entity/blue_santa_hat.png b/common/src/main/resources/assets/winterly/textures/entity/blue_santa_hat.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/blue_santa_hat.png rename to common/src/main/resources/assets/winterly/textures/entity/blue_santa_hat.png diff --git a/src/main/resources/assets/winterly/textures/entity/blue_scarf.png b/common/src/main/resources/assets/winterly/textures/entity/blue_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/blue_scarf.png rename to common/src/main/resources/assets/winterly/textures/entity/blue_scarf.png diff --git a/src/main/resources/assets/winterly/textures/entity/green_scarf.png b/common/src/main/resources/assets/winterly/textures/entity/green_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/green_scarf.png rename to common/src/main/resources/assets/winterly/textures/entity/green_scarf.png diff --git a/src/main/resources/assets/winterly/textures/entity/rainbow_scarf.png b/common/src/main/resources/assets/winterly/textures/entity/rainbow_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/rainbow_scarf.png rename to common/src/main/resources/assets/winterly/textures/entity/rainbow_scarf.png diff --git a/src/main/resources/assets/winterly/textures/entity/red_santa_hat.png b/common/src/main/resources/assets/winterly/textures/entity/red_santa_hat.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/red_santa_hat.png rename to common/src/main/resources/assets/winterly/textures/entity/red_santa_hat.png diff --git a/src/main/resources/assets/winterly/textures/entity/red_scarf.png b/common/src/main/resources/assets/winterly/textures/entity/red_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/red_scarf.png rename to common/src/main/resources/assets/winterly/textures/entity/red_scarf.png diff --git a/src/main/resources/assets/winterly/textures/entity/white_scarf.png b/common/src/main/resources/assets/winterly/textures/entity/white_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/entity/white_scarf.png rename to common/src/main/resources/assets/winterly/textures/entity/white_scarf.png diff --git a/src/main/resources/assets/winterly/textures/gui/icons.png b/common/src/main/resources/assets/winterly/textures/gui/icons.png similarity index 100% rename from src/main/resources/assets/winterly/textures/gui/icons.png rename to common/src/main/resources/assets/winterly/textures/gui/icons.png diff --git a/src/main/resources/assets/winterly/textures/item/blue_candy_cane.png b/common/src/main/resources/assets/winterly/textures/item/blue_candy_cane.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/blue_candy_cane.png rename to common/src/main/resources/assets/winterly/textures/item/blue_candy_cane.png diff --git a/src/main/resources/assets/winterly/textures/item/blue_santa_hat.png b/common/src/main/resources/assets/winterly/textures/item/blue_santa_hat.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/blue_santa_hat.png rename to common/src/main/resources/assets/winterly/textures/item/blue_santa_hat.png diff --git a/src/main/resources/assets/winterly/textures/item/blue_scarf.png b/common/src/main/resources/assets/winterly/textures/item/blue_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/blue_scarf.png rename to common/src/main/resources/assets/winterly/textures/item/blue_scarf.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble_axe.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble_axe.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble_axe.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble_axe.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble_hoe.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble_hoe.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble_hoe.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble_hoe.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble_pickaxe.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble_pickaxe.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble_pickaxe.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble_pickaxe.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble_shard.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble_shard.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble_shard.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble_shard.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble_shovel.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble_shovel.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble_shovel.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble_shovel.png diff --git a/src/main/resources/assets/winterly/textures/item/cryomarble_sword.png b/common/src/main/resources/assets/winterly/textures/item/cryomarble_sword.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/cryomarble_sword.png rename to common/src/main/resources/assets/winterly/textures/item/cryomarble_sword.png diff --git a/src/main/resources/assets/winterly/textures/item/green_candy_cane.png b/common/src/main/resources/assets/winterly/textures/item/green_candy_cane.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/green_candy_cane.png rename to common/src/main/resources/assets/winterly/textures/item/green_candy_cane.png diff --git a/src/main/resources/assets/winterly/textures/item/green_scarf.png b/common/src/main/resources/assets/winterly/textures/item/green_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/green_scarf.png rename to common/src/main/resources/assets/winterly/textures/item/green_scarf.png diff --git a/src/main/resources/assets/winterly/textures/item/icicle.png b/common/src/main/resources/assets/winterly/textures/item/icicle.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/icicle.png rename to common/src/main/resources/assets/winterly/textures/item/icicle.png diff --git a/src/main/resources/assets/winterly/textures/item/rainbow_scarf.png b/common/src/main/resources/assets/winterly/textures/item/rainbow_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/rainbow_scarf.png rename to common/src/main/resources/assets/winterly/textures/item/rainbow_scarf.png diff --git a/src/main/resources/assets/winterly/textures/item/red_candy_cane.png b/common/src/main/resources/assets/winterly/textures/item/red_candy_cane.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/red_candy_cane.png rename to common/src/main/resources/assets/winterly/textures/item/red_candy_cane.png diff --git a/src/main/resources/assets/winterly/textures/item/red_santa_hat.png b/common/src/main/resources/assets/winterly/textures/item/red_santa_hat.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/red_santa_hat.png rename to common/src/main/resources/assets/winterly/textures/item/red_santa_hat.png diff --git a/src/main/resources/assets/winterly/textures/item/red_scarf.png b/common/src/main/resources/assets/winterly/textures/item/red_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/red_scarf.png rename to common/src/main/resources/assets/winterly/textures/item/red_scarf.png diff --git a/src/main/resources/assets/winterly/textures/item/snowguy.png b/common/src/main/resources/assets/winterly/textures/item/snowguy.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/snowguy.png rename to common/src/main/resources/assets/winterly/textures/item/snowguy.png diff --git a/src/main/resources/assets/winterly/textures/item/white_scarf.png b/common/src/main/resources/assets/winterly/textures/item/white_scarf.png similarity index 100% rename from src/main/resources/assets/winterly/textures/item/white_scarf.png rename to common/src/main/resources/assets/winterly/textures/item/white_scarf.png diff --git a/src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json b/common/src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json rename to common/src/main/resources/data/minecraft/tags/blocks/beacon_base_blocks.json diff --git a/src/main/resources/data/minecraft/tags/blocks/mangrove_roots_can_grow_through.json b/common/src/main/resources/data/minecraft/tags/blocks/mangrove_roots_can_grow_through.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/mangrove_roots_can_grow_through.json rename to common/src/main/resources/data/minecraft/tags/blocks/mangrove_roots_can_grow_through.json diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json rename to common/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json b/common/src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json rename to common/src/main/resources/data/minecraft/tags/blocks/mineable/shovel.json diff --git a/src/main/resources/data/minecraft/tags/blocks/slabs.json b/common/src/main/resources/data/minecraft/tags/blocks/slabs.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/slabs.json rename to common/src/main/resources/data/minecraft/tags/blocks/slabs.json diff --git a/src/main/resources/data/minecraft/tags/blocks/snow.json b/common/src/main/resources/data/minecraft/tags/blocks/snow.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/snow.json rename to common/src/main/resources/data/minecraft/tags/blocks/snow.json diff --git a/src/main/resources/data/minecraft/tags/blocks/stairs.json b/common/src/main/resources/data/minecraft/tags/blocks/stairs.json similarity index 100% rename from src/main/resources/data/minecraft/tags/blocks/stairs.json rename to common/src/main/resources/data/minecraft/tags/blocks/stairs.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/cryomarble_block.json b/common/src/main/resources/data/winterly/loot_tables/blocks/cryomarble_block.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/cryomarble_block.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/cryomarble_block.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/dense_snow.json b/common/src/main/resources/data/winterly/loot_tables/blocks/dense_snow.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/dense_snow.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/dense_snow.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/dense_snow_slab.json b/common/src/main/resources/data/winterly/loot_tables/blocks/dense_snow_slab.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/dense_snow_slab.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/dense_snow_slab.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/dense_snow_stairs.json b/common/src/main/resources/data/winterly/loot_tables/blocks/dense_snow_stairs.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/dense_snow_stairs.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/dense_snow_stairs.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/frozen_flower.json b/common/src/main/resources/data/winterly/loot_tables/blocks/frozen_flower.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/frozen_flower.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/frozen_flower.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/frozen_grass.json b/common/src/main/resources/data/winterly/loot_tables/blocks/frozen_grass.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/frozen_grass.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/frozen_grass.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/garland_lights.json b/common/src/main/resources/data/winterly/loot_tables/blocks/garland_lights.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/garland_lights.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/garland_lights.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/icicle.json b/common/src/main/resources/data/winterly/loot_tables/blocks/icicle.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/icicle.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/icicle.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/icicle_bars.json b/common/src/main/resources/data/winterly/loot_tables/blocks/icicle_bars.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/icicle_bars.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/icicle_bars.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/icicle_block.json b/common/src/main/resources/data/winterly/loot_tables/blocks/icicle_block.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/icicle_block.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/icicle_block.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/icicle_pane.json b/common/src/main/resources/data/winterly/loot_tables/blocks/icicle_pane.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/icicle_pane.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/icicle_pane.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/packed_icicle_block.json b/common/src/main/resources/data/winterly/loot_tables/blocks/packed_icicle_block.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/packed_icicle_block.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/packed_icicle_block.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/rainy_garland_lights.json b/common/src/main/resources/data/winterly/loot_tables/blocks/rainy_garland_lights.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/rainy_garland_lights.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/rainy_garland_lights.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/raw_cryomarble_shard.json b/common/src/main/resources/data/winterly/loot_tables/blocks/raw_cryomarble_shard.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/raw_cryomarble_shard.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/raw_cryomarble_shard.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/snow_brick_slab.json b/common/src/main/resources/data/winterly/loot_tables/blocks/snow_brick_slab.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/snow_brick_slab.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/snow_brick_slab.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/snow_brick_stairs.json b/common/src/main/resources/data/winterly/loot_tables/blocks/snow_brick_stairs.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/snow_brick_stairs.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/snow_brick_stairs.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/snow_bricks.json b/common/src/main/resources/data/winterly/loot_tables/blocks/snow_bricks.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/snow_bricks.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/snow_bricks.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/snowball_wall.json b/common/src/main/resources/data/winterly/loot_tables/blocks/snowball_wall.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/snowball_wall.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/snowball_wall.json diff --git a/src/main/resources/data/winterly/loot_tables/blocks/snowguy.json b/common/src/main/resources/data/winterly/loot_tables/blocks/snowguy.json similarity index 100% rename from src/main/resources/data/winterly/loot_tables/blocks/snowguy.json rename to common/src/main/resources/data/winterly/loot_tables/blocks/snowguy.json diff --git a/src/main/resources/data/winterly/recipes/black_gift_box.json b/common/src/main/resources/data/winterly/recipes/black_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/black_gift_box.json rename to common/src/main/resources/data/winterly/recipes/black_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/blue_candy_cane.json b/common/src/main/resources/data/winterly/recipes/blue_candy_cane.json similarity index 100% rename from src/main/resources/data/winterly/recipes/blue_candy_cane.json rename to common/src/main/resources/data/winterly/recipes/blue_candy_cane.json diff --git a/src/main/resources/data/winterly/recipes/blue_gift_box.json b/common/src/main/resources/data/winterly/recipes/blue_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/blue_gift_box.json rename to common/src/main/resources/data/winterly/recipes/blue_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/blue_santa_hat.json b/common/src/main/resources/data/winterly/recipes/blue_santa_hat.json similarity index 100% rename from src/main/resources/data/winterly/recipes/blue_santa_hat.json rename to common/src/main/resources/data/winterly/recipes/blue_santa_hat.json diff --git a/src/main/resources/data/winterly/recipes/blue_scarf.json b/common/src/main/resources/data/winterly/recipes/blue_scarf.json similarity index 100% rename from src/main/resources/data/winterly/recipes/blue_scarf.json rename to common/src/main/resources/data/winterly/recipes/blue_scarf.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble.json b/common/src/main/resources/data/winterly/recipes/cryomarble.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble.json rename to common/src/main/resources/data/winterly/recipes/cryomarble.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_axe.json b/common/src/main/resources/data/winterly/recipes/cryomarble_axe.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_axe.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_axe.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_block.json b/common/src/main/resources/data/winterly/recipes/cryomarble_block.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_block.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_block.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_from_cryomarble_block.json b/common/src/main/resources/data/winterly/recipes/cryomarble_from_cryomarble_block.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_from_cryomarble_block.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_from_cryomarble_block.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_hoe.json b/common/src/main/resources/data/winterly/recipes/cryomarble_hoe.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_hoe.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_hoe.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_pickaxe.json b/common/src/main/resources/data/winterly/recipes/cryomarble_pickaxe.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_pickaxe.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_pickaxe.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_shovel.json b/common/src/main/resources/data/winterly/recipes/cryomarble_shovel.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_shovel.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_shovel.json diff --git a/src/main/resources/data/winterly/recipes/cryomarble_sword.json b/common/src/main/resources/data/winterly/recipes/cryomarble_sword.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cryomarble_sword.json rename to common/src/main/resources/data/winterly/recipes/cryomarble_sword.json diff --git a/src/main/resources/data/winterly/recipes/cyan_gift_box.json b/common/src/main/resources/data/winterly/recipes/cyan_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/cyan_gift_box.json rename to common/src/main/resources/data/winterly/recipes/cyan_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/dense_snow.json b/common/src/main/resources/data/winterly/recipes/dense_snow.json similarity index 100% rename from src/main/resources/data/winterly/recipes/dense_snow.json rename to common/src/main/resources/data/winterly/recipes/dense_snow.json diff --git a/src/main/resources/data/winterly/recipes/dense_snow_slab.json b/common/src/main/resources/data/winterly/recipes/dense_snow_slab.json similarity index 100% rename from src/main/resources/data/winterly/recipes/dense_snow_slab.json rename to common/src/main/resources/data/winterly/recipes/dense_snow_slab.json diff --git a/src/main/resources/data/winterly/recipes/dense_snow_stairs.json b/common/src/main/resources/data/winterly/recipes/dense_snow_stairs.json similarity index 100% rename from src/main/resources/data/winterly/recipes/dense_snow_stairs.json rename to common/src/main/resources/data/winterly/recipes/dense_snow_stairs.json diff --git a/src/main/resources/data/winterly/recipes/garland_lights.json b/common/src/main/resources/data/winterly/recipes/garland_lights.json similarity index 100% rename from src/main/resources/data/winterly/recipes/garland_lights.json rename to common/src/main/resources/data/winterly/recipes/garland_lights.json diff --git a/src/main/resources/data/winterly/recipes/green_candy_cane.json b/common/src/main/resources/data/winterly/recipes/green_candy_cane.json similarity index 100% rename from src/main/resources/data/winterly/recipes/green_candy_cane.json rename to common/src/main/resources/data/winterly/recipes/green_candy_cane.json diff --git a/src/main/resources/data/winterly/recipes/green_gift_box.json b/common/src/main/resources/data/winterly/recipes/green_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/green_gift_box.json rename to common/src/main/resources/data/winterly/recipes/green_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/green_scarf.json b/common/src/main/resources/data/winterly/recipes/green_scarf.json similarity index 100% rename from src/main/resources/data/winterly/recipes/green_scarf.json rename to common/src/main/resources/data/winterly/recipes/green_scarf.json diff --git a/src/main/resources/data/winterly/recipes/icicle_1.json b/common/src/main/resources/data/winterly/recipes/icicle_1.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_1.json rename to common/src/main/resources/data/winterly/recipes/icicle_1.json diff --git a/src/main/resources/data/winterly/recipes/icicle_2.json b/common/src/main/resources/data/winterly/recipes/icicle_2.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_2.json rename to common/src/main/resources/data/winterly/recipes/icicle_2.json diff --git a/src/main/resources/data/winterly/recipes/icicle_3.json b/common/src/main/resources/data/winterly/recipes/icicle_3.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_3.json rename to common/src/main/resources/data/winterly/recipes/icicle_3.json diff --git a/src/main/resources/data/winterly/recipes/icicle_bars.json b/common/src/main/resources/data/winterly/recipes/icicle_bars.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_bars.json rename to common/src/main/resources/data/winterly/recipes/icicle_bars.json diff --git a/src/main/resources/data/winterly/recipes/icicle_block.json b/common/src/main/resources/data/winterly/recipes/icicle_block.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_block.json rename to common/src/main/resources/data/winterly/recipes/icicle_block.json diff --git a/src/main/resources/data/winterly/recipes/icicle_from_icicle_block.json b/common/src/main/resources/data/winterly/recipes/icicle_from_icicle_block.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_from_icicle_block.json rename to common/src/main/resources/data/winterly/recipes/icicle_from_icicle_block.json diff --git a/src/main/resources/data/winterly/recipes/icicle_pane.json b/common/src/main/resources/data/winterly/recipes/icicle_pane.json similarity index 100% rename from src/main/resources/data/winterly/recipes/icicle_pane.json rename to common/src/main/resources/data/winterly/recipes/icicle_pane.json diff --git a/src/main/resources/data/winterly/recipes/orange_gift_box.json b/common/src/main/resources/data/winterly/recipes/orange_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/orange_gift_box.json rename to common/src/main/resources/data/winterly/recipes/orange_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/packed_icicle_block.json b/common/src/main/resources/data/winterly/recipes/packed_icicle_block.json similarity index 100% rename from src/main/resources/data/winterly/recipes/packed_icicle_block.json rename to common/src/main/resources/data/winterly/recipes/packed_icicle_block.json diff --git a/src/main/resources/data/winterly/recipes/purple_gift_box.json b/common/src/main/resources/data/winterly/recipes/purple_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/purple_gift_box.json rename to common/src/main/resources/data/winterly/recipes/purple_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/rainbow_scarf.json b/common/src/main/resources/data/winterly/recipes/rainbow_scarf.json similarity index 100% rename from src/main/resources/data/winterly/recipes/rainbow_scarf.json rename to common/src/main/resources/data/winterly/recipes/rainbow_scarf.json diff --git a/src/main/resources/data/winterly/recipes/rainy_garland_lights.json b/common/src/main/resources/data/winterly/recipes/rainy_garland_lights.json similarity index 100% rename from src/main/resources/data/winterly/recipes/rainy_garland_lights.json rename to common/src/main/resources/data/winterly/recipes/rainy_garland_lights.json diff --git a/src/main/resources/data/winterly/recipes/red_candy_cane.json b/common/src/main/resources/data/winterly/recipes/red_candy_cane.json similarity index 100% rename from src/main/resources/data/winterly/recipes/red_candy_cane.json rename to common/src/main/resources/data/winterly/recipes/red_candy_cane.json diff --git a/src/main/resources/data/winterly/recipes/red_gift_box.json b/common/src/main/resources/data/winterly/recipes/red_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/red_gift_box.json rename to common/src/main/resources/data/winterly/recipes/red_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/red_santa_hat.json b/common/src/main/resources/data/winterly/recipes/red_santa_hat.json similarity index 100% rename from src/main/resources/data/winterly/recipes/red_santa_hat.json rename to common/src/main/resources/data/winterly/recipes/red_santa_hat.json diff --git a/src/main/resources/data/winterly/recipes/red_scarf.json b/common/src/main/resources/data/winterly/recipes/red_scarf.json similarity index 100% rename from src/main/resources/data/winterly/recipes/red_scarf.json rename to common/src/main/resources/data/winterly/recipes/red_scarf.json diff --git a/src/main/resources/data/winterly/recipes/snow_brick_slab.json b/common/src/main/resources/data/winterly/recipes/snow_brick_slab.json similarity index 100% rename from src/main/resources/data/winterly/recipes/snow_brick_slab.json rename to common/src/main/resources/data/winterly/recipes/snow_brick_slab.json diff --git a/src/main/resources/data/winterly/recipes/snow_brick_stairs.json b/common/src/main/resources/data/winterly/recipes/snow_brick_stairs.json similarity index 100% rename from src/main/resources/data/winterly/recipes/snow_brick_stairs.json rename to common/src/main/resources/data/winterly/recipes/snow_brick_stairs.json diff --git a/src/main/resources/data/winterly/recipes/snow_bricks.json b/common/src/main/resources/data/winterly/recipes/snow_bricks.json similarity index 100% rename from src/main/resources/data/winterly/recipes/snow_bricks.json rename to common/src/main/resources/data/winterly/recipes/snow_bricks.json diff --git a/src/main/resources/data/winterly/recipes/snowball_wall.json b/common/src/main/resources/data/winterly/recipes/snowball_wall.json similarity index 100% rename from src/main/resources/data/winterly/recipes/snowball_wall.json rename to common/src/main/resources/data/winterly/recipes/snowball_wall.json diff --git a/src/main/resources/data/winterly/recipes/snowguy.json b/common/src/main/resources/data/winterly/recipes/snowguy.json similarity index 100% rename from src/main/resources/data/winterly/recipes/snowguy.json rename to common/src/main/resources/data/winterly/recipes/snowguy.json diff --git a/src/main/resources/data/winterly/recipes/white_gift_box.json b/common/src/main/resources/data/winterly/recipes/white_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/white_gift_box.json rename to common/src/main/resources/data/winterly/recipes/white_gift_box.json diff --git a/src/main/resources/data/winterly/recipes/white_scarf.json b/common/src/main/resources/data/winterly/recipes/white_scarf.json similarity index 100% rename from src/main/resources/data/winterly/recipes/white_scarf.json rename to common/src/main/resources/data/winterly/recipes/white_scarf.json diff --git a/src/main/resources/data/winterly/recipes/yellow_gift_box.json b/common/src/main/resources/data/winterly/recipes/yellow_gift_box.json similarity index 100% rename from src/main/resources/data/winterly/recipes/yellow_gift_box.json rename to common/src/main/resources/data/winterly/recipes/yellow_gift_box.json diff --git a/src/main/resources/data/winterly/tags/blocks/gift_boxes.json b/common/src/main/resources/data/winterly/tags/blocks/gift_boxes.json similarity index 100% rename from src/main/resources/data/winterly/tags/blocks/gift_boxes.json rename to common/src/main/resources/data/winterly/tags/blocks/gift_boxes.json diff --git a/src/main/resources/data/winterly/tags/items/candy_canes.json b/common/src/main/resources/data/winterly/tags/items/candy_canes.json similarity index 100% rename from src/main/resources/data/winterly/tags/items/candy_canes.json rename to common/src/main/resources/data/winterly/tags/items/candy_canes.json diff --git a/src/main/resources/data/winterly/tags/items/scarfs.json b/common/src/main/resources/data/winterly/tags/items/scarfs.json similarity index 100% rename from src/main/resources/data/winterly/tags/items/scarfs.json rename to common/src/main/resources/data/winterly/tags/items/scarfs.json diff --git a/src/main/resources/data/winterly/worldgen/configured_feature/cryomarble.json b/common/src/main/resources/data/winterly/worldgen/configured_feature/cryomarble.json similarity index 100% rename from src/main/resources/data/winterly/worldgen/configured_feature/cryomarble.json rename to common/src/main/resources/data/winterly/worldgen/configured_feature/cryomarble.json diff --git a/src/main/resources/data/winterly/worldgen/configured_feature/underground_icicle.json b/common/src/main/resources/data/winterly/worldgen/configured_feature/underground_icicle.json similarity index 100% rename from src/main/resources/data/winterly/worldgen/configured_feature/underground_icicle.json rename to common/src/main/resources/data/winterly/worldgen/configured_feature/underground_icicle.json diff --git a/src/main/resources/data/winterly/worldgen/placed_feature/cryomarble.json b/common/src/main/resources/data/winterly/worldgen/placed_feature/cryomarble.json similarity index 100% rename from src/main/resources/data/winterly/worldgen/placed_feature/cryomarble.json rename to common/src/main/resources/data/winterly/worldgen/placed_feature/cryomarble.json diff --git a/src/main/resources/data/winterly/worldgen/placed_feature/underground_icicle.json b/common/src/main/resources/data/winterly/worldgen/placed_feature/underground_icicle.json similarity index 100% rename from src/main/resources/data/winterly/worldgen/placed_feature/underground_icicle.json rename to common/src/main/resources/data/winterly/worldgen/placed_feature/underground_icicle.json diff --git a/src/main/resources/winterly.mixins.json b/common/src/main/resources/winterly-common.mixins.json similarity index 94% rename from src/main/resources/winterly.mixins.json rename to common/src/main/resources/winterly-common.mixins.json index 47dadab..5f03295 100644 --- a/src/main/resources/winterly.mixins.json +++ b/common/src/main/resources/winterly-common.mixins.json @@ -15,7 +15,6 @@ "common.ZombieExtension" ], "client": [ - "client.ArmorRendererMixin" ], "injectors": { "defaultRequire": 1 diff --git a/common/src/main/resources/winterly.accesswidener b/common/src/main/resources/winterly.accesswidener new file mode 100644 index 0000000..babb8fe --- /dev/null +++ b/common/src/main/resources/winterly.accesswidener @@ -0,0 +1,2 @@ +accessWidener v1 named +accessible method net/minecraft/world/level/biome/Biome getTemperature (Lnet/minecraft/core/BlockPos;)F diff --git a/fabric/build.gradle b/fabric/build.gradle new file mode 100644 index 0000000..8a3b154 --- /dev/null +++ b/fabric/build.gradle @@ -0,0 +1,90 @@ +plugins { + id "com.github.johnrengelman.shadow" version "7.1.2" +} + +architectury { + platformSetupLoomIde() + fabric() +} + +base { + archivesName = "${rootProject.archives_base_name}-fabric" +} + +loom { + accessWidenerPath = project(":common").loom.accessWidenerPath +} + +configurations { + common + shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files. + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentFabric.extendsFrom common +} + +repositories { + maven { + url "https://api.modrinth.com/maven" + content { includeGroup "maven.modrinth" } + } + maven { url "https://maven.ladysnake.org/releases" } //CCA + maven { url "https://maven.terraformersmc.com" } //trinkets + maven { url "https://maven.wispforest.io" } //owo-lib + maven { url "https://maven.shedaniel.me/" } //cloth-config +} + +dependencies { + modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" + modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" + // Remove the next line if you don't want to depend on the API + //modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}" + + modImplementation "dev.emi:trinkets:${project.trinkets_version}" + modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}" + modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}" + modImplementation include("dev.onyxstudios.cardinal-components-api:cardinal-components-world:${project.cca_version}") + modApi "io.wispforest:owo-lib:${project.owo_lib}" + modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}") { exclude(group: "net.fabricmc.fabric-api") } + modApi "com.terraformersmc:modmenu:${project.modmenu_version}" + + modLocalRuntime "maven.modrinth:here-be-no-dragons:1.0.0" + modLocalRuntime "dev.emi:emi-fabric:1.0.29+1.20.4" + + common(project(path: ":common", configuration: "namedElements")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } +} + +processResources { + inputs.property "version", project.version + + filesMatching("fabric.mod.json") { + expand "version": project.version + } +} + +shadowJar { + exclude "architectury.common.json" + + configurations = [project.configurations.shadowCommon] + archiveClassifier = "dev-shadow" +} + +remapJar { + injectAccessWidener = true + input.set shadowJar.archiveFile + dependsOn shadowJar +} + +sourcesJar { + def commonSources = project(":common").sourcesJar + dependsOn commonSources + from commonSources.archiveFile.map { zipTree(it) } +} + +components.java { + withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { + skip() + } +} + diff --git a/fabric/src/main/java/winterly/fabric/WinterlyFabric.java b/fabric/src/main/java/winterly/fabric/WinterlyFabric.java new file mode 100644 index 0000000..543514a --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/WinterlyFabric.java @@ -0,0 +1,56 @@ +package winterly.fabric; + +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.CreativeModeTab; +import winterly.Winterly; +import winterly.config.WinterlyClothConfig; +import winterly.fabric.compat.WinterlyOwoLibIntegration; +import winterly.fabric.registry.WinterlyBlockEntities; +import winterly.fabric.registry.WinterlyBlocks; +import winterly.registry.CommonWinterlyBlocks; +import winterly.fabric.registry.WinterlyFeatures; +import winterly.fabric.registry.WinterlyItems; +import winterly.registry.CommonWinterlyItems; + +public class WinterlyFabric implements ModInitializer { + public static CreativeModeTab itemGroup; + + @Override + public void onInitialize() { + itemGroup = createItemGroup(); + WinterlyItems.init(); + + WinterlyBlocks.init(); + WinterlyBlockEntities.init(); + WinterlyFeatures.init(); + + if(FabricLoader.getInstance().isModLoaded("owo")) { + WinterlyOwoLibIntegration.initItemGroup(); + ItemGroupEvents.modifyEntriesEvent(BuiltInRegistries.CREATIVE_MODE_TAB.getResourceKey(itemGroup).get()).register(entries -> { + CommonWinterlyItems.ITEMS.forEach((id, item) -> entries.accept(item.getDefaultInstance())); + CommonWinterlyBlocks.ITEMS.forEach((id, item) -> entries.accept(item.getDefaultInstance())); + }); + } + } + + private static CreativeModeTab createItemGroup() { + if(FabricLoader.getInstance().isModLoaded("owo")) { + return WinterlyOwoLibIntegration.createItemGroup(); + } + var group = FabricItemGroup.builder().title(Component.translatable("itemGroup.winterly.items")) + .icon(() -> CommonWinterlyBlocks.SNOWGUY.asItem().getDefaultInstance()) + .displayItems((displayContext, entries) -> { + CommonWinterlyItems.ITEMS.forEach((id, item) -> entries.accept(item.getDefaultInstance())); + CommonWinterlyBlocks.ITEMS.forEach((id, item) -> entries.accept(item.getDefaultInstance())); + }).build(); + Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, Winterly.id("items"), group); + return group; + } + +} diff --git a/fabric/src/main/java/winterly/fabric/block/FrozenFlowerBlock.java b/fabric/src/main/java/winterly/fabric/block/FrozenFlowerBlock.java new file mode 100644 index 0000000..26d45a1 --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/block/FrozenFlowerBlock.java @@ -0,0 +1,40 @@ +package winterly.fabric.block; + +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.block.state.BlockState; +import winterly.block.CommonFrozenFlowerBlock; +import winterly.data.CachedFlowers; + +import java.util.Objects; + +public class FrozenFlowerBlock extends CommonFrozenFlowerBlock { + + public FrozenFlowerBlock(Properties settings) { + super(settings); + } + + @SuppressWarnings("deprecation") + @Override + public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + if (world.getBrightness(LightLayer.BLOCK, pos) > 11) { + dropResources(state, world, pos); + if(state.getValue(LAYERS) != 0) { + var cachedFlower = CachedFlowers.getFlower(world, pos); + world.setBlockAndUpdate(pos, Objects.requireNonNullElse(cachedFlower, this).defaultBlockState()); + } + } + else if(FabricLoader.getInstance().isModLoaded("seasons")) { + if(!state.getValue(PERSISTENT) && world.getBrightness(LightLayer.SKY, pos) > 0 && world.getBiome(pos).value().getTemperature(pos) >= 0.15F) { + dropResources(state, world, pos); + if(state.getValue(LAYERS) != 0) { + var cachedFlower = CachedFlowers.getFlower(world, pos); + world.setBlockAndUpdate(pos, Objects.requireNonNullElse(cachedFlower, this).defaultBlockState()); + } + } + } + } +} diff --git a/fabric/src/main/java/winterly/fabric/block/FrozenGrassBlock.java b/fabric/src/main/java/winterly/fabric/block/FrozenGrassBlock.java new file mode 100644 index 0000000..f3f9fbe --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/block/FrozenGrassBlock.java @@ -0,0 +1,32 @@ +package winterly.fabric.block; + +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.core.BlockPos; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.LightLayer; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; +import winterly.block.CommonFrozenGrassBlock; + +public class FrozenGrassBlock extends CommonFrozenGrassBlock { + + public FrozenGrassBlock(Properties settings) { + super(settings); + } + + @SuppressWarnings("deprecation") + @Override + public void randomTick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) { + if (world.getBrightness(LightLayer.BLOCK, pos) > 11) { + dropResources(state, world, pos); + world.setBlockAndUpdate(pos, Blocks.SHORT_GRASS.defaultBlockState()); + } + else if(FabricLoader.getInstance().isModLoaded("seasons")) { + if(!state.getValue(PERSISTENT) && world.getBrightness(LightLayer.SKY, pos) > 0 && world.getBiome(pos).value().getTemperature(pos) >= 0.15F) { + dropResources(state, world, pos); + world.setBlockAndUpdate(pos, Blocks.SHORT_GRASS.defaultBlockState()); + } + } + } +} diff --git a/fabric/src/main/java/winterly/fabric/client/WinterlyFabricClient.java b/fabric/src/main/java/winterly/fabric/client/WinterlyFabricClient.java new file mode 100644 index 0000000..b14e4fb --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/client/WinterlyFabricClient.java @@ -0,0 +1,63 @@ +package winterly.fabric.client; + +import dev.emi.trinkets.api.client.TrinketRenderer; +import dev.emi.trinkets.api.client.TrinketRendererRegistry; +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.fabricmc.fabric.api.client.rendering.v1.LivingEntityFeatureRendererRegistrationCallback; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.entity.DrownedRenderer; +import net.minecraft.client.renderer.entity.SkeletonRenderer; +import net.minecraft.client.renderer.entity.ZombieRenderer; +import winterly.block.*; +import winterly.client.WinterlyModelLayers; +import winterly.client.model.SantaHatModel; +import winterly.client.model.ScarfModel; +import winterly.client.render.DecorationFeatureRenderer; +import winterly.client.render.MobDecorationRenderers; +import winterly.registry.CommonWinterlyBlocks; +import winterly.registry.CommonWinterlyItems; + +import static net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry.registerModelLayer; + +public class WinterlyFabricClient implements ClientModInitializer { + + @Override + public void onInitializeClient() { + registerModelLayer(WinterlyModelLayers.SANTA_HAT_LAYER, SantaHatModel::getTexturedModelData); + registerModelLayer(WinterlyModelLayers.SCARF_LAYER, ScarfModel::getTexturedModelData); + + MobDecorationRenderers.init(); + + BlockRenderLayerMap map = BlockRenderLayerMap.INSTANCE; + CommonWinterlyBlocks.BLOCKS.forEach((id, block) -> { + if(block instanceof GiftBoxBlock) map.putBlock(block, RenderType.cutout()); + if(block instanceof GarlandLightsBlock) map.putBlock(block, RenderType.cutout()); + if(block instanceof SnowguyBlock) map.putBlock(block, RenderType.cutout()); + if(block instanceof IcicleBlock) map.putBlock(block, RenderType.cutout()); + if(block instanceof CommonFrozenGrassBlock) map.putBlock(block, RenderType.cutout()); + if(block instanceof CommonFrozenFlowerBlock) map.putBlock(block, RenderType.cutout()); + }); + map.putBlock(CommonWinterlyBlocks.ICICLE_BLOCK, RenderType.translucent()); + map.putBlock(CommonWinterlyBlocks.ICICLE_PANE, RenderType.translucent()); + map.putBlock(CommonWinterlyBlocks.ICICLE_BARS, RenderType.cutout()); + + CommonWinterlyItems.ITEMS.forEach((id, item) -> { + if(item instanceof TrinketRenderer renderer) TrinketRendererRegistry.registerRenderer(item, renderer); + }); + + LivingEntityFeatureRendererRegistrationCallback.EVENT.register((entityType, entityRenderer, registrationHelper, context) -> { + if(entityRenderer instanceof ZombieRenderer renderer) { + registrationHelper.register(new DecorationFeatureRenderer<>(renderer)); + } + if(entityRenderer instanceof DrownedRenderer renderer) { + registrationHelper.register(new DecorationFeatureRenderer<>(renderer)); + } + if(entityRenderer instanceof SkeletonRenderer renderer) { + registrationHelper.register(new DecorationFeatureRenderer<>(renderer)); + } + }); + + } + +} diff --git a/src/main/java/winterly/compat/WinterlyModMenuIntegration.java b/fabric/src/main/java/winterly/fabric/compat/WinterlyModMenuIntegration.java similarity index 93% rename from src/main/java/winterly/compat/WinterlyModMenuIntegration.java rename to fabric/src/main/java/winterly/fabric/compat/WinterlyModMenuIntegration.java index 92c4ca0..5db00ea 100644 --- a/src/main/java/winterly/compat/WinterlyModMenuIntegration.java +++ b/fabric/src/main/java/winterly/fabric/compat/WinterlyModMenuIntegration.java @@ -1,4 +1,4 @@ -package winterly.compat; +package winterly.fabric.compat; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; diff --git a/src/main/java/winterly/compat/WinterlyOwoLibIntegration.java b/fabric/src/main/java/winterly/fabric/compat/WinterlyOwoLibIntegration.java similarity index 60% rename from src/main/java/winterly/compat/WinterlyOwoLibIntegration.java rename to fabric/src/main/java/winterly/fabric/compat/WinterlyOwoLibIntegration.java index fd61611..6adc56d 100644 --- a/src/main/java/winterly/compat/WinterlyOwoLibIntegration.java +++ b/fabric/src/main/java/winterly/fabric/compat/WinterlyOwoLibIntegration.java @@ -1,19 +1,19 @@ -package winterly.compat; +package winterly.fabric.compat; import io.wispforest.owo.itemgroup.Icon; import io.wispforest.owo.itemgroup.OwoItemGroup; import io.wispforest.owo.itemgroup.gui.ItemGroupButton; -import net.minecraft.item.ItemGroup; -import net.minecraft.util.Identifier; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.CreativeModeTab; import winterly.Winterly; -import winterly.registry.WinterlyBlocks; -import winterly.util.UpdateChecker; +import winterly.fabric.WinterlyFabric; +import winterly.registry.CommonWinterlyBlocks; public class WinterlyOwoLibIntegration { - public static final Identifier ICONS_TEXTURE = Winterly.id("textures/gui/icons.png"); + public static final ResourceLocation ICONS_TEXTURE = Winterly.id("textures/gui/icons.png"); - public static ItemGroup createItemGroup() { - return OwoItemGroup.builder(Winterly.id("items"), () -> Icon.of(WinterlyBlocks.SNOWGUY)) + public static CreativeModeTab createItemGroup() { + return OwoItemGroup.builder(Winterly.id("items"), () -> Icon.of(CommonWinterlyBlocks.SNOWGUY)) .initializer(group -> { group.addButton(ItemGroupButton.link(group, Icon.of(ICONS_TEXTURE, 0, 0, 64, 64), "discord", "https://discord.gg/DcemWeskeZ")); // if(UpdateChecker.check()) { @@ -23,7 +23,7 @@ public static ItemGroup createItemGroup() { } public static void initItemGroup() { - if(Winterly.itemGroup instanceof OwoItemGroup owoItemGroup) { + if(WinterlyFabric.itemGroup instanceof OwoItemGroup owoItemGroup) { owoItemGroup.initialize(); } } diff --git a/src/main/java/winterly/data/WinterlyComponents.java b/fabric/src/main/java/winterly/fabric/data/WinterlyComponents.java similarity index 95% rename from src/main/java/winterly/data/WinterlyComponents.java rename to fabric/src/main/java/winterly/fabric/data/WinterlyComponents.java index 6857afb..56897da 100644 --- a/src/main/java/winterly/data/WinterlyComponents.java +++ b/fabric/src/main/java/winterly/fabric/data/WinterlyComponents.java @@ -1,4 +1,4 @@ -package winterly.data; +package winterly.fabric.data; import dev.onyxstudios.cca.api.v3.component.ComponentKey; import dev.onyxstudios.cca.api.v3.component.ComponentRegistryV3; diff --git a/fabric/src/main/java/winterly/fabric/data/WorldData.java b/fabric/src/main/java/winterly/fabric/data/WorldData.java new file mode 100644 index 0000000..1057e77 --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/data/WorldData.java @@ -0,0 +1,58 @@ +package winterly.fabric.data; + +import dev.onyxstudios.cca.api.v3.component.ComponentV3; +import java.util.LinkedHashMap; +import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.Level; +import winterly.data.CachedFlowers; + +public class WorldData implements ComponentV3 { + + public Level world; + + public WorldData(Level world) { + this.world = world; + } + + @Override + public void readFromNbt(CompoundTag tag) { + CachedFlowers.instance.data = new LinkedHashMap<>(); + var cachedFlowerNbt = tag.getCompound("cachedFlower"); + + if(!cachedFlowerNbt.isEmpty()) { + int size = cachedFlowerNbt.getInt("size"); + + for(int i = 0; i < size; i++) { + CompoundTag entry = cachedFlowerNbt.getCompound(String.valueOf(i)); + BlockPos pos = new BlockPos(entry.getInt("x"), entry.getInt("y"), entry.getInt("z")); + var block = BuiltInRegistries.BLOCK.getOptional(new ResourceLocation(entry.getString("block"))); + block.ifPresent(bl -> CachedFlowers.cacheFlower(world, pos, bl)); + } + } + } + + @Override + public void writeToNbt(CompoundTag tag) { + CompoundTag cachedFlowerNbt = new CompoundTag(); + var map = CachedFlowers.instance.data.get(world.dimension()); + if(map != null) { + cachedFlowerNbt.putInt("size", map.size()); + int index = -1; + + for(var entry : map.entrySet()) { + index++; + CompoundTag entryNbt = new CompoundTag(); + entryNbt.putInt("x", entry.getKey().getX()); + entryNbt.putInt("y", entry.getKey().getY()); + entryNbt.putInt("z", entry.getKey().getZ()); + entryNbt.putString("block", BuiltInRegistries.BLOCK.getKey(entry.getValue()).toString()); + cachedFlowerNbt.put(String.valueOf(index), entryNbt); + } + tag.put("cachedFlower", cachedFlowerNbt); + } + + } +} diff --git a/fabric/src/main/java/winterly/fabric/item/SantaHatItem.java b/fabric/src/main/java/winterly/fabric/item/SantaHatItem.java new file mode 100644 index 0000000..dd49cd2 --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/item/SantaHatItem.java @@ -0,0 +1,39 @@ +package winterly.fabric.item; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import dev.emi.trinkets.api.SlotReference; +import dev.emi.trinkets.api.Trinket; +import dev.emi.trinkets.api.TrinketsApi; +import dev.emi.trinkets.api.client.TrinketRenderer; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.model.EntityModel; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import winterly.Winterly; +import winterly.client.model.WinterlyModels; +import winterly.item.CommonSantaHatItem; + +public class SantaHatItem extends CommonSantaHatItem implements Trinket, TrinketRenderer { + + public SantaHatItem(Item.Properties settings, String color) { + super(settings, color); + TrinketsApi.registerTrinket(this, this); + } + + @Environment(EnvType.CLIENT) + @Override + public void render(ItemStack stack, SlotReference slotReference, EntityModel contextModel, PoseStack matrices, MultiBufferSource vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { + if(contextModel instanceof HumanoidModel biped) { + WinterlyModels.SANTA_HAT_MODEL.hat.copyFrom(biped.head); + VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + color + "_santa_hat.png"))); + WinterlyModels.SANTA_HAT_MODEL.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/fabric/src/main/java/winterly/fabric/item/ScarfItem.java b/fabric/src/main/java/winterly/fabric/item/ScarfItem.java new file mode 100644 index 0000000..f1682c1 --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/item/ScarfItem.java @@ -0,0 +1,39 @@ +package winterly.fabric.item; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import dev.emi.trinkets.api.SlotReference; +import dev.emi.trinkets.api.Trinket; +import dev.emi.trinkets.api.TrinketsApi; +import dev.emi.trinkets.api.client.TrinketRenderer; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.model.EntityModel; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import winterly.Winterly; +import winterly.client.model.WinterlyModels; +import winterly.item.CommonScarfItem; + +public class ScarfItem extends CommonScarfItem implements Trinket, TrinketRenderer { + + public ScarfItem(Item.Properties settings, String color) { + super(settings, color); + TrinketsApi.registerTrinket(this, this); + } + + @Environment(EnvType.CLIENT) + @Override + public void render(ItemStack stack, SlotReference slotReference, EntityModel contextModel, PoseStack matrices, MultiBufferSource vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { + if(contextModel instanceof HumanoidModel biped){ + WinterlyModels.SCARF_MODEL.scarf.copyFrom(biped.body); + VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + color + "_scarf.png"))); + WinterlyModels.SCARF_MODEL.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/fabric/src/main/java/winterly/fabric/mixin/client/ArmorRendererMixin.java b/fabric/src/main/java/winterly/fabric/mixin/client/ArmorRendererMixin.java new file mode 100644 index 0000000..e03210f --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/mixin/client/ArmorRendererMixin.java @@ -0,0 +1,49 @@ +package winterly.fabric.mixin.client; + +import com.mojang.blaze3d.vertex.PoseStack; +import dev.emi.trinkets.api.SlotReference; +import dev.emi.trinkets.api.TrinketComponent; +import dev.emi.trinkets.api.TrinketsApi; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import winterly.fabric.item.SantaHatItem; +import java.util.Optional; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.RenderLayerParent; +import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer; +import net.minecraft.client.renderer.entity.layers.RenderLayer; +import net.minecraft.util.Tuple; +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; + +@Mixin(HumanoidArmorLayer.class) +public abstract class ArmorRendererMixin , A extends HumanoidModel> extends RenderLayer { + + public ArmorRendererMixin(RenderLayerParent context) { + super(context); + } + + @Inject(method = "renderArmorPiece", at = @At("HEAD"), cancellable = true) + void render(PoseStack matrices, MultiBufferSource vertexConsumers, T entity, EquipmentSlot armorSlot, int light, A model, CallbackInfo ci) { + if(entity instanceof Player player) { + if(armorSlot.equals(EquipmentSlot.HEAD)) { + if(winterly$hasHatOn(player)) ci.cancel(); + } + } + } + + boolean winterly$hasHatOn(Player player) { + Optional component = TrinketsApi.getTrinketComponent(player); + if(component.isPresent()) { + for(Tuple pair : component.get().getAllEquipped()) { + if(pair.getB().getItem() instanceof SantaHatItem) return true; + } + } + return false; + } +} diff --git a/src/main/java/winterly/registry/WinterlyBlockEntities.java b/fabric/src/main/java/winterly/fabric/registry/WinterlyBlockEntities.java similarity index 51% rename from src/main/java/winterly/registry/WinterlyBlockEntities.java rename to fabric/src/main/java/winterly/fabric/registry/WinterlyBlockEntities.java index 6efb106..3efe4fe 100644 --- a/src/main/java/winterly/registry/WinterlyBlockEntities.java +++ b/fabric/src/main/java/winterly/fabric/registry/WinterlyBlockEntities.java @@ -1,31 +1,30 @@ -package winterly.registry; +package winterly.fabric.registry; import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; -import net.minecraft.block.entity.BlockEntityType; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; import winterly.Winterly; import winterly.block.GiftBoxBlock; import winterly.block.entity.GiftBoxBlockEntity; +import winterly.registry.CommonWinterlyBlocks; +import static winterly.registry.CommonWinterlyBlockEntities.*; import java.util.ArrayList; public class WinterlyBlockEntities { - public static final BlockEntityType GIFT_BOX_BLOCK_ENTITY = Registry.register( - Registries.BLOCK_ENTITY_TYPE, - Winterly.id("gift_box"), - FabricBlockEntityTypeBuilder.create(GiftBoxBlockEntity::new, getGiftBoxes()).build() - ); - public static void init() { - + GIFT_BOX_BLOCK_ENTITY = Registry.register( + BuiltInRegistries.BLOCK_ENTITY_TYPE, + Winterly.id("gift_box"), + FabricBlockEntityTypeBuilder.create(GiftBoxBlockEntity::new, getGiftBoxes()).build() + ); } public static GiftBoxBlock[] getGiftBoxes() { ArrayList gifts = new ArrayList<>(); - WinterlyBlocks.BLOCKS.forEach((identifier, block) -> { + CommonWinterlyBlocks.BLOCKS.forEach((identifier, block) -> { if(block instanceof GiftBoxBlock box) { gifts.add(box); } diff --git a/fabric/src/main/java/winterly/fabric/registry/WinterlyBlocks.java b/fabric/src/main/java/winterly/fabric/registry/WinterlyBlocks.java new file mode 100644 index 0000000..bc18ea3 --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/registry/WinterlyBlocks.java @@ -0,0 +1,81 @@ +package winterly.fabric.registry; + +import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.material.MapColor; +import net.minecraft.world.level.material.PushReaction; +import winterly.Winterly; +import winterly.block.*; +import winterly.block.base.BasePaneBlock; +import winterly.block.base.BaseStairsBlock; +import winterly.fabric.block.FrozenFlowerBlock; +import winterly.fabric.block.FrozenGrassBlock; + +import static net.minecraft.world.level.block.Blocks.*; +import static winterly.registry.CommonWinterlyBlocks.*; +public class WinterlyBlocks { + + public static void init() { + ICICLE = add("icicle", new IcicleBlock(copyOf(ICE).pushReaction(PushReaction.DESTROY))); + ICICLE_BLOCK = add("icicle_block", new TransparentBlock(copyOf(PACKED_ICE).nonOpaque())); + PACKED_ICICLE_BLOCK = add("packed_icicle_block", new TransparentBlock(copyOf(PACKED_ICE).nonOpaque())); + ICICLE_PANE = add("icicle_pane", new BasePaneBlock(copyOf(PACKED_ICE).nonOpaque())); + ICICLE_BARS = add("icicle_bars", new BasePaneBlock(copyOf(ICE).nonOpaque())); + CRYOMARBLE_BLOCK = add("cryomarble_block", new Block(copyOf(DIAMOND_BLOCK))); + SNOWGUY = add("snowguy", new SnowguyBlock(copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + SNOWBALL_WALL = add("snowball_wall", new SnowballWallBlock(copyOf(WHITE_WOOL).sounds(SoundType.SNOW).nonOpaque())); + DENSE_SNOW = add("dense_snow", new Block(copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + DENSE_SNOW_STAIRS = add("dense_snow_stairs", new BaseStairsBlock(SNOW_BLOCK.defaultBlockState(), copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + DENSE_SNOW_SLAB = add("dense_snow_slab", new SlabBlock(copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + + SNOW_BRICKS = add("snow_bricks", new Block(copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + SNOW_BRICK_STAIRS = add("snow_brick_stairs", new BaseStairsBlock(SNOW_BLOCK.defaultBlockState(), copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + SNOW_BRICK_SLAB = add("snow_brick_slab", new SlabBlock(copyOf(WHITE_WOOL).sounds(SoundType.SNOW))); + FROZEN_GRASS = add("frozen_grass", new FrozenGrassBlock(FabricBlockSettings.create().mapColor(MapColor.SNOW).replaceable().notSolid().ticksRandomly().strength(0.1F).requiresTool().sounds(SoundType.SNOW).blockVision((state, world, pos) -> state.getValue(CommonFrozenGrassBlock.LAYERS) >= 8).pushReaction(PushReaction.DESTROY))); + FROZEN_FLOWER = add("frozen_flower", new FrozenFlowerBlock(FabricBlockSettings.create().mapColor(MapColor.SNOW).replaceable().notSolid().ticksRandomly().strength(0.1F).requiresTool().sounds(SoundType.GRASS).blockVision((state, world, pos) -> state.getValue(CommonFrozenFlowerBlock.LAYERS) >= 8).pushReaction(PushReaction.DESTROY))); + + RAW_CRYOMARBLE_SHARD = add("raw_cryomarble_shard", new IcicleBlock(copyOf(WHITE_WOOL).sounds(SoundType.GLASS).luminance(state -> 12))); + + RED_GIFT_BOX = add("red_gift_box", new GiftBoxBlock(copyOf(RED_WOOL).pistonBehavior(PushReaction.DESTROY))); + ORANGE_GIFT_BOX = add("orange_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + YELLOW_GIFT_BOX = add("yellow_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + GREEN_GIFT_BOX = add("green_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + CYAN_GIFT_BOX = add("cyan_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + BLUE_GIFT_BOX = add("blue_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + PURPLE_GIFT_BOX = add("purple_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + BLACK_GIFT_BOX = add("black_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + WHITE_GIFT_BOX = add("white_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + + GARLAND_LIGHTS = add("garland_lights", new GarlandLightsBlock(copyOf(GREEN_WOOL).pistonBehavior(PushReaction.DESTROY).noCollision().sounds(SoundType.CANDLE))); + RAINY_GARLAND_LIGHTS = add("rainy_garland_lights", new GarlandLightsBlock(copyOf(WHITE_WOOL).pistonBehavior(PushReaction.DESTROY).noCollision().sounds(SoundType.CANDLE))); + + ITEMS.forEach((id, item) -> Registry.register(BuiltInRegistries.ITEM, id, item)); + BLOCKS.forEach((id, block) -> Registry.register(BuiltInRegistries.BLOCK, id, block)); + } + + public static T add(String name, T block) { + return addBlockItem(name, block, new BlockItem(block, new Item.Properties())); + } + + private static T addBlockItem(String name, T block, BlockItem item) { + addBlock(name, block); + if (item != null) { + item.registerBlocks(Item.BY_BLOCK, item); + ITEMS.put(Winterly.id(name), item); + } + return block; + } + + private static T addBlock(String name, T block) { + BLOCKS.put(Winterly.id(name), block); + return block; + } + + public static FabricBlockSettings copyOf(Block block) { + return FabricBlockSettings.copyOf(block); + } +} diff --git a/fabric/src/main/java/winterly/fabric/registry/WinterlyFeatures.java b/fabric/src/main/java/winterly/fabric/registry/WinterlyFeatures.java new file mode 100644 index 0000000..d76965e --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/registry/WinterlyFeatures.java @@ -0,0 +1,52 @@ +package winterly.fabric.registry; + +import net.fabricmc.fabric.api.biome.v1.BiomeModifications; +import net.fabricmc.fabric.api.biome.v1.ModificationPhase; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.core.registries.Registries; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.BiomeTags; +import net.minecraft.tags.TagKey; +import net.minecraft.world.level.levelgen.GenerationStep; +import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; +import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; +import net.minecraft.world.level.levelgen.placement.PlacedFeature; +import winterly.Winterly; +import winterly.worldgen.CryomarbleFeature; +import winterly.worldgen.UndergroundIcicleFeature; + +import static winterly.Winterly.id; + +public class WinterlyFeatures { + public static final Feature UNDERGROUND_ICICLE_FEATURE = new UndergroundIcicleFeature(); + public static final ResourceKey> UNDERGROUND_ICICLE_CONFIG = ResourceKey.create(Registries.CONFIGURED_FEATURE, Winterly.id("underground_icicle")); + public static final ResourceKey UNDERGROUND_ICICLE_PLACED = ResourceKey.create(Registries.PLACED_FEATURE, Winterly.id("underground_icicle")); + + + public static final Feature CRYOMARBLE_FEATURE = new CryomarbleFeature(); + public static final ResourceKey> CRYOMARBLE_CONFIG = ResourceKey.create(Registries.CONFIGURED_FEATURE, Winterly.id("cryomarble")); + public static final ResourceKey CRYOMARBLE_PLACED = ResourceKey.create(Registries.PLACED_FEATURE, Winterly.id("cryomarble")); + + public static void init() { + Registry.register(BuiltInRegistries.FEATURE, id("underground_icicle"), UNDERGROUND_ICICLE_FEATURE); + Registry.register(BuiltInRegistries.FEATURE, id("cryomarble"), CRYOMARBLE_FEATURE); + + BiomeModifications.create(Winterly.id("features")) + .add(ModificationPhase.ADDITIONS, ctx -> { + var entry = ctx.getBiomeRegistryEntry(); + var coldTag = TagKey.create(Registries.BIOME, new ResourceLocation("c", "climate_cold")); + return !entry.is(BiomeTags.IS_NETHER) && !entry.is(BiomeTags.IS_END) && entry.is(coldTag); + }, ctx -> { + ctx.getGenerationSettings().addFeature(GenerationStep.Decoration.UNDERGROUND_DECORATION, UNDERGROUND_ICICLE_PLACED); + }) + .add(ModificationPhase.ADDITIONS, ctx -> { + var entry = ctx.getBiomeRegistryEntry(); + return !entry.is(BiomeTags.IS_NETHER) && !entry.is(BiomeTags.IS_END); + }, ctx -> { + ctx.getGenerationSettings().addFeature(GenerationStep.Decoration.UNDERGROUND_DECORATION, CRYOMARBLE_PLACED); + }); + } +} diff --git a/fabric/src/main/java/winterly/fabric/registry/WinterlyItems.java b/fabric/src/main/java/winterly/fabric/registry/WinterlyItems.java new file mode 100644 index 0000000..ab97b59 --- /dev/null +++ b/fabric/src/main/java/winterly/fabric/registry/WinterlyItems.java @@ -0,0 +1,53 @@ +package winterly.fabric.registry; + +import net.fabricmc.fabric.api.item.v1.FabricItemSettings; +import net.minecraft.core.Registry; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.food.FoodProperties; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Tiers; +import winterly.Winterly; +import winterly.fabric.item.SantaHatItem; +import winterly.fabric.item.ScarfItem; +import winterly.item.tool.*; + +import static winterly.registry.CommonWinterlyItems.*; + +@SuppressWarnings("unused") +public class WinterlyItems { + + public static void init() { + RED_CANDY_CANE = add("red_candy_cane", new Item(settings().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F).fast().build()))); + GREEN_CANDY_CANE = add("green_candy_cane", new Item(settings().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F).fast().build()))); + BLUE_CANDY_CANE = add("blue_candy_cane", new Item(settings().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F).fast().build()))); + + CRYOMARBLE_SHARD = add("cryomarble_shard", new Item(settings())); + CRYOMARBLE = add("cryomarble", new Item(settings())); + + CRYOMARBLE_SWORD = add("cryomarble_sword", new CryomarbleSwordItem(Tiers.DIAMOND, 3, -2.4F, settings())); + CRYOMARBLE_SHOVEL = add("cryomarble_shovel", new CryomarbleShovelItem(Tiers.DIAMOND, 1.5F, -3.0F, settings())); + CRYOMARBLE_PICKAXE = add("cryomarble_pickaxe", new CryomarblePickaxeItem(Tiers.DIAMOND, 1, -2.8F, settings())); + CRYOMARBLE_AXE = add("cryomarble_axe", new CryomarbleAxeItem(Tiers.DIAMOND, 5.0F, -3.0F, settings())); + CRYOMARBLE_HOE = add("cryomarble_hoe", new CryomarbleHoeItem(Tiers.DIAMOND, -3, 0.0F, settings())); + + RED_SANTA_HAT = add("red_santa_hat", new SantaHatItem(settings(), "red")); + BLUE_SANTA_HAT = add("blue_santa_hat", new SantaHatItem(settings(), "blue")); + + WHITE_SCARF = add("white_scarf", new ScarfItem(settings(), "white")); + RED_SCARF = add("red_scarf", new ScarfItem(settings(), "red")); + GREEN_SCARF = add("green_scarf", new ScarfItem(settings(), "green")); + BLUE_SCARF = add("blue_scarf", new ScarfItem(settings(), "blue")); + RAINBOW_SCARF = add("rainbow_scarf", new ScarfItem(settings(), "rainbow")); + + ITEMS.forEach((id, item) -> Registry.register(BuiltInRegistries.ITEM, id, item)); + } + + private static T add(String name, T item) { + ITEMS.put(Winterly.id(name), item); + return item; + } + + private static FabricItemSettings settings() { + return new FabricItemSettings(); + } +} diff --git a/src/main/resources/data/trinkets/entities/winterly.json b/fabric/src/main/resources/data/trinkets/entities/winterly.json similarity index 100% rename from src/main/resources/data/trinkets/entities/winterly.json rename to fabric/src/main/resources/data/trinkets/entities/winterly.json diff --git a/src/main/resources/data/trinkets/tags/items/chest/necklace.json b/fabric/src/main/resources/data/trinkets/tags/items/chest/necklace.json similarity index 100% rename from src/main/resources/data/trinkets/tags/items/chest/necklace.json rename to fabric/src/main/resources/data/trinkets/tags/items/chest/necklace.json diff --git a/src/main/resources/data/trinkets/tags/items/head/hat.json b/fabric/src/main/resources/data/trinkets/tags/items/head/hat.json similarity index 100% rename from src/main/resources/data/trinkets/tags/items/head/hat.json rename to fabric/src/main/resources/data/trinkets/tags/items/head/hat.json diff --git a/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json similarity index 58% rename from src/main/resources/fabric.mod.json rename to fabric/src/main/resources/fabric.mod.json index ce21f15..10afb19 100644 --- a/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -1,39 +1,39 @@ { "schemaVersion": 1, - "id": "winterly", + "id": "${id}", "version": "${version}", - "name": "Winterly", - "description": "Winter expansion mod adding cold and sloppy stuff.", + "name": "${name}", + "description": "${description}", "authors": [ "PinkGoosik", "VioletSomik" ], "contact": { - "homepage": "https://modrinth.com/mod/winterly", - "sources": "https://github.com/tyap-lyap/winterly", - "issues": "https://github.com/tyap-lyap/winterly/issues" + "homepage": "${homepage_url}", + "sources": "${sources_url}", + "issues": "${issue_tracker_url}" }, - "license": "MIT", + "license": "${license}", "icon": "assets/winterly/icon.png", "environment": "*", "entrypoints": { "main": [ - "winterly.Winterly" + "winterly.fabric.WinterlyFabric" ], "client": [ - "winterly.client.WinterlyClient" + "winterly.fabric.client.WinterlyFabricClient" ], "cardinal-components": [ - "winterly.data.WinterlyComponents" + "winterly.fabric.data.WinterlyComponents" ], "modmenu": [ - "winterly.compat.WinterlyModMenuIntegration" + "winterly.fabric.compat.WinterlyModMenuIntegration" ] }, "mixins": [ - "winterly.mixins.json" + "${id}-common.mixins.json", + "${id}.mixins.json" ], - "accessWidener": "winterly.accesswidener", "custom": { "modmenu": { "links": { @@ -51,7 +51,7 @@ "fabric-api": "*", "cloth-config": "*", "trinkets": "*", - "minecraft": ">=1.20.3 <1.21", + "minecraft": "${minecraft_version_range_fabric}", "java": ">=17" } } diff --git a/fabric/src/main/resources/winterly.mixins.json b/fabric/src/main/resources/winterly.mixins.json new file mode 100644 index 0000000..0ee5726 --- /dev/null +++ b/fabric/src/main/resources/winterly.mixins.json @@ -0,0 +1,14 @@ +{ + "required": true, + "package": "winterly.fabric.mixin", + "compatibilityLevel": "JAVA_17", + "minVersion": "0.8", + "client": [ + "client.ArmorRendererMixin" + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 1 + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index c9ce60e..9056614 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,20 +1,39 @@ -# Done to increase the memory available to gradle. +# Gradle org.gradle.jvmargs = -Xmx2G org.gradle.parallel = true +org.gradle.daemon = true +org.gradle.debug = false -# Mod Properties -mod_version = 0.9.6+1.20.4 -maven_group = ru.pinkgoosik +# Build archives_base_name = winterly +maven_group = ru.pinkgoosik -# Dependencies | Check these on https://fabricmc.net/develop +# Mod Properties +mod_name = Winterly +mod_version = 0.10.0+1.20.4 +mod_description = Winter expansion mod adding cold and sloppy stuff. +mod_id = winterly +homepage_url = https://github.com/tyap-lyap/winterly +sources_url = https://github.com/tyap-lyap/winterly +issue_tracker_url = https://github.com/tyap-lyap/winterly/issues +license = MIT + +# Minecraft minecraft_version = 1.20.4 -yarn_mappings = 1.20.4+build.3 -fabric_loader = 0.15.3 -fabric_api = 0.92.0+1.20.4 +minecraft_version_range = [1.20.4,1.21) +minecraft_version_range_fabric = >=1.20.3 <1.21 +enabled_platforms = fabric,neoforge +# Fabric +fabric_loader_version = 0.15.3 +fabric_api_version = 0.93.1+1.20.4 trinkets_version = 3.8.0 cca_version = 5.4.0 cloth_config = 13.0.121 modmenu_version = 9.0.0 owo_lib = 0.12.0+1.20.3 + +# NeoForge +neoforge_version = 20.4.69-beta +neoforge_version_range = [20.4,) +curios_version = 7.0.0-beta.3+1.20.4 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 249e583..d64cd49 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6704de8..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists \ No newline at end of file +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index a69d9cb..1aa94a4 100644 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,11 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,22 +131,29 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index f127cfd..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% diff --git a/neoforge/build.gradle b/neoforge/build.gradle new file mode 100644 index 0000000..e56651a --- /dev/null +++ b/neoforge/build.gradle @@ -0,0 +1,82 @@ +plugins { + id "com.github.johnrengelman.shadow" version "7.1.2" +} + +architectury { + platformSetupLoomIde() + neoForge() +} + +base { + archivesName = "${rootProject.archives_base_name}-neoforge" +} + +loom { + accessWidenerPath = project(":common").loom.accessWidenerPath +} + +configurations { + common + shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files. + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentNeoForge.extendsFrom common +} + +repositories { + maven { + name = "Illusive Soulworks maven" + url = "https://maven.theillusivec4.top/" + } + maven { url "https://maven.shedaniel.me/" } +} + +dependencies { + neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}" + + // Remove the next line if you don't want to depend on the API +// modApi "dev.architectury:architectury-neoforge:${rootProject.architectury_version}" + + modCompileOnly("top.theillusivec4.curios:curios-neoforge:${rootProject.curios_version}:api") + // Use the full Curios API jar at runtime + modRuntimeOnly("top.theillusivec4.curios:curios-neoforge:${rootProject.curios_version}") + + modApi("me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_config}") + + common(project(path: ":common", configuration: "namedElements")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false } +} + + +processResources { + inputs.property "version", project.version + + filesMatching("META-INF/mods.toml") { + expand "version": project.version + } +} + +shadowJar { + exclude "fabric.mod.json" + exclude "architectury.common.json" + + configurations = [project.configurations.shadowCommon] + archiveClassifier = "dev-shadow" +} + +remapJar { + input.set shadowJar.archiveFile + dependsOn shadowJar +} + +sourcesJar { + def commonSources = project(":common").sourcesJar + dependsOn commonSources + from commonSources.archiveFile.map { zipTree(it) } +} + +components.java { + withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { + skip() + } +} diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties new file mode 100644 index 0000000..2914393 --- /dev/null +++ b/neoforge/gradle.properties @@ -0,0 +1 @@ +loom.platform=neoforge \ No newline at end of file diff --git a/neoforge/src/main/java/winterly/neoforge/WinterlyNeoforge.java b/neoforge/src/main/java/winterly/neoforge/WinterlyNeoforge.java new file mode 100644 index 0000000..252e0ed --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/WinterlyNeoforge.java @@ -0,0 +1,99 @@ +package winterly.neoforge; + +import net.minecraft.client.renderer.entity.*; +import net.minecraft.core.registries.Registries; +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.CreativeModeTab; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModLoadingContext; +import net.neoforged.fml.common.Mod; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; +import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent; +import net.neoforged.fml.loading.FMLEnvironment; +import net.neoforged.neoforge.client.ConfigScreenHandler; +import net.neoforged.neoforge.client.event.EntityRenderersEvent; +import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; +import net.neoforged.neoforge.registries.DeferredRegister; +import top.theillusivec4.curios.api.client.CuriosRendererRegistry; +import top.theillusivec4.curios.api.client.ICurioRenderer; +import winterly.Winterly; +import winterly.client.WinterlyModelLayers; +import winterly.client.model.SantaHatModel; +import winterly.client.model.ScarfModel; +import winterly.client.render.DecorationFeatureRenderer; +import winterly.client.render.MobDecorationRenderers; +import winterly.config.WinterlyClientConfig; +import winterly.neoforge.data.WinterlyDataAttachments; +import winterly.neoforge.registry.WinterlyBlockEntities; +import winterly.neoforge.registry.WinterlyBlocks; +import winterly.neoforge.registry.WinterlyFeatures; +import winterly.neoforge.registry.WinterlyItems; +import winterly.registry.CommonWinterlyBlocks; +import winterly.registry.CommonWinterlyItems; + +import java.util.function.Supplier; + +@SuppressWarnings("unused") +@Mod(Winterly.MOD_ID) +public class WinterlyNeoforge { + public static final DeferredRegister CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, "winterly"); + + public static Supplier WINTERLY_TAB = CREATIVE_MODE_TABS.register("winterly", () -> CreativeModeTab.builder().icon(CommonWinterlyBlocks.SNOWGUY.asItem()::getDefaultInstance).title(Component.literal("Winterly")).build()); + + public WinterlyNeoforge(IEventBus bus) { + CREATIVE_MODE_TABS.register(bus); + + WinterlyItems.init(bus); + WinterlyBlocks.init(bus); + WinterlyBlockEntities.init(bus); + WinterlyFeatures.init(bus); + WinterlyDataAttachments.init(bus); + + bus.addListener(this::buildCreativeTab); + bus.addListener(this::registerModelLayers); + bus.addListener(this::registerRenderLayers); + bus.addListener(this::clientSetup); + bus.addListener(this::commonSetup); + + if(FMLEnvironment.dist.isClient()) { + ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> WinterlyClientConfig.buildScreen(parent))); + } + } + + private void buildCreativeTab(BuildCreativeModeTabContentsEvent event) { + if (event.getTab() == WINTERLY_TAB.get()) { + CommonWinterlyItems.ITEMS.forEach((id, item) -> event.accept(item)); + CommonWinterlyBlocks.ITEMS.forEach((id, item) -> event.accept(item)); + } + } + + private void registerModelLayers(EntityRenderersEvent.RegisterLayerDefinitions event) { + event.registerLayerDefinition(WinterlyModelLayers.SANTA_HAT_LAYER, SantaHatModel::getTexturedModelData); + event.registerLayerDefinition(WinterlyModelLayers.SCARF_LAYER, ScarfModel::getTexturedModelData); + } + + private void registerRenderLayers(EntityRenderersEvent.AddLayers event) { + event.getContext().getEntityRenderDispatcher().renderers.forEach((entityType, entityRenderer) -> { + if(entityRenderer instanceof ZombieRenderer renderer) { + renderer.addLayer(new DecorationFeatureRenderer<>(renderer)); + } + if(entityRenderer instanceof DrownedRenderer renderer) { + renderer.addLayer(new DecorationFeatureRenderer<>(renderer)); + } + if(entityRenderer instanceof SkeletonRenderer renderer) { + renderer.addLayer(new DecorationFeatureRenderer<>(renderer)); + } + }); + } + + private void clientSetup(FMLClientSetupEvent event) { + CommonWinterlyItems.ITEMS.forEach((resourceLocation, item) -> { + if(item instanceof ICurioRenderer renderer) CuriosRendererRegistry.register(item, () -> renderer); + }); + MobDecorationRenderers.init(); + } + + private void commonSetup(FMLCommonSetupEvent event) { + + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/block/BaseTransparentBlock.java b/neoforge/src/main/java/winterly/neoforge/block/BaseTransparentBlock.java new file mode 100644 index 0000000..40a8431 --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/block/BaseTransparentBlock.java @@ -0,0 +1,10 @@ +package winterly.neoforge.block; + +import net.minecraft.world.level.block.TransparentBlock; + +public class BaseTransparentBlock extends TransparentBlock { + + public BaseTransparentBlock(Properties arg) { + super(arg); + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/data/WinterlyDataAttachments.java b/neoforge/src/main/java/winterly/neoforge/data/WinterlyDataAttachments.java new file mode 100644 index 0000000..5e90d3c --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/data/WinterlyDataAttachments.java @@ -0,0 +1,39 @@ +package winterly.neoforge.data; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.attachment.AttachmentType; +import net.neoforged.neoforge.registries.DeferredRegister; +import net.neoforged.neoforge.registries.NeoForgeRegistries; +import org.jetbrains.annotations.Nullable; +import winterly.Winterly; +import winterly.data.CachedFlowers; + +import java.util.function.Supplier; + +public class WinterlyDataAttachments { + private static final DeferredRegister> ATTACHMENT_TYPES = DeferredRegister.create(NeoForgeRegistries.ATTACHMENT_TYPES, Winterly.MOD_ID); + + private static final Supplier> WORLD_DATA = ATTACHMENT_TYPES.register( + "world_data", () -> AttachmentType.builder(WorldData::new).serialize(new WorldData.WorldDataIAttachmentSerializer()).build() + ); + + public static void init(IEventBus eventBus) { + + CachedFlowers.instance = new CachedFlowers() { + @Override + public @Nullable Block getFlowerImpl(Level world, BlockPos pos) { + return world.getData(WORLD_DATA).cachedFlowers.get(pos); + } + + @Override + public void cacheFlowerImpl(Level world, BlockPos pos, Block flower) { + world.getData(WORLD_DATA).cachedFlowers.put(pos, flower); + } + }; + + ATTACHMENT_TYPES.register(eventBus); + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/data/WorldData.java b/neoforge/src/main/java/winterly/neoforge/data/WorldData.java new file mode 100644 index 0000000..a253f76 --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/data/WorldData.java @@ -0,0 +1,61 @@ +package winterly.neoforge.data; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.Tag; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.block.Block; +import net.neoforged.neoforge.attachment.IAttachmentSerializer; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class WorldData { + public Map cachedFlowers = new LinkedHashMap<>(); + + public static class WorldDataIAttachmentSerializer implements IAttachmentSerializer { + + @Override + public WorldData read(Tag nbt) { + WorldData data = new WorldData(); + + var cachedFlowersNbt = ((CompoundTag) nbt).getCompound("cachedFlowers"); + + if (!cachedFlowersNbt.isEmpty()) { + int size = cachedFlowersNbt.getInt("size"); + + for (int i = 0; i < size; i++) { + CompoundTag entry = cachedFlowersNbt.getCompound(String.valueOf(i)); + BlockPos pos = new BlockPos(entry.getInt("x"), entry.getInt("y"), entry.getInt("z")); + var block = BuiltInRegistries.BLOCK.getOptional(new ResourceLocation(entry.getString("block"))); + block.ifPresent(bl -> data.cachedFlowers.put(pos, bl)); + } + } + + return data; + } + + @Override + public Tag write(WorldData data) { + CompoundTag cachedFlowersNbt = new CompoundTag(); + cachedFlowersNbt.putInt("size", data.cachedFlowers.size()); + int index = -1; + + for (var entry : data.cachedFlowers.entrySet()) { + index++; + CompoundTag entryNbt = new CompoundTag(); + entryNbt.putInt("x", entry.getKey().getX()); + entryNbt.putInt("y", entry.getKey().getY()); + entryNbt.putInt("z", entry.getKey().getZ()); + entryNbt.putString("block", BuiltInRegistries.BLOCK.getKey(entry.getValue()).toString()); + cachedFlowersNbt.put(String.valueOf(index), entryNbt); + } + + CompoundTag nbt = new CompoundTag(); + nbt.put("cachedFlowers", cachedFlowersNbt); + + return nbt; + } + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/item/SantaHatItem.java b/neoforge/src/main/java/winterly/neoforge/item/SantaHatItem.java new file mode 100644 index 0000000..9be059c --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/item/SantaHatItem.java @@ -0,0 +1,57 @@ +package winterly.neoforge.item; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.ChatFormatting; +import net.minecraft.client.model.EntityModel; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.entity.RenderLayerParent; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; +import top.theillusivec4.curios.api.CuriosApi; +import top.theillusivec4.curios.api.SlotContext; +import top.theillusivec4.curios.api.client.ICurioRenderer; +import top.theillusivec4.curios.api.type.capability.ICurioItem; +import winterly.Winterly; +import winterly.client.model.WinterlyModels; +import winterly.item.CommonSantaHatItem; + +import java.util.List; + +public class SantaHatItem extends CommonSantaHatItem implements ICurioRenderer { + + public SantaHatItem(Item.Properties settings, String color) { + super(settings, color); + + CuriosApi.registerCurio(this, new ICurioItem() { + + @Override + public boolean canEquip(SlotContext slotContext, ItemStack stack) { + return true; + } + }); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag context) { + tooltip.add(Component.nullToEmpty(" ")); + tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY)); + } + + @Override + public > void render(ItemStack stack, SlotContext slotContext, PoseStack matrices, RenderLayerParent renderLayerParent, MultiBufferSource renderTypeBuffer, int light, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { + if(renderLayerParent.getModel() instanceof HumanoidModel biped) { + WinterlyModels.SANTA_HAT_MODEL.hat.copyFrom(biped.head); + VertexConsumer vertexConsumer = renderTypeBuffer.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + color + "_santa_hat.png"))); + WinterlyModels.SANTA_HAT_MODEL.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/item/ScarfItem.java b/neoforge/src/main/java/winterly/neoforge/item/ScarfItem.java new file mode 100644 index 0000000..c359d90 --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/item/ScarfItem.java @@ -0,0 +1,57 @@ +package winterly.neoforge.item; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.ChatFormatting; +import net.minecraft.client.model.EntityModel; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.entity.RenderLayerParent; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.network.chat.Component; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; +import org.jetbrains.annotations.Nullable; +import top.theillusivec4.curios.api.CuriosApi; +import top.theillusivec4.curios.api.SlotContext; +import top.theillusivec4.curios.api.client.ICurioRenderer; +import top.theillusivec4.curios.api.type.capability.ICurioItem; +import winterly.Winterly; +import winterly.client.model.WinterlyModels; +import winterly.item.CommonScarfItem; + +import java.util.List; + +public class ScarfItem extends CommonScarfItem implements ICurioRenderer { + + public ScarfItem(Item.Properties settings, String color) { + super(settings, color); + + CuriosApi.registerCurio(this, new ICurioItem() { + + @Override + public boolean canEquip(SlotContext slotContext, ItemStack stack) { + return true; + } + }); + } + + @Override + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag context) { + tooltip.add(Component.nullToEmpty(" ")); + tooltip.add(Component.translatable("tag.winterly.cosmetic").withStyle(ChatFormatting.GRAY)); + } + + @Override + public > void render(ItemStack stack, SlotContext slotContext, PoseStack matrices, RenderLayerParent renderLayerParent, MultiBufferSource renderTypeBuffer, int light, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) { + if(renderLayerParent.getModel() instanceof HumanoidModel biped){ + WinterlyModels.SCARF_MODEL.scarf.copyFrom(biped.body); + VertexConsumer vertexConsumer = renderTypeBuffer.getBuffer(RenderType.entityCutout(Winterly.id("textures/entity/" + color + "_scarf.png"))); + WinterlyModels.SCARF_MODEL.renderToBuffer(matrices, vertexConsumer, light, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + } + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/registry/WinterlyBlockEntities.java b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyBlockEntities.java new file mode 100644 index 0000000..900814d --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyBlockEntities.java @@ -0,0 +1,40 @@ +package winterly.neoforge.registry; + +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import winterly.block.GiftBoxBlock; +import winterly.block.entity.GiftBoxBlockEntity; +import winterly.registry.CommonWinterlyBlocks; + +import java.util.ArrayList; + +import static winterly.registry.CommonWinterlyBlockEntities.GIFT_BOX_BLOCK_ENTITY; + +public class WinterlyBlockEntities { + public static final DeferredRegister> BLOCK_ENTITIES_REGISTERER = DeferredRegister.create(BuiltInRegistries.BLOCK_ENTITY_TYPE, "winterly"); + + public static void init(IEventBus eventBus) { + + BLOCK_ENTITIES_REGISTERER.register("gift_box", () -> { + var type = BlockEntityType.Builder.of(GiftBoxBlockEntity::new, getGiftBoxes()).build(null); + GIFT_BOX_BLOCK_ENTITY = type; + return type; + }); + + BLOCK_ENTITIES_REGISTERER.register(eventBus); + } + + public static GiftBoxBlock[] getGiftBoxes() { + ArrayList gifts = new ArrayList<>(); + + CommonWinterlyBlocks.BLOCKS.forEach((identifier, block) -> { + if(block instanceof GiftBoxBlock box) { + gifts.add(box); + } + }); + + return gifts.toArray(new GiftBoxBlock[0]); + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/registry/WinterlyBlocks.java b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyBlocks.java new file mode 100644 index 0000000..cbc0f48 --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyBlocks.java @@ -0,0 +1,86 @@ +package winterly.neoforge.registry; + +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SlabBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.material.MapColor; +import net.minecraft.world.level.material.PushReaction; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredBlock; +import net.neoforged.neoforge.registries.DeferredRegister; +import winterly.Winterly; +import winterly.block.*; +import winterly.block.base.BasePaneBlock; +import winterly.block.base.BaseStairsBlock; +import winterly.neoforge.block.BaseTransparentBlock; + +import java.util.function.Supplier; + +import static net.minecraft.world.level.block.Blocks.*; +import static winterly.registry.CommonWinterlyBlocks.*; +import static winterly.registry.CommonWinterlyItems.ITEMS; + +public class WinterlyBlocks { + public static final DeferredRegister.Blocks BLOCKS_REGISTERER = DeferredRegister.createBlocks("winterly"); + + public static void init(IEventBus eventBus) { + add("icicle", () -> ICICLE = new IcicleBlock(copyOf(ICE).pushReaction(PushReaction.DESTROY))); + add("icicle_block", () -> ICICLE_BLOCK = new BaseTransparentBlock(copyOf(PACKED_ICE).noOcclusion())); + add("packed_icicle_block", () -> PACKED_ICICLE_BLOCK = new BaseTransparentBlock(copyOf(PACKED_ICE).noOcclusion())); + add("icicle_pane", () -> ICICLE_PANE = new BasePaneBlock(copyOf(PACKED_ICE).noOcclusion())); + add("icicle_bars", () -> ICICLE_BARS = new BasePaneBlock(copyOf(ICE).noOcclusion())); + add("cryomarble_block", () -> CRYOMARBLE_BLOCK = new Block(copyOf(DIAMOND_BLOCK))); + add("snowguy", () -> SNOWGUY = new SnowguyBlock(copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + add("snowball_wall", () -> SNOWBALL_WALL = new SnowballWallBlock(copyOf(WHITE_WOOL).sound(SoundType.SNOW).noOcclusion())); + add("dense_snow", () -> DENSE_SNOW = new Block(copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + add("dense_snow_stairs", () -> DENSE_SNOW_STAIRS = new BaseStairsBlock(SNOW_BLOCK.defaultBlockState(), copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + add("dense_snow_slab", () -> DENSE_SNOW_SLAB = new SlabBlock(copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + + add("snow_bricks", () -> SNOW_BRICKS = new Block(copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + add("snow_brick_stairs", () -> SNOW_BRICK_STAIRS = new BaseStairsBlock(SNOW_BLOCK.defaultBlockState(), copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + add("snow_brick_slab", () -> SNOW_BRICK_SLAB = new SlabBlock(copyOf(WHITE_WOOL).sound(SoundType.SNOW))); + add("frozen_grass", () -> FROZEN_GRASS = new CommonFrozenGrassBlock(BlockBehaviour.Properties.of().mapColor(MapColor.SNOW).replaceable().forceSolidOff().randomTicks().strength(0.1F).requiresCorrectToolForDrops().sound(SoundType.SNOW).isViewBlocking((state, world, pos) -> state.getValue(CommonFrozenGrassBlock.LAYERS) >= 8).pushReaction(PushReaction.DESTROY))); + add("frozen_flower", () -> FROZEN_FLOWER = new CommonFrozenFlowerBlock(BlockBehaviour.Properties.of().mapColor(MapColor.SNOW).replaceable().forceSolidOff().randomTicks().strength(0.1F).requiresCorrectToolForDrops().sound(SoundType.GRASS).isViewBlocking((state, world, pos) -> state.getValue(CommonFrozenFlowerBlock.LAYERS) >= 8).pushReaction(PushReaction.DESTROY))); + + add("raw_cryomarble_shard", () -> RAW_CRYOMARBLE_SHARD = new IcicleBlock(copyOf(WHITE_WOOL).sound(SoundType.GLASS).lightLevel(state -> 12))); + + add("red_gift_box", () -> RED_GIFT_BOX = new GiftBoxBlock(copyOf(RED_WOOL).pushReaction(PushReaction.DESTROY))); + add("orange_gift_box", () -> ORANGE_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("yellow_gift_box", () -> YELLOW_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("green_gift_box", () -> GREEN_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("cyan_gift_box", () -> CYAN_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("blue_gift_box", () -> BLUE_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("purple_gift_box", () -> PURPLE_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("black_gift_box", () -> BLACK_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + add("white_gift_box", () -> WHITE_GIFT_BOX = new GiftBoxBlock(copyOf(RED_GIFT_BOX))); + + add("garland_lights", () -> GARLAND_LIGHTS = new GarlandLightsBlock(copyOf(GREEN_WOOL).pushReaction(PushReaction.DESTROY).noCollission().sound(SoundType.CANDLE))); + add("rainy_garland_lights", () -> RAINY_GARLAND_LIGHTS = new GarlandLightsBlock(copyOf(WHITE_WOOL).pushReaction(PushReaction.DESTROY).noCollission().sound(SoundType.CANDLE))); + +// ITEMS.forEach((id, item) -> Registry.register(BuiltInRegistries.ITEM, id, item)); +// BLOCKS.forEach((id, block) -> Registry.register(BuiltInRegistries.BLOCK, id, block)); + + BLOCKS_REGISTERER.register(eventBus); + } + + public static T add(String name, Supplier blockSup) { + DeferredBlock toReturn = BLOCKS_REGISTERER.register(name, () -> { + var block = blockSup.get(); + BLOCKS.put(Winterly.id(name), block); + return block; + }); + WinterlyItems.ITEMS_REGISTERER.register(name, () -> { + var item = new BlockItem(toReturn.get(), new Item.Properties()); + ITEMS.put(Winterly.id(name), item); + return item; + }); + return null; + } + + public static BlockBehaviour.Properties copyOf(Block block) { + return BlockBehaviour.Properties.ofFullCopy(block); + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/registry/WinterlyFeatures.java b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyFeatures.java new file mode 100644 index 0000000..1cb1cd0 --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyFeatures.java @@ -0,0 +1,20 @@ +package winterly.neoforge.registry; + +import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.world.level.levelgen.feature.Feature; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import winterly.worldgen.CryomarbleFeature; +import winterly.worldgen.UndergroundIcicleFeature; + +public class WinterlyFeatures { + + public static final DeferredRegister> REGISTERER = DeferredRegister.create(BuiltInRegistries.FEATURE, "winterly"); + + public static void init(IEventBus eventBus) { + REGISTERER.register("underground_icicle", UndergroundIcicleFeature::new); + REGISTERER.register("cryomarble", CryomarbleFeature::new); + + REGISTERER.register(eventBus); + } +} diff --git a/neoforge/src/main/java/winterly/neoforge/registry/WinterlyItems.java b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyItems.java new file mode 100644 index 0000000..479437c --- /dev/null +++ b/neoforge/src/main/java/winterly/neoforge/registry/WinterlyItems.java @@ -0,0 +1,62 @@ +package winterly.neoforge.registry; + +import net.minecraft.world.food.FoodProperties; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.Tiers; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.neoforge.registries.DeferredRegister; +import winterly.Winterly; +import winterly.item.tool.*; +import winterly.neoforge.item.SantaHatItem; +import winterly.neoforge.item.ScarfItem; + +import java.util.function.Supplier; + +import static winterly.registry.CommonWinterlyItems.*; + +@SuppressWarnings("unused") +public class WinterlyItems { + + public static final DeferredRegister.Items ITEMS_REGISTERER = DeferredRegister.createItems("winterly"); + + public static void init(IEventBus eventBus) { + add("red_candy_cane", () -> RED_CANDY_CANE = new Item(settings().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F).fast().build()))); + add("green_candy_cane", () -> GREEN_CANDY_CANE = new Item(settings().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F).fast().build()))); + add("blue_candy_cane", () -> BLUE_CANDY_CANE = new Item(settings().food(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F).fast().build()))); + + add("cryomarble_shard", () -> CRYOMARBLE_SHARD = new Item(settings())); + add("cryomarble", () -> CRYOMARBLE = new Item(settings())); + + add("cryomarble_sword", () -> CRYOMARBLE_SWORD = new CryomarbleSwordItem(Tiers.DIAMOND, 3, -2.4F, settings())); + add("cryomarble_shovel", () -> CRYOMARBLE_SHOVEL = new CryomarbleShovelItem(Tiers.DIAMOND, 1.5F, -3.0F, settings())); + add("cryomarble_pickaxe", () -> CRYOMARBLE_PICKAXE = new CryomarblePickaxeItem(Tiers.DIAMOND, 1, -2.8F, settings())); + add("cryomarble_axe", () -> CRYOMARBLE_AXE = new CryomarbleAxeItem(Tiers.DIAMOND, 5.0F, -3.0F, settings())); + add("cryomarble_hoe", () -> CRYOMARBLE_HOE = new CryomarbleHoeItem(Tiers.DIAMOND, -3, 0.0F, settings())); + + add("red_santa_hat", () -> RED_SANTA_HAT = new SantaHatItem(settings(), "red")); + add("blue_santa_hat", () -> BLUE_SANTA_HAT = new SantaHatItem(settings(), "blue")); + + add("white_scarf", () -> WHITE_SCARF = new ScarfItem(settings(), "white")); + add("red_scarf", () -> RED_SCARF = new ScarfItem(settings(), "red")); + add("green_scarf", () -> GREEN_SCARF = new ScarfItem(settings(), "green")); + add("blue_scarf", () -> BLUE_SCARF = new ScarfItem(settings(), "blue")); + add("rainbow_scarf", () -> RAINBOW_SCARF = new ScarfItem(settings(), "rainbow")); + +// ITEMS.forEach((id, item) -> Registry.register(BuiltInRegistries.ITEM, id, item)); + ITEMS_REGISTERER.register(eventBus); + } + + private static T add(String name, Supplier sup) { +// ITEMS.put(Winterly.id(name), null); + ITEMS_REGISTERER.register(name, () -> { + var item = sup.get(); + ITEMS.put(Winterly.id(name), item); + return item; + }); + return null; + } + + private static Item.Properties settings() { + return new Item.Properties(); + } +} diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..3a0ae5a --- /dev/null +++ b/neoforge/src/main/resources/META-INF/mods.toml @@ -0,0 +1,18 @@ +modLoader = "javafml" +loaderVersion = "[2,)" +issueTrackerURL = "${issue_tracker_url}" # Change this to the link to your mod's issue tracker. +license = "${license}" + +[[mods]] +modId = "${id}" +displayName = "${name}" +version = "${version}" +description = '''${description}''' +authors = "PinkGoosik" +logoFile = "assets/winterly/icon.png" + +[[mixins]] +config = "${id}-common.mixins.json" + +[[mixins]] +config = "${id}.mixins.json" diff --git a/neoforge/src/main/resources/data/curios/tags/items/curio.json b/neoforge/src/main/resources/data/curios/tags/items/curio.json new file mode 100644 index 0000000..e66e6b4 --- /dev/null +++ b/neoforge/src/main/resources/data/curios/tags/items/curio.json @@ -0,0 +1,12 @@ +{ + "replace": false, + "values": [ + "winterly:red_santa_hat", + "winterly:blue_santa_hat", + "winterly:red_scarf", + "winterly:green_scarf", + "winterly:blue_scarf", + "winterly:white_scarf", + "winterly:rainbow_scarf" + ] +} \ No newline at end of file diff --git a/neoforge/src/main/resources/data/winterly/curios/entities/winterly.json b/neoforge/src/main/resources/data/winterly/curios/entities/winterly.json new file mode 100644 index 0000000..8d2c6ea --- /dev/null +++ b/neoforge/src/main/resources/data/winterly/curios/entities/winterly.json @@ -0,0 +1,11 @@ +{ + "entities": ["minecraft:player"], + "slots": [ + "belt", + "body", + "charm", + "head", + "necklace", + "ring" + ] +} \ No newline at end of file diff --git a/neoforge/src/main/resources/data/winterly/neoforge/biome_modifier/cryomarble.json b/neoforge/src/main/resources/data/winterly/neoforge/biome_modifier/cryomarble.json new file mode 100644 index 0000000..a802550 --- /dev/null +++ b/neoforge/src/main/resources/data/winterly/neoforge/biome_modifier/cryomarble.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "winterly:cryomarble", + "step": "underground_decoration" +} \ No newline at end of file diff --git a/neoforge/src/main/resources/data/winterly/neoforge/biome_modifier/underground_icicle.json b/neoforge/src/main/resources/data/winterly/neoforge/biome_modifier/underground_icicle.json new file mode 100644 index 0000000..759d169 --- /dev/null +++ b/neoforge/src/main/resources/data/winterly/neoforge/biome_modifier/underground_icicle.json @@ -0,0 +1,6 @@ +{ + "type": "neoforge:add_features", + "biomes": "#forge:is_cold/overworld", + "features": "winterly:underground_icicle", + "step": "underground_decoration" +} \ No newline at end of file diff --git a/neoforge/src/main/resources/pack.mcmeta b/neoforge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..75408ef --- /dev/null +++ b/neoforge/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "${description}", + "pack_format": 15 + } +} diff --git a/neoforge/src/main/resources/winterly.mixins.json b/neoforge/src/main/resources/winterly.mixins.json new file mode 100644 index 0000000..176b208 --- /dev/null +++ b/neoforge/src/main/resources/winterly.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "package": "winterly.neoforge.mixin", + "compatibilityLevel": "JAVA_17", + "minVersion": "0.8", + "client": [ + ], + "mixins": [ + ], + "injectors": { + "defaultRequire": 1 + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index cf0fb6c..95d03fb 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,27 @@ pluginManagement { - repositories { - mavenCentral() - gradlePluginPortal() - maven { url "https://maven.fabricmc.net" } - } + repositories { + maven { + name "FabricMC" + url "https://maven.fabricmc.net/" + } + + maven { + name "Architectury" + url "https://maven.architectury.dev/" + } + + maven { + name "MinecraftForge" + url "https://maven.minecraftforge.net/" + } + + mavenCentral() + gradlePluginPortal() + } } + +include("common") +include("fabric") +include("neoforge") + +rootProject.name = "Winterly" diff --git a/src/main/java/winterly/Winterly.java b/src/main/java/winterly/Winterly.java deleted file mode 100644 index 4af535f..0000000 --- a/src/main/java/winterly/Winterly.java +++ /dev/null @@ -1,63 +0,0 @@ -package winterly; - -import net.fabricmc.api.ModInitializer; -import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.item.ItemGroup; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import winterly.compat.WinterlyOwoLibIntegration; -import winterly.config.WinterlyClothConfig; -import winterly.config.WinterlyConfig; -import winterly.registry.WinterlyBlockEntities; -import winterly.registry.WinterlyBlocks; -import winterly.registry.WinterlyFeatures; -import winterly.registry.WinterlyItems; - -public class Winterly implements ModInitializer { - public static final String MOD_ID = "winterly"; - public static final Logger LOGGER = LoggerFactory.getLogger("Winterly"); - public static ItemGroup itemGroup; - public static WinterlyConfig config = WinterlyClothConfig.init(); - - @Override - public void onInitialize() { - itemGroup = createItemGroup(); - WinterlyItems.init(); - WinterlyBlocks.init(); - WinterlyBlockEntities.init(); - WinterlyFeatures.init(); - - if(FabricLoader.getInstance().isModLoaded("owo")) { - WinterlyOwoLibIntegration.initItemGroup(); - ItemGroupEvents.modifyEntriesEvent(Registries.ITEM_GROUP.getKey(itemGroup).get()).register(entries -> { - WinterlyItems.ITEMS.forEach((id, item) -> entries.add(item.getDefaultStack())); - WinterlyBlocks.ITEMS.forEach((id, item) -> entries.add(item.getDefaultStack())); - }); - } - } - - private static ItemGroup createItemGroup() { - if(FabricLoader.getInstance().isModLoaded("owo")) { - return WinterlyOwoLibIntegration.createItemGroup(); - } - var group = FabricItemGroup.builder().displayName(Text.translatable("itemGroup.winterly.items")) - .icon(() -> WinterlyBlocks.SNOWGUY.asItem().getDefaultStack()) - .entries((displayContext, entries) -> { - WinterlyItems.ITEMS.forEach((id, item) -> entries.add(item.getDefaultStack())); - WinterlyBlocks.ITEMS.forEach((id, item) -> entries.add(item.getDefaultStack())); - }).build(); - Registry.register(Registries.ITEM_GROUP, id("items"), group); - return group; - } - - public static Identifier id(String path) { - return new Identifier(MOD_ID, path); - } - -} diff --git a/src/main/java/winterly/block/FrozenFlowerBlock.java b/src/main/java/winterly/block/FrozenFlowerBlock.java deleted file mode 100644 index a17f301..0000000 --- a/src/main/java/winterly/block/FrozenFlowerBlock.java +++ /dev/null @@ -1,187 +0,0 @@ -package winterly.block; - -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.ShapeContext; -import net.minecraft.entity.ai.pathing.NavigationType; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.BooleanProperty; -import net.minecraft.state.property.IntProperty; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.random.Random; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.BlockView; -import net.minecraft.world.LightType; -import net.minecraft.world.WorldAccess; -import net.minecraft.world.WorldView; -import org.jetbrains.annotations.Nullable; -import winterly.data.CachedFlowers; -import winterly.registry.WinterlyBlocks; - -import java.util.Objects; - -@SuppressWarnings("deprecation") -public class FrozenFlowerBlock extends Block { - public static final IntProperty LAYERS = IntProperty.of("layers", 0, 8); - public static final BooleanProperty PERSISTENT = Properties.PERSISTENT; - - protected static final VoxelShape[] LAYERS_TO_SHAPE = new VoxelShape[] { - Block.createCuboidShape(5.0, 0.0, 5.0, 11.0, 10.0, 11.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 2.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 4.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 6.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 8.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 10.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 12.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 14.0, 16.0), - Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 16.0, 16.0) - }; - - public FrozenFlowerBlock(Settings settings) { - super(settings); - this.setDefaultState(this.stateManager.getDefaultState().with(LAYERS, 0).with(PERSISTENT, false)); - } - - @Override - public BlockSoundGroup getSoundGroup(BlockState state) { - if(state.get(LAYERS) == 0) { - return BlockSoundGroup.GRASS; - } - else { - return BlockSoundGroup.SNOW; - } - } - - @Override - public boolean canPathfindThrough(BlockState state, BlockView world, BlockPos pos, NavigationType type) { - if(type.equals(NavigationType.LAND)) { - return state.get(LAYERS) < 5; - } - else return false; - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return LAYERS_TO_SHAPE[state.get(LAYERS)]; - } - - @Override - public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if(state.get(LAYERS).equals(0) || state.get(LAYERS).equals(1)) { - return VoxelShapes.empty(); - } - else { - return LAYERS_TO_SHAPE[state.get(LAYERS) - 1]; - } - } - - @Override - public VoxelShape getSidesShape(BlockState state, BlockView world, BlockPos pos) { - return LAYERS_TO_SHAPE[state.get(LAYERS)]; - } - - @Override - public VoxelShape getCameraCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return LAYERS_TO_SHAPE[state.get(LAYERS)]; - } - - @Override - public boolean hasSidedTransparency(BlockState state) { - return true; - } - - @Override - public float getAmbientOcclusionLightLevel(BlockState state, BlockView world, BlockPos pos) { - return state.get(LAYERS) == 8 ? 0.2F : 1.0F; - } - - @Override - public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { - BlockPos down = pos.down(); - return this.canPlantOnTop(world.getBlockState(down)); - } - - protected boolean canPlantOnTop(BlockState floor) { - return floor.isIn(BlockTags.DIRT) || floor.isOf(Blocks.FARMLAND); - } - - @Override - public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { - return !state.canPlaceAt(world, pos) ? Blocks.AIR.getDefaultState() : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); - } - - @Override - public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { - if (world.getLightLevel(LightType.BLOCK, pos) > 11) { - dropStacks(state, world, pos); - if(state.get(LAYERS) != 0) { - var cachedFlower = CachedFlowers.getFlower(world.getRegistryKey(), pos); - world.setBlockState(pos, Objects.requireNonNullElse(cachedFlower, this).getDefaultState()); - } - } - else if(FabricLoader.getInstance().isModLoaded("seasons")) { - if(!state.get(PERSISTENT) && world.getLightLevel(LightType.SKY, pos) > 0 && world.getBiome(pos).value().getTemperature(pos) >= 0.15F) { - dropStacks(state, world, pos); - if(state.get(LAYERS) != 0) { - var cachedFlower = CachedFlowers.getFlower(world.getRegistryKey(), pos); - world.setBlockState(pos, Objects.requireNonNullElse(cachedFlower, this).getDefaultState()); - } - } - } - } - - @Override - public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { - super.onBroken(world, pos, state); - - if(state.get(LAYERS) != 0 && world instanceof ServerWorld server) { - var cachedFlower = CachedFlowers.getFlower(server.getRegistryKey(), pos); - world.setBlockState(pos, Objects.requireNonNullElse(cachedFlower, this).getDefaultState(), Block.NOTIFY_ALL); - } - } - - @Override - public boolean canReplace(BlockState state, ItemPlacementContext context) { - int layers = state.get(LAYERS); - - if(layers == 8) { - return false; - } - if(context.getStack().isOf(Blocks.SNOW.asItem())) { - if(layers == 0) { - return true; - } - else { - return context.getSide() == Direction.UP; - } - } - return false; - } - - @Nullable - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - BlockState state = ctx.getWorld().getBlockState(ctx.getBlockPos()); - if(state.isOf(Blocks.SNOW) || state.isOf(WinterlyBlocks.FROZEN_GRASS)) { - return getDefaultState().with(LAYERS, 1).with(PERSISTENT, true); - } - else { - return super.getPlacementState(ctx); - } - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - builder.add(LAYERS); - builder.add(PERSISTENT); - } -} diff --git a/src/main/java/winterly/block/FrozenGrassBlock.java b/src/main/java/winterly/block/FrozenGrassBlock.java deleted file mode 100644 index f10793f..0000000 --- a/src/main/java/winterly/block/FrozenGrassBlock.java +++ /dev/null @@ -1,67 +0,0 @@ -package winterly.block; - -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.SnowBlock; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.BooleanProperty; -import net.minecraft.state.property.Properties; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.math.random.Random; -import net.minecraft.world.LightType; -import net.minecraft.world.WorldAccess; - -public class FrozenGrassBlock extends SnowBlock { - public static final BooleanProperty PERSISTENT = Properties.PERSISTENT; - - public FrozenGrassBlock(Settings settings) { - super(settings); - this.setDefaultState(this.stateManager.getDefaultState().with(LAYERS, 1).with(PERSISTENT, false)); - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - super.appendProperties(builder); - builder.add(PERSISTENT); - } - - @Override - public boolean canReplace(BlockState state, ItemPlacementContext context) { - int layers = state.get(LAYERS); - - if(layers == 8 || context.getStack().isOf(this.asItem())) { - return false; - } - if(context.getStack().isOf(Blocks.SNOW.asItem())) { - return context.getSide() == Direction.UP; - } - - return layers == 1; - } - - @SuppressWarnings("deprecation") - @Override - public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { - if (world.getLightLevel(LightType.BLOCK, pos) > 11) { - dropStacks(state, world, pos); - world.setBlockState(pos, Blocks.SHORT_GRASS.getDefaultState()); - } - else if(FabricLoader.getInstance().isModLoaded("seasons")) { - if(!state.get(PERSISTENT) && world.getLightLevel(LightType.SKY, pos) > 0 && world.getBiome(pos).value().getTemperature(pos) >= 0.15F) { - dropStacks(state, world, pos); - world.setBlockState(pos, Blocks.SHORT_GRASS.getDefaultState()); - } - } - } - - @Override - public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { - super.onBroken(world, pos, state); - world.setBlockState(pos, Blocks.SHORT_GRASS.getDefaultState(), Block.NOTIFY_ALL); - } -} diff --git a/src/main/java/winterly/block/GarlandLightsBlock.java b/src/main/java/winterly/block/GarlandLightsBlock.java deleted file mode 100644 index dbeb5ff..0000000 --- a/src/main/java/winterly/block/GarlandLightsBlock.java +++ /dev/null @@ -1,81 +0,0 @@ -package winterly.block; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.HorizontalFacingBlock; -import net.minecraft.block.ShapeContext; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.DirectionProperty; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import net.minecraft.world.WorldView; -import org.jetbrains.annotations.Nullable; - -@SuppressWarnings("deprecation") -public class GarlandLightsBlock extends Block { - public static final DirectionProperty FACING = HorizontalFacingBlock.FACING; - - private static final VoxelShape EAST_SHAPE = createCuboidShape(0, 3, 0, 1, 13, 16); - private static final VoxelShape WEST_SHAPE = createCuboidShape(15, 3, 0, 16, 13, 16); - private static final VoxelShape SOUTH_SHAPE = createCuboidShape(0, 3, 0, 16, 13, 1); - private static final VoxelShape NORTH_SHAPE = createCuboidShape(0, 3, 15, 16, 13, 16); - - public GarlandLightsBlock(Settings settings) { - super(settings); - this.setDefaultState(getDefaultState().with(FACING, Direction.NORTH)); - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return switch (state.get(FACING)) { - case NORTH -> NORTH_SHAPE; - case SOUTH -> SOUTH_SHAPE; - case WEST -> WEST_SHAPE; - default -> EAST_SHAPE; - }; - } - - @Override - public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { - Direction direction = state.get(FACING); - return this.canPlaceOn(world, pos.offset(direction.getOpposite())); - } - - private boolean canPlaceOn(BlockView world, BlockPos pos) { - BlockState state = world.getBlockState(pos); - return !state.isAir(); - } - - @Nullable - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - if (!ctx.canReplaceExisting()) { - BlockState state = ctx.getWorld().getBlockState(ctx.getBlockPos().offset(ctx.getSide().getOpposite())); - if (state.isOf(this) && state.get(FACING) == ctx.getSide()) { - return null; - } - } - - BlockState state = this.getDefaultState(); - WorldView world = ctx.getWorld(); - BlockPos pos = ctx.getBlockPos(); - - for(Direction direction : ctx.getPlacementDirections()) { - if (direction.getAxis().isHorizontal()) { - state = state.with(FACING, direction.getOpposite()); - if (state.canPlaceAt(world, pos)) { - return state; - } - } - } - return null; - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - builder.add(FACING); - } -} diff --git a/src/main/java/winterly/block/GiftBoxBlock.java b/src/main/java/winterly/block/GiftBoxBlock.java deleted file mode 100644 index d96b099..0000000 --- a/src/main/java/winterly/block/GiftBoxBlock.java +++ /dev/null @@ -1,132 +0,0 @@ -package winterly.block; - -import net.minecraft.block.*; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.enchantment.Enchantments; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.BlockItem; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.sound.SoundCategory; -import net.minecraft.sound.SoundEvents; -import net.minecraft.text.Style; -import net.minecraft.text.Text; -import net.minecraft.util.*; -import net.minecraft.util.hit.BlockHitResult; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; -import winterly.Winterly; -import winterly.block.entity.GiftBoxBlockEntity; -import winterly.data.GiftBoxData; - -import java.util.List; - -@SuppressWarnings("deprecation") -public class GiftBoxBlock extends Block implements BlockEntityProvider { - public static final VoxelShape SHAPE = createCuboidShape(4, 0, 4, 12, 8, 12); - - public GiftBoxBlock(Settings settings) { - super(settings); - } - - @Nullable - @Override - public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { - return new GiftBoxBlockEntity(pos, state); - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return GiftBoxBlock.SHAPE; - } - - @Override - public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { - super.onPlaced(world, pos, state, placer, stack); - - if(world.getBlockEntity(pos) instanceof GiftBoxBlockEntity entity) { - entity.readNbt(stack.getOrCreateNbt()); - } - } - - @Override - public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { - super.onBreak(world, pos, state, player); - - if(!world.isClient && world.getBlockEntity(pos) instanceof GiftBoxBlockEntity entity) { - ItemStack stack = player.getStackInHand(Hand.MAIN_HAND); - if(!EnchantmentHelper.get(stack).containsKey(Enchantments.SILK_TOUCH)) { - if(entity.stacks.isEmpty()) { - dropStack(world, pos, new ItemStack(this.asItem())); - } - else { - entity.stacks.forEach(st -> dropStack(world, pos, st)); - } - } - else { - ItemStack box = new ItemStack(this); - - if(!entity.stacks.isEmpty()) { - var nbt = new NbtCompound(); - entity.writeNbt(nbt); - box.setNbt(nbt); - } - dropStack(world, pos, box); - } - } - return state; - } - - @Override - public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { - if(!world.isClient && world.getBlockEntity(pos) instanceof GiftBoxBlockEntity entity) { - var stack = player.getStackInHand(hand); - - if(!stack.isEmpty() && entity.stacks.size() < Winterly.config.getGiftBoxCapacity()) { - if(stack.getItem() instanceof BlockItem blockItem) { - if(blockItem.getBlock() instanceof ShulkerBoxBlock || blockItem.getBlock() instanceof GiftBoxBlock) { - return ActionResult.PASS; - } - } - entity.stacks.add(stack.copy()); - player.setStackInHand(hand, ItemStack.EMPTY); - world.playSound(null, pos, SoundEvents.ITEM_BUNDLE_INSERT, SoundCategory.BLOCKS, 1, 1); - return ActionResult.SUCCESS; - } - } - return super.onUse(state, world, pos, player, hand, hit); - } - - @Override - public void appendTooltip(ItemStack stack, @Nullable BlockView world, List tooltip, TooltipContext options) { - super.appendTooltip(stack, world, tooltip, options); - - if(stack.getOrCreateNbt().contains("giftBoxData")) { - var gift = GiftBoxData.fromNbt(stack.getOrCreateNbt().getCompound("giftBoxData")); - - gift.stacks.forEach(st -> { - String name = Language.getInstance().get(st.getTranslationKey()); - tooltip.add(Text.of("- " + name + " x" + st.getCount()).getWithStyle(Style.EMPTY.withColor(Formatting.GRAY)).get(0)); - }); - } - else { - Language lang = Language.getInstance(); - String key = "description.winterly.gift_box."; - - for(int i = 0; i <= 32; i++) { - if(lang.hasTranslation(key + i)) { - tooltip.add(Text.translatable(key + i).getWithStyle(Style.EMPTY.withColor(Formatting.GRAY)).get(0)); - } - if(!lang.hasTranslation(key + (i + 1))) { - break; - } - } - } - } -} diff --git a/src/main/java/winterly/block/IcicleBlock.java b/src/main/java/winterly/block/IcicleBlock.java deleted file mode 100644 index fb5c2af..0000000 --- a/src/main/java/winterly/block/IcicleBlock.java +++ /dev/null @@ -1,116 +0,0 @@ -package winterly.block; - -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.block.*; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.fluid.FluidState; -import net.minecraft.fluid.Fluids; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.item.ItemStack; -import net.minecraft.state.StateManager; -import net.minecraft.state.property.BooleanProperty; -import net.minecraft.state.property.DirectionProperty; -import net.minecraft.state.property.Properties; -import net.minecraft.text.Text; -import net.minecraft.util.BlockMirror; -import net.minecraft.util.BlockRotation; -import net.minecraft.util.Formatting; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import net.minecraft.world.WorldAccess; -import net.minecraft.world.WorldView; -import org.jetbrains.annotations.Nullable; -import winterly.registry.WinterlyBlocks; - -import java.util.List; - -@SuppressWarnings("deprecation") -public class IcicleBlock extends Block implements Waterloggable { - public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; - public static final DirectionProperty FACING = Properties.FACING; - - public static final VoxelShape NORTH_SHAPE = createCuboidShape(3, 3, 9, 13, 13, 16); - public static final VoxelShape SOUTH_SHAPE = createCuboidShape(3, 3, 0, 13, 13, 7); - public static final VoxelShape EAST_SHAPE = createCuboidShape(0, 3, 3, 7, 13, 13); - public static final VoxelShape WEST_SHAPE = createCuboidShape(13, 3, 3, 16, 13, 13); - public static final VoxelShape UP_SHAPE = createCuboidShape(3, 0, 3, 13, 7, 13); - public static final VoxelShape DOWN_SHAPE = createCuboidShape(3, 9, 3, 13, 16, 13); - - public IcicleBlock(Settings settings) { - super(settings); - this.setDefaultState(this.getDefaultState().with(WATERLOGGED, Boolean.FALSE).with(FACING, Direction.DOWN)); - } - - @Override - public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { - Direction direction = state.get(FACING); - BlockPos blockPos = pos.offset(direction.getOpposite()); - BlockState blockState = world.getBlockState(blockPos); - return !blockState.isAir() && !blockState.isOf(this); - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - Direction direction = state.get(FACING); - return switch (direction) { - case NORTH -> NORTH_SHAPE; - case SOUTH -> SOUTH_SHAPE; - case EAST -> EAST_SHAPE; - case WEST -> WEST_SHAPE; - case DOWN -> DOWN_SHAPE; - default -> UP_SHAPE; - }; - } - - @Override - public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { - if (state.get(WATERLOGGED)) { - world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); - } - return direction == state.get(FACING).getOpposite() && !state.canPlaceAt(world, pos) - ? Blocks.AIR.getDefaultState() - : super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); - } - - @Nullable - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - WorldAccess world = ctx.getWorld(); - BlockPos pos = ctx.getBlockPos(); - return this.getDefaultState() - .with(WATERLOGGED, world.getFluidState(pos).getFluid() == Fluids.WATER) - .with(FACING, ctx.getSide()); - } - - @Override - public BlockState rotate(BlockState state, BlockRotation rotation) { - return state.with(FACING, rotation.rotate(state.get(FACING))); - } - - @Override - public BlockState mirror(BlockState state, BlockMirror mirror) { - return state.rotate(mirror.getRotation(state.get(FACING))); - } - - @Override - public FluidState getFluidState(BlockState state) { - return state.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(state); - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - builder.add(WATERLOGGED, FACING); - } - - @Environment(EnvType.CLIENT) - @Override - public void appendTooltip(ItemStack stack, @Nullable BlockView world, List tooltip, TooltipContext options) { - if(this.equals(WinterlyBlocks.ICICLE)) { - tooltip.add(Text.translatable("tag.winterly.placeable").formatted(Formatting.GRAY)); - } - super.appendTooltip(stack, world, tooltip, options); - } -} diff --git a/src/main/java/winterly/block/SnowballWallBlock.java b/src/main/java/winterly/block/SnowballWallBlock.java deleted file mode 100644 index 9cc945f..0000000 --- a/src/main/java/winterly/block/SnowballWallBlock.java +++ /dev/null @@ -1,41 +0,0 @@ -package winterly.block; - -import com.mojang.serialization.MapCodec; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.HorizontalFacingBlock; -import net.minecraft.block.ShapeContext; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.state.StateManager; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; - -@SuppressWarnings("deprecation") -public class SnowballWallBlock extends HorizontalFacingBlock { - private static final VoxelShape SHAPE = createCuboidShape(4, 0, 4, 12, 12, 12); - - public SnowballWallBlock(Settings settings) { - super(settings); - } - - @Override - protected MapCodec getCodec() { - return null; - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return SHAPE; - } - - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - return this.getDefaultState().with(FACING, ctx.getHorizontalPlayerFacing().getOpposite()); - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - builder.add(FACING); - } -} diff --git a/src/main/java/winterly/block/SnowguyBlock.java b/src/main/java/winterly/block/SnowguyBlock.java deleted file mode 100644 index 97f188e..0000000 --- a/src/main/java/winterly/block/SnowguyBlock.java +++ /dev/null @@ -1,57 +0,0 @@ -package winterly.block; - -import com.mojang.serialization.MapCodec; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.HorizontalFacingBlock; -import net.minecraft.block.ShapeContext; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.item.ItemPlacementContext; -import net.minecraft.item.ItemStack; -import net.minecraft.state.StateManager; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.shape.VoxelShape; -import net.minecraft.world.BlockView; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -@SuppressWarnings("deprecation") -public class SnowguyBlock extends HorizontalFacingBlock { - public static final VoxelShape SHAPE = createCuboidShape(4, 0, 4, 12, 14, 12); - - public SnowguyBlock(Settings settings) { - super(settings); - } - - @Override - protected MapCodec getCodec() { - return null; - } - - @Override - public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - return SHAPE; - } - - @Override - public BlockState getPlacementState(ItemPlacementContext ctx) { - return this.getDefaultState().with(FACING, ctx.getHorizontalPlayerFacing().getOpposite()); - } - - @Override - protected void appendProperties(StateManager.Builder builder) { - builder.add(FACING); - } - - @Environment(EnvType.CLIENT) - @Override - public void appendTooltip(ItemStack stack, @Nullable BlockView world, List tooltip, TooltipContext options) { - tooltip.add(Text.translatable("tag.winterly.placeable").formatted(Formatting.GRAY)); - super.appendTooltip(stack, world, tooltip, options); - } -} diff --git a/src/main/java/winterly/block/base/BasePaneBlock.java b/src/main/java/winterly/block/base/BasePaneBlock.java deleted file mode 100644 index fb363e2..0000000 --- a/src/main/java/winterly/block/base/BasePaneBlock.java +++ /dev/null @@ -1,10 +0,0 @@ -package winterly.block.base; - -import net.minecraft.block.PaneBlock; - -public class BasePaneBlock extends PaneBlock { - - public BasePaneBlock(Settings settings) { - super(settings); - } -} diff --git a/src/main/java/winterly/block/base/BaseStairsBlock.java b/src/main/java/winterly/block/base/BaseStairsBlock.java deleted file mode 100644 index 3dc4efe..0000000 --- a/src/main/java/winterly/block/base/BaseStairsBlock.java +++ /dev/null @@ -1,11 +0,0 @@ -package winterly.block.base; - -import net.minecraft.block.BlockState; -import net.minecraft.block.StairsBlock; - -public class BaseStairsBlock extends StairsBlock { - - public BaseStairsBlock(BlockState base, Settings settings) { - super(base, settings); - } -} diff --git a/src/main/java/winterly/block/entity/GiftBoxBlockEntity.java b/src/main/java/winterly/block/entity/GiftBoxBlockEntity.java deleted file mode 100644 index a4ce201..0000000 --- a/src/main/java/winterly/block/entity/GiftBoxBlockEntity.java +++ /dev/null @@ -1,33 +0,0 @@ -package winterly.block.entity; - -import net.minecraft.block.BlockState; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.util.math.BlockPos; -import winterly.data.GiftBoxData; -import winterly.registry.WinterlyBlockEntities; - -import java.util.ArrayList; - -public class GiftBoxBlockEntity extends BlockEntity { - public ArrayList stacks = new ArrayList<>(); - - public GiftBoxBlockEntity(BlockPos pos, BlockState state) { - super(WinterlyBlockEntities.GIFT_BOX_BLOCK_ENTITY, pos, state); - } - - @Override - public void writeNbt(NbtCompound nbt) { - super.writeNbt(nbt); - nbt.put("giftBoxData", GiftBoxData.toNbt(this)); - } - - @Override - public void readNbt(NbtCompound nbt) { - super.readNbt(nbt); - var data = GiftBoxData.fromNbt(nbt.getCompound("giftBoxData")); - this.stacks = data.stacks; - } - -} diff --git a/src/main/java/winterly/client/WinterlyClient.java b/src/main/java/winterly/client/WinterlyClient.java deleted file mode 100644 index 96b27e3..0000000 --- a/src/main/java/winterly/client/WinterlyClient.java +++ /dev/null @@ -1,56 +0,0 @@ -package winterly.client; - -import dev.emi.trinkets.api.client.TrinketRenderer; -import dev.emi.trinkets.api.client.TrinketRendererRegistry; -import net.fabricmc.api.ClientModInitializer; -import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; -import net.fabricmc.fabric.api.client.rendering.v1.LivingEntityFeatureRendererRegistrationCallback; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.entity.DrownedEntityRenderer; -import net.minecraft.client.render.entity.SkeletonEntityRenderer; -import net.minecraft.client.render.entity.ZombieEntityRenderer; -import winterly.block.*; -import winterly.client.render.DecorationFeatureRenderer; -import winterly.client.render.MobDecorationRenderers; -import winterly.registry.WinterlyBlocks; -import winterly.registry.WinterlyItems; - -public class WinterlyClient implements ClientModInitializer { - - @Override - public void onInitializeClient() { - WinterlyModelLayers.init(); - MobDecorationRenderers.init(); - - BlockRenderLayerMap map = BlockRenderLayerMap.INSTANCE; - WinterlyBlocks.BLOCKS.forEach((id, block) -> { - if(block instanceof GiftBoxBlock) map.putBlock(block, RenderLayer.getCutout()); - if(block instanceof GarlandLightsBlock) map.putBlock(block, RenderLayer.getCutout()); - if(block instanceof SnowguyBlock) map.putBlock(block, RenderLayer.getCutout()); - if(block instanceof IcicleBlock) map.putBlock(block, RenderLayer.getCutout()); - if(block instanceof FrozenGrassBlock) map.putBlock(block, RenderLayer.getCutout()); - if(block instanceof FrozenFlowerBlock) map.putBlock(block, RenderLayer.getCutout()); - }); - map.putBlock(WinterlyBlocks.ICICLE_BLOCK, RenderLayer.getTranslucent()); - map.putBlock(WinterlyBlocks.ICICLE_PANE, RenderLayer.getTranslucent()); - map.putBlock(WinterlyBlocks.ICICLE_BARS, RenderLayer.getCutout()); - - WinterlyItems.ITEMS.forEach((id, item) -> { - if(item instanceof TrinketRenderer renderer) TrinketRendererRegistry.registerRenderer(item, renderer); - }); - - LivingEntityFeatureRendererRegistrationCallback.EVENT.register((entityType, entityRenderer, registrationHelper, context) -> { - if(entityRenderer instanceof ZombieEntityRenderer renderer) { - registrationHelper.register(new DecorationFeatureRenderer<>(renderer)); - } - if(entityRenderer instanceof DrownedEntityRenderer renderer) { - registrationHelper.register(new DecorationFeatureRenderer<>(renderer)); - } - if(entityRenderer instanceof SkeletonEntityRenderer renderer) { - registrationHelper.register(new DecorationFeatureRenderer<>(renderer)); - } - }); - - } - -} diff --git a/src/main/java/winterly/client/WinterlyModelLayers.java b/src/main/java/winterly/client/WinterlyModelLayers.java deleted file mode 100644 index 9b454b7..0000000 --- a/src/main/java/winterly/client/WinterlyModelLayers.java +++ /dev/null @@ -1,22 +0,0 @@ -package winterly.client; - -import static net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry.registerModelLayer; -import net.minecraft.client.render.entity.model.EntityModelLayer; - -import winterly.client.model.SantaHatModel; -import winterly.client.model.ScarfModel; -import static winterly.Winterly.id; - -public class WinterlyModelLayers { - public static final EntityModelLayer SANTA_HAT_LAYER = of("santa_hat"); - public static final EntityModelLayer SCARF_LAYER = of("scarf"); - - private static EntityModelLayer of(String name){ - return new EntityModelLayer(id(name), "main"); - } - - public static void init() { - registerModelLayer(SANTA_HAT_LAYER, SantaHatModel::getTexturedModelData); - registerModelLayer(SCARF_LAYER, ScarfModel::getTexturedModelData); - } -} diff --git a/src/main/java/winterly/client/model/SantaHatModel.java b/src/main/java/winterly/client/model/SantaHatModel.java deleted file mode 100644 index adc71eb..0000000 --- a/src/main/java/winterly/client/model/SantaHatModel.java +++ /dev/null @@ -1,34 +0,0 @@ -package winterly.client.model; - -import com.google.common.collect.ImmutableList; -import net.minecraft.client.model.*; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.util.math.MatrixStack; - -public class SantaHatModel extends Model { - public final ModelPart hat; - - public SantaHatModel(ModelPart root) { - super(RenderLayer::getEntityCutoutNoCull); - this.hat = root.getChild("hat"); - } - - public static TexturedModelData getTexturedModelData() { - ModelData modelData = new ModelData(); - ModelPartData modelPartData = modelData.getRoot(); - - ModelPartData hat = modelPartData.addChild("hat", ModelPartBuilder.create().uv(27, 14).cuboid(-4.0F, -8.0F, 7.0F, 3.0F, 3.0F, 3.0F), ModelTransform.pivot(0.0F, 24.0F, 0.0F)); - - hat.addChild("cube_1", ModelPartBuilder.create().uv(0, 27).cuboid(-3.0F, -5.0F, 0.0F, 6.0F, 4.0F, 8.0F), ModelTransform.of(0.0F, -8.0F, 0.0F, -0.3491F, 0.0F, 0.0F)); - hat.addChild("cube_2", ModelPartBuilder.create().uv(0, 14).cuboid(-4.5F, -3.0F, -3.5F, 9.0F, 4.0F, 9.0F), ModelTransform.of(0.0F, -8.0F, 0.0F, -0.5236F, 0.0F, 0.0F)); - hat.addChild("cube_3", ModelPartBuilder.create().uv(0, 0).cuboid(-5.5F, 0.0F, -4.5F, 11.0F, 3.0F, 11.0F), ModelTransform.of(0.0F, -8.0F, 0.0F, -0.2618F, 0.0F, 0.0F)); - - return TexturedModelData.of(modelData, 64, 64); - } - - @Override - public void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float r, float g, float b, float a) { - ImmutableList.of(this.hat).forEach((part) -> part.render(matrices, vertices, light, overlay, r, g, b, a)); - } -} diff --git a/src/main/java/winterly/client/model/ScarfModel.java b/src/main/java/winterly/client/model/ScarfModel.java deleted file mode 100644 index fc2b356..0000000 --- a/src/main/java/winterly/client/model/ScarfModel.java +++ /dev/null @@ -1,32 +0,0 @@ -package winterly.client.model; - -import com.google.common.collect.ImmutableList; -import net.minecraft.client.model.*; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.util.math.MatrixStack; - -public class ScarfModel extends Model { - public final ModelPart scarf; - - public ScarfModel(ModelPart root) { - super(RenderLayer::getEntityCutoutNoCull); - this.scarf = root.getChild("scarf"); - } - - public static TexturedModelData getTexturedModelData() { - ModelData modelData = new ModelData(); - ModelPartData modelPartData = modelData.getRoot(); - - ModelPartData scarf = modelPartData.addChild("scarf", ModelPartBuilder.create().uv(0, 0).cuboid(-5.0F, -1.0F, -5.0F, 10.0F, 3.0F, 10.0F, new Dilation(0.0F)), ModelTransform.pivot(0.0F, 24.0F, 0.0F)); - scarf.addChild("back_hanger", ModelPartBuilder.create().uv(0, 13).cuboid(-5.0F, 3.0F, 3.0F, 5.0F, 16.0F, 0.0F, new Dilation(0.0F)), ModelTransform.rotation(0.3491F, 0.0F, 0.0F)); - scarf.addChild("front_hanger", ModelPartBuilder.create().uv(0, 13).cuboid(-1.0F, 2.0F, -4.0F, 5.0F, 16.0F, 0.0F, new Dilation(0.0F)), ModelTransform.rotation(0.0F, -0.2618F, 0.0F)); - - return TexturedModelData.of(modelData, 64, 64); - } - - @Override - public void render(MatrixStack matrices, VertexConsumer vertices, int light, int overlay, float r, float g, float b, float a) { - ImmutableList.of(this.scarf).forEach((part) -> part.render(matrices, vertices, light, overlay, r, g, b, a)); - } -} diff --git a/src/main/java/winterly/client/render/DecorationFeatureRenderer.java b/src/main/java/winterly/client/render/DecorationFeatureRenderer.java deleted file mode 100644 index fec56d7..0000000 --- a/src/main/java/winterly/client/render/DecorationFeatureRenderer.java +++ /dev/null @@ -1,26 +0,0 @@ -package winterly.client.render; - -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.feature.FeatureRenderer; -import net.minecraft.client.render.entity.feature.FeatureRendererContext; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; -import winterly.extension.DecoratedMob; - -public class DecorationFeatureRenderer> extends FeatureRenderer { - - public DecorationFeatureRenderer(FeatureRendererContext context) { - super(context); - } - - @Override - public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { - if(entity instanceof DecoratedMob decorated) { - if(decorated.winterly$decorated()) { - MobDecorationRenderer renderer = MobDecorationRenderers.getRenderer(decorated.winterly$getIndex()); - renderer.render(this.getContextModel(), matrices, vertexConsumers, light, entity, limbAngle, limbDistance, tickDelta, animationProgress, headYaw, headPitch); - } - } - } -} diff --git a/src/main/java/winterly/client/render/MobDecorationRenderer.java b/src/main/java/winterly/client/render/MobDecorationRenderer.java deleted file mode 100644 index f668493..0000000 --- a/src/main/java/winterly/client/render/MobDecorationRenderer.java +++ /dev/null @@ -1,16 +0,0 @@ -package winterly.client.render; - -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; - -public abstract class MobDecorationRenderer { - public final String texture; - - public MobDecorationRenderer(String texture) { - this.texture = texture; - } - - abstract public void render(BipedEntityModel contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch); -} diff --git a/src/main/java/winterly/client/render/SantaHatRenderer.java b/src/main/java/winterly/client/render/SantaHatRenderer.java deleted file mode 100644 index f4a60b0..0000000 --- a/src/main/java/winterly/client/render/SantaHatRenderer.java +++ /dev/null @@ -1,25 +0,0 @@ -package winterly.client.render; - -import net.minecraft.client.render.OverlayTexture; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; -import winterly.Winterly; -import winterly.client.model.WinterlyModels; - -public class SantaHatRenderer extends MobDecorationRenderer { - - public SantaHatRenderer(String texture) { - super(texture); - } - - @Override - public void render(BipedEntityModel contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { - WinterlyModels.SANTA_HAT_MODEL.hat.copyTransform(contextModel.head); - VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(Winterly.id("textures/entity/" + texture + ".png"))); - WinterlyModels.SANTA_HAT_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F); - } -} diff --git a/src/main/java/winterly/client/render/ScarfRenderer.java b/src/main/java/winterly/client/render/ScarfRenderer.java deleted file mode 100644 index c0ccc09..0000000 --- a/src/main/java/winterly/client/render/ScarfRenderer.java +++ /dev/null @@ -1,25 +0,0 @@ -package winterly.client.render; - -import net.minecraft.client.render.OverlayTexture; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; -import winterly.Winterly; -import winterly.client.model.WinterlyModels; - -public class ScarfRenderer extends MobDecorationRenderer { - - public ScarfRenderer(String texture) { - super(texture); - } - - @Override - public void render(BipedEntityModel contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { - WinterlyModels.SCARF_MODEL.scarf.copyTransform(contextModel.body); - VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(Winterly.id("textures/entity/" + texture + ".png"))); - WinterlyModels.SCARF_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F); - } -} diff --git a/src/main/java/winterly/data/CachedFlowers.java b/src/main/java/winterly/data/CachedFlowers.java deleted file mode 100644 index 2b3341f..0000000 --- a/src/main/java/winterly/data/CachedFlowers.java +++ /dev/null @@ -1,40 +0,0 @@ -package winterly.data; - -import net.minecraft.block.Block; -import net.minecraft.registry.RegistryKey; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; - -import java.util.LinkedHashMap; -import java.util.Map; - -public class CachedFlowers { - - public static Map, Map> data = new LinkedHashMap<>(); - - @Nullable - public static Block getFlower(RegistryKey world, BlockPos pos) { - var map = data.get(world); - if(map != null) { - return map.get(pos); - } - else { - var newMap = new LinkedHashMap(); - data.put(world, newMap); - return null; - } - } - - public static void cacheFlower(RegistryKey world, BlockPos pos, Block flower) { - var map = data.get(world); - if(map != null) { - map.put(pos, flower); - } - else { - var newMap = new LinkedHashMap(); - newMap.put(pos, flower); - data.put(world, newMap); - } - } -} diff --git a/src/main/java/winterly/data/GiftBoxData.java b/src/main/java/winterly/data/GiftBoxData.java deleted file mode 100644 index 325d70e..0000000 --- a/src/main/java/winterly/data/GiftBoxData.java +++ /dev/null @@ -1,47 +0,0 @@ -package winterly.data; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.registry.Registries; -import net.minecraft.util.Identifier; -import winterly.block.entity.GiftBoxBlockEntity; - -import java.util.ArrayList; - -public class GiftBoxData { - public ArrayList stacks = new ArrayList<>(); - - public static GiftBoxData fromNbt(NbtCompound nbt) { - GiftBoxData gift = new GiftBoxData(); - - int size = nbt.getInt("size"); - for(int i = 0; i < size; i++) { - NbtCompound entryNbt = nbt.getCompound(String.valueOf(i)); - - var item = Registries.ITEM.getOrEmpty(new Identifier(entryNbt.getString("item"))); - if(item.isPresent()) { - ItemStack temp = new ItemStack(item.get(), entryNbt.getInt("count")); - temp.setNbt((NbtCompound)entryNbt.get("nbt")); - gift.stacks.add(temp); - } - } - - return gift; - } - - public static NbtCompound toNbt(GiftBoxBlockEntity entity) { - NbtCompound nbt = new NbtCompound(); - nbt.putInt("size", entity.stacks.size()); - - for(int i = 0; i < entity.stacks.size(); i++) { - ItemStack stack = entity.stacks.get(i); - NbtCompound entryNbt = new NbtCompound(); - entryNbt.putString("item", Registries.ITEM.getId(stack.getItem()).toString()); - entryNbt.put("nbt", stack.getOrCreateNbt()); - entryNbt.putInt("count", stack.getCount()); - - nbt.put(Integer.toString(i), entryNbt); - } - return nbt; - } -} diff --git a/src/main/java/winterly/data/WorldData.java b/src/main/java/winterly/data/WorldData.java deleted file mode 100644 index d8d1e42..0000000 --- a/src/main/java/winterly/data/WorldData.java +++ /dev/null @@ -1,58 +0,0 @@ -package winterly.data; - -import dev.onyxstudios.cca.api.v3.component.ComponentV3; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.registry.Registries; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import java.util.LinkedHashMap; - -public class WorldData implements ComponentV3 { - - public World world; - - public WorldData(World world) { - this.world = world; - } - - @Override - public void readFromNbt(NbtCompound tag) { - CachedFlowers.data = new LinkedHashMap<>(); - var cachedFlowerNbt = tag.getCompound("cachedFlower"); - - if(!cachedFlowerNbt.isEmpty()) { - int size = cachedFlowerNbt.getInt("size"); - - for(int i = 0; i < size; i++) { - NbtCompound entry = cachedFlowerNbt.getCompound(String.valueOf(i)); - BlockPos pos = new BlockPos(entry.getInt("x"), entry.getInt("y"), entry.getInt("z")); - var block = Registries.BLOCK.getOrEmpty(new Identifier(entry.getString("block"))); - block.ifPresent(bl -> CachedFlowers.cacheFlower(world.getRegistryKey(), pos, bl)); - } - } - } - - @Override - public void writeToNbt(NbtCompound tag) { - NbtCompound cachedFlowerNbt = new NbtCompound(); - var map = CachedFlowers.data.get(world.getRegistryKey()); - if(map != null) { - cachedFlowerNbt.putInt("size", map.size()); - int index = -1; - - for(var entry : map.entrySet()) { - index++; - NbtCompound entryNbt = new NbtCompound(); - entryNbt.putInt("x", entry.getKey().getX()); - entryNbt.putInt("y", entry.getKey().getY()); - entryNbt.putInt("z", entry.getKey().getZ()); - entryNbt.putString("block", Registries.BLOCK.getId(entry.getValue()).toString()); - cachedFlowerNbt.put(String.valueOf(index), entryNbt); - } - tag.put("cachedFlower", cachedFlowerNbt); - } - - } -} diff --git a/src/main/java/winterly/item/SantaHatItem.java b/src/main/java/winterly/item/SantaHatItem.java deleted file mode 100644 index 9691775..0000000 --- a/src/main/java/winterly/item/SantaHatItem.java +++ /dev/null @@ -1,55 +0,0 @@ -package winterly.item; - -import dev.emi.trinkets.api.SlotReference; -import dev.emi.trinkets.api.Trinket; -import dev.emi.trinkets.api.TrinketsApi; -import dev.emi.trinkets.api.client.TrinketRenderer; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.client.render.OverlayTexture; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.render.entity.model.EntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; -import winterly.Winterly; -import winterly.client.model.WinterlyModels; - -import java.util.List; - -public class SantaHatItem extends Item implements Trinket, TrinketRenderer { - private final String color; - - public SantaHatItem(Settings settings, String color) { - super(settings); - this.color = color; - TrinketsApi.registerTrinket(this, this); - } - - @Environment(EnvType.CLIENT) - @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - tooltip.add(Text.translatable("tag.winterly.cosmetic").formatted(Formatting.GRAY)); - tooltip.add(Text.of(" ")); - super.appendTooltip(stack, world, tooltip, context); - } - - @Environment(EnvType.CLIENT) - @Override - public void render(ItemStack stack, SlotReference slotReference, EntityModel contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { - if(contextModel instanceof BipedEntityModel biped) { - WinterlyModels.SANTA_HAT_MODEL.hat.copyTransform(biped.head); - VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(Winterly.id("textures/entity/" + color + "_santa_hat.png"))); - WinterlyModels.SANTA_HAT_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F); - } - } -} diff --git a/src/main/java/winterly/item/ScarfItem.java b/src/main/java/winterly/item/ScarfItem.java deleted file mode 100644 index bdbf6bf..0000000 --- a/src/main/java/winterly/item/ScarfItem.java +++ /dev/null @@ -1,55 +0,0 @@ -package winterly.item; - -import dev.emi.trinkets.api.SlotReference; -import dev.emi.trinkets.api.Trinket; -import dev.emi.trinkets.api.TrinketsApi; -import dev.emi.trinkets.api.client.TrinketRenderer; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.client.render.OverlayTexture; -import net.minecraft.client.render.RenderLayer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.render.entity.model.EntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; -import winterly.Winterly; -import winterly.client.model.WinterlyModels; - -import java.util.List; - -public class ScarfItem extends Item implements Trinket, TrinketRenderer { - private final String color; - - public ScarfItem(Settings settings, String color) { - super(settings); - this.color = color; - TrinketsApi.registerTrinket(this, this); - } - - @Environment(EnvType.CLIENT) - @Override - public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { - tooltip.add(Text.translatable("tag.winterly.cosmetic").formatted(Formatting.GRAY)); - tooltip.add(Text.of(" ")); - super.appendTooltip(stack, world, tooltip, context); - } - - @Environment(EnvType.CLIENT) - @Override - public void render(ItemStack stack, SlotReference slotReference, EntityModel contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) { - if(contextModel instanceof BipedEntityModel biped){ - WinterlyModels.SCARF_MODEL.scarf.copyTransform(biped.body); - VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(Winterly.id("textures/entity/" + color + "_scarf.png"))); - WinterlyModels.SCARF_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F); - } - } -} diff --git a/src/main/java/winterly/item/tool/CryomarbleAxeItem.java b/src/main/java/winterly/item/tool/CryomarbleAxeItem.java deleted file mode 100644 index e070201..0000000 --- a/src/main/java/winterly/item/tool/CryomarbleAxeItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package winterly.item.tool; - -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.AxeItem; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ToolMaterial; - -public class CryomarbleAxeItem extends AxeItem { - - public CryomarbleAxeItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) { - super(material, attackDamage, attackSpeed, settings); - } - - @Override - public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { - target.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 60, 0)); - return super.postHit(stack, target, attacker); - } -} diff --git a/src/main/java/winterly/item/tool/CryomarbleHoeItem.java b/src/main/java/winterly/item/tool/CryomarbleHoeItem.java deleted file mode 100644 index 1a66677..0000000 --- a/src/main/java/winterly/item/tool/CryomarbleHoeItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package winterly.item.tool; - -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.HoeItem; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ToolMaterial; - -public class CryomarbleHoeItem extends HoeItem { - - public CryomarbleHoeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { - super(material, attackDamage, attackSpeed, settings); - } - - @Override - public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { - target.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 60, 0)); - return super.postHit(stack, target, attacker); - } -} diff --git a/src/main/java/winterly/item/tool/CryomarblePickaxeItem.java b/src/main/java/winterly/item/tool/CryomarblePickaxeItem.java deleted file mode 100644 index 7663d93..0000000 --- a/src/main/java/winterly/item/tool/CryomarblePickaxeItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package winterly.item.tool; - -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.ItemStack; -import net.minecraft.item.PickaxeItem; -import net.minecraft.item.ToolMaterial; - -public class CryomarblePickaxeItem extends PickaxeItem { - - public CryomarblePickaxeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) { - super(material, attackDamage, attackSpeed, settings); - } - - @Override - public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { - target.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 60, 0)); - return super.postHit(stack, target, attacker); - } -} diff --git a/src/main/java/winterly/item/tool/CryomarbleShovelItem.java b/src/main/java/winterly/item/tool/CryomarbleShovelItem.java deleted file mode 100644 index a22271b..0000000 --- a/src/main/java/winterly/item/tool/CryomarbleShovelItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package winterly.item.tool; - -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ShovelItem; -import net.minecraft.item.ToolMaterial; - -public class CryomarbleShovelItem extends ShovelItem { - - public CryomarbleShovelItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) { - super(material, attackDamage, attackSpeed, settings); - } - - @Override - public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { - target.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 60, 0)); - return super.postHit(stack, target, attacker); - } -} diff --git a/src/main/java/winterly/item/tool/CryomarbleSwordItem.java b/src/main/java/winterly/item/tool/CryomarbleSwordItem.java deleted file mode 100644 index 397968a..0000000 --- a/src/main/java/winterly/item/tool/CryomarbleSwordItem.java +++ /dev/null @@ -1,21 +0,0 @@ -package winterly.item.tool; - -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.item.ItemStack; -import net.minecraft.item.SwordItem; -import net.minecraft.item.ToolMaterial; - -public class CryomarbleSwordItem extends SwordItem { - - public CryomarbleSwordItem(ToolMaterial toolMaterial, int attackDamage, float attackSpeed, Settings settings) { - super(toolMaterial, attackDamage, attackSpeed, settings); - } - - @Override - public boolean postHit(ItemStack stack, LivingEntity target, LivingEntity attacker) { - target.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 60, 0)); - return super.postHit(stack, target, attacker); - } -} diff --git a/src/main/java/winterly/mixin/client/ArmorRendererMixin.java b/src/main/java/winterly/mixin/client/ArmorRendererMixin.java deleted file mode 100644 index 6bca21f..0000000 --- a/src/main/java/winterly/mixin/client/ArmorRendererMixin.java +++ /dev/null @@ -1,50 +0,0 @@ -package winterly.mixin.client; - -import dev.emi.trinkets.api.SlotReference; -import dev.emi.trinkets.api.TrinketComponent; -import dev.emi.trinkets.api.TrinketsApi; -import net.minecraft.client.render.VertexConsumerProvider; -import net.minecraft.client.render.entity.feature.ArmorFeatureRenderer; -import net.minecraft.client.render.entity.feature.FeatureRenderer; -import net.minecraft.client.render.entity.feature.FeatureRendererContext; -import net.minecraft.client.render.entity.model.BipedEntityModel; -import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Pair; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import winterly.item.SantaHatItem; - -import java.util.Optional; - -@Mixin(ArmorFeatureRenderer.class) -public abstract class ArmorRendererMixin , A extends BipedEntityModel> extends FeatureRenderer { - - public ArmorRendererMixin(FeatureRendererContext context) { - super(context); - } - - @Inject(method = "renderArmor", at = @At("HEAD"), cancellable = true) - void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, T entity, EquipmentSlot armorSlot, int light, A model, CallbackInfo ci) { - if(entity instanceof PlayerEntity player) { - if(armorSlot.equals(EquipmentSlot.HEAD)) { - if(winterly$hasHatOn(player)) ci.cancel(); - } - } - } - - boolean winterly$hasHatOn(PlayerEntity player) { - Optional component = TrinketsApi.getTrinketComponent(player); - if(component.isPresent()) { - for(Pair pair : component.get().getAllEquipped()) { - if(pair.getRight().getItem() instanceof SantaHatItem) return true; - } - } - return false; - } -} diff --git a/src/main/java/winterly/mixin/common/BlockStateMixin.java b/src/main/java/winterly/mixin/common/BlockStateMixin.java deleted file mode 100644 index 70ac29e..0000000 --- a/src/main/java/winterly/mixin/common/BlockStateMixin.java +++ /dev/null @@ -1,58 +0,0 @@ -package winterly.mixin.common; - -import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.MapCodec; -import net.minecraft.block.AbstractBlock; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.state.State; -import net.minecraft.state.property.Property; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.BlockView; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import winterly.block.FrozenFlowerBlock; -import winterly.registry.WinterlyBlocks; - -@Mixin(AbstractBlock.AbstractBlockState.class) -public abstract class BlockStateMixin extends State { - - protected BlockStateMixin(Block owner, ImmutableMap, Comparable> entries, MapCodec codec) { - super(owner, entries, codec); - } - - @Shadow - public abstract boolean isOf(Block block); - - @Shadow - @Final - private float hardness; - - @Inject(method = "getHardness", at = @At("HEAD"), cancellable = true) - void getHardness(BlockView world, BlockPos pos, CallbackInfoReturnable cir) { - if(isOf(WinterlyBlocks.FROZEN_FLOWER)) { - if(get(FrozenFlowerBlock.LAYERS) == 0) { - cir.setReturnValue(0.0F); - } - else { - cir.setReturnValue(hardness); - } - } - } - - @Inject(method = "isToolRequired", at = @At("HEAD"), cancellable = true) - void isToolRequired(CallbackInfoReturnable cir) { - if(isOf(WinterlyBlocks.FROZEN_FLOWER)) { - if(get(FrozenFlowerBlock.LAYERS) == 0) { - cir.setReturnValue(false); - } - else { - cir.setReturnValue(true); - } - } - } -} diff --git a/src/main/java/winterly/mixin/common/FreezeTopLayerMixin.java b/src/main/java/winterly/mixin/common/FreezeTopLayerMixin.java deleted file mode 100644 index 3702564..0000000 --- a/src/main/java/winterly/mixin/common/FreezeTopLayerMixin.java +++ /dev/null @@ -1,54 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.block.*; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.LightType; -import net.minecraft.world.StructureWorldAccess; -import net.minecraft.world.WorldView; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.gen.feature.FreezeTopLayerFeature; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; -import winterly.Winterly; -import winterly.block.FrozenFlowerBlock; -import winterly.registry.WinterlyBlocks; - -@Mixin(FreezeTopLayerFeature.class) -public abstract class FreezeTopLayerMixin { - - @Redirect(method = "generate", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/Biome;canSetSnow(Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;)Z")) - boolean canSetIce(Biome biome, WorldView view, BlockPos pos) { - - if(!biome.doesNotSnow(pos) && (pos.getY() >= view.getBottomY() && pos.getY() < view.getTopY() && view.getLightLevel(LightType.BLOCK, pos) < 10)) { - BlockState state = view.getBlockState(pos); - if(view instanceof StructureWorldAccess world) { - - if (Winterly.config.generateFrozenGrass && (state.isOf(Blocks.SHORT_GRASS) || state.isOf(Blocks.FERN) || state.isOf(Blocks.LARGE_FERN) || state.isOf(Blocks.TALL_GRASS))) { - world.setBlockState(pos, WinterlyBlocks.FROZEN_GRASS.getDefaultState(), 3); - BlockState floor = world.getBlockState(pos.down()); - if (floor.contains(SnowyBlock.SNOWY)) { - world.setBlockState(pos.down(), floor.with(SnowyBlock.SNOWY, Boolean.TRUE), 2); - } - if(state.isOf(Blocks.LARGE_FERN) || state.isOf(Blocks.TALL_GRASS)) { - world.setBlockState(pos.up(), Blocks.AIR.getDefaultState(), 2); - } - return false; - } - else if(Winterly.config.generateFrozenFlowers && (state.getBlock() instanceof FlowerBlock || state.getBlock() instanceof TallFlowerBlock)) { - world.setBlockState(pos, WinterlyBlocks.FROZEN_FLOWER.getDefaultState().with(FrozenFlowerBlock.LAYERS, 1), 3); - BlockState floor = world.getBlockState(pos.down()); - if (floor.contains(SnowyBlock.SNOWY)) { - world.setBlockState(pos.down(), floor.with(SnowyBlock.SNOWY, Boolean.TRUE), 2); - } - if(state.getBlock() instanceof TallFlowerBlock) { - world.setBlockState(pos.up(), Blocks.AIR.getDefaultState(), 2); - } - return false; - } - } - } - - return biome.canSetSnow(view, pos); - } -} diff --git a/src/main/java/winterly/mixin/common/MiningToolItemMixin.java b/src/main/java/winterly/mixin/common/MiningToolItemMixin.java deleted file mode 100644 index b49c1dc..0000000 --- a/src/main/java/winterly/mixin/common/MiningToolItemMixin.java +++ /dev/null @@ -1,56 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.item.ItemStack; -import net.minecraft.item.MiningToolItem; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.TagKey; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import winterly.block.FrozenFlowerBlock; -import winterly.registry.WinterlyBlocks; - -@Mixin(MiningToolItem.class) -public abstract class MiningToolItemMixin { - - @Shadow - @Final - private TagKey effectiveBlocks; - - @Shadow - @Final - protected float miningSpeed; - - @Inject(method = "isSuitableFor", at = @At("HEAD"), cancellable = true) - void isSuitableFor(BlockState state, CallbackInfoReturnable cir) { - if(effectiveBlocks.equals(BlockTags.SHOVEL_MINEABLE)) { - if(state.isOf(WinterlyBlocks.FROZEN_FLOWER)) { - if(state.get(FrozenFlowerBlock.LAYERS) != 0) { - cir.setReturnValue(true); - } - else { - cir.setReturnValue(false); - } - } - } - } - - @Inject(method = "getMiningSpeedMultiplier", at = @At("HEAD"), cancellable = true) - void getMiningSpeedMultiplier(ItemStack stack, BlockState state, CallbackInfoReturnable cir) { - if(effectiveBlocks.equals(BlockTags.SHOVEL_MINEABLE)) { - if(state.isOf(WinterlyBlocks.FROZEN_FLOWER)) { - if(state.get(FrozenFlowerBlock.LAYERS) != 0) { - cir.setReturnValue(miningSpeed); - } - else { - cir.setReturnValue(1.0F); - } - } - } - } -} diff --git a/src/main/java/winterly/mixin/common/ServerWorldMixin.java b/src/main/java/winterly/mixin/common/ServerWorldMixin.java deleted file mode 100644 index a08a788..0000000 --- a/src/main/java/winterly/mixin/common/ServerWorldMixin.java +++ /dev/null @@ -1,42 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.FlowerBlock; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.LightType; -import net.minecraft.world.World; -import net.minecraft.world.WorldView; -import net.minecraft.world.biome.Biome; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; -import winterly.Winterly; -import winterly.block.FrozenFlowerBlock; -import winterly.data.CachedFlowers; -import winterly.registry.WinterlyBlocks; - -@Mixin(ServerWorld.class) -public abstract class ServerWorldMixin { - - @Redirect(method = "tickIceAndSnow", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/Biome;canSetSnow(Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;)Z")) - boolean canSetSnow(Biome biome, WorldView view, BlockPos pos) { - - if(!biome.doesNotSnow(pos) && (pos.getY() >= view.getBottomY() && pos.getY() < view.getTopY() && view.getLightLevel(LightType.BLOCK, pos) < 10)) { - BlockState state = view.getBlockState(pos); - if(view instanceof World world) { - if (state.isOf(Blocks.SHORT_GRASS) && Winterly.config.generateFrozenGrass) { - world.setBlockState(pos, WinterlyBlocks.FROZEN_GRASS.getDefaultState()); - return false; - } - else if(state.getBlock() instanceof FlowerBlock && Winterly.config.generateFrozenFlowers) { - world.setBlockState(pos, WinterlyBlocks.FROZEN_FLOWER.getDefaultState().with(FrozenFlowerBlock.LAYERS, 1)); - CachedFlowers.cacheFlower(((World) view).getRegistryKey(), pos, state.getBlock()); - return false; - } - } - } - return biome.canSetSnow(view, pos); - } -} diff --git a/src/main/java/winterly/mixin/common/SkeletonExtension.java b/src/main/java/winterly/mixin/common/SkeletonExtension.java deleted file mode 100644 index 1648984..0000000 --- a/src/main/java/winterly/mixin/common/SkeletonExtension.java +++ /dev/null @@ -1,77 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.entity.EntityData; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.SpawnReason; -import net.minecraft.entity.data.DataTracker; -import net.minecraft.entity.data.TrackedData; -import net.minecraft.entity.data.TrackedDataHandlerRegistry; -import net.minecraft.entity.mob.AbstractSkeletonEntity; -import net.minecraft.entity.mob.SkeletonEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.world.LocalDifficulty; -import net.minecraft.world.ServerWorldAccess; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import winterly.Winterly; -import winterly.extension.DecoratedMob; -import winterly.util.HolidayUtils; - -@Mixin(SkeletonEntity.class) -public abstract class SkeletonExtension extends AbstractSkeletonEntity implements DecoratedMob { - private static final TrackedData winterly$DECORATED = DataTracker.registerData(SkeletonEntity.class, TrackedDataHandlerRegistry.BOOLEAN); - private static final TrackedData winterly$INDEX = DataTracker.registerData(SkeletonEntity.class, TrackedDataHandlerRegistry.INTEGER); - - protected SkeletonExtension(EntityType entityType, World world) { - super(entityType, world); - } - - @Override - public boolean winterly$decorated() { - return getDataTracker().get(winterly$DECORATED); - } - - @Override - public int winterly$getIndex() { - return getDataTracker().get(winterly$INDEX); - } - - @Inject(method = "initDataTracker", at = @At("TAIL")) - void initData(CallbackInfo ci) { - getDataTracker().startTracking(winterly$DECORATED, false); - getDataTracker().startTracking(winterly$INDEX, 0); - } - - @Inject(method = "writeCustomDataToNbt", at = @At("TAIL")) - void write(NbtCompound nbt, CallbackInfo ci) { - nbt.putBoolean("WinterlyDecorated", getDataTracker().get(winterly$DECORATED)); - nbt.putInt("WinterlyIndex", getDataTracker().get(winterly$INDEX)); - } - - @Inject(method = "readCustomDataFromNbt", at = @At("TAIL")) - void read(NbtCompound nbt, CallbackInfo ci) { - getDataTracker().set(winterly$DECORATED, nbt.getBoolean("WinterlyDecorated")); - getDataTracker().set(winterly$INDEX, nbt.getInt("WinterlyIndex")); - } - - @Override - public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, NbtCompound entityNbt){ - entityData = super.initialize(world, difficulty, spawnReason, entityData, entityNbt); - if(!spawnReason.equals(SpawnReason.SPAWNER) && !spawnReason.equals(SpawnReason.CHUNK_GENERATION)) { - if(Winterly.config.mobDecorations.enabled && HolidayUtils.isWinter() || !Winterly.config.mobDecorations.onlyInWinter) { - if(!this.getWorld().getRegistryKey().equals(World.NETHER)) { - int chance = Winterly.config.mobDecorations.chance; - if(chance > 0 && Math.random() < (double)chance / 100) { - getDataTracker().set(winterly$DECORATED, true); - getDataTracker().set(winterly$INDEX, world.getRandom().nextInt(5)); - } - } - } - } - return entityData; - } - -} diff --git a/src/main/java/winterly/mixin/common/SnowBlockMixin.java b/src/main/java/winterly/mixin/common/SnowBlockMixin.java deleted file mode 100644 index 1167816..0000000 --- a/src/main/java/winterly/mixin/common/SnowBlockMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.FlowerBlock; -import net.minecraft.block.SnowBlock; -import net.minecraft.item.ItemPlacementContext; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import winterly.block.FrozenFlowerBlock; -import winterly.block.FrozenGrassBlock; -import winterly.registry.WinterlyBlocks; - -@Mixin(SnowBlock.class) -public abstract class SnowBlockMixin { - - @Inject(method = "getPlacementState", at = @At("HEAD"), cancellable = true) - void getPlacementState(ItemPlacementContext ctx, CallbackInfoReturnable cir) { - BlockState state = ctx.getWorld().getBlockState(ctx.getBlockPos()); - if(state.isOf(WinterlyBlocks.FROZEN_GRASS)) { - int layers = state.get(SnowBlock.LAYERS); - cir.setReturnValue(state.with(SnowBlock.LAYERS, Math.min(8, layers + 1)).with(FrozenGrassBlock.PERSISTENT, true)); - } - else if(state.isOf(WinterlyBlocks.FROZEN_FLOWER)) { - int layers = state.get(FrozenFlowerBlock.LAYERS); - cir.setReturnValue(state.with(FrozenFlowerBlock.LAYERS, Math.min(8, layers + 1)).with(FrozenGrassBlock.PERSISTENT, true)); - } - else if(state.isOf(Blocks.SHORT_GRASS)) { - cir.setReturnValue(WinterlyBlocks.FROZEN_GRASS.getDefaultState().with(FrozenGrassBlock.PERSISTENT, true)); - } - else if(state.getBlock() instanceof FlowerBlock) { - cir.setReturnValue(WinterlyBlocks.FROZEN_FLOWER.getDefaultState().with(FrozenFlowerBlock.LAYERS, 1).with(FrozenFlowerBlock.PERSISTENT, true)); - } - } -} diff --git a/src/main/java/winterly/mixin/common/SpreadableBlockMixin.java b/src/main/java/winterly/mixin/common/SpreadableBlockMixin.java deleted file mode 100644 index f43ff6b..0000000 --- a/src/main/java/winterly/mixin/common/SpreadableBlockMixin.java +++ /dev/null @@ -1,23 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.block.BlockState; -import net.minecraft.block.SpreadableBlock; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.WorldView; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import winterly.registry.WinterlyBlocks; - -@Mixin(SpreadableBlock.class) -public abstract class SpreadableBlockMixin { - - @Inject(method = "canSurvive", at = @At("HEAD"), cancellable = true) - private static void canSurvive(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable cir) { - BlockState up = world.getBlockState(pos.up()); - if(up.isOf(WinterlyBlocks.FROZEN_GRASS) || up.isOf(WinterlyBlocks.FROZEN_FLOWER)) { - cir.setReturnValue(true); - } - } -} diff --git a/src/main/java/winterly/mixin/common/ZombieExtension.java b/src/main/java/winterly/mixin/common/ZombieExtension.java deleted file mode 100644 index 2e7bda5..0000000 --- a/src/main/java/winterly/mixin/common/ZombieExtension.java +++ /dev/null @@ -1,77 +0,0 @@ -package winterly.mixin.common; - -import net.minecraft.entity.EntityData; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.SpawnReason; -import net.minecraft.entity.data.DataTracker; -import net.minecraft.entity.data.TrackedData; -import net.minecraft.entity.data.TrackedDataHandlerRegistry; -import net.minecraft.entity.mob.HostileEntity; -import net.minecraft.entity.mob.ZombieEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.world.LocalDifficulty; -import net.minecraft.world.ServerWorldAccess; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import winterly.Winterly; -import winterly.extension.DecoratedMob; -import winterly.util.HolidayUtils; - -@Mixin(ZombieEntity.class) -public abstract class ZombieExtension extends HostileEntity implements DecoratedMob { - private static final TrackedData winterly$DECORATED = DataTracker.registerData(ZombieEntity.class, TrackedDataHandlerRegistry.BOOLEAN); - private static final TrackedData winterly$INDEX = DataTracker.registerData(ZombieEntity.class, TrackedDataHandlerRegistry.INTEGER); - - protected ZombieExtension(EntityType entityType, World world) { - super(entityType, world); - } - - @Override - public boolean winterly$decorated() { - return getDataTracker().get(winterly$DECORATED); - } - - @Override - public int winterly$getIndex() { - return getDataTracker().get(winterly$INDEX); - } - - @Inject(method = "initDataTracker", at = @At("TAIL")) - void initData(CallbackInfo ci) { - getDataTracker().startTracking(winterly$DECORATED, false); - getDataTracker().startTracking(winterly$INDEX, 0); - } - - @Inject(method = "writeCustomDataToNbt", at = @At("TAIL")) - void write(NbtCompound nbt, CallbackInfo ci) { - nbt.putBoolean("WinterlyDecorated", getDataTracker().get(winterly$DECORATED)); - nbt.putInt("WinterlyIndex", getDataTracker().get(winterly$INDEX)); - } - - @Inject(method = "readCustomDataFromNbt", at = @At("TAIL")) - void read(NbtCompound nbt, CallbackInfo ci) { - getDataTracker().set(winterly$DECORATED, nbt.getBoolean("WinterlyDecorated")); - getDataTracker().set(winterly$INDEX, nbt.getInt("WinterlyIndex")); - } - - @Inject(method = "initialize", at = @At("RETURN")) - void initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, NbtCompound entityNbt, CallbackInfoReturnable cir) { - if(!spawnReason.equals(SpawnReason.SPAWNER) && !spawnReason.equals(SpawnReason.CHUNK_GENERATION) && !isBaby()) { - if(Winterly.config.mobDecorations.enabled && HolidayUtils.isWinter() || !Winterly.config.mobDecorations.onlyInWinter) { - if(!this.getWorld().getRegistryKey().equals(World.NETHER)) { - int chance = Winterly.config.mobDecorations.chance; - if(chance > 0 && Math.random() < (double)chance / 100) { - getDataTracker().set(winterly$DECORATED, true); - getDataTracker().set(winterly$INDEX, world.getRandom().nextInt(5)); - } - } - - } - } - } - -} diff --git a/src/main/java/winterly/registry/WinterlyBlocks.java b/src/main/java/winterly/registry/WinterlyBlocks.java deleted file mode 100644 index 742ced6..0000000 --- a/src/main/java/winterly/registry/WinterlyBlocks.java +++ /dev/null @@ -1,87 +0,0 @@ -package winterly.registry; - -import net.fabricmc.fabric.api.item.v1.FabricItemSettings; -import net.minecraft.block.*; -import net.minecraft.block.piston.PistonBehavior; -import net.minecraft.item.BlockItem; -import net.minecraft.item.Item; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.Identifier; -import winterly.Winterly; -import winterly.block.*; -import winterly.block.base.BasePaneBlock; -import winterly.block.base.BaseStairsBlock; - -import static net.minecraft.block.Blocks.*; -import static net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings.copyOf; - -import java.util.LinkedHashMap; -import java.util.Map; - -@SuppressWarnings("unused") -public class WinterlyBlocks { - public static final Map ITEMS = new LinkedHashMap<>(); - public static final Map BLOCKS = new LinkedHashMap<>(); - -// public static final Block RED_SOCK = add("red_sock", new SockBlock(copyOf(CANDLE).sounds(BlockSoundGroup.WOOL))); -// public static final Block GREEN_SOCK = add("green_sock", new SockBlock(copyOf(CANDLE).sounds(BlockSoundGroup.WOOL))); -// public static final Block BLUE_SOCK = add("blue_sock", new SockBlock(copyOf(CANDLE).sounds(BlockSoundGroup.WOOL))); - - public static final Block ICICLE = add("icicle", new IcicleBlock(copyOf(ICE).pistonBehavior(PistonBehavior.DESTROY))); - public static final Block ICICLE_BLOCK = add("icicle_block", new TransparentBlock(copyOf(PACKED_ICE).nonOpaque())); - public static final Block PACKED_ICICLE_BLOCK = add("packed_icicle_block", new TransparentBlock(copyOf(PACKED_ICE).nonOpaque())); - public static final Block ICICLE_PANE = add("icicle_pane", new BasePaneBlock(copyOf(PACKED_ICE).nonOpaque())); - public static final Block ICICLE_BARS = add("icicle_bars", new BasePaneBlock(copyOf(ICE).nonOpaque())); - public static final Block CRYOMARBLE_BLOCK = add("cryomarble_block", new Block(copyOf(DIAMOND_BLOCK))); - public static final Block SNOWGUY = add("snowguy", new SnowguyBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - public static final Block SNOWBALL_WALL = add("snowball_wall", new SnowballWallBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW).nonOpaque())); - public static final Block DENSE_SNOW = add("dense_snow", new Block(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - public static final Block DENSE_SNOW_STAIRS = add("dense_snow_stairs", new BaseStairsBlock(SNOW_BLOCK.getDefaultState(), copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - public static final Block DENSE_SNOW_SLAB = add("dense_snow_slab", new SlabBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - - public static final Block SNOW_BRICKS = add("snow_bricks", new Block(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - public static final Block SNOW_BRICK_STAIRS = add("snow_brick_stairs", new BaseStairsBlock(SNOW_BLOCK.getDefaultState(), copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - public static final Block SNOW_BRICK_SLAB = add("snow_brick_slab", new SlabBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.SNOW))); - public static final Block FROZEN_GRASS = add("frozen_grass", new FrozenGrassBlock(copyOf(AbstractBlock.Settings.create().mapColor(MapColor.WHITE).replaceable().notSolid().ticksRandomly().strength(0.1F).requiresTool().sounds(BlockSoundGroup.SNOW).blockVision((state, world, pos) -> state.get(FrozenGrassBlock.LAYERS) >= 8).pistonBehavior(PistonBehavior.DESTROY)))); - public static final Block FROZEN_FLOWER = add("frozen_flower", new FrozenFlowerBlock(copyOf(AbstractBlock.Settings.create().mapColor(MapColor.WHITE).replaceable().notSolid().ticksRandomly().strength(0.1F).requiresTool().sounds(BlockSoundGroup.GRASS).blockVision((state, world, pos) -> state.get(FrozenFlowerBlock.LAYERS) >= 8).pistonBehavior(PistonBehavior.DESTROY)))); - - public static final Block RAW_CRYOMARBLE_SHARD = add("raw_cryomarble_shard", new IcicleBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.GLASS).luminance(12))); - - public static final Block RED_GIFT_BOX = add("red_gift_box", new GiftBoxBlock(copyOf(RED_WOOL).pistonBehavior(PistonBehavior.DESTROY))); - public static final Block ORANGE_GIFT_BOX = add("orange_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block YELLOW_GIFT_BOX = add("yellow_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block GREEN_GIFT_BOX = add("green_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block CYAN_GIFT_BOX = add("cyan_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block BLUE_GIFT_BOX = add("blue_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block PURPLE_GIFT_BOX = add("purple_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block BLACK_GIFT_BOX = add("black_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - public static final Block WHITE_GIFT_BOX = add("white_gift_box", new GiftBoxBlock(copyOf(RED_GIFT_BOX))); - - public static final Block GARLAND_LIGHTS = add("garland_lights", new GarlandLightsBlock(copyOf(GREEN_WOOL).pistonBehavior(PistonBehavior.DESTROY).noCollision().sounds(BlockSoundGroup.CANDLE))); - public static final Block RAINY_GARLAND_LIGHTS = add("rainy_garland_lights", new GarlandLightsBlock(copyOf(WHITE_WOOL).pistonBehavior(PistonBehavior.DESTROY).noCollision().sounds(BlockSoundGroup.CANDLE))); - - private static T add(String name, T block) { - return addBlockItem(name, block, new BlockItem(block, new FabricItemSettings())); - } - - private static T addBlockItem(String name, T block, BlockItem item) { - addBlock(name, block); - if (item != null) { - item.appendBlocks(Item.BLOCK_ITEMS, item); - ITEMS.put(Winterly.id(name), item); - } - return block; - } - - private static T addBlock(String name, T block) { - BLOCKS.put(Winterly.id(name), block); - return block; - } - - public static void init() { - ITEMS.forEach((id, item) -> Registry.register(Registries.ITEM, id, item)); - BLOCKS.forEach((id, block) -> Registry.register(Registries.BLOCK, id, block)); - } -} diff --git a/src/main/java/winterly/registry/WinterlyFeatures.java b/src/main/java/winterly/registry/WinterlyFeatures.java deleted file mode 100644 index 01ad141..0000000 --- a/src/main/java/winterly/registry/WinterlyFeatures.java +++ /dev/null @@ -1,46 +0,0 @@ -package winterly.registry; - -import net.fabricmc.fabric.api.biome.v1.BiomeModifications; -import net.fabricmc.fabric.api.biome.v1.ModificationPhase; -import net.minecraft.registry.*; -import net.minecraft.registry.tag.BiomeTags; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; -import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.feature.*; -import winterly.Winterly; -import winterly.worldgen.CryomarbleFeature; -import winterly.worldgen.UndergroundIcicleFeature; - -import static winterly.Winterly.id; - -public class WinterlyFeatures { - public static final Feature UNDERGROUND_ICICLE_FEATURE = new UndergroundIcicleFeature(); - public static final RegistryKey> UNDERGROUND_ICICLE_CONFIG = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Winterly.id("underground_icicle")); - public static final RegistryKey UNDERGROUND_ICICLE_PLACED = RegistryKey.of(RegistryKeys.PLACED_FEATURE, Winterly.id("underground_icicle")); - - - public static final Feature CRYOMARBLE_FEATURE = new CryomarbleFeature(); - public static final RegistryKey> CRYOMARBLE_CONFIG = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Winterly.id("cryomarble")); - public static final RegistryKey CRYOMARBLE_PLACED = RegistryKey.of(RegistryKeys.PLACED_FEATURE, Winterly.id("cryomarble")); - - public static void init() { - Registry.register(Registries.FEATURE, id("underground_icicle"), UNDERGROUND_ICICLE_FEATURE); - Registry.register(Registries.FEATURE, id("cryomarble"), CRYOMARBLE_FEATURE); - - BiomeModifications.create(Winterly.id("features")) - .add(ModificationPhase.ADDITIONS, ctx -> { - var entry = ctx.getBiomeRegistryEntry(); - var coldTag = TagKey.of(RegistryKeys.BIOME, new Identifier("c", "climate_cold")); - return !entry.isIn(BiomeTags.IS_NETHER) && !entry.isIn(BiomeTags.IS_END) && entry.isIn(coldTag); - }, ctx -> { - ctx.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_DECORATION, UNDERGROUND_ICICLE_PLACED); - }) - .add(ModificationPhase.ADDITIONS, ctx -> { - var entry = ctx.getBiomeRegistryEntry(); - return !entry.isIn(BiomeTags.IS_NETHER) && !entry.isIn(BiomeTags.IS_END); - }, ctx -> { - ctx.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_DECORATION, CRYOMARBLE_PLACED); - }); - } -} diff --git a/src/main/java/winterly/registry/WinterlyItems.java b/src/main/java/winterly/registry/WinterlyItems.java deleted file mode 100644 index 55393f9..0000000 --- a/src/main/java/winterly/registry/WinterlyItems.java +++ /dev/null @@ -1,63 +0,0 @@ -package winterly.registry; - -import net.fabricmc.fabric.api.item.v1.FabricItemSettings; -import net.minecraft.item.*; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.util.Identifier; -import winterly.Winterly; -import winterly.item.SantaHatItem; -import winterly.item.ScarfItem; -import winterly.item.tool.*; - -import java.util.LinkedHashMap; -import java.util.Map; - -@SuppressWarnings("unused") -public class WinterlyItems { - public static final Map ITEMS = new LinkedHashMap<>(); - -// public static final Item GINGERBREAD_MAN = add("gingerbread_man", new Item(settings().food(new FoodComponent.Builder().hunger(3).saturationModifier(0.5F).build()))); -// public static final Item EDIBLE_SNOW = add("edible_snow", new Item(settings().food(new FoodComponent.Builder().hunger(1).saturationModifier(0.1F).statusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 120, 0), 0.5F).statusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 120, 1), 0.5F).build()))); -// public static final Item PISS_SNOW = add("yellow_snow", new Item(settings().food(new FoodComponent.Builder().hunger(1).saturationModifier(0F).statusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 200, 0), 0.9F).statusEffect(new StatusEffectInstance(StatusEffects.POISON, 80, 1), 0.8F).build()))); - public static final Item RED_CANDY_CANE = add("red_candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); - public static final Item GREEN_CANDY_CANE = add("green_candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); - public static final Item BLUE_CANDY_CANE = add("blue_candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); -// public static final Item YELLOW_CANDY_CANE = add("yellow_candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); -// public static final Item CANDY_CANE = add("candy_cane", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.1F).snack().build()))); -// public static final Item MULLED_WINE = add("mulled_wine", new Item(settings().food(new FoodComponent.Builder().hunger(4).saturationModifier(0.2F).build()))); -// public static final Item EGGNOG = add("eggnog", new Item(settings().food(new FoodComponent.Builder().hunger(2).saturationModifier(0.4F).statusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 200, 0), 0.2F).build()))); -// public static final Item COCOA = add("cocoa", new Item(settings().food(new FoodComponent.Builder().hunger(4).saturationModifier(0.5F).build()))); -// public static final Item KIDS_CHAMPAGNE = add("kids_champagne", new Item(settings().food(new FoodComponent.Builder().hunger(10).saturationModifier(0.1F).statusEffect(new StatusEffectInstance(StatusEffects.REGENERATION, 100, 0), 0.3F).statusEffect(new StatusEffectInstance(StatusEffects.ABSORPTION, 400, 0), 0.3F).statusEffect(new StatusEffectInstance(StatusEffects.INSTANT_HEALTH, 0, 0), 0.3F).build()))); - - public static final Item CRYOMARBLE_SHARD = add("cryomarble_shard", new Item(settings())); - public static final Item CRYOMARBLE = add("cryomarble", new Item(settings())); - - public static final Item CRYOMARBLE_SWORD = add("cryomarble_sword", new CryomarbleSwordItem(ToolMaterials.DIAMOND, 3, -2.4F, settings())); - public static final Item CRYOMARBLE_SHOVEL = add("cryomarble_shovel", new CryomarbleShovelItem(ToolMaterials.DIAMOND, 1.5F, -3.0F, settings())); - public static final Item CRYOMARBLE_PICKAXE = add("cryomarble_pickaxe", new CryomarblePickaxeItem(ToolMaterials.DIAMOND, 1, -2.8F, settings())); - public static final Item CRYOMARBLE_AXE = add("cryomarble_axe", new CryomarbleAxeItem(ToolMaterials.DIAMOND, 5.0F, -3.0F, settings())); - public static final Item CRYOMARBLE_HOE = add("cryomarble_hoe", new CryomarbleHoeItem(ToolMaterials.DIAMOND, -3, 0.0F, settings())); - - public static final Item RED_SANTA_HAT = add("red_santa_hat", new SantaHatItem(settings(), "red")); - public static final Item BLUE_SANTA_HAT = add("blue_santa_hat", new SantaHatItem(settings(), "blue")); - - public static final Item WHITE_SCARF = add("white_scarf", new ScarfItem(settings(), "white")); - public static final Item RED_SCARF = add("red_scarf", new ScarfItem(settings(), "red")); - public static final Item GREEN_SCARF = add("green_scarf", new ScarfItem(settings(), "green")); - public static final Item BLUE_SCARF = add("blue_scarf", new ScarfItem(settings(), "blue")); - public static final Item RAINBOW_SCARF = add("rainbow_scarf", new ScarfItem(settings(), "rainbow")); - - private static T add(String name, T item) { - ITEMS.put(Winterly.id(name), item); - return item; - } - - private static FabricItemSettings settings() { - return new FabricItemSettings(); - } - - public static void init() { - ITEMS.forEach((id, item) -> Registry.register(Registries.ITEM, id, item)); - } -} diff --git a/src/main/java/winterly/util/HolidayUtils.java b/src/main/java/winterly/util/HolidayUtils.java deleted file mode 100644 index 1cda423..0000000 --- a/src/main/java/winterly/util/HolidayUtils.java +++ /dev/null @@ -1,13 +0,0 @@ -package winterly.util; - -import java.time.LocalDate; -import java.time.temporal.ChronoField; - -public final class HolidayUtils { - - public static boolean isWinter() { - LocalDate date = LocalDate.now(); - int month = date.get(ChronoField.MONTH_OF_YEAR); - return month == 12 || month == 1 || month == 2; - } -} diff --git a/src/main/java/winterly/worldgen/CryomarbleFeature.java b/src/main/java/winterly/worldgen/CryomarbleFeature.java deleted file mode 100644 index d2b4248..0000000 --- a/src/main/java/winterly/worldgen/CryomarbleFeature.java +++ /dev/null @@ -1,57 +0,0 @@ -package winterly.worldgen; - -import net.minecraft.block.Block; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.StructureWorldAccess; -import net.minecraft.world.gen.feature.DefaultFeatureConfig; -import net.minecraft.world.gen.feature.Feature; -import net.minecraft.world.gen.feature.util.FeatureContext; -import winterly.Winterly; -import winterly.block.IcicleBlock; -import winterly.registry.WinterlyBlocks; - -public class CryomarbleFeature extends Feature { - - public CryomarbleFeature() { - super(DefaultFeatureConfig.CODEC); - } - - @Override - public boolean generate(FeatureContext context) { - if(!Winterly.config.generateCryomarble) return false; - StructureWorldAccess world = context.getWorld(); - BlockPos origin = context.getOrigin(); - - for(int i = -20; i < 20; i++) { - BlockPos newOrigin = new BlockPos(origin.getX(), i, origin.getZ()); - if(world.getBlockState(newOrigin).isAir()) { - origin = newOrigin; - break; - } - } - if(context.getRandom().nextInt(16) != 0) return false; - - int spawned = 0; - - for(int x = -3; x < 3; x++) { - for(int z = -3; z < 3; z++) { - for(int y = -3; y < 3; y++) { - int xPos = origin.getX() + x; - int zPos = origin.getZ() + z; - int yPos = origin.getY() + y; - BlockPos pos = new BlockPos(xPos, yPos, zPos); - if(context.getRandom().nextInt(Math.abs(x) + Math.abs(y) + Math.abs(z) + 1) == 0) { - if(world.isAir(pos) && isStone(world.getBlockState(pos.down()))) { - if(spawned < 3) { - world.setBlockState(pos, WinterlyBlocks.RAW_CRYOMARBLE_SHARD.getDefaultState().with(IcicleBlock.FACING, Direction.UP), Block.NOTIFY_ALL); - spawned++; - }else return true; - } - } - } - } - } - return true; - } -} diff --git a/src/main/java/winterly/worldgen/UndergroundIcicleFeature.java b/src/main/java/winterly/worldgen/UndergroundIcicleFeature.java deleted file mode 100644 index 5ef76ed..0000000 --- a/src/main/java/winterly/worldgen/UndergroundIcicleFeature.java +++ /dev/null @@ -1,45 +0,0 @@ -package winterly.worldgen; - -import net.minecraft.block.Block; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.StructureWorldAccess; -import net.minecraft.world.gen.feature.DefaultFeatureConfig; -import net.minecraft.world.gen.feature.Feature; -import net.minecraft.world.gen.feature.util.FeatureContext; -import winterly.Winterly; -import winterly.registry.WinterlyBlocks; - -public class UndergroundIcicleFeature extends Feature { - - public UndergroundIcicleFeature() { - super(DefaultFeatureConfig.CODEC); - } - - @Override - public boolean generate(FeatureContext context) { - if(!Winterly.config.generateUndergroundIcicles) return false; - boolean generated = false; - int randomY = context.getRandom().nextInt(100) - 50; - - for (int x = 0; x < 10; x++) { - for (int z = 0; z < 10; z++) { - for (int y = 0; y < 10; y++) { - int xPos = context.getOrigin().getX() + x; - int zPos = context.getOrigin().getZ() + z; - int yPos = randomY + y; - BlockPos pos = new BlockPos(xPos, yPos, zPos); - StructureWorldAccess world = context.getWorld(); - if(context.getRandom().nextInt(4) == 0) { - if(world.isAir(pos)) { - if(isStone(world.getBlockState(pos.up()))) { - world.setBlockState(pos, WinterlyBlocks.ICICLE.getDefaultState(), Block.NOTIFY_ALL); - generated = true; - } - } - } - } - } - } - return generated; - } -} diff --git a/src/main/resources/winterly.accesswidener b/src/main/resources/winterly.accesswidener deleted file mode 100644 index 166a9b0..0000000 --- a/src/main/resources/winterly.accesswidener +++ /dev/null @@ -1,2 +0,0 @@ -accessWidener v1 named -accessible method net/minecraft/world/biome/Biome getTemperature (Lnet/minecraft/util/math/BlockPos;)F