forked from WildBamaBoy/minecraft-comes-alive
-
Notifications
You must be signed in to change notification settings - Fork 65
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
1961caa
commit 6a6c322
Showing
5 changed files
with
34 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# 7.5.18 | ||
|
||
* Updated contributor book | ||
* Fixed ReaperSpawner eating all your CPU | ||
|
||
# 7.5.17 | ||
|
||
|
23 changes: 23 additions & 0 deletions
23
common/src/main/java/net/mca/mixin/MixinFlintAndSteelItem.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,23 @@ | ||
package net.mca.mixin; | ||
|
||
import net.mca.server.world.data.VillageManager; | ||
import net.minecraft.item.FlintAndSteelItem; | ||
import net.minecraft.item.ItemUsageContext; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.ActionResult; | ||
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(FlintAndSteelItem.class) | ||
public class MixinFlintAndSteelItem { | ||
@Inject(method = "useOnBlock(Lnet/minecraft/item/ItemUsageContext;)Lnet/minecraft/util/ActionResult;", at = @At("RETURN")) | ||
private void mca$onUseOnBlock(ItemUsageContext context, CallbackInfoReturnable<ActionResult> cir) { | ||
if (cir.getReturnValue().isAccepted() && context.getWorld() instanceof ServerWorld serverWorld) { | ||
serverWorld.getServer().execute(() -> | ||
VillageManager.get(serverWorld).getReaperSpawner().trySpawnReaper(serverWorld, context.getBlockPos()) | ||
); | ||
} | ||
} | ||
} |
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