[Forge] Initial update to 1.11

Also updates Gradle to 3.2.1, because keeping updated is good.
This commit is contained in:
Kenzie Togami 2016-11-17 22:17:04 -08:00 committed by Wizjany
parent 17aafe87d0
commit 6ad11624bb
16 changed files with 58 additions and 58 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
#Thu May 05 15:11:12 PDT 2016 #Wed Nov 23 21:39:25 PST 2016
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-3.2.1-bin.zip

23
gradlew vendored
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
############################################################################## ##############################################################################
## ##
@ -154,11 +154,18 @@ if $cygwin ; then
esac esac
fi fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules # Escape application args
function splitJvmOpts() { for s in "${@}" ; do
JVM_OPTS=("$@") s=\"$s\"
} APP_ARGS=$APP_ARGS" "$s
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS done
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" # Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

6
gradlew.bat vendored
View File

@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants @rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args :win9xME_args
@rem Slurp the command line arguments. @rem Slurp the command line arguments.
@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%* set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute :execute
@rem Setup the command line @rem Setup the command line

View File

@ -26,13 +26,11 @@ repositories {
} }
} }
//version = "6.1.2" ext.forgeVersion = "13.19.0.2149"
ext.forgeVersion = "12.18.0.2002-1.10.0"
//ext.internalVersion = version + ";" + gitCommitHash
minecraft { minecraft {
version = "1.10.2-${project.forgeVersion}" version = "1.11-${project.forgeVersion}"
mappings = "snapshot_20160629" mappings = "snapshot_20161118"
runDir = 'run' runDir = 'run'
replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java" replaceIn "com/sk89q/worldedit/forge/ForgeWorldEdit.java"

View File

@ -38,12 +38,12 @@ public class CommandWrapper extends CommandBase {
} }
@Override @Override
public String getCommandName() { public String getName() {
return command.getPrimaryAlias(); return command.getPrimaryAlias();
} }
@Override @Override
public List<String> getCommandAliases() { public List<String> getAliases() {
return Arrays.asList(command.getAllAliases()); return Arrays.asList(command.getAllAliases());
} }
@ -52,7 +52,7 @@ public class CommandWrapper extends CommandBase {
} }
@Override @Override
public String getCommandUsage(ICommandSender icommandsender) { public String getUsage(ICommandSender icommandsender) {
return "/" + command.getPrimaryAlias() + " " + command.getDescription().getUsage(); return "/" + command.getPrimaryAlias() + " " + command.getDescription().getUsage();
} }
@ -70,10 +70,8 @@ public class CommandWrapper extends CommandBase {
public int compareTo(@Nullable ICommand o) { public int compareTo(@Nullable ICommand o) {
if (o == null) { if (o == null) {
return 0; return 0;
} else if (o instanceof ICommand) {
return super.compareTo((ICommand) o);
} else { } else {
return 0; return super.compareTo(o);
} }
} }
} }

View File

