[Forge] Initial update to 1.11

Also updates Gradle to 3.2.1, because keeping updated is good.
Dieser Commit ist enthalten in:
Kenzie Togami 2016-11-17 22:17:04 -08:00 committet von Wizjany
Ursprung 17aafe87d0
Commit 6ad11624bb
16 geänderte Dateien mit 58 neuen und 58 gelöschten Zeilen

Binäre Datei nicht angezeigt.

Datei anzeigen

@ -1,6 +1,6 @@
#Thu May 05 15:11:12 PDT 2016
#Wed Nov 23 21:39:25 PST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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
Datei anzeigen

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh
##############################################################################
##
@ -154,11 +154,18 @@ if $cygwin ; then
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
# Escape application args
for s in "${@}" ; do
s=\"$s\"
APP_ARGS=$APP_ARGS" "$s
done
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
Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -27,6 +27,7 @@ import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.blocks.LazyBlock;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.history.change.BlockChange;
import com.sk89q.worldedit.internal.Constants;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Direction;
@ -50,6 +51,7 @@ import net.minecraft.server.management.PlayerChunkMapEntry;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World;
@ -77,7 +79,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
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;
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);
@ -145,6 +147,7 @@ public class ForgeWorld extends AbstractWorld {
Chunk chunk = world.getChunkFromChunkCoords(x >> 4, z >> 4);
BlockPos pos = new BlockPos(x, y, z);
IBlockState old = chunk.getBlockState(pos);
@SuppressWarnings("deprecation")
IBlockState newState = Block.getBlockById(block.getId()).getStateFromMeta(block.getData());
IBlockState successState = chunk.setBlockState(pos, newState);
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));
entity.setPickupDelay(10);
getWorld().spawnEntityInWorld(entity);
getWorld().spawnEntity(entity);
}
@Override
@ -263,7 +266,7 @@ public class ForgeWorld extends AbstractWorld {
try {
ChunkProviderServer chunkServer = (ChunkProviderServer) provider;
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())) {
mcChunk = chunkServer.loadChunk(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))
editSession.smartSetBlock(pt, history[index]);
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
public Entity createEntity(Location location, BaseEntity entity) {
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) {
CompoundTag nativeTag = entity.getNbtData();
if (nativeTag != null) {
@ -436,7 +439,7 @@ public class ForgeWorld extends AbstractWorld {
createdEntity.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
world.spawnEntityInWorld(createdEntity);
world.spawnEntity(createdEntity);
return new ForgeEntity(createdEntity);
} else {
return null;
@ -446,6 +449,7 @@ public class ForgeWorld extends AbstractWorld {
/**
* Thrown when the reference to the world is lost.
*/
@SuppressWarnings("serial")
private static class WorldReferenceLostException extends WorldEditException {
private WorldReferenceLostException(String message) {
super(message);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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