Migrate the Carpet codebase to Mojang Mappings
This commit is contained in:
346 files changed
+8353
-8492
No files matched your search
@@ -17,21 +17,21 @@ import carpet.script.value.BlockValue;
|
||||
import carpet.script.value.EntityValue;
|
||||
import carpet.script.value.NumericValue;
|
||||
import carpet.script.value.Value;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
|
||||
public class CarpetExpression
|
||||
{
|
||||
private final ServerCommandSource source;
|
||||
private final CommandSourceStack source;
|
||||
private final BlockPos origin;
|
||||
private final Expression expr;
|
||||
// these are for extensions
|
||||
public Expression getExpr() {return expr;}
|
||||
public ServerCommandSource getSource() {return source;}
|
||||
public CommandSourceStack getSource() {return source;}
|
||||
public BlockPos getOrigin() {return origin;}
|
||||
|
||||
public CarpetExpression(Module module, String expression, ServerCommandSource source, BlockPos origin)
|
||||
public CarpetExpression(Module module, String expression, CommandSourceStack source, BlockPos origin)
|
||||
{
|
||||
this.origin = origin;
|
||||
this.source = source;
|
||||
@@ -60,7 +60,7 @@ public class CarpetExpression
|
||||
with("x", (c, t) -> new NumericValue(x - origin.getX()).bindTo("x")).
|
||||
with("y", (c, t) -> new NumericValue(y - origin.getY()).bindTo("y")).
|
||||
with("z", (c, t) -> new NumericValue(z - origin.getZ()).bindTo("z")).
|
||||
with("_", (c, t) -> new BlockValue(null, source.getWorld(), new BlockPos(x, y, z)).bindTo("_"));
|
||||
with("_", (c, t) -> new BlockValue(null, source.getLevel(), new BlockPos(x, y, z)).bindTo("_"));
|
||||
Entity e = source.getEntity();
|
||||
if (e==null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user