Migrate the Carpet codebase to Mojang Mappings
This commit is contained in:
346 files changed
+8353
-8492
No files matched your search
@@ -8,16 +8,15 @@ import carpet.script.value.NumericValue;
|
||||
import carpet.script.value.StringValue;
|
||||
import carpet.script.value.Value;
|
||||
import carpet.script.value.ValueConversions;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public class EntityEventsGroup
|
||||
{
|
||||
@@ -48,7 +47,7 @@ public class EntityEventsGroup
|
||||
}
|
||||
if (key.user() != null)
|
||||
{
|
||||
if (entity.getServer().getPlayerManager().getPlayer(key.user())==null)
|
||||
if (entity.getServer().getPlayerList().getPlayerByName(key.user())==null)
|
||||
{
|
||||
iterator.remove();
|
||||
continue;
|
||||
@@ -105,8 +104,8 @@ public class EntityEventsGroup
|
||||
return Arrays.asList(
|
||||
new EntityValue(entity),
|
||||
new NumericValue(amount),
|
||||
new StringValue(source.getName()),
|
||||
source.getAttacker()==null?Value.NULL:new EntityValue(source.getAttacker())
|
||||
new StringValue(source.getMsgId()),
|
||||
source.getEntity()==null?Value.NULL:new EntityValue(source.getEntity())
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -117,9 +116,9 @@ public class EntityEventsGroup
|
||||
{
|
||||
return Arrays.asList(
|
||||
new EntityValue(entity),
|
||||
ValueConversions.of((Vec3d) providedArgs[0]),
|
||||
ValueConversions.of((Vec3d) providedArgs[1]),
|
||||
ValueConversions.of((Vec3d) providedArgs[2])
|
||||
ValueConversions.of((Vec3) providedArgs[0]),
|
||||
ValueConversions.of((Vec3) providedArgs[1]),
|
||||
ValueConversions.of((Vec3) providedArgs[2])
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -143,7 +142,7 @@ public class EntityEventsGroup
|
||||
public CarpetEventServer.CallbackResult call(CarpetEventServer.Callback tickCall, Entity entity, Object ... args)
|
||||
{
|
||||
assert args.length == argcount-1;
|
||||
return tickCall.execute(entity.getCommandSource(), makeArgs(entity, args));
|
||||
return tickCall.execute(entity.createCommandSourceStack(), makeArgs(entity, args));
|
||||
}
|
||||
protected List<Value> makeArgs(Entity entity, Object ... args)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user