23w16a
This commit is contained in:
1 parent
97ab52a917
commit
d68c252180
11 files changed
+23
-35
No files matched your search
@@ -527,7 +527,7 @@ public class WorldAccess
|
||||
booleanStateTest(c, "flammable", lv, (s, p) -> s.ignitedByLava()));
|
||||
|
||||
expression.addContextFunction("transparent", -1, (c, t, lv) ->
|
||||
booleanStateTest(c, "transparent", lv, (s, p) -> !s.getMaterial().isSolid()));
|
||||
booleanStateTest(c, "transparent", lv, (s, p) -> !s.isSolid()));
|
||||
|
||||
/*this.expr.addContextFunction("opacity", -1, (c, t, lv) ->
|
||||
genericStateTest(c, "opacity", lv, (s, p, w) -> new NumericValue(s.getOpacity(w, p))));
|
||||
@@ -1162,8 +1162,7 @@ public class WorldAccess
|
||||
|
||||
expression.addContextFunction("material", -1, (c, t, lv) -> {
|
||||
c.host.issueDeprecation("material(...)"); // deprecated for block_state()
|
||||
return stateStringQuery(c, "material", lv, (s, p) ->
|
||||
Colors.materialName.getOrDefault(s.getMaterial(), "unknown"));
|
||||
return StringValue.of("unknown");
|
||||
});
|
||||
|
||||
expression.addContextFunction("map_colour", -1, (c, t, lv) ->
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package carpet.script.utils;
|
||||
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.level.material.MaterialColor;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -154,13 +153,4 @@ public class Colors
|
||||
entry(MaterialColor.RAW_IRON , "raw_iron" ),
|
||||
entry(MaterialColor.GLOW_LICHEN , "glow_lichen" )
|
||||
);
|
||||
|
||||
public static final Map<Material, String> materialName = Map.ofEntries(
|
||||
entry(Material.PLANT , "plant" ),
|
||||
entry(Material.DEPRECATED_REPLACEABLE, "vegetation" ),
|
||||
entry(Material.SAND , "sand" ),
|
||||
entry(Material.WOOD , "wood" ),
|
||||
entry(Material.GLASS , "glass" ),
|
||||
entry(Material.STONE , "stone" )
|
||||
);
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class SnoopyCommandSource extends CommandSourceStack
|
||||
super(CommandSource.NULL, original.getPosition(), original.getRotation(), original.getLevel(), Vanilla.MinecraftServer_getRunPermissionLevel(original.getServer()),
|
||||
original.getTextName(), original.getDisplayName(), original.getServer(), original.getEntity(), false,
|
||||
(ctx, succ, res) -> {
|
||||
}, EntityAnchorArgument.Anchor.FEET, CommandSigningContext.ANONYMOUS, TaskChainer.immediate(original.getServer()));
|
||||
}, EntityAnchorArgument.Anchor.FEET, CommandSigningContext.ANONYMOUS, TaskChainer.immediate(original.getServer()), i -> {});
|
||||
this.output = CommandSource.NULL;
|
||||
this.position = original.getPosition();
|
||||
this.world = original.getLevel();
|
||||
@@ -92,7 +92,7 @@ public class SnoopyCommandSource extends CommandSourceStack
|
||||
{
|
||||
super(output, pos, rot, world, level,
|
||||
simpleName, name, server, entity, false,
|
||||
consumer, entityAnchor, context, TaskChainer.immediate(server));
|
||||
consumer, entityAnchor, context, TaskChainer.immediate(server), i -> {});
|
||||
this.output = output;
|
||||
this.position = pos;
|
||||
this.rotation = rot;
|
||||
|
||||
Reference in new issue
Block a user