Skip to content

Commit

Permalink
Fabric; Fixed crash on server side
Browse files Browse the repository at this point in the history
  • Loading branch information
SammyForReal committed Aug 12, 2023
1 parent b5db8fb commit 1262413
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 71 deletions.
2 changes: 1 addition & 1 deletion fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
org.gradle.jvmargs=-Xmx2G

# Mod Properties
mod_version=1.6.2
mod_version=1.6.2a
maven_group=cc.tweaked_programs
archives_base_name=cccbridge

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.simibubi.create.foundation.blockEntity.behaviour.scrollValue.ScrollValueBehaviour;
import com.simibubi.create.foundation.blockEntity.behaviour.scrollValue.ScrollValueRenderer;
import com.simibubi.create.foundation.utility.AdventureUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
Expand All @@ -22,8 +21,8 @@ private static boolean isPhysicalPlayer(Player player) {
@Redirect(method = "addBox", at = @At(value = "INVOKE", target = "Lcom/simibubi/create/foundation/utility/AdventureUtil;isAdventure(Lnet/minecraft/world/entity/player/Player;)Z"), remap = false)
private static boolean cccbridge$addBox$redirectIsAdventure(Player player, ClientLevel world, BlockPos pos, Direction face, ScrollValueBehaviour behaviour, boolean highlight) {
if (world.getBlockState(pos).getBlock() instanceof ScrollerBlock)
return isPhysicalPlayer(Minecraft.getInstance().player);
return isPhysicalPlayer(player);

return AdventureUtil.isAdventure(Minecraft.getInstance().player);
return AdventureUtil.isAdventure(player);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import cc.tweaked_programs.cccbridge.common.minecraft.blockEntity.ScrollerBlockEntity;
import com.simibubi.create.foundation.blockEntity.behaviour.ValueSettingsInputHandler;
import com.simibubi.create.foundation.utility.AdventureUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
Expand All @@ -28,7 +27,7 @@ private static boolean isPhysicalPlayer(Player player) {
BlockEntity blockEntity = level.getBlockEntity(blockHit.getBlockPos());

if (blockEntity instanceof ScrollerBlockEntity)
return !isPhysicalPlayer(Minecraft.getInstance().player);
return !isPhysicalPlayer(player);
}

return !AdventureUtil.isAdventure(player);
Expand Down

0 comments on commit 1262413

Please sign in to comment.