PaperMC/scripts/importmcdev.sh

98 lines
2.2 KiB
Bash
Raw Normal View History

2016-03-31 02:50:23 +02:00
#!/usr/bin/env bash
(
set -e
2016-03-31 02:50:23 +02:00
nms="net/minecraft/server"
export MODLOG=""
PS1="$"
basedir="$(cd "$1" && pwd -P)"
2016-03-31 02:50:23 +02:00
2016-04-02 05:55:54 +02:00
workdir="$basedir/work"
minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
decompiledir="$workdir/$minecraftversion"
2016-03-31 02:50:23 +02:00
export importedmcdev=""
function import {
export importedmcdev="$importedmcdev $1"
file="${1}.java"
2016-04-02 05:55:54 +02:00
target="$workdir/Spigot/Spigot-Server/src/main/java/$nms/$file"
2016-03-31 02:50:23 +02:00
base="$decompiledir/$nms/$file"
if [[ ! -f "$target" ]]; then
export MODLOG="$MODLOG Imported $file from mc-dev\n";
echo "Copying $base to $target"
cp "$base" "$target"
2016-05-12 04:07:46 +02:00
else
echo "UN-NEEDED IMPORT: $file"
2016-03-31 02:50:23 +02:00
fi
}
(
2016-04-02 05:55:54 +02:00
cd "$workdir/Spigot/Spigot-Server/"
2016-03-31 02:50:23 +02:00
lastlog=$(git log -1 --oneline)
if [[ "$lastlog" = *"mc-dev Imports"* ]]; then
git reset --hard HEAD^
fi
)
2016-07-23 01:54:48 +02:00
import AxisAlignedBB
2016-03-31 02:50:23 +02:00
import BaseBlockPosition
import BiomeBase
import BiomeJungle
2016-03-31 02:50:23 +02:00
import BiomeMesa
import BlockBeacon
2016-03-31 02:50:23 +02:00
import BlockChest
import BlockFalling
import BlockFurnace
import BlockIceFrost
2016-03-31 02:50:23 +02:00
import BlockPosition
2016-08-31 00:54:03 +02:00
import BlockSnowBlock
2016-08-19 02:53:36 +02:00
import BlockStateEnum
2016-05-05 01:53:33 +02:00
import ChunkCache
2016-03-31 02:50:23 +02:00
import ChunkProviderFlat
import ChunkProviderGenerate
import ChunkProviderHell
import CommandAbstract
import CommandScoreboard
import CommandWhitelist
import ControllerJump
import DataBits
2016-03-31 02:50:23 +02:00
import DataConverterMaterialId
import DataInspectorBlockEntity
import DefinedStructure
2016-03-31 02:50:23 +02:00
import EULA
import EntitySquid
import EntityWaterAnimal
2016-03-31 02:50:23 +02:00
import FileIOThread
import IHopper
2016-03-31 02:50:23 +02:00
import ItemBlock
import ItemFireworks
import ItemMonsterEgg
2016-05-12 04:07:46 +02:00
import NavigationAbstract
import NBTTagCompound
import NBTTagList
import PersistentScoreboard
2016-04-03 03:10:38 +02:00
import PacketPlayInUseEntity
2016-03-31 02:50:23 +02:00
import PacketPlayOutPlayerListHeaderFooter
import PacketPlayOutScoreboardTeam
2016-03-31 02:50:23 +02:00
import PacketPlayOutTitle
import PacketPlayOutUpdateTime
import PathfinderAbstract
import PathfinderGoal
2016-03-31 02:50:23 +02:00
import PathfinderGoalFloat
import PathfinderGoalGotoTarget
import PathfinderWater
2016-03-31 02:50:23 +02:00
import PersistentVillage
import PlayerConnectionUtils
import RemoteControlListener
2016-03-31 02:50:23 +02:00
import TileEntityEnderChest
import TileEntityLootable
import WorldGenStronghold
import WorldProvider
2016-03-31 02:50:23 +02:00
cd "$workdir/Spigot/Spigot-Server/"
rm -rf nms-patches applyPatches.sh makePatches.sh >/dev/null 2>&1
git add . -A >/dev/null 2>&1
echo -e "mc-dev Imports\n\n$MODLOG" | git commit . -F -
2016-03-31 02:50:23 +02:00
)