Skip to content

Commit

Permalink
disable interactions on adventure mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiDragon committed Apr 28, 2022
1 parent e448725 commit 3616861
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ group project.maven_group
repositories {
ext.maven = { String s -> maven {url(s)}}

maven "https://jitpack.io"
//mconfig dep
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }

maven { url "https://jitpack.io" }
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ minecraft_version=1.18.2
yarn_mappings=1.18.2+build.3
loader_version=0.13.3

mod_version=1.0.1
mod_version=1.0.2
maven_group=io.github.mattidragon
archives_base_name=ExtendedDrawers

fabric_version=0.51.1+1.18.2
mconfig_version=1.1.1
mconfig_version=1.1.2

Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockSt

@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (!player.canModifyBlocks()) return ActionResult.PASS;

var internalPos = DrawerRaycastUtil.calculateFaceLocation(pos, hit.getPos(), hit.getSide(), state.get(FACING));
if (internalPos == null) return ActionResult.PASS;
var slot = getSlot(internalPos);
Expand Down Expand Up @@ -127,7 +129,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt

@Override
public void onBlockBreakStart(BlockState state, World world, BlockPos pos, PlayerEntity player) {
if (world.isClient) return;
if (world.isClient || !player.canModifyBlocks()) return;

var drawer = getBlockEntity(world, pos);
if (!getAndResetExtractionTimer(player)) return; // Mojank moment
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"MattiDragon"
],
"contact": {
"sources": "https://github.com/MattiDragon/ExtendedDrawers"
"sources": "https://github.com/MattiDragon/ExtendedDrawers",
"website": "https://modrinth.com/mod/extended-drawers",
"issues": "https://github.com/MattiDragon/ExtendedDrawers/issues"
},
"license": "MIT",
"icon": "icon.png",
Expand Down

0 comments on commit 3616861

Please sign in to comment.