geforkt von Mirrors/FastAsyncWorldEdit
Update to 1.8.9
Dieser Commit ist enthalten in:
Ursprung
39e17ddbce
Commit
633e734b70
@ -7,25 +7,30 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':worldedit-core')
|
compile project(':worldedit-core')
|
||||||
compile 'org.spongepowered:spongeapi:2.1-SNAPSHOT'
|
compile 'org.spongepowered:spongeapi:3.1.0-SNAPSHOT'
|
||||||
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1'
|
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url ="https://repo.spongepowered.org/maven" }
|
maven {
|
||||||
|
name = "Sponge"
|
||||||
|
url = "https://repo.spongepowered.org/maven"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext.forgeVersion = "11.15.0.1695"
|
||||||
minecraft {
|
minecraft {
|
||||||
ext.forgeVersion = "11.14.0.1281"
|
version = "1.8.9-${project.forgeVersion}"
|
||||||
version = "1.8-$forgeVersion-1.8"
|
mappings = "snapshot_20160111"
|
||||||
|
runDir = 'run'
|
||||||
|
|
||||||
replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java"
|
replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java"
|
||||||
replace "%VERSION%", project.version
|
replace "%VERSION%", project.version
|
||||||
@ -37,7 +42,7 @@ processResources {
|
|||||||
from (sourceSets.main.resources.srcDirs) {
|
from (sourceSets.main.resources.srcDirs) {
|
||||||
expand 'version': project.version,
|
expand 'version': project.version,
|
||||||
'mcVersion': project.minecraft.version,
|
'mcVersion': project.minecraft.version,
|
||||||
'forgeVersion': project.minecraft.forgeVersion,
|
'forgeVersion': project.forgeVersion,
|
||||||
'internalVersion': project.internalVersion
|
'internalVersion': project.internalVersion
|
||||||
include 'mcmod.info'
|
include 'mcmod.info'
|
||||||
}
|
}
|
||||||
@ -60,8 +65,8 @@ shadowJar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reobf.reobf(shadowJar) { spec ->
|
reobf {
|
||||||
spec.classpath = sourceSets.main.compileClasspath;
|
shadowJar
|
||||||
}
|
}
|
||||||
|
|
||||||
task deobfJar(type: Jar) {
|
task deobfJar(type: Jar) {
|
||||||
|
@ -19,14 +19,14 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.forge;
|
package com.sk89q.worldedit.forge;
|
||||||
|
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy {
|
public class ClientProxy extends CommonProxy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerHandlers() {
|
public void registerHandlers() {
|
||||||
super.registerHandlers();
|
super.registerHandlers();
|
||||||
FMLCommonHandler.instance().bus().register(new KeyHandler());
|
MinecraftForge.EVENT_BUS.register(new KeyHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class CommandWrapper extends CommandBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(@Nullable Object o) {
|
public int compareTo(@Nullable ICommand o) {
|
||||||
if (o == null) {
|
if (o == null) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (o instanceof ICommand) {
|
} else if (o instanceof ICommand) {
|
||||||
|
@ -41,9 +41,14 @@ import com.sk89q.worldedit.world.biome.BaseBiome;
|
|||||||
import com.sk89q.worldedit.world.registry.WorldData;
|
import com.sk89q.worldedit.world.registry.WorldData;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.BlockLeaves;
|
||||||
|
import net.minecraft.block.BlockOldLeaf;
|
||||||
|
import net.minecraft.block.BlockOldLog;
|
||||||
|
import net.minecraft.block.BlockPlanks;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityList;
|
import net.minecraft.entity.EntityList;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -90,9 +95,14 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||||||
*/
|
*/
|
||||||
public class ForgeWorld extends AbstractWorld {
|
public class ForgeWorld extends AbstractWorld {
|
||||||
|
|
||||||
|
private static final Random random = new Random();
|
||||||
private static final int UPDATE = 1, NOTIFY = 2, NOTIFY_CLIENT = 4;
|
private static final int UPDATE = 1, NOTIFY = 2, NOTIFY_CLIENT = 4;
|
||||||
private static final Logger logger = Logger.getLogger(ForgeWorld.class.getCanonicalName());
|
private static final Logger logger = Logger.getLogger(ForgeWorld.class.getCanonicalName());
|
||||||
private static final Random random = new Random();
|
|
||||||
|
private static final IBlockState JUNGLE_LOG = Blocks.log.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
|
||||||
|
private static final IBlockState JUNGLE_LEAF = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.JUNGLE).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
||||||
|
private static final IBlockState JUNGLE_SHRUB = Blocks.leaves.getDefaultState().withProperty(BlockOldLeaf.VARIANT, BlockPlanks.EnumType.OAK).withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false));
|
||||||
|
|
||||||
private final WeakReference<World> worldRef;
|
private final WeakReference<World> worldRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -348,12 +358,12 @@ public class ForgeWorld extends AbstractWorld {
|
|||||||
case REDWOOD: return new WorldGenTaiga2(true);
|
case REDWOOD: return new WorldGenTaiga2(true);
|
||||||
case TALL_REDWOOD: return new WorldGenTaiga1();
|
case TALL_REDWOOD: return new WorldGenTaiga1();
|
||||||
case BIRCH: return new WorldGenForest(true, false);
|
case BIRCH: return new WorldGenForest(true, false);
|
||||||
case JUNGLE: return new WorldGenMegaJungle(true, 10, 20, 3, 3);
|
case JUNGLE: return new WorldGenMegaJungle(true, 10, 20, JUNGLE_LOG, JUNGLE_LEAF);
|
||||||
case SMALL_JUNGLE: return new WorldGenTrees(true, 4 + random.nextInt(7), 3, 3, false);
|
case SMALL_JUNGLE: return new WorldGenTrees(true, 4 + random.nextInt(7), JUNGLE_LOG, JUNGLE_LEAF, false);
|
||||||
case SHORT_JUNGLE: return new WorldGenTrees(true, 4 + random.nextInt(7), 3, 3, true);
|
case SHORT_JUNGLE: return new WorldGenTrees(true, 4 + random.nextInt(7), JUNGLE_LOG, JUNGLE_LEAF, true);
|
||||||
case JUNGLE_BUSH: return new WorldGenShrub(3, 0);
|
case JUNGLE_BUSH: return new WorldGenShrub(JUNGLE_LOG, JUNGLE_SHRUB);
|
||||||
case RED_MUSHROOM: return new WorldGenBigMushroom(1);
|
case RED_MUSHROOM: return new WorldGenBigMushroom(Blocks.brown_mushroom_block);
|
||||||
case BROWN_MUSHROOM: return new WorldGenBigMushroom(0);
|
case BROWN_MUSHROOM: return new WorldGenBigMushroom(Blocks.red_mushroom_block);
|
||||||
case SWAMP: return new WorldGenSwamp();
|
case SWAMP: return new WorldGenSwamp();
|
||||||
case ACACIA: return new WorldGenSavannaTree(true);
|
case ACACIA: return new WorldGenSavannaTree(true);
|
||||||
case DARK_OAK: return new WorldGenCanopyTree(true);
|
case DARK_OAK: return new WorldGenCanopyTree(true);
|
||||||
@ -427,7 +437,6 @@ public class ForgeWorld extends AbstractWorld {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public List<? extends Entity> getEntities(Region region) {
|
public List<? extends Entity> getEntities(Region region) {
|
||||||
List<Entity> entities = new ArrayList<Entity>();
|
List<Entity> entities = new ArrayList<Entity>();
|
||||||
World world = getWorld();
|
World world = getWorld();
|
||||||
@ -443,8 +452,8 @@ public class ForgeWorld extends AbstractWorld {
|
|||||||
@Override
|
@Override
|
||||||
public List<? extends Entity> getEntities() {
|
public List<? extends Entity> getEntities() {
|
||||||
List<Entity> entities = new ArrayList<Entity>();
|
List<Entity> entities = new ArrayList<Entity>();
|
||||||
for (Object entity : getWorld().loadedEntityList) {
|
for (net.minecraft.entity.Entity entity : getWorld().loadedEntityList) {
|
||||||
entities.add(new ForgeEntity((net.minecraft.entity.Entity) entity));
|
entities.add(new ForgeEntity(entity));
|
||||||
}
|
}
|
||||||
return entities;
|
return entities;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.forge;
|
package com.sk89q.worldedit.forge;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
import com.sk89q.worldedit.LocalSession;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
@ -28,6 +30,8 @@ import com.sk89q.worldedit.event.platform.PlatformReadyEvent;
|
|||||||
import com.sk89q.worldedit.extension.platform.Platform;
|
import com.sk89q.worldedit.extension.platform.Platform;
|
||||||
import com.sk89q.worldedit.internal.LocalWorldAdapter;
|
import com.sk89q.worldedit.internal.LocalWorldAdapter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Map;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -35,7 +39,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.CommandEvent;
|
import net.minecraftforge.event.CommandEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||||
import net.minecraftforge.fml.common.Loader;
|
import net.minecraftforge.fml.common.Loader;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||||
@ -50,13 +54,7 @@ import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
|||||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
import static net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Forge implementation of WorldEdit.
|
* The Forge implementation of WorldEdit.
|
||||||
@ -90,7 +88,7 @@ public class ForgeWorldEdit {
|
|||||||
config = new ForgeConfiguration(this);
|
config = new ForgeConfiguration(this);
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
FMLCommonHandler.instance().bus().register(ThreadSafeCache.getInstance());
|
MinecraftForge.EVENT_BUS.register(ThreadSafeCache.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
@ -203,7 +201,7 @@ public class ForgeWorldEdit {
|
|||||||
public static ItemStack toForgeItemStack(BaseItemStack item) {
|
public static ItemStack toForgeItemStack(BaseItemStack item) {
|
||||||
ItemStack ret = new ItemStack(Item.getItemById(item.getType()), item.getAmount(), item.getData());
|
ItemStack ret = new ItemStack(Item.getItemById(item.getType()), item.getAmount(), item.getData());
|
||||||
for (Map.Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
for (Map.Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
||||||
ret.addEnchantment(net.minecraft.enchantment.Enchantment.enchantmentsList[((Integer) entry.getKey())], (Integer) entry.getValue());
|
ret.addEnchantment(net.minecraft.enchantment.Enchantment.getEnchantmentById(entry.getKey()), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -19,13 +19,13 @@
|
|||||||
|
|
||||||
package com.sk89q.worldedit.forge;
|
package com.sk89q.worldedit.forge;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import com.sk89q.worldedit.LocalSession;
|
||||||
|
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.network.NetHandlerPlayServer;
|
import net.minecraft.network.NetHandlerPlayServer;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.network.ThreadQuickExitException;
|
import net.minecraft.network.ThreadQuickExitException;
|
||||||
import net.minecraft.network.play.server.S20PacketEntityProperties;
|
|
||||||
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
import net.minecraft.network.play.server.S3FPacketCustomPayload;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.network.FMLEventChannel;
|
import net.minecraftforge.fml.common.network.FMLEventChannel;
|
||||||
@ -33,8 +33,6 @@ import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientCustomPacketE
|
|||||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||||
|
|
||||||
import com.sk89q.worldedit.LocalSession;
|
|
||||||
|
|
||||||
public class WECUIPacketHandler {
|
public class WECUIPacketHandler {
|
||||||
public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
|
public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
|
||||||
public static FMLEventChannel WECUI_CHANNEL;
|
public static FMLEventChannel WECUI_CHANNEL;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren