mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-03-07 13:48:00 +08:00
parent
8fee9bdd2c
commit
8caaa3e0ed
@ -16,7 +16,7 @@
|
||||
val nextMajorMinecraftVersion: String = minecraftVersion.split('.').let { (useless, major) ->
|
||||
"$useless.${major.toInt() + 1}"
|
||||
}
|
||||
val forgeVersion = "41.0.1"
|
||||
val forgeVersion = "41.0.98"
|
||||
|
||||
val apiClasspath = configurations.create("apiClasspath") {
|
||||
isCanBeResolved = true
|
||||
|
@ -53,7 +53,7 @@ public BaseEntity getState() {
|
||||
if (entity == null || entity.isPassenger()) {
|
||||
return null;
|
||||
}
|
||||
ResourceLocation id = ForgeRegistries.ENTITIES.getKey(entity.getType());
|
||||
ResourceLocation id = ForgeRegistries.ENTITY_TYPES.getKey(entity.getType());
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public DataFixer getDataFixer() {
|
||||
|
||||
@Override
|
||||
public boolean isValidMobType(String type) {
|
||||
return net.minecraftforge.registries.ForgeRegistries.ENTITIES.containsKey(new ResourceLocation(type));
|
||||
return net.minecraftforge.registries.ForgeRegistries.ENTITY_TYPES.containsKey(new ResourceLocation(type));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -89,7 +89,6 @@
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.sk89q.worldedit.forge.ForgeAdapter.adaptPlayer;
|
||||
import static com.sk89q.worldedit.internal.anvil.ChunkDeleter.DELCHUNKS_FILE_NAME;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
/**
|
||||
* The Forge implementation of WorldEdit.
|
||||
@ -189,7 +188,7 @@ private void setupRegistries(MinecraftServer server) {
|
||||
}
|
||||
}
|
||||
// Entities
|
||||
for (ResourceLocation name : ForgeRegistries.ENTITIES.getKeys()) {
|
||||
for (ResourceLocation name : ForgeRegistries.ENTITY_TYPES.getKeys()) {
|
||||
if (EntityType.REGISTRY.get(name.toString()) == null) {
|
||||
EntityType.REGISTRY.register(name.toString(), new EntityType(name.toString()));
|
||||
}
|
||||
@ -225,7 +224,7 @@ public void registerCommands(RegisterCommandsEvent event) {
|
||||
}
|
||||
|
||||
List<Command> commands = manager.getPlatformCommandManager().getCommandManager()
|
||||
.getAllCommands().collect(toList());
|
||||
.getAllCommands().toList();
|
||||
for (Command command : commands) {
|
||||
CommandWrapper.register(event.getDispatcher(), command);
|
||||
Set<String> perms = command.getCondition().as(PermissionCondition.class)
|
||||
@ -270,7 +269,7 @@ public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
return; // We have to be told to catch these events
|
||||
}
|
||||
|
||||
if (event.getWorld().isClientSide && event instanceof LeftClickEmpty) {
|
||||
if (event.getLevel().isClientSide && event instanceof LeftClickEmpty) {
|
||||
// catch LCE, pass it to server
|
||||
InternalPacketHandler.getHandler().sendToServer(LeftClickAirEventMessage.INSTANCE);
|
||||
return;
|
||||
@ -288,8 +287,8 @@ public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
}
|
||||
|
||||
WorldEdit we = WorldEdit.getInstance();
|
||||
ForgePlayer player = adaptPlayer((ServerPlayer) event.getPlayer());
|
||||
ForgeWorld world = getWorld((ServerLevel) event.getPlayer().level);
|
||||
ForgePlayer player = adaptPlayer((ServerPlayer) event.getEntity());
|
||||
ForgeWorld world = getWorld((ServerLevel) event.getEntity().level);
|
||||
Direction direction = ForgeAdapter.adaptEnumFacing(event.getFace());
|
||||
|
||||
if (event instanceof PlayerInteractEvent.LeftClickEmpty) {
|
||||
@ -343,9 +342,9 @@ public void onCommandEvent(CommandEvent event) throws CommandSyntaxException {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerLogOut(PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
if (event.getPlayer() instanceof ServerPlayer) {
|
||||
if (event.getEntity() instanceof ServerPlayer) {
|
||||
WorldEdit.getInstance().getEventBus()
|
||||
.post(new SessionIdleEvent(new ForgePlayer.SessionKeyImpl((ServerPlayer) event.getPlayer())));
|
||||
.post(new SessionIdleEvent(new ForgePlayer.SessionKeyImpl((ServerPlayer) event.getEntity())));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user