Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'ver/1.16.5' of github.com:YatopiaMC/Yatopia into stagin…
Browse files Browse the repository at this point in the history
…g/1.16.5
  • Loading branch information
Titaniumtown committed Mar 29, 2021
2 parents 4898c0c + ac524e3 commit 25b910f
Show file tree
Hide file tree
Showing 406 changed files with 16,764 additions and 12,707 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -59,7 +58,7 @@ jobs:
id: decompile-cache
with:
path: Paper/work/Minecraft/${{ steps.mcver.outputs.mcver }}
key: ${{ steps.mcver.outputs.mcver }}-${{ runner.os }}-java-${{ matrix.java }}-minecraft-decomp
key: ${{ hashFiles('Paper/work/BuildData/mappings/bukkit-$STEPS_MCVER_OUTPUTS_MCVER-cl.csrg') }}-${{ steps.mcver.outputs.mcver }}-${{ runner.os }}-java-${{ matrix.java }}-minecraft-decomp

- name: Apply Patches
run: |
Expand Down
30 changes: 27 additions & 3 deletions PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,24 @@ This is an overview over all patches that are currently used.
| server | Add canSaveToDisk to Entity | William Blake Galbreath | |
| server | Add config for allowing Endermen to despawn even while | jmp | |
| server | Add config for snow on blue ice | BillyGalbreath | |
| server | Add config for villager trading | Ben Kerllenevich | |
| server | Add configurable snowball damage | BillyGalbreath | |
| server | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | |
| api | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | |
| server | Add demo command | BillyGalbreath | |
| api | Add enchantment target for bows and crossbows | BillyGalbreath | |
| server | Add enderman and creeper griefing controls | William Blake Galbreath | |
| server | Add ghast allow-griefing option | BillyGalbreath | |
| server | Add last tick time API | Ivan Pekov | tr7zw |
| api | Add last tick time API | Ivan Pekov | tr7zw |
| server | Add mobGriefing bypass to everything affected | Encode42 | |
| server | Add no-tick block list | William Blake Galbreath | |
| server | Add no-random-tick block list | William Blake Galbreath | |
| server | Add nspt command | Ivan Pekov | |
| server | Add obfhelpers for plugin use | William Blake Galbreath | |
| server | Add option for boats to eject players on land | William Blake Galbreath | |
| server | Add option to allow loyalty on tridents to work in the void | William Blake Galbreath | |
| server | Add option to disable dolphin treasure searching | William Blake Galbreath | |
| server | Add option to disable mushroom block updates | William Blake Galbreath | |
| server | Add option to disable mushroom and note block updates | William Blake Galbreath | |
| server | Add option to disable observer clocks | Phoenix616 | |
| server | Add option to disable zombie aggressiveness towards villagers | nitricspace | |
| api | Add option to disable zombie aggressiveness towards villagers | nitricspace | |
Expand All @@ -70,6 +72,7 @@ This is an overview over all patches that are currently used.
| server | Add wither skeleton takes wither damage option | William Blake Galbreath | |
| server | Advancement API | William Blake Galbreath | |
| api | Advancement API | William Blake Galbreath | |
| server | Airplane Branding Changes | Paul Sauve | |
| server | Airplane Configuration | Paul Sauve | |
| server | Airplane MC Dev Fixes | Paul Sauve | |
| server | Airplane Profiler | Paul Sauve | |
Expand All @@ -78,6 +81,7 @@ This is an overview over all patches that are currently used.
| server | Allow color codes in books | William Blake Galbreath | |
| server | Allow controlled flushing for network manager | Spottedleaf | |
| server | Allow infinite and mending enchantments together | William Blake Galbreath | |
| server | Allow infinity on crossbows | Ben Kerllenevich | |
| api | Allow inventory resizing | William Blake Galbreath | |
| server | Allow leashing villagers | William Blake Galbreath | |
| server | Allow soil to moisten from water directly under it | William Blake Galbreath | |
Expand All @@ -92,8 +96,10 @@ This is an overview over all patches that are currently used.
| server | Attempt to recalculate regionfile header if it is corrupt | Spottedleaf | |
| server | Avoid double I/O operation on load player file | ㄗㄠˋ ㄑㄧˊ | |
| server | Barrels and enderchests 6 rows | William Blake Galbreath | |
| server | Be aware of entity teleports when chunk checking entities | Spottedleaf | |
| server | Brand changes | Spottedleaf | |
| server | Brandings | YatopiaMC | |
| server | Break individual slabs when sneaking | BillyGalbreath | |
| server | Breedable Polar Bears | William Blake Galbreath | |
| server | Bring back server name | William Blake Galbreath | |
| api | Bring back server name | William Blake Galbreath | |
Expand All @@ -106,12 +112,19 @@ This is an overview over all patches that are currently used.
| api | ChatColor conveniences | William Blake Galbreath | |
| server | Chickens can retaliate | William Blake Galbreath | |
| server | Config for Enderman to aggro spawned Endermites | Encode42 | |
| server | Config for powered rail activation distance | Encode42 | |
| server | Config for skipping night | Ben Kerllenevich | |
| server | Config migration: climbing should not bypass cramming | jmp | |
| server | Config migration: disable saving projectiles to disk -> | jmp | |
| server | Config to allow Note Block sounds when blocked | Encode42 | |
| server | Config to allow for unsafe enchants | Encode42 | |
| server | Config to always tame in Creative | Encode42 | |
| server | Config to disable Llama caravans | Encode42 | |
| server | Config to disable hostile mob spawn on ice | Encode42 | |
| server | Config to ignore Dragon Head wearers and stare aggro | Encode42 | |
| server | Config to ignore nearby mobs when sleeping | Encode42 | |
| server | Config to make Creepers explode on death | Encode42 | |
| server | Config to show Armor Stand arms on spawn | Encode42 | |
| server | Config to use infinity bows without arrows | Encode42 | |
| server | Configs for if Wither/Ender Dragon can ride vehicles | jmp | |
| server | Configurable BlockPhysicsEvent | Mykyta Komarnytskyy | |
Expand All @@ -129,10 +142,13 @@ This is an overview over all patches that are currently used.
| server | Configurable jockey options | William Blake Galbreath | |
| server | Configurable movement checks | l_MrBoom_l | |
| api | Configurable permission message upgrades | William Blake Galbreath | |
| server | Configurable ravager griefable blocks list | BillyGalbreath | |
| server | Configurable server mod name | William Blake Galbreath | |
| server | Configurable sponge absorption | Encode42 | |
| server | Configurable villager brain ticks | William Blake Galbreath | |
| server | Configurable villager breeding | draycia | |
| server | Configurable void damage height | William Blake Galbreath | |
| api | Conflict on change for adventure deprecations | BillyGalbreath | |
| server | Consolidate flush calls for entity tracker packets | Spottedleaf | |
| server | Controllable Minecarts | William Blake Galbreath | |
| server | Copy passenger list in enderTeleportTo | Spottedleaf | |
Expand Down Expand Up @@ -166,6 +182,7 @@ This is an overview over all patches that are currently used.
| server | Don't wake up entities when damage event is cancelled | Phoenix616 | |
| server | Dont run with scissors! | JustDoom | |
| server | Dont send useless entity packets | William Blake Galbreath | |
| server | Drowning Settings | Ben Kerllenevich | |
| server | Dynamic activation range | Paul Sauve | |
| server | EMC - Configurable disable give dropping | Aikar | |
| server | EMC - MonsterEggSpawnEvent | Aikar | |
Expand Down Expand Up @@ -252,12 +269,14 @@ This is an overview over all patches that are currently used.
| server | Make entity tracker use highest range of passengers | Spottedleaf | |
| server | Make lava flow speed configurable | William Blake Galbreath | |
| server | Make sure inlined getChunkAt has inlined logic for loaded | Spottedleaf | |
| server | Make sure to remove correct TE during TE tick | Spottedleaf | |
| server | Manually inline methods in BlockPosition | Spottedleaf | |
| server | Mending mends most damages equipment first | William Blake Galbreath | |
| server | Modify POM | YatopiaMC | |
| api | Modify POM | YatopiaMC | |
| server | Modify default configs | tr7zw | |
| server | Movement options for armour stands | Mariell Hoversholm | |
| server | More debug for plugins not shutting down tasks | Paul Sauve | |
| server | Movement options for armor stands | Mariell Hoversholm | |
| server | Multi-Threaded Server Ticking Vanilla | Spottedleaf | |
| server | Multi-Threaded ticking CraftBukkit | Spottedleaf | |
| server | Multithreaded entity tracking | Paul Sauve | |
Expand Down Expand Up @@ -289,6 +308,7 @@ This is an overview over all patches that are currently used.
| server | Option for Villager Clerics to farm Nether Wart | jmp | |
| server | Option for chests to open even with a solid block on top | jmp | |
| server | Option for simpler Villagers | tr7zw | |
| server | Option to make doors require restone | BillyGalbreath | |
| server | Option to toggle milk curing bad omen | William Blake Galbreath | |
| server | Origami - Fix ProtocolLib issues on Java 15 | Phoenix616 | |
| server | Origami Server Config | Phoenix616 | |
Expand Down Expand Up @@ -318,6 +338,7 @@ This is an overview over all patches that are currently used.
| server | Prevent light queue overfill when no players are online | Spottedleaf | |
| server | Prevent long map entry creation in light engine | Spottedleaf | |
| server | Prevent unload() calls removing tickets for sync loads | Spottedleaf | |
| server | Projectile offset config | YouHaveTrouble | |
| server | Properly handle cancellation of projectile hit event | Spottedleaf | |
| server | Purpur config files | William Blake Galbreath | |
| api | Purpur config files | William Blake Galbreath | |
Expand Down Expand Up @@ -361,6 +382,7 @@ This is an overview over all patches that are currently used.
| server | Skip events if there's no listeners | William Blake Galbreath | |
| server | Smarter statistics ticking | Mykyta Komarnytskyy | |
| server | Smol entity optimisations | Ivan Pekov | |
| server | Sneak to bulk process composter | BillyGalbreath | |
| server | Snow Golem rate of fire config | Simon Gardling | |
| server | Snowman drop and put back pumpkin | William Blake Galbreath | |
| api | Spigot - Improve output of plugins command | Parker Hawke | |
Expand All @@ -375,11 +397,13 @@ This is an overview over all patches that are currently used.
| api | Suspected plugins report | ishland | |
| server | Swap priority of checks in chunk ticking | Paul Sauve | |
| server | Swaps the predicate order of collision | ㄗㄠˋ ㄑㄧˊ | |
| server | Tick fluids config | BillyGalbreath | |
| server | Time scoreboard search | Spottedleaf | |
| server | Timings stuff | William Blake Galbreath | |
| server | Toggle for Zombified Piglin death always counting as player | jmp | |
| server | Toggle for water sensitive mob damage | YouHaveTrouble | |
| server | Totems work in inventory | draycia | |
| server | Track Queue debug | Paul Sauve | |
| server | Tuinity POM Changes | Spottedleaf | |
| api | Tuinity POM Changes | Spottedleaf | |
| server | Tuinity Server Config | Spottedleaf | |
Expand Down
2 changes: 1 addition & 1 deletion Paper
Submodule Paper updated 686 files
22 changes: 14 additions & 8 deletions buildSrc/src/main/kotlin/ConfigureSubprojects.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
// import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import xyz.jpenilla.toothpick.transformer.ModifiedLog4j2PluginsCacheFileTransformer
import transformer.ModifiedLog4j2PluginsCacheFileTransformer
import relocation.ToothpickRelocator
import kotlinx.dom.elements
import kotlinx.dom.parseXml
import kotlinx.dom.search
Expand Down Expand Up @@ -148,8 +149,7 @@ private fun Project.configureServerProject() {
destination = project.buildDir.resolve("tmp/pom.xml")
}

