-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
8 changed files
with
30 additions
and
6 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
18 changes: 18 additions & 0 deletions
18
src/main/java/dev/dubhe/skyland/mixin/WanderingTraderManagerMixin.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,18 @@ | ||
package dev.dubhe.skyland.mixin; | ||
|
||
import dev.dubhe.skyland.SkyLand; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.world.WanderingTraderManager; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.util.Random; | ||
|
||
@Mixin(WanderingTraderManager.class) | ||
public class WanderingTraderManagerMixin { | ||
@Redirect(method = "trySpawn", at = @At(value = "INVOKE", target = "Ljava/util/Random;nextInt(I)I")) | ||
private int spawnX10(Random random, int value, ServerWorld world) { | ||
return world.getGameRules().getBoolean(SkyLand.CHIEFTAIN) ? 0 : random.nextInt(value); | ||
} | ||
} |
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,4 +1,5 @@ | ||
{ | ||
"generator.skyland": "SkyLand", | ||
"gamerule.qnmdLC": "qnmdLC" | ||
"gamerule.qnmdLC": "qnmdLC", | ||
"gamerule.chieftainMode": "Chieftain Mode" | ||
} |
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,4 +1,5 @@ | ||
{ | ||
"generator.skyland": "空岛", | ||
"gamerule.qnmdLC": "忽略LC值影响" | ||
"gamerule.qnmdLC": "忽略LC值影响", | ||
"gamerule.chieftainMode": "非酋模式" | ||
} |
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,4 +1,5 @@ | ||
{ | ||
"generator.skyland": "空島", | ||
"gamerule.qnmdLC": "忽略LC值影響" | ||
"gamerule.qnmdLC": "忽略LC值影響", | ||
"gamerule.chieftainMode": "非酋模式" | ||
} |
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,4 +1,5 @@ | ||
{ | ||
"generator.skyland": "空島", | ||
"gamerule.qnmdLC": "忽略LC值影響" | ||
"gamerule.qnmdLC": "忽略LC值影響", | ||
"gamerule.chieftainMode": "非酋模式" | ||
} |
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