This commit is contained in:
gnembon committed 2023-03-22 18:27:44 +01:00
1 parent 4e94d1bc15
commit f1586b3809
9 files changed
+33 -43

No files matched your search

+4 -4
View File
@@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check https://fabricmc.net/develop/ # check https://fabricmc.net/develop/
minecraft_version=1.19.4 minecraft_version=23w12a
loader_version=0.14.17 loader_version=0.14.18
jsr305_version=3.0.2 jsr305_version=3.0.2
fabric_version=0.75.3+1.19.4 fabric_version=0.76.0+1.19.4
# Mod Properties # Mod Properties
mod_version = 1.4.101 mod_version = 1.4.101
@@ -17,7 +17,7 @@ org.gradle.jvmargs=-Xmx1G
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5) # 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 # 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] # Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
release-curse-versions = Minecraft 1.19:1.19.4 release-curse-versions = Minecraft 1.20:1.20-Snapshot
# Whether or not to build another branch on release # Whether or not to build another branch on release
release-extra-branch = false release-extra-branch = false
# The name of the second branch to release # The name of the second branch to release
@@ -3,11 +3,11 @@ package carpet.helpers;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level; import net.minecraft.world.level.SignalGetter;
public class QuasiConnectivity { public class QuasiConnectivity {
public static boolean hasQuasiSignal(Level level, BlockPos pos) { public static boolean hasQuasiSignal(SignalGetter level, BlockPos pos) {
for (int i = 1; i <= CarpetSettings.quasiConnectivity; i++) { for (int i = 1; i <= CarpetSettings.quasiConnectivity; i++) {
BlockPos above = pos.above(i); BlockPos above = pos.above(i);
@@ -1,5 +1,6 @@
package carpet.mixins; package carpet.mixins;
import net.minecraft.world.level.SignalGetter;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
@@ -9,7 +10,6 @@ import carpet.helpers.QuasiConnectivity;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.piston.PistonBaseBlock; import net.minecraft.world.level.block.piston.PistonBaseBlock;
@Mixin(PistonBaseBlock.class) @Mixin(PistonBaseBlock.class)
@@ -23,7 +23,7 @@ public class PistonBaseBlock_qcMixin {
target = "Lnet/minecraft/core/BlockPos;above()Lnet/minecraft/core/BlockPos;" target = "Lnet/minecraft/core/BlockPos;above()Lnet/minecraft/core/BlockPos;"
) )
) )
private void carpet_checkQuasiSignal(Level level, BlockPos pos, Direction facing, CallbackInfoReturnable<Boolean> cir) { private void carpet_checkQuasiSignal(SignalGetter level, BlockPos pos, Direction facing, CallbackInfoReturnable<Boolean> cir) {
cir.setReturnValue(QuasiConnectivity.hasQuasiSignal(level, pos)); cir.setReturnValue(QuasiConnectivity.hasQuasiSignal(level, pos));
} }
} }
@@ -4,6 +4,7 @@ import carpet.fakes.PistonBlockInterface;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.SignalGetter;
import net.minecraft.world.level.block.piston.PistonBaseBlock; import net.minecraft.world.level.block.piston.PistonBaseBlock;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
@@ -11,7 +12,7 @@ import org.spongepowered.asm.mixin.Shadow;
@Mixin(PistonBaseBlock.class) @Mixin(PistonBaseBlock.class)
public abstract class PistonBaseBlock_rotatorBlockMixin implements PistonBlockInterface public abstract class PistonBaseBlock_rotatorBlockMixin implements PistonBlockInterface
{ {
@Shadow protected abstract boolean getNeighborSignal(Level world_1, BlockPos blockPos_1, Direction direction_1); @Shadow protected abstract boolean getNeighborSignal(SignalGetter world_1, BlockPos blockPos_1, Direction direction_1);
@Override @Override
public boolean publicShouldExtend(Level world_1, BlockPos blockPos_1, Direction direction_1) public boolean publicShouldExtend(Level world_1, BlockPos blockPos_1, Direction direction_1)
@@ -0,0 +1,21 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.world.level.block.entity.SculkSensorBlockEntity;
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;
@Mixin(SculkSensorBlockEntity.VibrationConfig.class)
public class SculkSensorBlockEntityVibrationConfig_sculkSensorRangeMixin
{
@Inject(method = "getListenerRadius", at = @At("HEAD"), cancellable = true)
private void sculkSensorRange(CallbackInfoReturnable<Integer> cir)
{
if (CarpetSettings.sculkSensorRange != SculkSensorBlockEntity.VibrationConfig.LISTENER_RANGE) {
cir.setReturnValue(CarpetSettings.sculkSensorRange);
}
}
}
@@ -1,30 +0,0 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.world.level.block.SculkSensorBlock;
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;
@Mixin(SculkSensorBlock.class)
public class SculkSensorBlock_rangeMixin {
@Shadow
@Final
private int listenerRange;
@Inject(
method = "getListenerRange()I",
at = @At("HEAD"),
cancellable = true
)
public void getListenerRange(CallbackInfoReturnable<Integer> cir) {
if (CarpetSettings.sculkSensorRange != this.listenerRange) {
cir.setReturnValue(CarpetSettings.sculkSensorRange);
}
}
}
@@ -45,7 +45,6 @@ import net.minecraft.world.inventory.FurnaceMenu;
import net.minecraft.world.inventory.GrindstoneMenu; import net.minecraft.world.inventory.GrindstoneMenu;
import net.minecraft.world.inventory.HopperMenu; import net.minecraft.world.inventory.HopperMenu;
import net.minecraft.world.inventory.LecternMenu; import net.minecraft.world.inventory.LecternMenu;
import net.minecraft.world.inventory.LegacySmithingMenu;
import net.minecraft.world.inventory.LoomMenu; import net.minecraft.world.inventory.LoomMenu;
import net.minecraft.world.inventory.MerchantMenu; import net.minecraft.world.inventory.MerchantMenu;
import net.minecraft.world.inventory.ShulkerBoxMenu; import net.minecraft.world.inventory.ShulkerBoxMenu;
@@ -99,7 +98,6 @@ public class ScreenValue extends Value
screenHandlerFactories.put("loom", LoomMenu::new); screenHandlerFactories.put("loom", LoomMenu::new);
screenHandlerFactories.put("merchant", MerchantMenu::new); screenHandlerFactories.put("merchant", MerchantMenu::new);
screenHandlerFactories.put("shulker_box", (syncId, playerInventory) -> new ShulkerBoxMenu(syncId, playerInventory, new SimpleContainer(9 * 3))); screenHandlerFactories.put("shulker_box", (syncId, playerInventory) -> new ShulkerBoxMenu(syncId, playerInventory, new SimpleContainer(9 * 3)));
screenHandlerFactories.put("smithing_legacy", LegacySmithingMenu::new);
screenHandlerFactories.put("smithing", SmithingMenu::new); screenHandlerFactories.put("smithing", SmithingMenu::new);
screenHandlerFactories.put("smoker", SmokerMenu::new); screenHandlerFactories.put("smoker", SmokerMenu::new);
screenHandlerFactories.put("stonecutter", StonecutterMenu::new); screenHandlerFactories.put("stonecutter", StonecutterMenu::new);
+1 -1
View File
@@ -179,7 +179,7 @@
"TheEndGatewayBlockEntity_creativeNoClipMixin", "TheEndGatewayBlockEntity_creativeNoClipMixin",
"LivingEntity_creativeFlyMixin", "LivingEntity_creativeFlyMixin",
"ChunkMap_creativePlayersLoadChunksMixin", "ChunkMap_creativePlayersLoadChunksMixin",
"SculkSensorBlock_rangeMixin", "SculkSensorBlockEntityVibrationConfig_sculkSensorRangeMixin",
"CollectingNeighborUpdaterAccessor", "CollectingNeighborUpdaterAccessor",
"BlockBehaviour_customStickyMixin", "BlockBehaviour_customStickyMixin",
+1 -1
View File
@@ -33,7 +33,7 @@
"accessWidener" : "carpet.accesswidener", "accessWidener" : "carpet.accesswidener",
"depends": { "depends": {
"minecraft": "1.19.4", "minecraft": ">1.19.4",
"fabricloader": ">=0.14.6", "fabricloader": ">=0.14.6",
"java": ">=17" "java": ">=17"
} }