22w12a
This commit is contained in:
1 parent
2743908887
commit
ab07a6807a
6 files changed
+12
-8
No files matched your search
@@ -24,9 +24,11 @@ import net.minecraft.world.level.storage.WritableLevelData;
|
||||
@Mixin(ServerLevel.class)
|
||||
public abstract class ServerLevel_tickMixin extends Level
|
||||
{
|
||||
protected ServerLevel_tickMixin(WritableLevelData properties, ResourceKey<Level> registryKey, Holder<DimensionType> dimensionType, Supplier<ProfilerFiller> supplier, boolean bl, boolean bl2, long l)
|
||||
|
||||
|
||||
protected ServerLevel_tickMixin(WritableLevelData writableLevelData, ResourceKey<Level> resourceKey, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean bl, boolean bl2, long l, int i)
|
||||
{
|
||||
super(properties, registryKey, dimensionType, supplier, bl, bl2, l);
|
||||
super(writableLevelData, resourceKey, holder, supplier, bl, bl2, l, i);
|
||||
}
|
||||
|
||||
@Shadow protected abstract void runBlockEvents();
|
||||
|
||||
@@ -3,6 +3,7 @@ package carpet.mixins;
|
||||
import carpet.fakes.BlockPredicateInterface;
|
||||
import carpet.script.value.StringValue;
|
||||
import carpet.script.value.Value;
|
||||
import net.minecraft.core.HolderSet;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -18,7 +19,7 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
@Mixin(targets = "net.minecraft.commands.arguments.blocks.BlockPredicateArgument$TagPredicate")
|
||||
public class TagPredicate_scarpetMixin implements BlockPredicateInterface
|
||||
{
|
||||
@Shadow @Final private TagKey<Block> tag;
|
||||
@Shadow @Final private HolderSet<Block> tag;
|
||||
|
||||
@Shadow @Final private Map<String, String> vagueProperties;
|
||||
|
||||
@@ -33,7 +34,8 @@ public class TagPredicate_scarpetMixin implements BlockPredicateInterface
|
||||
@Override
|
||||
public TagKey<Block> getCMBlockTagKey()
|
||||
{
|
||||
return tag;
|
||||
// might be good to explose the holder set nature of it.
|
||||
return tag.unwrap().left().orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -513,7 +513,7 @@ public class WorldAccess {
|
||||
genericStateTest(c, "see_sky", lv, (s, p, w) -> BooleanValue.of(w.canSeeSky(p))));
|
||||
|
||||
expression.addContextFunction("brightness", -1, (c, t, lv) ->
|
||||
genericStateTest(c, "brightness", lv, (s, p, w) -> new NumericValue(w.getBrightness(p))));
|
||||
genericStateTest(c, "brightness", lv, (s, p, w) -> new NumericValue(w.getLightLevelDependentMagicValue(p))));
|
||||
|
||||
expression.addContextFunction("hardness", -1, (c, t, lv) ->
|
||||
genericStateTest(c, "hardness", lv, (s, p, w) -> new NumericValue(s.getDestroySpeed(w, p))));
|
||||
|
||||
@@ -66,7 +66,7 @@ public class ValueConversions
|
||||
return ListValue.of(new NumericValue(vec.x), new NumericValue(vec.y), new NumericValue(vec.z));
|
||||
}
|
||||
|
||||
public static Value of(ColumnPos cpos) { return ListValue.of(new NumericValue(cpos.x), new NumericValue(cpos.z));}
|
||||
public static Value of(ColumnPos cpos) { return ListValue.of(new NumericValue(cpos.x()), new NumericValue(cpos.z()));}
|
||||
|
||||
public static Value of(ServerLevel world)
|
||||
{
|
||||
|
||||
@@ -246,7 +246,7 @@ public class BlockInfo
|
||||
lst.add(Messenger.s(String.format(" - Light in: %d, above: %d",
|
||||
Math.max(world.getBrightness(LightLayer.BLOCK, pos),world.getBrightness(LightLayer.SKY, pos)) ,
|
||||
Math.max(world.getBrightness(LightLayer.BLOCK, pos.above()),world.getBrightness(LightLayer.SKY, pos.above())))));
|
||||
lst.add(Messenger.s(String.format(" - Brightness in: %.2f, above: %.2f", world.getBrightness(pos), world.getBrightness(pos.above()))));
|
||||
lst.add(Messenger.s(String.format(" - Brightness in: %.2f, above: %.2f", world.getLightLevelDependentMagicValue(pos), world.getLightLevelDependentMagicValue(pos.above()))));
|
||||
lst.add(Messenger.s(String.format(" - Is opaque: %s", material.isSolid() )));
|
||||
//lst.add(Messenger.s(String.format(" - Light opacity: %d", state.getOpacity(world,pos))));
|
||||
lst.add(Messenger.s(String.format(" - Blocks light: %s", state.getMaterial().isSolidBlocking())));
|
||||
|
||||
Reference in new issue
Block a user