@ -68,7 +68,7 @@ class ForgeEntity implements Entity {
float yaw = entity.rotationYaw; float yaw = entity.rotationYaw;
float pitch = entity.rotationPitch; float pitch = entity.rotationPitch;
return new Location(ForgeAdapter.adapt(entity.worldObj), position, yaw, pitch); return new Location(ForgeAdapter.adapt(entity.world), position, yaw, pitch);
} else { } else {
return new Location(NullWorld.getInstance()); return new Location(NullWorld.getInstance());
} }
@ -78,7 +78,7 @@ class ForgeEntity implements Entity {
public Extent getExtent() { public Extent getExtent() {
net.minecraft.entity.Entity entity = entityRef.get(); net.minecraft.entity.Entity entity = entityRef.get();
if (entity != null) { if (entity != null) {
return ForgeAdapter.adapt(entity.worldObj); return ForgeAdapter.adapt(entity.world);
} else { } else {
return NullWorld.getInstance(); return NullWorld.getInstance();
} }

View File

@ -36,6 +36,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.server.management.PlayerList; import net.minecraft.server.management.PlayerList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.FMLCommonHandler;
@ -92,7 +93,7 @@ class ForgePlatform extends AbstractPlatform implements MultiUserPlatform {
@Override @Override
public boolean isValidMobType(String type) { public boolean isValidMobType(String type) {
return EntityList.NAME_TO_CLASS.containsKey(type); return EntityList.isStringValidEntityName(new ResourceLocation(type));
} }
@Override @Override
@ -122,7 +123,7 @@ class ForgePlatform extends AbstractPlatform implements MultiUserPlatform {
return player; return player;
} else { } else {
EntityPlayerMP entity = server.getPlayerList().getPlayerByUsername(player.getName()); EntityPlayerMP entity = server.getPlayerList().getPlayerByUsername(player.getName());
return entity != null ? new ForgePlayer(this, entity) : null; return entity != null ? new ForgePlayer(entity) : null;
} }
} }
@ -201,9 +202,9 @@ class ForgePlatform extends AbstractPlatform implements MultiUserPlatform {
public Collection<Actor> getConnectedUsers() { public Collection<Actor> getConnectedUsers() {
List<Actor> users = new ArrayList<Actor>(); List<Actor> users = new ArrayList<Actor>();
PlayerList scm = server.getPlayerList(); PlayerList scm = server.getPlayerList();
for (EntityPlayerMP entity : scm.getPlayerList()) { for (EntityPlayerMP entity : scm.getPlayers()) {
if (entity != null) { if (entity != null) {
users.add(new ForgePlayer(this, entity)); users.add(new ForgePlayer(entity));
} }
} }
return users; return users;

View File

@ -44,11 +44,9 @@ import net.minecraft.util.text.TextFormatting;
public class ForgePlayer extends AbstractPlayerActor { public class ForgePlayer extends AbstractPlayerActor {
private final ForgePlatform platform;
private final EntityPlayerMP player; private final EntityPlayerMP player;
protected ForgePlayer(ForgePlatform platform, EntityPlayerMP player) { protected ForgePlayer(EntityPlayerMP player) {
this.platform = platform;
this.player = player; this.player = player;
ThreadSafeCache.getInstance().getOnlineIds().add(getUniqueId()); ThreadSafeCache.getInstance().getOnlineIds().add(getUniqueId());
} }
@ -78,7 +76,7 @@ public class ForgePlayer extends AbstractPlayerActor {
public Location getLocation() { public Location getLocation() {
Vector position = new Vector(this.player.posX, this.player.posY, this.player.posZ); Vector position = new Vector(this.player.posX, this.player.posY, this.player.posZ);
return new Location( return new Location(
ForgeWorldEdit.inst.getWorld(this.player.worldObj), ForgeWorldEdit.inst.getWorld(this.player.world),
position, position,
this.player.rotationYaw, this.player.rotationYaw,
this.player.rotationPitch); this.player.rotationPitch);
@ -87,12 +85,12 @@ public class ForgePlayer extends AbstractPlayerActor {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Override @Override
public WorldVector getPosition() { public WorldVector getPosition() {
return new WorldVector(LocalWorldAdapter.adapt(ForgeWorldEdit.inst.getWorld(this.player.worldObj)), this.player.posX, this.player.posY, this.player.posZ); return new WorldVector(LocalWorldAdapter.adapt(ForgeWorldEdit.inst.getWorld(this.player.world)), this.player.posX, this.player.posY, this.player.posZ);
} }
@Override @Override
public com.sk89q.worldedit.world.World getWorld() { public com.sk89q.worldedit.world.World getWorld() {
return ForgeWorldEdit.inst.getWorld(this.player.worldObj); return ForgeWorldEdit.inst.getWorld(this.player.world);
} }
@Override @Override
@ -125,7 +123,7 @@ public class ForgePlayer extends AbstractPlayerActor {
@Override @Override
public void printRaw(String msg) { public void printRaw(String msg) {
for (String part : msg.split("\n")) { for (String part : msg.split("\n")) {
this.player.addChatMessage(new TextComponentString(part)); this.player.sendMessage(new TextComponentString(part));
} }
} }
@ -148,7 +146,7 @@ public class ForgePlayer extends AbstractPlayerActor {
for (String part : msg.split("\n")) { for (String part : msg.split("\n")) {
TextComponentString component = new TextComponentString(part); TextComponentString component = new TextComponentString(part);
component.getStyle().setColor(formatting); component.getStyle().setColor(formatting);
this.player.addChatMessage(component); this.player.sendMessage(component);
} }
} }

View File

@ -27,6 +27,7 @@ import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.blocks.LazyBlock; import com.sk89q.worldedit.blocks.LazyBlock;
import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity; import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.history.change.BlockChange;
import com.sk89q.worldedit.internal.Constants; import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Direction;
@ -50,6 +51,7 @@ import net.minecraft.server.management.PlayerChunkMapEntry;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World; import net.minecraft.world.World;
@ -77,7 +79,7 @@ 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 Random random = new Random();
private static final int UPDATE = 1, NOTIFY = 2, NOTIFY_CLIENT = 4; private static final int UPDATE = 1, NOTIFY = 2;
private static final Logger logger = Logger.getLogger(ForgeWorld.class.getCanonicalName()); private static final Logger logger = Logger.getLogger(ForgeWorld.class.getCanonicalName());
private static final IBlockState JUNGLE_LOG = Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE); private static final IBlockState JUNGLE_LOG = Blocks.LOG.getDefaultState().withProperty(BlockOldLog.VARIANT, BlockPlanks.EnumType.JUNGLE);
@ -145,6 +147,7 @@ public class ForgeWorld extends AbstractWorld {
Chunk chunk = world.getChunkFromChunkCoords(x >> 4, z >> 4); Chunk chunk = world.getChunkFromChunkCoords(x >> 4, z >> 4);
BlockPos pos = new BlockPos(x, y, z); BlockPos pos = new BlockPos(x, y, z);
IBlockState old = chunk.getBlockState(pos); IBlockState old = chunk.getBlockState(pos);
@SuppressWarnings("deprecation")
IBlockState newState = Block.getBlockById(block.getId()).getStateFromMeta(block.getData()); IBlockState newState = Block.getBlockById(block.getId()).getStateFromMeta(block.getData());
IBlockState successState = chunk.setBlockState(pos, newState); IBlockState successState = chunk.setBlockState(pos, newState);
boolean successful = successState != null; boolean successful = successState != null;
@ -233,7 +236,7 @@ public class ForgeWorld extends AbstractWorld {
EntityItem entity = new EntityItem(getWorld(), position.getX(), position.getY(), position.getZ(), ForgeWorldEdit.toForgeItemStack(item)); EntityItem entity = new EntityItem(getWorld(), position.getX(), position.getY(), position.getZ(), ForgeWorldEdit.toForgeItemStack(item));
entity.setPickupDelay(10); entity.setPickupDelay(10);
getWorld().spawnEntityInWorld(entity); getWorld().spawnEntity(entity);
} }
@Override @Override
@ -263,7 +266,7 @@ public class ForgeWorld extends AbstractWorld {
try { try {
ChunkProviderServer chunkServer = (ChunkProviderServer) provider; ChunkProviderServer chunkServer = (ChunkProviderServer) provider;
IChunkGenerator gen = chunkServer.chunkGenerator; IChunkGenerator gen = chunkServer.chunkGenerator;
long pos = ChunkPos.chunkXZ2Int(chunk.getBlockX(), chunk.getBlockZ()); long pos = ChunkPos.asLong(chunk.getBlockX(), chunk.getBlockZ());
if (chunkServer.chunkExists(chunk.getBlockX(), chunk.getBlockZ())) { if (chunkServer.chunkExists(chunk.getBlockX(), chunk.getBlockZ())) {
mcChunk = chunkServer.loadChunk(chunk.getBlockX(), chunk.getBlockZ()); mcChunk = chunkServer.loadChunk(chunk.getBlockX(), chunk.getBlockZ());
PlayerChunkMapEntry entry = playerManager.getEntry(chunk.getBlockX(), chunk.getBlockZ()); PlayerChunkMapEntry entry = playerManager.getEntry(chunk.getBlockX(), chunk.getBlockZ());
@ -295,7 +298,7 @@ public class ForgeWorld extends AbstractWorld {
if (!region.contains(pt)) if (!region.contains(pt))
editSession.smartSetBlock(pt, history[index]); editSession.smartSetBlock(pt, history[index]);
else { else {
editSession.rememberChange(pt, history[index], editSession.rawGetBlock(pt)); editSession.getChangeSet().add(new BlockChange(pt.toBlockVector(), history[index], editSession.getBlock(pt)));
} }
} }
} }
@ -423,7 +426,7 @@ public class ForgeWorld extends AbstractWorld {
@Override @Override
public Entity createEntity(Location location, BaseEntity entity) { public Entity createEntity(Location location, BaseEntity entity) {
World world = getWorld(); World world = getWorld();
net.minecraft.entity.Entity createdEntity = EntityList.createEntityByName(entity.getTypeId(), world); net.minecraft.entity.Entity createdEntity = EntityList.createEntityByIDFromName(new ResourceLocation(entity.getTypeId()), world);
if (createdEntity != null) { if (createdEntity != null) {
CompoundTag nativeTag = entity.getNbtData(); CompoundTag nativeTag = entity.getNbtData();
if (nativeTag != null) { if (nativeTag != null) {
@ -436,7 +439,7 @@ public class ForgeWorld extends AbstractWorld {
createdEntity.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); createdEntity.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
world.spawnEntityInWorld(createdEntity); world.spawnEntity(createdEntity);
return new ForgeEntity(createdEntity); return new ForgeEntity(createdEntity);
} else { } else {
return null; return null;
@ -446,6 +449,7 @@ public class ForgeWorld extends AbstractWorld {
/** /**
* Thrown when the reference to the world is lost. * Thrown when the reference to the world is lost.
*/ */
@SuppressWarnings("serial")
private static class WorldReferenceLostException extends WorldEditException { private static class WorldReferenceLostException extends WorldEditException {
private WorldReferenceLostException(String message) { private WorldReferenceLostException(String message) {
super(message); super(message);

View File

@ -138,10 +138,10 @@ public class ForgeWorldEdit {
@SubscribeEvent @SubscribeEvent
public void onCommandEvent(CommandEvent event) { public void onCommandEvent(CommandEvent event) {
if ((event.getSender() instanceof EntityPlayerMP)) { if ((event.getSender() instanceof EntityPlayerMP)) {
if (((EntityPlayerMP) event.getSender()).worldObj.isRemote) return; if (((EntityPlayerMP) event.getSender()).world.isRemote) return;
String[] split = new String[event.getParameters().length + 1]; String[] split = new String[event.getParameters().length + 1];
System.arraycopy(event.getParameters(), 0, split, 1, event.getParameters().length); System.arraycopy(event.getParameters(), 0, split, 1, event.getParameters().length);
split[0] = event.getCommand().getCommandName(); split[0] = event.getCommand().getName();
com.sk89q.worldedit.event.platform.CommandEvent weEvent = com.sk89q.worldedit.event.platform.CommandEvent weEvent =
new com.sk89q.worldedit.event.platform.CommandEvent(wrap((EntityPlayerMP) event.getSender()), Joiner.on(" ").join(split)); new com.sk89q.worldedit.event.platform.CommandEvent(wrap((EntityPlayerMP) event.getSender()), Joiner.on(" ").join(split));
WorldEdit.getInstance().getEventBus().post(weEvent); WorldEdit.getInstance().getEventBus().post(weEvent);
@ -164,13 +164,13 @@ public class ForgeWorldEdit {
event instanceof PlayerInteractEvent.RightClickBlock event instanceof PlayerInteractEvent.RightClickBlock
&& ((PlayerInteractEvent.RightClickBlock) event) && ((PlayerInteractEvent.RightClickBlock) event)
.getUseItem() == Result.DENY; .getUseItem() == Result.DENY;
if (isLeftDeny || isRightDeny || event.getEntity().worldObj.isRemote) { if (isLeftDeny || isRightDeny || event.getEntity().world.isRemote) {
return; return;
} }
WorldEdit we = WorldEdit.getInstance(); WorldEdit we = WorldEdit.getInstance();
ForgePlayer player = wrap((EntityPlayerMP) event.getEntityPlayer()); ForgePlayer player = wrap((EntityPlayerMP) event.getEntityPlayer());
ForgeWorld world = getWorld(event.getEntityPlayer().worldObj); ForgeWorld world = getWorld(event.getEntityPlayer().world);
if (event instanceof PlayerInteractEvent.LeftClickBlock) { if (event instanceof PlayerInteractEvent.LeftClickBlock) {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@ -229,7 +229,7 @@ public class ForgeWorldEdit {
*/ */
public ForgePlayer wrap(EntityPlayerMP player) { public ForgePlayer wrap(EntityPlayerMP player) {
checkNotNull(player); checkNotNull(player);
return new ForgePlayer(platform, player); return new ForgePlayer(player);
} }
/** /**

View File

@ -40,8 +40,8 @@ public class KeyHandler {
@SubscribeEvent @SubscribeEvent
public void onKey(KeyInputEvent evt) { public void onKey(KeyInputEvent evt) {
if (mc.thePlayer != null && mc.theWorld != null && mainKey.isPressed()) { if (mc.player != null && mc.world != null && mainKey.isPressed()) {
mc.thePlayer.openGui(ForgeWorldEdit.inst, GuiHandler.REFERENCE_ID, mc.theWorld, 0, 0, 0); mc.player.openGui(ForgeWorldEdit.inst, GuiHandler.REFERENCE_ID, mc.world, 0, 0, 0);
} }
} }

View File

@ -175,7 +175,7 @@ final class NBTConverter {
} }
public static ListTag fromNative(NBTTagList other) { public static ListTag fromNative(NBTTagList other) {
other = (NBTTagList) other.copy(); other = other.copy();
List<Tag> list = new ArrayList<Tag>(); List<Tag> list = new ArrayList<Tag>();
Class<? extends Tag> listClass = StringTag.class; Class<? extends Tag> listClass = StringTag.class;
int tags = other.tagCount(); int tags = other.tagCount();

View File

@ -61,7 +61,7 @@ public class ThreadSafeCache {
if (server == null || server.getPlayerList() == null) { if (server == null || server.getPlayerList() == null) {
return; return;
} }
for (EntityPlayerMP player : server.getPlayerList().getPlayerList()) { for (EntityPlayerMP player : server.getPlayerList().getPlayers()) {
if (player != null) { if (player != null) {
onlineIds.add(player.getUniqueID()); onlineIds.add(player.getUniqueID());
} }

View File

@ -46,7 +46,7 @@ public class WECUIPacketHandler {
public void onPacketData(ServerCustomPacketEvent event) { public void onPacketData(ServerCustomPacketEvent event) {
if (event.getPacket().channel().equals(ForgeWorldEdit.CUI_PLUGIN_CHANNEL)) { if (event.getPacket().channel().equals(ForgeWorldEdit.CUI_PLUGIN_CHANNEL)) {
EntityPlayerMP player = getPlayerFromEvent(event); EntityPlayerMP player = getPlayerFromEvent(event);
LocalSession session = ForgeWorldEdit.inst.getSession((EntityPlayerMP) player); LocalSession session = ForgeWorldEdit.inst.getSession(player);
if (session.hasCUISupport()) { if (session.hasCUISupport()) {
return; return;

View File

@ -50,7 +50,7 @@ public class GuiReferenceCard extends GuiScreen {
@Override @Override
protected void actionPerformed(GuiButton button) { protected void actionPerformed(GuiButton button) {
if (button.id == 0) { if (button.id == 0) {
this.mc.thePlayer.closeScreen(); this.mc.player.closeScreen();
} }
} }