@Suppress("UNUSED_VARIABLE")
val test by tasks.getting(Test::class) {
tasks.withType<Test> {
// didn't bother to look into why these fail. paper excludes them in paperweight as well though
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
}
Expand All @@ -158,7 +158,6 @@ private fun Project.configureServerProject() {
archiveClassifier.set("") // ShadowJar is the main server artifact
dependsOn(generatePomFileForMavenJavaPublication)
transform(ModifiedLog4j2PluginsCacheFileTransformer::class.java)
//transform(Log4j2PluginsCacheFileTransformer::class.java)
mergeServiceFiles()
manifest {
attributes(
Expand All @@ -182,7 +181,6 @@ private fun Project.configureServerProject() {
relocate("org.bukkit.craftbukkit", "org.bukkit.craftbukkit.v${toothpick.nmsPackage}") {
exclude("org.bukkit.craftbukkit.Main*")
}
relocate("net.minecraft.server", "net.minecraft.server.v${toothpick.nmsPackage}")
relocationSet.add(PatchesMetadata.Relocation("", "net.minecraft.server.v${toothpick.nmsPackage}", false))

// Make sure we relocate deps the same as Paper et al.
Expand All @@ -202,9 +200,17 @@ private fun Project.configureServerProject() {
.elements("relocation").forEach { relocation ->
val pattern = relocation.search("pattern").first().textContent
val shadedPattern = relocation.search("shadedPattern").first().textContent
if (pattern != "org.bukkit.craftbukkit" && pattern != "net.minecraft.server") { // We handle these ourselves above
logger.debug("Imported relocation to server project shadowJar from ${pomFile.absolutePath}: $pattern to $shadedPattern")
relocate(pattern, shadedPattern)
val rawString = relocation.search("rawString").firstOrNull()?.textContent?.toBoolean() ?: false
if (pattern != "org.bukkit.craftbukkit") { // We handle cb ourselves
val excludes = if (rawString) listOf("net/minecraft/data/Main*") else emptyList()
relocate(
ToothpickRelocator(
pattern,
shadedPattern.replace("\${minecraft_version}", toothpick.nmsPackage),
rawString,
excludes = excludes
)
)
relocationSet.add(PatchesMetadata.Relocation(pattern, shadedPattern, true))
}
}
Expand Down
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/InitTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,5 @@ internal fun Project.initToothpickTasks() {

val upstreamCommit = createUpstreamCommitTask()

val repackageNMS = createRepackageNMSTask()
}
5 changes: 4 additions & 1 deletion buildSrc/src/main/kotlin/ToothpickExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ open class ToothpickExtension(objects: ObjectFactory) {
}
}

val paperWorkDir: File
val paperDecompDir: File
get() = paperDir.resolve("work/Minecraft/${minecraftVersion}")

val paperWorkDir: File
get() = paperDir.resolve("work")

fun getUpstreams(rootProjectDir: File): MutableList<Upstream>? {
val configDir = rootProjectDir.resolve("$rootProjectDir/upstreamConfig")
val upstreams = configDir.listFiles()
Expand Down
20 changes: 12 additions & 8 deletions buildSrc/src/main/kotlin/Util.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ data class CmdResult(val exitCode: Int, val output: String?)
fun Project.cmd(
vararg args: String,
dir: File = rootProject.projectDir,
printOut: Boolean = false
printOut: Boolean = false,
environment: Map<String, String> = emptyMap()
): CmdResult {
val process = ProcessBuilder()
.command(*args)
.redirectErrorStream(true)
.directory(dir)
.start()
val process = ProcessBuilder().apply {
command(*args)
redirectErrorStream(true)
directory(dir)
environment().putAll(environment)
}.start()
val output = process.inputStream.bufferedReader().use { reader ->
reader.lines().asSequence()
.onEach {
Expand Down Expand Up @@ -46,14 +48,16 @@ fun ensureSuccess(
fun Project.gitCmd(
vararg args: String,
dir: File = rootProject.projectDir,
printOut: Boolean = false
printOut: Boolean = false,
environment: Map<String, String> = emptyMap()
): CmdResult =
cmd("git", *args, dir = dir, printOut = printOut)

fun Project.bashCmd(
vararg args: String,
dir: File = rootProject.projectDir,
printOut: Boolean = false
printOut: Boolean = false,
environment: Map<String, String> = emptyMap()
): CmdResult =
cmd("bash", "-c", *args, dir = dir, printOut = printOut)

Expand Down
58 changes: 58 additions & 0 deletions buildSrc/src/main/kotlin/relocation/ToothpickRelocator.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* This file is part of Toothpick, licensed under the MIT License.
*
* Copyright (c) 2020-2021 Jason Penilla & Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package relocation

import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator
import com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator
import java.lang.reflect.Method
import java.util.regex.Pattern

internal class ToothpickRelocator(
pattern: String,
shadedPattern: String,
rawString: Boolean = false,
includes: List<String> = emptyList(),
excludes: List<String> = emptyList(),
private val simpleRelocator: SimpleRelocator = SimpleRelocator(pattern, shadedPattern, includes, excludes, rawString)
) : Relocator by simpleRelocator {
override fun canRelocatePath(path: String): Boolean {
// Respect includes/excludes for rawString too
if (simpleRelocator.rawString) {
return isIncludedMethod(simpleRelocator, path) as Boolean
&& !(isExcludedMethod(simpleRelocator, path) as Boolean)
&& Pattern.compile(simpleRelocator.pathPattern).matcher(path).find()
}
return simpleRelocator.canRelocatePath(path)
}

companion object {
private val isExcludedMethod: Method = SimpleRelocator::class.java.getDeclaredMethod("isExcluded", String::class.java)
private val isIncludedMethod: Method = SimpleRelocator::class.java.getDeclaredMethod("isIncluded", String::class.java)

init {
isExcludedMethod.isAccessible = true
isIncludedMethod.isAccessible = true
}
}
}
Loading

0 comments on commit 25b910f

Please sign in to comment.