diff --git a/build.gradle b/build.gradle index 0df9479..e868f52 100644 --- a/build.gradle +++ b/build.gradle @@ -83,7 +83,7 @@ dependencies { include(modApi("de.siphalor.tweed4:tweed4-annotated-$project.minecraft_version_major")) include(modApi("de.siphalor.tweed4:tweed4-data-$project.minecraft_version_major")) include(modApi("de.siphalor.tweed4:tweed4-data-hjson-$project.minecraft_version_major")) - include(modApi("de.siphalor.tweed4:tweed4-tailor-cloth-$project.minecraft_version_major")) + //include(modApi("de.siphalor.tweed4:tweed4-tailor-cloth-$project.minecraft_version_major")) include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$project.minecraft_version_major")) @@ -102,10 +102,9 @@ configurations.include.dependencies.each { } processResources { - inputs.property "version", project.version filesMatching("fabric.mod.json") { - expand "version": project.version + expand(project.properties) } } @@ -134,6 +133,7 @@ import com.modrinth.minotaur.dependencies.ModDependency modrinth { projectId = 'QXA901PE' // The ID of your Modrinth project. Slugs will not work. uploadFile = remapJar // Tells Minotaur to use the remapped jar + versionType = "beta" dependencies = [ new ModDependency('P7dR8mSH', 'required'), //required dependency on Fabric API new ModDependency('zJpHMkdD', 'required') //required dependency on Immersive Portals diff --git a/gradle.properties b/gradle.properties index 047f928..604ad7e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,20 +4,21 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.19.4 -minecraft_version_major=1.19 -yarn_mappings=1.19.4+build.2 -loader_version=0.14.19 +minecraft_version=1.20 +yarn_mappings=1.20+build.1 +loader_version=0.14.21 +minecraft_version_major=1.20 # Mod Properties -mod_version=1.0.0 +mod_version=0.9.1 maven_group=quimufu.colourful-portals archives_base_name=colourful-portals # Dependencies -fabric_version=0.81.1+1.19.4 -cardinal_components_version=5.1.0 -immersive_portals_version=v2.6.9-mc1.19.4 -tweed_version=1.3.0+mc1.19.4 +fabric_version=0.83.0+1.20 +cardinal_components_version=5.2.1 +immersive_portals_version_short=3.0.1 +immersive_portals_version=v3.0.1-mc1.20 +tweed_version=1.3.0+mc1.20-pre1 sodium_version=0.4.10 -cloth_config_version=10.0.96 \ No newline at end of file +cloth_config_version=11.0.99 \ No newline at end of file diff --git a/src/main/java/quimufu/colourful_portals/ColourfulPortalsMod.java b/src/main/java/quimufu/colourful_portals/ColourfulPortalsMod.java index de4ed30..a4d435e 100644 --- a/src/main/java/quimufu/colourful_portals/ColourfulPortalsMod.java +++ b/src/main/java/quimufu/colourful_portals/ColourfulPortalsMod.java @@ -4,33 +4,26 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandlerRegistry; -import net.fabricmc.fabric.api.event.player.AttackBlockCallback; import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries; import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.minecraft.block.BlockState; -import net.minecraft.block.Material; +import net.minecraft.block.enums.Instrument; import net.minecraft.client.render.RenderLayer; import net.minecraft.entity.EntityType; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.*; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Hand; +import net.minecraft.sound.BlockSoundGroup; import net.minecraft.util.Identifier; import net.minecraft.util.Rarity; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -import net.minecraft.world.World; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import quimufu.colourful_portals.client.PortalFluidRenderHandler; import quimufu.colourful_portals.config.ColourfulPortalConfig; -import quimufu.colourful_portals.portal.PortalManager; import quimufu.colourful_portals.portal_fluid.PortalFluid; import quimufu.colourful_portals.portal_fluid.PortalFluidBlock; import quimufu.colourful_portals.portal_fluid.PortalFluidBucketItem; @@ -43,12 +36,12 @@ public class ColourfulPortalsMod implements ModInitializer, ClientModInitializer public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); public static final HashSet PORTAL_BLOCKS = new HashSet<>(); - public static final PortalBlock PORTAL_BLOCK = new PortalBlock(FabricBlockSettings.of(Material.GLASS).strength(-1.0f, 3600000.8f).dropsNothing().nonOpaque().luminance(15).allowsSpawning(ColourfulPortalsMod::never).solidBlock(ColourfulPortalsMod::never).suffocates(ColourfulPortalsMod::never).blockVision(ColourfulPortalsMod::never).ticksRandomly()); + public static final PortalBlock PORTAL_BLOCK = new PortalBlock(FabricBlockSettings.create().instrument(Instrument.HAT).sounds(BlockSoundGroup.GLASS).strength(-1.0f, 3600000.8f).dropsNothing().nonOpaque().luminance(15).allowsSpawning(ColourfulPortalsMod::never).solidBlock(ColourfulPortalsMod::never).suffocates(ColourfulPortalsMod::never).blockVision(ColourfulPortalsMod::never).ticksRandomly()); public static final BlockItem PORTAL_BLOCK_ITEM = new BlockItem(PORTAL_BLOCK, new FabricItemSettings().rarity(Rarity.EPIC)); public static final Item BLOB_DARK = new Item(new FabricItemSettings()); public static final Item BLOB_BRIGHT = new Item(new FabricItemSettings()); public static final PortalFluid PORTAL_FLUID = new PortalFluid(); - public static final PortalFluidBlock PORTAL_FLUID_BLOCk = new PortalFluidBlock(PORTAL_FLUID, FabricBlockSettings.of(Material.WATER).luminance(15).noCollision().strength(100.0f).dropsNothing()); + public static final PortalFluidBlock PORTAL_FLUID_BLOCk = new PortalFluidBlock(PORTAL_FLUID, FabricBlockSettings.create().sounds(BlockSoundGroup.field_44608).luminance(15).noCollision().strength(100.0f).dropsNothing()); public static final BucketItem PORTAL_FLUID_BUCKET_ITEM = new PortalFluidBucketItem(PORTAL_FLUID, new FabricItemSettings().recipeRemainder(Items.BUCKET).maxCount(1).rarity(Rarity.RARE)); private static boolean never(BlockState blockState, BlockView blockView, BlockPos blockPos, EntityType entityType) { diff --git a/src/main/java/quimufu/colourful_portals/PortalBlock.java b/src/main/java/quimufu/colourful_portals/PortalBlock.java index 2ec0d11..36e21c6 100644 --- a/src/main/java/quimufu/colourful_portals/PortalBlock.java +++ b/src/main/java/quimufu/colourful_portals/PortalBlock.java @@ -26,31 +26,31 @@ import quimufu.colourful_portals.portal.PortalManager; public class PortalBlock extends Block implements FluidFillable { public static final EnumProperty AXIS = Properties.AXIS; - public static final EnumProperty DYE_COLOR = EnumProperty.of("colour", DyeColor.class);; + public static final EnumProperty DYE_COLOR = EnumProperty.of("colour", DyeColor.class); public static final VoxelShape X_AABB = Block.createCuboidShape( - 7.0D, - 0.0D, - 0.0D, - 9.0D, - 16.0D, - 16.0D + 7.0D, + 0.0D, + 0.0D, + 9.0D, + 16.0D, + 16.0D ); public static final VoxelShape Y_AABB = Block.createCuboidShape( - 0.0D, - 7.0D, - 0.0D, - 16.0D, - 9.0D, - 16.0D + 0.0D, + 7.0D, + 0.0D, + 16.0D, + 9.0D, + 16.0D ); public static final VoxelShape Z_AABB = Block.createCuboidShape( - 0.0D, - 0.0D, - 7.0D, - 16.0D, - 16.0D, - 9.0D + 0.0D, + 0.0D, + 7.0D, + 16.0D, + 16.0D, + 9.0D ); public PortalBlock(Settings settings) { @@ -59,12 +59,10 @@ public class PortalBlock extends Block implements FluidFillable { } @Override - public VoxelShape getOutlineShape( - BlockState state, BlockView world, BlockPos blockPos, ShapeContext shapeContext - ) { - if(shapeContext.isHolding(Items.DEBUG_STICK) + public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos blockPos, ShapeContext shapeContext) { + if (shapeContext.isHolding(Items.DEBUG_STICK) || shapeContext.isHolding(ColourfulPortalsMod.PORTAL_BLOCK_ITEM) - || shapeContext.isHolding(ColourfulPortalsMod.PORTAL_FLUID_BUCKET_ITEM)){ + || shapeContext.isHolding(ColourfulPortalsMod.PORTAL_FLUID_BUCKET_ITEM)) { return switch (state.get(AXIS)) { case Z -> Z_AABB; case Y -> Y_AABB; @@ -122,7 +120,7 @@ public class PortalBlock extends Block implements FluidFillable { @Override public boolean canFillWithFluid(BlockView world, BlockPos pos, BlockState state, Fluid fluid) { - if(((World)world).isClient() && fluid == ColourfulPortalsMod.PORTAL_FLUID){ + if (((World) world).isClient() && fluid == ColourfulPortalsMod.PORTAL_FLUID) { return true; } return fluid == ColourfulPortalsMod.PORTAL_FLUID @@ -132,7 +130,7 @@ public class PortalBlock extends Block implements FluidFillable { @Override public boolean tryFillWithFluid(WorldAccess world, BlockPos pos, BlockState state, FluidState fluidState) { - if(((World)world).isClient() && fluidState.isOf(ColourfulPortalsMod.PORTAL_FLUID)){ + if (world.isClient() && fluidState.isOf(ColourfulPortalsMod.PORTAL_FLUID)) { return true; } return fluidState.isOf(ColourfulPortalsMod.PORTAL_FLUID) diff --git a/src/main/java/quimufu/colourful_portals/config/ColourfulPortalConfig.java b/src/main/java/quimufu/colourful_portals/config/ColourfulPortalConfig.java index fa7df6e..5157703 100644 --- a/src/main/java/quimufu/colourful_portals/config/ColourfulPortalConfig.java +++ b/src/main/java/quimufu/colourful_portals/config/ColourfulPortalConfig.java @@ -6,14 +6,14 @@ import de.siphalor.tweed4.annotated.AConfigEntry; import de.siphalor.tweed4.annotated.ATweedConfig; import de.siphalor.tweed4.config.ConfigEnvironment; import de.siphalor.tweed4.config.ConfigScope; -import de.siphalor.tweed4.tailor.cloth.ClothData; +//import de.siphalor.tweed4.tailor.cloth.ClothData; import net.minecraft.util.DyeColor; import quimufu.colourful_portals.ColourfulPortalsMod; import java.util.Map; @ATweedConfig(serializer = "tweed4:hjson", scope = ConfigScope.GAME, environment = ConfigEnvironment.SERVER, tailors = {"tweed4:lang_json_descriptions", "tweed4:coat", "tweed4:json_schema"}, casing = CaseFormat.LOWER_HYPHEN) -@ClothData(modid = ColourfulPortalsMod.MOD_ID) +//@ClothData(modid = ColourfulPortalsMod.MOD_ID) public class ColourfulPortalConfig { @AConfigEntry(comment = diff --git a/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBlock.java b/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBlock.java index a286423..deff532 100644 --- a/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBlock.java +++ b/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBlock.java @@ -7,6 +7,7 @@ import net.minecraft.fluid.FluidState; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.loot.context.LootContext; +import net.minecraft.loot.context.LootContextParameterSet; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; import net.minecraft.state.StateManager; @@ -90,7 +91,7 @@ public class PortalFluidBlock } @Override - public List getDroppedStacks(BlockState state, LootContext.Builder builder) { + public List getDroppedStacks(BlockState state, LootContextParameterSet.Builder builder) { return Collections.emptyList(); } diff --git a/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBucketItem.java b/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBucketItem.java index 9668f37..a655df0 100644 --- a/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBucketItem.java +++ b/src/main/java/quimufu/colourful_portals/portal_fluid/PortalFluidBucketItem.java @@ -3,7 +3,6 @@ package quimufu.colourful_portals.portal_fluid; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.FluidFillable; -import net.minecraft.block.Material; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BucketItem; import net.minecraft.item.ItemStack; @@ -62,7 +61,6 @@ public class PortalFluidBucketItem extends BucketItem { public boolean placeFluid(PlayerEntity player, World world, BlockPos pos, BlockHitResult hitResult) { BlockState blockState = world.getBlockState(pos); Block block = blockState.getBlock(); - Material material = blockState.getMaterial(); boolean shouldTryPlace = blockState.isAir() || blockState.canBucketPlace(this.fluid) || block instanceof FluidFillable && ((FluidFillable) block).canFillWithFluid(world, pos, blockState, this.fluid); @@ -83,7 +81,7 @@ public class PortalFluidBucketItem extends BucketItem { } - if (!world.isClient && blockState.canBucketPlace(this.fluid) && !material.isLiquid()) { + if (!world.isClient && blockState.canBucketPlace(this.fluid) && !blockState.isLiquid()) { world.breakBlock(pos, true); } if (world.setBlockState(pos, this.fluid.getDefaultState().getBlockState(), Block.NOTIFY_ALL | Block.REDRAW_ON_MAIN_THREAD) || blockState.getFluidState().isStill()) { diff --git a/src/main/resources/colourful_portals.mixins.json b/src/main/resources/colourful_portals.mixins.json index ea48216..60bdcd6 100644 --- a/src/main/resources/colourful_portals.mixins.json +++ b/src/main/resources/colourful_portals.mixins.json @@ -11,6 +11,7 @@ "plugin": "quimufu.colourful_portals.MixinConfig", "client": [ "InterpolationMixin", - "SodiumFluidRendererMixin" + "SodiumFluidRendererMixin", + "FrontClippingMixin" ] } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index bc52c7e..4dcf57c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -41,14 +41,11 @@ "colourful_portals.mixins.json" ], "depends": { - "fabricloader": ">=0.14.19", - "imm_ptl_core": ">=2.6.9", - "q_misc_util": ">=2.6.9", - "minecraft": "~1.19.4", + "fabricloader": ">=${loader_version}", + "imm_ptl_core": ">=${immersive_portals_version_short}", + "q_misc_util": ">=${immersive_portals_version_short}", + "minecraft": "~${minecraft_version}", "java": ">=17", "fabric-api": "*" - }, - "suggests": { - "another-mod": "*" } } \ No newline at end of file