Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Cjsah committed Mar 20, 2022
1 parent 2381018 commit af0d059
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ org.gradle.jvmargs=-Xmx1G
mc_version=1.18.2
yarn_version=1.18.2+build.1
fabric_version=0.13.3
mod_version=1.1.1
mod_version=1.1.2
maven_group=dev.dubhe
1 change: 1 addition & 0 deletions src/main/java/dev/dubhe/skyland/SkyLand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

public class SkyLand implements ModInitializer {
public static final GameRules.Key<GameRules.BooleanRule> LC = GameRules.register("qnmdLC", GameRules.Category.MOBS, GameRules.BooleanRule.create(false));
public static final GameRules.Key<GameRules.BooleanRule> CHIEFTAIN = GameRules.register("chieftainMode", GameRules.Category.MOBS, GameRules.BooleanRule.create(false));

@Override
public void onInitialize() {
Expand Down
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);
}
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/skyland/lang/en_us.json
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"
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/skyland/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"generator.skyland": "空岛",
"gamerule.qnmdLC": "忽略LC值影响"
"gamerule.qnmdLC": "忽略LC值影响",
"gamerule.chieftainMode": "非酋模式"
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/skyland/lang/zh_hk.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"generator.skyland": "空島",
"gamerule.qnmdLC": "忽略LC值影響"
"gamerule.qnmdLC": "忽略LC值影響",
"gamerule.chieftainMode": "非酋模式"
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/skyland/lang/zh_tw.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"generator.skyland": "空島",
"gamerule.qnmdLC": "忽略LC值影響"
"gamerule.qnmdLC": "忽略LC值影響",
"gamerule.chieftainMode": "非酋模式"
}
3 changes: 2 additions & 1 deletion src/main/resources/skyland.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"EnderDragonFightMixin",
"GeneratorOptionsMixin",
"RegistryMixin",
"SpawnHelperMixin"
"SpawnHelperMixin",
"WanderingTraderManagerMixin"
],
"client": [],
"injectors": {
Expand Down

0 comments on commit af0d059

Please sign in to comment.