This commit is contained in:
gnembon committed 2020-05-21 14:23:04 -03:00
1 parent 42ba5a9f03
commit cf817c2e39
25 files changed
+91 -92

No files matched your search

@@ -12,7 +12,6 @@ import carpet.script.value.StringValue;
import carpet.script.value.Value;
import carpet.utils.Messenger;
import net.minecraft.block.BlockState;
import net.minecraft.class_5321;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.entity.Entity;
@@ -29,6 +28,7 @@ import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.dimension.DimensionType;
import org.apache.commons.lang3.tuple.Pair;
@@ -191,7 +191,7 @@ public class CarpetEventServer
{
handler.call(Collections::emptyList, () ->
CarpetServer.minecraft_server.getCommandSource().
withWorld(CarpetServer.minecraft_server.getWorld(DimensionType.field_24753))// OVERWORLD))
withWorld(CarpetServer.minecraft_server.getWorld(DimensionType.OVERWORLD_REGISTRY_KEY))
);
}
},
@@ -202,7 +202,7 @@ public class CarpetEventServer
{
handler.call(Collections::emptyList, () ->
CarpetServer.minecraft_server.getCommandSource().
withWorld(CarpetServer.minecraft_server.getWorld(DimensionType.field_24754))// THE_NETHER))
withWorld(CarpetServer.minecraft_server.getWorld(DimensionType.THE_NETHER_REGISTRY_KEY))
);
}
},
@@ -213,7 +213,7 @@ public class CarpetEventServer
{
handler.call(Collections::emptyList, () ->
CarpetServer.minecraft_server.getCommandSource().
withWorld(CarpetServer.minecraft_server.getWorld(DimensionType.field_24755))//THE_END))
withWorld(CarpetServer.minecraft_server.getWorld(DimensionType.THE_END_REGISTRY_KEY))
);
}
},
@@ -531,13 +531,13 @@ public class CarpetEventServer
PLAYER_CHANGES_DIMENSION("player_changes_dimension", 5, false)
{
@Override
public void onDimensionChange(ServerPlayerEntity player, Vec3d from, Vec3d to, class_5321<DimensionType> fromDim, class_5321<DimensionType> dimTo)
public void onDimensionChange(ServerPlayerEntity player, Vec3d from, Vec3d to, RegistryKey<DimensionType> fromDim, RegistryKey<DimensionType> dimTo)
{
// eligibility already checked in mixin
Value fromValue = ListValue.fromTriple(from.x, from.y, from.z);
Value toValue = (to == null)?Value.NULL:ListValue.fromTriple(to.x, to.y, to.z);
Value fromDimStr = new StringValue(NBTSerializableValue.nameFromRegistryId(fromDim.method_29177()));
Value toDimStr = new StringValue(NBTSerializableValue.nameFromRegistryId(dimTo.method_29177()));
Value fromDimStr = new StringValue(NBTSerializableValue.nameFromRegistryId(fromDim.getValue()));
Value toDimStr = new StringValue(NBTSerializableValue.nameFromRegistryId(dimTo.getValue()));
handler.call( () -> Arrays.asList(
((c, t) -> new EntityValue(player)),
@@ -620,7 +620,7 @@ public class CarpetEventServer
public void onBlockBroken(ServerPlayerEntity player, BlockPos pos, BlockState previousBS) { }
public void onBlockPlaced(ServerPlayerEntity player, BlockPos pos, Hand enumhand, ItemStack itemstack) { }
public void onEntityAction(ServerPlayerEntity player, Entity entity, Hand enumhand) { }
public void onDimensionChange(ServerPlayerEntity player, Vec3d from, Vec3d to, class_5321<DimensionType> fromDim, class_5321<DimensionType> dimTo) {}
public void onDimensionChange(ServerPlayerEntity player, Vec3d from, Vec3d to, RegistryKey<DimensionType> fromDim, RegistryKey<DimensionType> dimTo) {}
public void onDamage(Entity target, float amount, DamageSource source) { }