Paper/scripts/importmcdev.sh

123 lines
2.9 KiB
Bash
Raw Normal View History

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