diff --git a/.github/workflows/build-on-pr.yml b/.github/workflows/build-on-pr.yml
index 3647d0d7..ad69a4b3 100644
--- a/.github/workflows/build-on-pr.yml
+++ b/.github/workflows/build-on-pr.yml
@@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v7
- name: Set up JDK
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: microsoft
java-version: 25
@@ -21,7 +21,7 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: "Compiled artifacts for Pull Request #${{github.event.number}}"
path: build/libs
diff --git a/.github/workflows/devbuild.yml b/.github/workflows/devbuild.yml
index e6cfebab..02ef2622 100644
--- a/.github/workflows/devbuild.yml
+++ b/.github/workflows/devbuild.yml
@@ -7,13 +7,12 @@ on: [push]
jobs:
Build:
-
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v7
- name: Set up JDK
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: microsoft
java-version: 25
@@ -22,7 +21,7 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- - uses: actions/upload-artifact@v4
+ - uses: actions/upload-artifact@v7
with:
name: Compiled artifacts for ${{ github.sha }}
path: build/libs
diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml
index bc01cc31..462d84ab 100644
--- a/.github/workflows/publish-release.yml
+++ b/.github/workflows/publish-release.yml
@@ -16,7 +16,7 @@ jobs:
extra-branch-curse-version: ${{ steps.properties.outputs.release-extra-curse-version }}
steps:
- name: Checkout the sources
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
- name: Determine release type
id: type
run: |
@@ -41,7 +41,7 @@ jobs:
if ! ${{ steps.properties.outputs.release-extra-branch }}; then
echo "matrix-to-exclude=Snapshots" >> $GITHUB_OUTPUT
fi
- - uses: actions/github-script@v7
+ - uses: actions/github-script@v9
env:
READ_VERSION: ${{ steps.properties.outputs.mod_version }}
with:
@@ -78,11 +78,11 @@ jobs:
echo "curse-versions=${{ needs.Get-Properties.outputs.curse-versions }}" >> $GITHUB_OUTPUT
fi
- name: Checkout the sources
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
with:
ref: ${{ steps.getbranchinfo.outputs.branchname }}
- name: Set up JDK
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: microsoft
java-version: 25
@@ -97,7 +97,7 @@ jobs:
output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
echo "jarname=$output" >> $GITHUB_OUTPUT
- name: Save build artifacts in the action
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v7
with:
name: Artifacts for ${{ matrix.branch }}
path: build/libs
@@ -125,7 +125,7 @@ jobs:
- name: Ask Gradle to publish
run: ./gradlew publish
- name: Save publish folder in action's artifacts # Remove when automated
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v7
with:
name: Maven publishing artifacts for ${{ matrix.branch }}
path: publish/carpet/fabric-carpet/
@@ -149,7 +149,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the sources
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
with:
ref: master
- name: Merge docs
@@ -166,15 +166,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Carpet sources
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
- name: Set up JDK
- uses: actions/setup-java@v4
+ uses: actions/setup-java@v5
with:
distribution: microsoft
java-version: 25
cache: 'gradle'
- name: Checkout wiki
- uses: actions/checkout@v4
+ uses: actions/checkout@v7
with:
repository: ${{github.repository}}.wiki
path: wiki
diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md
index 7f0cf592..b8f807a7 100644
--- a/docs/scarpet/Full.md
+++ b/docs/scarpet/Full.md
@@ -2869,7 +2869,7 @@ On top of that, scarpet provides the following list of noises sampled directly f
`'barrier_noise'`, `'fluid_level_floodedness_noise'`, `'fluid_level_spread_noise'`, `'lava_noise'`,
`'temperature'`, `'vegetation'`, `'continents'`, `'erosion'`, `'depth'`, `'ridges'`,
-`'preliminary_surface_level'`, `'final_density'`, `'vein_toggle'`, `'vein_ridged'` and `'vein_gap'`
+`'preliminary_surface_level'`, `'final_density'`
// requesting single value
@@ -2966,7 +2966,7 @@ with minecraft 1.16.1 and below or 1.16.2 and above since in 1.16.2 Mojang has a
meaning that since 1.16.2 - they have official names that can be used by datapacks and scarpet. If you have most recent
scarpet on 1.16.4, you can use `plop()` to get all available worldgen features including custom features and structures
controlled by datapacks. It returns a map of lists in the following categories:
-`'scarpet_custom'`, `'configured_features'`, `'structures'`, `'features'`, `'structure_types'`
+`'scarpet_custom'`, `'features'`, `'structures'`, `'feature_types'`, `'structure_types'`
### Previous Structure Names, including variants (for MC1.16.1 and below only)
* `'monument'`: Ocean Monument. Generates at fixed Y coordinate, surrounds itself with water.
@@ -3065,7 +3065,7 @@ controlled by datapacks. It returns a map of lists in the following categories:
### World Generation Features and Structures (as of MC1.16.2+)
-Use `plop():'structure_types'`, `plop():'structures'`, `plop():'features'`, and `plop():'configured_features'` for a list of available options. Your output may vary based on
+Use `plop():'structure_types'`, `plop():'structures'`, `plop():'features'`, and `plop():'feature_types'` for a list of available options. Your output may vary based on
datapacks installed in your world.
### Custom Scarpet Features
diff --git a/docs/scarpet/api/BlocksAndWorldAccess.md b/docs/scarpet/api/BlocksAndWorldAccess.md
index a4555608..ff14f56d 100644
--- a/docs/scarpet/api/BlocksAndWorldAccess.md
+++ b/docs/scarpet/api/BlocksAndWorldAccess.md
@@ -540,7 +540,7 @@ On top of that, scarpet provides the following list of noises sampled directly f
`'barrier_noise'`, `'fluid_level_floodedness_noise'`, `'fluid_level_spread_noise'`, `'lava_noise'`,
`'temperature'`, `'vegetation'`, `'continents'`, `'erosion'`, `'depth'`, `'ridges'`,
-`'preliminary_surface_level'`, `'final_density'`, `'vein_toggle'`, `'vein_ridged'` and `'vein_gap'`
+`'preliminary_surface_level'`, `'final_density'`
// requesting single value
@@ -637,7 +637,7 @@ with minecraft 1.16.1 and below or 1.16.2 and above since in 1.16.2 Mojang has a
meaning that since 1.16.2 - they have official names that can be used by datapacks and scarpet. If you have most recent
scarpet on 1.16.4, you can use `plop()` to get all available worldgen features including custom features and structures
controlled by datapacks. It returns a map of lists in the following categories:
-`'scarpet_custom'`, `'configured_features'`, `'structures'`, `'features'`, `'structure_types'`
+`'scarpet_custom'`, `'features'`, `'structures'`, `'feature_types'`, `'structure_types'`
### Previous Structure Names, including variants (for MC1.16.1 and below only)
* `'monument'`: Ocean Monument. Generates at fixed Y coordinate, surrounds itself with water.
@@ -736,7 +736,7 @@ controlled by datapacks. It returns a map of lists in the following categories:
### World Generation Features and Structures (as of MC1.16.2+)
-Use `plop():'structure_types'`, `plop():'structures'`, `plop():'features'`, and `plop():'configured_features'` for a list of available options. Your output may vary based on
+Use `plop():'structure_types'`, `plop():'structures'`, `plop():'features'`, and `plop():'feature_types'` for a list of available options. Your output may vary based on
datapacks installed in your world.
### Custom Scarpet Features
diff --git a/gradle.properties b/gradle.properties
index e61fd155..42795fed 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,12 +7,12 @@ org.gradle.configuration-cache=false
# Fabric Properties
# check https://fabricmc.net/develop/
- minecraft_version=26.2
+ minecraft_version=26.3-snapshot-9
loader_version=0.19.3
- loom_version=1.15-SNAPSHOT
+ loom_version=1.17-SNAPSHOT
# Mod Properties
- mod_version = 26.2
+ mod_version = 26.3-beta-3
maven_group = carpet
archives_base_name = fabric-carpet
@@ -20,7 +20,7 @@ org.gradle.configuration-cache=false
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5)
# This is needed because CF uses too vague names for prereleases and release candidates
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
- release-curse-versions = Minecraft 26:26.2
+ release-curse-versions = Minecraft 26.3:26.3-Snapshot
# Whether or not to build another branch on release
release-extra-branch = false
# The name of the second branch to release
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 23449a2b..5dd3c012 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/src/main/java/carpet/fakes/CoralFeatureInterface.java b/src/main/java/carpet/fakes/CoralFeatureInterface.java
deleted file mode 100644
index 915d09b3..00000000
--- a/src/main/java/carpet/fakes/CoralFeatureInterface.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package carpet.fakes;
-
-import java.util.Random;
-import net.minecraft.core.BlockPos;
-import net.minecraft.util.RandomSource;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.block.state.BlockState;
-
-public interface CoralFeatureInterface
-{
- boolean growSpecific(Level worldIn, RandomSource random, BlockPos pos, BlockState blockUnder);
-}
diff --git a/src/main/java/carpet/fakes/RandomStateVisitorAccessor.java b/src/main/java/carpet/fakes/RandomStateVisitorAccessor.java
index d423bb52..261f856f 100644
--- a/src/main/java/carpet/fakes/RandomStateVisitorAccessor.java
+++ b/src/main/java/carpet/fakes/RandomStateVisitorAccessor.java
@@ -1,6 +1,6 @@
package carpet.fakes;
-import net.minecraft.world.level.levelgen.DensityFunction;
+import net.minecraft.world.level.levelgen.densityfunction.DensityFunction;
public interface RandomStateVisitorAccessor {
DensityFunction.Visitor getVisitor();
diff --git a/src/main/java/carpet/helpers/EntityPlayerActionPack.java b/src/main/java/carpet/helpers/EntityPlayerActionPack.java
index 599a9318..891dc7be 100644
--- a/src/main/java/carpet/helpers/EntityPlayerActionPack.java
+++ b/src/main/java/carpet/helpers/EntityPlayerActionPack.java
@@ -16,15 +16,18 @@ import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.Mth;
+import net.minecraft.util.Prediction;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.animal.equine.AbstractHorse;
+import net.minecraft.world.entity.animal.equine.SkeletonHorse;
import net.minecraft.world.entity.decoration.ItemFrame;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.vehicle.boat.Boat;
import net.minecraft.world.entity.vehicle.minecart.Minecart;
import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.component.SwingAnimation;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
@@ -260,7 +263,7 @@ public class EntityPlayerActionPack
if (!inv.getItem(slot).isEmpty())
player.drop(inv.removeItem(slot,
dropAll ? inv.getItem(slot).getCount() : 1
- ), false, true); // scatter, keep owner
+ ), false, Prediction.SERVER_ONLY); // scatter, keep owner
}
public void drop(int selectedSlot, boolean dropAll)
@@ -319,7 +322,7 @@ public class EntityPlayerActionPack
InteractionResult result = player.gameMode.useItemOn(player, world, player.getItemInHand(hand), hand, blockHit);
if (result instanceof InteractionResult.Success success)
{
- if (success.swingSource() == InteractionResult.SwingSource.SERVER) player.swing(hand);
+ if (success.swingSource() == InteractionResult.SwingSource.SERVER_ONLY) player.swing(hand, SwingAnimation.DEFAULT, true);
ap.itemUseCooldown = 3;
return true;
}
@@ -331,8 +334,14 @@ public class EntityPlayerActionPack
player.resetLastActionTime();
EntityHitResult entityHit = (EntityHitResult) hit;
Entity entity = entityHit.getEntity();
- boolean handWasEmpty = player.getItemInHand(hand).isEmpty();
+ ItemStack handItem = player.getItemInHand(hand);
+ boolean handWasEmpty = handItem.isEmpty();
boolean itemFrameEmpty = (entity instanceof ItemFrame) && ((ItemFrame) entity).getItem().isEmpty();
+ // client always consumes action with food on a horse, unless it's a skeleton horse.
+ boolean isFeedingHorse = entity instanceof AbstractHorse horse
+ && horse.isAlive()
+ && horse.isFood(handItem)
+ && !(horse instanceof SkeletonHorse);
Vec3 relativeHitPos = entityHit.getLocation().subtract(entity.getX(), entity.getY(), entity.getZ());
if (entity.interact(player, hand, relativeHitPos).consumesAction())
{
@@ -340,7 +349,9 @@ public class EntityPlayerActionPack
return true;
}
// fix for SS itemframe always returns CONSUME even if no action is performed
- if (player.interactOn(entity, hand, relativeHitPos).consumesAction() && !(handWasEmpty && itemFrameEmpty))
+ InteractionResult interactionResult = player.interactOn(entity, hand, relativeHitPos);
+ if ((interactionResult.consumesAction() && !(handWasEmpty && itemFrameEmpty))
+ || isFeedingHorse)
{
ap.itemUseCooldown = 3;
return true;
@@ -376,7 +387,7 @@ public class EntityPlayerActionPack
if (!action.isContinuous)
{
player.attack(entityHit.getEntity());
- player.swing(InteractionHand.MAIN_HAND);
+ player.swing(InteractionHand.MAIN_HAND, SwingAnimation.DEFAULT, true);
}
player.resetAttackStrengthTicker();
player.resetLastActionTime();
@@ -444,7 +455,7 @@ public class EntityPlayerActionPack
}
player.resetLastActionTime();
- player.swing(InteractionHand.MAIN_HAND);
+ player.swing(InteractionHand.MAIN_HAND, SwingAnimation.DEFAULT, true);
return blockBroken;
}
}
diff --git a/src/main/java/carpet/helpers/FertilizableCoral.java b/src/main/java/carpet/helpers/FertilizableCoral.java
index a588ec31..7b7e2076 100644
--- a/src/main/java/carpet/helpers/FertilizableCoral.java
+++ b/src/main/java/carpet/helpers/FertilizableCoral.java
@@ -1,28 +1,35 @@
package carpet.helpers;
-import carpet.fakes.CoralFeatureInterface;
+import carpet.script.utils.FeatureGenerator;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderSet;
import net.minecraft.core.registries.Registries;
+import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.RandomSource;
+import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.BaseCoralPlantTypeBlock;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
+import net.minecraft.world.level.block.BonemealSource;
import net.minecraft.world.level.block.BonemealableBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.CoralClawFeature;
-import net.minecraft.world.level.levelgen.feature.CoralFeature;
-import net.minecraft.world.level.levelgen.feature.CoralMushroomFeature;
import net.minecraft.world.level.levelgen.feature.CoralTreeFeature;
-import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
+import net.minecraft.world.level.levelgen.feature.CuboidPlacement;
+import net.minecraft.world.level.levelgen.feature.Feature;
+import net.minecraft.world.level.levelgen.feature.SimpleRandomSelectorFeature;
+import net.minecraft.world.level.levelgen.placement.OffsetPlacement;
+import net.minecraft.world.level.levelgen.placement.RandomChancePlacement;
import net.minecraft.world.level.material.MapColor;
+import java.util.stream.Stream;
+
/**
* Deduplicates logic for the different behaviors of the {@code renewableCoral} rule
*/
@@ -33,7 +40,7 @@ public interface FertilizableCoral extends BonemealableBlock {
boolean isEnabled();
@Override
- public default boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state)
+ public default boolean isValidBonemealTarget(LevelReader world, BlockPos pos, BlockState state, BonemealSource bonemealSource)
{
return isEnabled()
&& state.getValue(BaseCoralPlantTypeBlock.WATERLOGGED)
@@ -41,23 +48,17 @@ public interface FertilizableCoral extends BonemealableBlock {
}
@Override
- public default boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state)
+ public default boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, BlockState state, BonemealSource bonemealSource)
{
return random.nextFloat() < 0.15D;
}
@Override
- public default void performBonemeal(ServerLevel worldIn, RandomSource random, BlockPos pos, BlockState blockUnder)
+ public default void performBonemeal(ServerLevel worldIn, RandomSource random, BlockPos pos, BlockState blockUnder, BonemealSource bonemealSource)
{
- int variant = random.nextInt(3);
- CoralFeature coral = switch (variant) {
- case 0 -> new CoralClawFeature(NoneFeatureConfiguration.CODEC);
- case 1 -> new CoralTreeFeature(NoneFeatureConfiguration.CODEC);
- default -> new CoralMushroomFeature(NoneFeatureConfiguration.CODEC);
- };
-
MapColor color = blockUnder.getMapColor(worldIn, pos);
BlockState properBlock = blockUnder;
+ var blocks = worldIn.registryAccess().lookupOrThrow(Registries.BLOCK);
HolderSet.Named coralBlocks = worldIn.registryAccess().lookupOrThrow(Registries.BLOCK).get(BlockTags.CORAL_BLOCKS).orElseThrow();
for (Holder block: coralBlocks)
{
@@ -67,9 +68,36 @@ public interface FertilizableCoral extends BonemealableBlock {
break;
}
}
+ Block actualProperBlock = properBlock.getBlock();
+
worldIn.setBlock(pos, Blocks.WATER.defaultBlockState(), Block.UPDATE_NONE);
- if (!((CoralFeatureInterface)coral).growSpecific(worldIn, random, pos, properBlock))
+ var features = worldIn.registryAccess().lookupOrThrow(Registries.FEATURE);
+ Feature feature = new SimpleRandomSelectorFeature( HolderSet.direct(Stream.of(actualProperBlock)
+ .map(block -> FeatureGenerator.coral(features, blocks, actualProperBlock))
+ .flatMap(
+ coralType -> Stream.of(
+ PlacementUtils.inlinePlaced(new CoralTreeFeature(
+ PlacementUtils.inlinePlaced(coralType, FeatureGenerator.coralPlacement))
+ ),
+ PlacementUtils.inlinePlaced(new CoralClawFeature(
+ PlacementUtils.inlinePlaced(coralType, FeatureGenerator.coralPlacement))),
+ PlacementUtils.inlinePlaced(
+ coralType,
+ OffsetPlacement.vertical(UniformInt.of(-3, -1)),
+ new CuboidPlacement(
+ UniformInt.of(3, 5),
+ UniformInt.of(3, 5),
+ false,
+ false
+ ),
+ new RandomChancePlacement(0.9f),
+ FeatureGenerator.coralPlacement
+ )
+ )
+ ).toList())
+ );
+ if (!feature.place(worldIn, worldIn.getChunkSource().getGenerator(), random, pos))
{
worldIn.setBlock(pos, blockUnder, 3);
}
diff --git a/src/main/java/carpet/helpers/RedstoneWireTurbo.java b/src/main/java/carpet/helpers/RedstoneWireTurbo.java
index 57015ed0..ba095a7f 100644
--- a/src/main/java/carpet/helpers/RedstoneWireTurbo.java
+++ b/src/main/java/carpet/helpers/RedstoneWireTurbo.java
@@ -11,7 +11,7 @@ import net.minecraft.core.Direction;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
-import net.minecraft.world.level.block.RedStoneWireBlock;
+import net.minecraft.world.level.block.RedstoneWireBlock;
import net.minecraft.world.level.block.state.BlockState;
import carpet.fakes.RedstoneWireBlockInterface;
@@ -79,7 +79,7 @@ public class RedstoneWireTurbo
/* Reference to RedstoneWireBlock object, which uses this accelerator */
- private final RedStoneWireBlock wire;
+ private final RedstoneWireBlock wire;
/*
@@ -115,7 +115,7 @@ public class RedstoneWireTurbo
private List updateQueue2 = new ArrayList<>();
- public RedstoneWireTurbo(RedStoneWireBlock wire) {
+ public RedstoneWireTurbo(RedstoneWireBlock wire) {
this.wire = wire;
}
@@ -848,7 +848,7 @@ public class RedstoneWireTurbo
private BlockState calculateCurrentChanges(final Level worldIn, final UpdateNode upd)
{
BlockState state = upd.currentState;
- final int i = state.getValue(RedStoneWireBlock.POWER);
+ final int i = state.getValue(RedstoneWireBlock.POWER);
int j = 0;
j = getMaxCurrentStrength(upd, j);
int l = 0;
@@ -918,7 +918,7 @@ public class RedstoneWireTurbo
// and set it in the world.
// Possible optimization: Don't commit state changes to the world until they
// need to be known by some nearby non-redstone-wire block.
- state = state.setValue(RedStoneWireBlock.POWER, j);
+ state = state.setValue(RedstoneWireBlock.POWER, j);
// [gnembon] added state check cause other things in the tick may have popped it up already
// https://github.com/gnembon/fabric-carpet/issues/117
if (worldIn.getBlockState(upd.self).getBlock() == Blocks.REDSTONE_WIRE)
@@ -962,7 +962,7 @@ public class RedstoneWireTurbo
*/
private static int getMaxCurrentStrength(final UpdateNode upd, final int strength) {
if (upd.type != UpdateNode.Type.REDSTONE) return strength;
- final int i = upd.currentState.getValue(RedStoneWireBlock.POWER);
+ final int i = upd.currentState.getValue(RedstoneWireBlock.POWER);
return i > strength ? i : strength;
}
}
\ No newline at end of file
diff --git a/src/main/java/carpet/mixins/BlockBehaviourBlockStateBase_mixin.java b/src/main/java/carpet/mixins/BlockBehaviourBlockStateBase_mixin.java
index 3e512d97..33b4cd79 100644
--- a/src/main/java/carpet/mixins/BlockBehaviourBlockStateBase_mixin.java
+++ b/src/main/java/carpet/mixins/BlockBehaviourBlockStateBase_mixin.java
@@ -21,7 +21,7 @@ public abstract class BlockBehaviourBlockStateBase_mixin
{
if (CarpetSettings.movableAmethyst && getBlock() instanceof BuddingAmethystBlock)
{
- cir.setReturnValue(PushReaction.NORMAL);
+ cir.setReturnValue(PushReaction.PUSH_PULL);
}
}
}
diff --git a/src/main/java/carpet/mixins/BuddingAmethystBlock_movableAmethystMixin.java b/src/main/java/carpet/mixins/BuddingAmethystBlock_movableAmethystMixin.java
index f1adfc67..d063f4ff 100644
--- a/src/main/java/carpet/mixins/BuddingAmethystBlock_movableAmethystMixin.java
+++ b/src/main/java/carpet/mixins/BuddingAmethystBlock_movableAmethystMixin.java
@@ -3,13 +3,13 @@ package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.server.level.ServerPlayer;
import net.minecraft.tags.ItemTags;
-import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
-import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.BuddingAmethystBlock;
import net.minecraft.world.level.block.entity.BlockEntity;
@@ -24,7 +24,7 @@ public class BuddingAmethystBlock_movableAmethystMixin extends Block {
}
@Override
- public void playerDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
+ public void playerDestroy(ServerLevel world, ServerPlayer player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
super.playerDestroy(world, player, pos, state, blockEntity, stack);
// doing it here rather than though loottables since loottables are loaded on reload
// drawback - not controlled via loottables, but hey
diff --git a/src/main/java/carpet/mixins/ChunkGenerator_customMobSpawnsMixin.java b/src/main/java/carpet/mixins/ChunkGenerator_customMobSpawnsMixin.java
index 71f9b48d..0a87fa42 100644
--- a/src/main/java/carpet/mixins/ChunkGenerator_customMobSpawnsMixin.java
+++ b/src/main/java/carpet/mixins/ChunkGenerator_customMobSpawnsMixin.java
@@ -4,6 +4,7 @@ import carpet.utils.SpawnOverrides;
import it.unimi.dsi.fastutil.longs.LongSet;
import net.minecraft.core.Holder;
import net.minecraft.util.random.WeightedList;
+import net.minecraft.world.level.Level;
import net.minecraft.world.level.StructureManager;
import net.minecraft.world.level.levelgen.structure.Structure;
import org.spongepowered.asm.mixin.Mixin;
@@ -30,7 +31,7 @@ public abstract class ChunkGenerator_customMobSpawnsMixin
value = "INVOKE",
target = "Ljava/util/Map$Entry;getKey()Ljava/lang/Object;"
), cancellable = true)
- private void checkCMSpawns(Holder holder, StructureManager structureFeatureManager, MobCategory mobCategory, BlockPos blockPos,
+ private void checkCMSpawns(Level holder, StructureManager structureFeatureManager, MobCategory mobCategory, BlockPos blockPos,
CallbackInfoReturnable> cir,
Map map, Iterator> var6, Map.Entry entry)
{
diff --git a/src/main/java/carpet/mixins/CoralFeature_renewableCoralMixin.java b/src/main/java/carpet/mixins/CoralFeature_renewableCoralMixin.java
deleted file mode 100644
index f2d3800f..00000000
--- a/src/main/java/carpet/mixins/CoralFeature_renewableCoralMixin.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package carpet.mixins;
-
-import carpet.fakes.CoralFeatureInterface;
-import net.minecraft.util.RandomSource;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.Shadow;
-
-import java.util.Random;
-import net.minecraft.core.BlockPos;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.LevelAccessor;
-import net.minecraft.world.level.block.state.BlockState;
-import net.minecraft.world.level.levelgen.feature.CoralFeature;
-
-@Mixin(CoralFeature.class)
-public abstract class CoralFeature_renewableCoralMixin implements CoralFeatureInterface
-{
-
- @Shadow protected abstract boolean placeFeature(LevelAccessor var1, RandomSource var2, BlockPos var3, BlockState var4);
-
- @Override
- public boolean growSpecific(Level worldIn, RandomSource random, BlockPos pos, BlockState blockUnder)
- {
- return placeFeature(worldIn, random, pos, blockUnder);
- }
-}
diff --git a/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java b/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java
index 76effd11..81913320 100644
--- a/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java
+++ b/src/main/java/carpet/mixins/Explosion_optimizedTntMixin.java
@@ -86,7 +86,7 @@ public abstract class Explosion_optimizedTntMixin
}
@Redirect(method = "hurtEntities",
- at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;push(Lnet/minecraft/world/phys/Vec3;)V"))
+ at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;pushFromExplosion(Lnet/minecraft/world/phys/Vec3;)V"))
private void setVelocityAndUpdateLogging(Entity entity, Vec3 velocity)
{
if (eLogger != null) {
diff --git a/src/main/java/carpet/mixins/FlowingFluid_liquidDamageDisabledMixin.java b/src/main/java/carpet/mixins/FlowingFluid_liquidDamageDisabledMixin.java
index 1990e719..fad9e343 100644
--- a/src/main/java/carpet/mixins/FlowingFluid_liquidDamageDisabledMixin.java
+++ b/src/main/java/carpet/mixins/FlowingFluid_liquidDamageDisabledMixin.java
@@ -19,7 +19,7 @@ public class FlowingFluid_liquidDamageDisabledMixin
method = "canHoldAnyFluid",
at = @At(
value = "INVOKE",
- target = "Lnet/minecraft/world/level/block/state/BlockState;blocksMotion()Z"
+ target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/tags/TagKey;)Z"
),
cancellable = true
)
@@ -27,7 +27,7 @@ public class FlowingFluid_liquidDamageDisabledMixin
{
if (CarpetSettings.liquidDamageDisabled)
{
- cir.setReturnValue(state.isAir() || state.is(Blocks.WATER) || state.is(Blocks.LAVA));
+ cir.setReturnValue((state.isAir() || state.is(Blocks.WATER) || state.is(Blocks.LAVA)));
}
}
}
diff --git a/src/main/java/carpet/mixins/HugeFungusFeatureMixin.java b/src/main/java/carpet/mixins/HugeFungusFeatureMixin.java
index e07921bf..b780312a 100644
--- a/src/main/java/carpet/mixins/HugeFungusFeatureMixin.java
+++ b/src/main/java/carpet/mixins/HugeFungusFeatureMixin.java
@@ -2,23 +2,32 @@ package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.util.RandomSource;
-import net.minecraft.world.level.levelgen.feature.HugeFungusConfiguration;
import net.minecraft.world.level.levelgen.feature.HugeFungusFeature;
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.ModifyArgs;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
+import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
import static carpet.CarpetSettings.FungusGrowthMode.*;
@Mixin(HugeFungusFeature.class)
public class HugeFungusFeatureMixin {
- @ModifyArgs(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/feature/HugeFungusFeature;placeStem(Lnet/minecraft/world/level/WorldGenLevel;Lnet/minecraft/util/RandomSource;Lnet/minecraft/world/level/levelgen/feature/HugeFungusConfiguration;Lnet/minecraft/core/BlockPos;IZ)V"))
+ @Inject( method = "planted", at = @At("HEAD"), cancellable = true)
+ private void planted(CallbackInfoReturnable cir) {
+ if (CarpetSettings.thickFungusGrowth == ALL) {
+ cir.setReturnValue(true);
+ }
+ }
+
+ /*@ModifyArgs(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/feature/HugeFungusFeature;placeStem(Lnet/minecraft/world/level/WorldGenLevel;Lnet/minecraft/util/RandomSource;Lnet/minecraft/world/level/levelgen/feature/HugeFungusConfiguration;Lnet/minecraft/core/BlockPos;IZ)V"))
private void mixin(Args args) {
boolean natural = !((HugeFungusConfiguration) args.get(2)).planted;
args.set(5, natural && ((boolean) args.get(5)) ||
!natural && (CarpetSettings.thickFungusGrowth == ALL ||
CarpetSettings.thickFungusGrowth == RANDOM && ((RandomSource) args.get(1)).nextFloat() < 0.06F)
);
- }
+ }*/
}
diff --git a/src/main/java/carpet/mixins/ItemStack_stackableShulkerBoxesMixin.java b/src/main/java/carpet/mixins/ItemStack_stackableShulkerBoxesMixin.java
index 79432d89..8746b71e 100644
--- a/src/main/java/carpet/mixins/ItemStack_stackableShulkerBoxesMixin.java
+++ b/src/main/java/carpet/mixins/ItemStack_stackableShulkerBoxesMixin.java
@@ -22,7 +22,7 @@ public interface ItemStack_stackableShulkerBoxesMixin
&& ((ItemInstance)((Object)this)) instanceof final ItemStack itemStack
&& itemStack.getItem() instanceof BlockItem blockItem
&& blockItem.getBlock() instanceof ShulkerBoxBlock
- && ((ItemStack) ((Object) this)).getOrDefault(DataComponents.CONTAINER, ItemContainerContents.EMPTY).allItemsCopyStream().findAny().isEmpty()
+ && ((ItemStack) ((Object) this)).getOrDefault(DataComponents.CONTAINER, ItemContainerContents.EMPTY).itemCopies().findAny().isEmpty()
) {
cir.setReturnValue(CarpetSettings.shulkerBoxStackSize);
}
diff --git a/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java b/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java
index 9ce4505e..2d45981b 100644
--- a/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java
+++ b/src/main/java/carpet/mixins/LevelRenderer_scarpetRenderMixin.java
@@ -3,10 +3,10 @@ package carpet.mixins;
import carpet.network.CarpetClient;
import carpet.script.utils.ShapesRenderer;
import com.llamalad7.mixinextras.sugar.Local;
-import com.mojang.blaze3d.buffers.GpuBufferSlice;
import com.mojang.blaze3d.framegraph.FrameGraphBuilder;
import com.mojang.blaze3d.framegraph.FramePass;
import com.mojang.blaze3d.resource.GraphicsResourceAllocator;
+import com.mojang.renderpearl.api.buffers.GpuBufferSlice;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GameRenderer;
@@ -26,6 +26,7 @@ import net.minecraft.client.renderer.state.level.LevelRenderState;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.client.resources.model.sprite.AtlasManager;
+import org.joml.Matrix4f;
import org.joml.Matrix4fc;
import org.joml.Vector4f;
import org.spongepowered.asm.mixin.Final;
@@ -56,14 +57,18 @@ public class LevelRenderer_scarpetRenderMixin
@Inject(method = "render", at = @At(
value = "INVOKE",
-target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/util/profiling/ProfilerFiller;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;)V",
+//target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/renderpearl/api/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;Z)V"
+target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/renderpearl/api/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;Z)V",
+ //target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;F)V",
+ //target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;)V",
//target = "Lnet/minecraft/client/renderer/LevelRenderer;addAlwaysOnTopPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;)V",
//target = "Lnet/minecraft/client/renderer/LevelRenderer;submitFeatures(Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/client/renderer/SubmitNodeCollector;Z)V",
//target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/util/profiling/ProfilerFiller;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;)V",
//target = "Lnet/minecraft/client/renderer/LevelRenderer;addLateDebugPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/state/level/CameraRenderState;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lorg/joml/Matrix4fc;)V",
shift = At.Shift.AFTER
))
- private void renderScarpetThingsLate(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, CallbackInfo ci, @Local FrameGraphBuilder frameGraphBuilder)
+ private void renderStanperThingsLate (GraphicsResourceAllocator resourceAllocator, boolean renderOutline, CameraRenderState cameraState, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, boolean consistentDepthRequired, CallbackInfo ci, @Local(name = "frame") FrameGraphBuilder frameGraphBuilder)
+ //private void renderScarpetThingsLate(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, boolean consistentDepthRequired, CallbackInfo ci, @Local FrameGraphBuilder frameGraphBuilder)
//private void renderScarpetThinsLate(GraphicsResourceAllocator resourceAllocator, DeltaTracker deltaTracker, boolean renderOutline, CameraRenderState cameraState, Matrix4fc modelViewMatrix, GpuBufferSlice terrainFog, Vector4f fogColor, boolean shouldRenderSky, CallbackInfo ci, @Local FrameGraphBuilder frameGraphBuilder)
{
// in normal circumstances we want to render shapes at the very end so it appears correctly behind stuff.
@@ -71,10 +76,11 @@ target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/b
//if (!FabricAPIHooks.WORLD_RENDER_EVENTS && CarpetClient.shapes != null )
if (CarpetClient.shapes != null)
{
- final float deltaPartialTick = deltaTracker.getGameTimeDeltaPartialTick(false);
+ //final float deltaPartialTick = deltaTracker.getGameTimeDeltaPartialTick(false);
FramePass pass = frameGraphBuilder.addPass("scarpet_shapes");
targets.main = pass.readsAndWrites(targets.main);
- pass.executes(() -> CarpetClient.shapes.render(submitNodeStorage, levelRenderState, modelViewMatrix, deltaPartialTick));
+ var modelViewMatrix = new Matrix4f(levelRenderState.cameraRenderState.viewRotationMatrix);
+ pass.executes(() -> CarpetClient.shapes.render(submitNodeStorage, levelRenderState, modelViewMatrix, levelRenderState.worldPartialTicks));
//featureRenderDispatcher.renderAllFeatures(submitNodeStorage);
//renderBuffers.bufferSource().uploadAndDraw();
}
diff --git a/src/main/java/carpet/mixins/PieceGeneratorSupplier_plopMixin.java b/src/main/java/carpet/mixins/PieceGeneratorSupplier_plopMixin.java
deleted file mode 100644
index 0cd7363a..00000000
--- a/src/main/java/carpet/mixins/PieceGeneratorSupplier_plopMixin.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package carpet.mixins;
-
-import carpet.CarpetSettings;
-import org.spongepowered.asm.mixin.Mixin;
-import org.spongepowered.asm.mixin.injection.At;
-import org.spongepowered.asm.mixin.injection.Redirect;
-
-import java.util.function.Predicate;
-import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier;
-
-@Mixin(PieceGeneratorSupplier.class)
-public interface PieceGeneratorSupplier_plopMixin
-{
- @Redirect(method = "lambda$simple$0", at = @At(
- value = "INVOKE",
- target = "java/util/function/Predicate.test(Ljava/lang/Object;)Z"
- ), remap = false)
- private static boolean checkMate(Predicate