-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- RedRouter Blocks can't conduct outside redstone signals anymore & now will emit strong redstone signals when one side is powered. - Scroller Panes now can be used in Adventure mode as well. - They also won't push a `"scroller_changed"` event anymore, when a Computer changes the value. - Create dependency's version got updated to something that makes more sense
- Loading branch information
1 parent
2a7943d
commit 7b29c96
Showing
7 changed files
with
56 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
fabric/src/main/java/cc/tweaked_programs/cccbridge/common/mixin/MixinAdventureUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cc.tweaked_programs.cccbridge.common.mixin; | ||
|
||
import cc.tweaked_programs.cccbridge.common.minecraft.blockEntity.ScrollerBlockEntity; | ||
import com.simibubi.create.foundation.utility.AdventureUtil; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.phys.BlockHitResult; | ||
import net.minecraft.world.phys.HitResult; | ||
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(AdventureUtil.class) | ||
public abstract class MixinAdventureUtil { | ||
@Inject(method = "isAdventure", at = @At("HEAD"), cancellable = true, remap = false) | ||
private static void cccbridge$isAdventure(Player player, CallbackInfoReturnable<Boolean> cir) { | ||
if (player.isSpectator()) | ||
return; | ||
|
||
Level level = player.level(); | ||
HitResult hitResult = player.pick(5, 1, false); | ||
|
||
if (hitResult instanceof BlockHitResult blockHit) { | ||
BlockEntity blockEntity = level.getBlockEntity(blockHit.getBlockPos()); | ||
|
||
if (blockEntity instanceof ScrollerBlockEntity) | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters