Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-07 20:10:06 +01:00
Removed forgegradle - it's not needed.
Dieser Commit ist enthalten in:
Ursprung
156bf0acf5
Commit
3df026c2fd
@ -2,23 +2,15 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url = "http://files.minecraftforge.net/maven" }
|
maven { url = "http://files.minecraftforge.net/maven" }
|
||||||
maven { url = "http://repo.minecrell.net/releases" }
|
|
||||||
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath 'net.minecrell:VanillaGradle:2.0.3_1'
|
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.spongepowered.plugin' version '0.6'
|
id 'org.spongepowered.plugin' version '0.6'
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'net.minecrell.vanilla.server.library'
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':worldedit-core')
|
compile project(':worldedit-core')
|
||||||
compile 'org.spongepowered:spongeapi:6.0.0-SNAPSHOT'
|
compile 'org.spongepowered:spongeapi:6.0.0-SNAPSHOT'
|
||||||
@ -34,14 +26,6 @@ sponge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
|
||||||
version = "1.11"
|
|
||||||
mappings = "snapshot_20161116"
|
|
||||||
runDir = 'run'
|
|
||||||
}
|
|
||||||
|
|
||||||
project.archivesBaseName = "${project.archivesBaseName}-mc${minecraft.version}"
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes("Class-Path": "truezip.jar WorldEdit/truezip.jar js.jar WorldEdit/js.jar",
|
attributes("Class-Path": "truezip.jar WorldEdit/truezip.jar js.jar WorldEdit/js.jar",
|
||||||
@ -55,12 +39,6 @@ shadowJar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reobf {
|
|
||||||
shadowJar {
|
|
||||||
mappingType = 'SEARGE'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task deobfJar(type: Jar) {
|
task deobfJar(type: Jar) {
|
||||||
from sourceSets.main.output
|
from sourceSets.main.output
|
||||||
classifier = 'dev'
|
classifier = 'dev'
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* WorldEdit, a Minecraft world manipulation toolkit
|
|
||||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
|
||||||
* Copyright (C) WorldEdit team and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU Lesser General Public License as published by the
|
|
||||||
* Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
|
||||||
* for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sk89q.worldedit.sponge;
|
|
||||||
|
|
||||||
import com.flowpowered.math.vector.Vector3d;
|
|
||||||
import com.sk89q.worldedit.Vector;
|
|
||||||
import com.sk89q.worldedit.util.Location;
|
|
||||||
import com.sk89q.worldedit.world.World;
|
|
||||||
|
|
||||||
final class SpongeAdapter {
|
|
||||||
|
|
||||||
private SpongeAdapter() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static World adapt(org.spongepowered.api.world.World world) {
|
|
||||||
return SpongeWorldEdit.inst().getAdapter().getWorld(world);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Location adapt(org.spongepowered.api.world.Location<org.spongepowered.api.world.World> loc, Vector3d rot) {
|
|
||||||
Vector position = new Vector(loc.getX(), loc.getY(), loc.getZ());
|
|
||||||
|
|
||||||
return new Location(SpongeAdapter.adapt(loc.getExtent()), position, (float) rot.getY(), (float) rot.getX());
|
|
||||||
}
|
|
||||||
}
|
|
@ -59,7 +59,7 @@ class SpongeEntity implements Entity {
|
|||||||
org.spongepowered.api.world.Location<World> entityLoc = entity.getLocation();
|
org.spongepowered.api.world.Location<World> entityLoc = entity.getLocation();
|
||||||
Vector3d entityRot = entity.getRotation();
|
Vector3d entityRot = entity.getRotation();
|
||||||
|
|
||||||
return SpongeAdapter.adapt(entityLoc, entityRot);
|
return SpongeWorldEdit.inst().getAdapter().adapt(entityLoc, entityRot);
|
||||||
} else {
|
} else {
|
||||||
return new Location(NullWorld.getInstance());
|
return new Location(NullWorld.getInstance());
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ class SpongeEntity implements Entity {
|
|||||||
public Extent getExtent() {
|
public Extent getExtent() {
|
||||||
org.spongepowered.api.entity.Entity entity = entityRef.get();
|
org.spongepowered.api.entity.Entity entity = entityRef.get();
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
return SpongeAdapter.adapt(entity.getWorld());
|
return SpongeWorldEdit.inst().getAdapter().getWorld(entity.getWorld());
|
||||||
} else {
|
} else {
|
||||||
return NullWorld.getInstance();
|
return NullWorld.getInstance();
|
||||||
}
|
}
|
||||||
|
@ -79,18 +79,18 @@ public class SpongePlayer extends AbstractPlayerActor {
|
|||||||
org.spongepowered.api.world.Location<World> entityLoc = this.player.getLocation();
|
org.spongepowered.api.world.Location<World> entityLoc = this.player.getLocation();
|
||||||
Vector3d entityRot = this.player.getRotation();
|
Vector3d entityRot = this.player.getRotation();
|
||||||
|
|
||||||
return SpongeAdapter.adapt(entityLoc, entityRot);
|
return SpongeWorldEdit.inst().getAdapter().adapt(entityLoc, entityRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorldVector getPosition() {
|
public WorldVector getPosition() {
|
||||||
Vector3d pos = this.player.getLocation().getPosition();
|
Vector3d pos = this.player.getLocation().getPosition();
|
||||||
return new WorldVector(LocalWorldAdapter.adapt(SpongeAdapter.adapt(this.player.getWorld())), pos.getX(), pos.getY(), pos.getZ());
|
return new WorldVector(LocalWorldAdapter.adapt(SpongeWorldEdit.inst().getAdapter().getWorld(this.player.getWorld())), pos.getX(), pos.getY(), pos.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public com.sk89q.worldedit.world.World getWorld() {
|
public com.sk89q.worldedit.world.World getWorld() {
|
||||||
return SpongeAdapter.adapt(player.getWorld());
|
return SpongeWorldEdit.inst().getAdapter().getWorld(player.getWorld());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,7 +55,6 @@ import java.lang.ref.WeakReference;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
@ -64,8 +63,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||||||
*/
|
*/
|
||||||
public abstract class SpongeWorld extends AbstractWorld {
|
public abstract class SpongeWorld extends AbstractWorld {
|
||||||
|
|
||||||
protected static final Random random = new Random();
|
|
||||||
|
|
||||||
private final WeakReference<World> worldRef;
|
private final WeakReference<World> worldRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,11 +19,12 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.sponge.adapter;
|
package com.sk89q.worldedit.sponge.adapter;
|
||||||
|
|
||||||
import com.sk89q.jnbt.*;
|
import com.flowpowered.math.vector.Vector3d;
|
||||||
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||||
import com.sk89q.worldedit.entity.BaseEntity;
|
import com.sk89q.worldedit.entity.BaseEntity;
|
||||||
import com.sk89q.worldedit.sponge.SpongeWorld;
|
import com.sk89q.worldedit.sponge.SpongeWorld;
|
||||||
import net.minecraft.nbt.*;
|
import com.sk89q.worldedit.util.Location;
|
||||||
import org.spongepowered.api.block.BlockType;
|
import org.spongepowered.api.block.BlockType;
|
||||||
import org.spongepowered.api.entity.Entity;
|
import org.spongepowered.api.entity.Entity;
|
||||||
import org.spongepowered.api.item.ItemType;
|
import org.spongepowered.api.item.ItemType;
|
||||||
@ -66,59 +67,15 @@ public interface SpongeImplAdapter {
|
|||||||
|
|
||||||
BiomeType resolveBiome(int intID);
|
BiomeType resolveBiome(int intID);
|
||||||
|
|
||||||
NBTBase toNative(Tag tag);
|
|
||||||
|
|
||||||
NBTTagIntArray toNative(IntArrayTag tag);
|
|
||||||
|
|
||||||
NBTTagList toNative(ListTag tag);
|
|
||||||
|
|
||||||
NBTTagLong toNative(LongTag tag);
|
|
||||||
|
|
||||||
NBTTagString toNative(StringTag tag);
|
|
||||||
|
|
||||||
NBTTagInt toNative(IntTag tag);
|
|
||||||
|
|
||||||
NBTTagByte toNative(ByteTag tag);
|
|
||||||
|
|
||||||
NBTTagByteArray toNative(ByteArrayTag tag);
|
|
||||||
|
|
||||||
NBTTagCompound toNative(CompoundTag tag);
|
|
||||||
|
|
||||||
NBTTagFloat toNative(FloatTag tag);
|
|
||||||
|
|
||||||
NBTTagShort toNative(ShortTag tag);
|
|
||||||
|
|
||||||
NBTTagDouble toNative(DoubleTag tag);
|
|
||||||
|
|
||||||
Tag fromNative(NBTBase other);
|
|
||||||
|
|
||||||
IntArrayTag fromNative(NBTTagIntArray other);
|
|
||||||
|
|
||||||
ListTag fromNative(NBTTagList other);
|
|
||||||
|
|
||||||
EndTag fromNative(NBTTagEnd other);
|
|
||||||
|
|
||||||
LongTag fromNative(NBTTagLong other);
|
|
||||||
|
|
||||||
StringTag fromNative(NBTTagString other);
|
|
||||||
|
|
||||||
IntTag fromNative(NBTTagInt other);
|
|
||||||
|
|
||||||
ByteTag fromNative(NBTTagByte other);
|
|
||||||
|
|
||||||
ByteArrayTag fromNative(NBTTagByteArray other);
|
|
||||||
|
|
||||||
CompoundTag fromNative(NBTTagCompound other);
|
|
||||||
|
|
||||||
FloatTag fromNative(NBTTagFloat other);
|
|
||||||
|
|
||||||
ShortTag fromNative(NBTTagShort other);
|
|
||||||
|
|
||||||
DoubleTag fromNative(NBTTagDouble other);
|
|
||||||
|
|
||||||
BaseEntity createBaseEntity(Entity entity);
|
BaseEntity createBaseEntity(Entity entity);
|
||||||
|
|
||||||
ItemStack makeSpongeStack(BaseItemStack itemStack);
|
ItemStack makeSpongeStack(BaseItemStack itemStack);
|
||||||
|
|
||||||
SpongeWorld getWorld(World world);
|
SpongeWorld getWorld(World world);
|
||||||
|
|
||||||
|
default Location adapt(org.spongepowered.api.world.Location<org.spongepowered.api.world.World> loc, Vector3d rot) {
|
||||||
|
Vector position = new Vector(loc.getX(), loc.getY(), loc.getZ());
|
||||||
|
|
||||||
|
return new Location(getWorld(loc.getExtent()), position, (float) rot.getY(), (float) rot.getX());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren