-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecb67c2
commit 22de70b
Showing
17 changed files
with
68 additions
and
175 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip | ||
networkTimeout=10000 | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
package skylands.event; | ||
|
||
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.CropBlock; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import skylands.logic.Skylands; | ||
import org.jetbrains.annotations.Nullable; | ||
import skylands.util.SkylandsTexts; | ||
import skylands.util.WorldProtection; | ||
|
||
@SuppressWarnings("unused") | ||
public class BlockBreakEvent { | ||
public class BlockBreakEvent implements PlayerBlockBreakEvents.Before { | ||
static final BlockBreakEvent INSTANCE = new BlockBreakEvent(); | ||
|
||
public static boolean onBreak(World world, PlayerEntity player, BlockPos pos, BlockState state) { | ||
if(!WorldProtection.canModify(world, player)) { | ||
@Override | ||
public boolean beforeBlockBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity) { | ||
if(!world.isClient() && !WorldProtection.canModify(world, player)) { | ||
player.sendMessage(SkylandsTexts.prefixed("message.skylands.world_protection.block_break"), true); | ||
return false; | ||
} | ||
|
||
if(Skylands.config.rightClickHarvestEnabled && state.getBlock() instanceof CropBlock crop && crop.isMature(state)) { | ||
player.sendMessage(SkylandsTexts.prefixed("message.skylands.right_click_harvest.tip"), true); | ||
} | ||
|
||
return true; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package skylands.event; | ||
|
||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; | ||
import net.minecraft.server.MinecraftServer; | ||
import skylands.logic.Skylands; | ||
|
||
public class ServerTickEvent { | ||
public class ServerTickEvent implements ServerTickEvents.EndTick { | ||
static final ServerTickEvent INSTANCE = new ServerTickEvent(); | ||
|
||
public static void onTick(MinecraftServer server) { | ||
@Override | ||
public void onEndTick(MinecraftServer server) { | ||
Skylands.getInstance().onTick(server); | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.