25w44a
This commit is contained in:
1 parent
b0ea03d1c3
commit
461e64d34c
22 files changed
+81
-125
No files matched your search
@@ -29,9 +29,9 @@ public class BiomeInfo
|
||||
put("temperature", (w, b) -> NumericValue.of(b.getBaseTemperature()));
|
||||
// todo add per postion query for environmental attributes as well
|
||||
put("fog_color", (w, b) -> fromEnvironmentalAttribute(w, b, EnvironmentAttributes.FOG_COLOR));
|
||||
put("foliage_color", (w, b) -> ValueConversions.ofRGB(b.getSpecialEffects().getFoliageColorOverride().orElse(4764952))); // client Biome.getDefaultFoliageColor
|
||||
put("foliage_color", (w, b) -> ValueConversions.ofRGB(b.getSpecialEffects().foliageColorOverride().orElse(4764952))); // client Biome.getDefaultFoliageColor
|
||||
put("sky_color", (w, b) -> fromEnvironmentalAttribute(w, b, EnvironmentAttributes.SKY_COLOR));
|
||||
put("water_color", (w, b) -> ValueConversions.ofRGB(b.getSpecialEffects().getWaterColor()));
|
||||
put("water_color", (w, b) -> ValueConversions.ofRGB(b.getSpecialEffects().waterColor()));
|
||||
put("water_fog_color", (w, b) -> fromEnvironmentalAttribute(w, b, EnvironmentAttributes.WATER_FOG_COLOR));
|
||||
put("humidity", (w, b) -> NumericValue.of(Vanilla.Biome_getClimateSettings(b).downfall()));
|
||||
put("precipitation", (w, b) -> StringValue.of(b.getPrecipitationAt(new BlockPos(0, w.getSeaLevel(), 0), w.getSeaLevel()).name().toLowerCase(Locale.ROOT)));
|
||||
|
||||
@@ -15,7 +15,9 @@ import carpet.script.value.ValueConversions;
|
||||
import com.sun.management.OperatingSystemMXBean;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.gamerules.GameRule;
|
||||
import net.minecraft.world.level.gamerules.GameRuleTypeVisitor;
|
||||
import net.minecraft.world.level.gamerules.GameRules;
|
||||
import net.minecraft.world.level.border.WorldBorder;
|
||||
import net.minecraft.world.level.storage.LevelData;
|
||||
import net.minecraft.world.level.storage.LevelResource;
|
||||
@@ -166,12 +168,15 @@ public class SystemInfo
|
||||
put("world_gamerules", c -> {
|
||||
Map<Value, Value> rules = new HashMap<>();
|
||||
GameRules gameRules = c.level().getGameRules();
|
||||
gameRules.visitGameRuleTypes(new GameRules.GameRuleTypeVisitor()
|
||||
gameRules.visitGameRuleTypes(new GameRuleTypeVisitor()
|
||||
{
|
||||
@Override
|
||||
public <T extends GameRules.Value<T>> void visit(GameRules.Key<T> key, GameRules.Type<T> type)
|
||||
{
|
||||
rules.put(StringValue.of(key.getId()), StringValue.of(gameRules.getRule(key).toString()));
|
||||
public void visitBoolean(GameRule<Boolean> gameRule) {
|
||||
rules.put(StringValue.of(gameRule.id()), BooleanValue.of(gameRules.get(gameRule)));
|
||||
}
|
||||
@Override
|
||||
public void visitInteger(GameRule<Integer> gameRule) {
|
||||
rules.put(StringValue.of(gameRule.id()), NumericValue.of(gameRules.get(gameRule)));
|
||||
}
|
||||
});
|
||||
return MapValue.wrap(rules);
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
@ParametersAreNonnullByDefault
|
||||
@FieldsAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@NullMarked
|
||||
package carpet.script.utils;
|
||||
|
||||
import net.minecraft.FieldsAreNonnullByDefault;
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@@ -1,8 +1,3 @@
|
||||
@ParametersAreNonnullByDefault
|
||||
@FieldsAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
@NullMarked
|
||||
package carpet.script.utils.shapes;
|
||||
|
||||
import net.minecraft.FieldsAreNonnullByDefault;
|
||||
import net.minecraft.MethodsReturnNonnullByDefault;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
Reference in new issue
Block a user