From ec5260b89dcadb4e66de5224843d26232a1d73ef Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:39:50 +0200 Subject: [PATCH] Update checkout to v4 License header fixed README issue --- .github/workflows/build.yml | 2 +- .idea/copyright/profile_settings.xml | 10 +++++++ .idea/copyright/viarewind_ls_gpl.xml | 6 +++++ README.md | 2 +- settings.gradle | 2 +- .../viarewind/legacysupport/BukkitPlugin.java | 18 +++++++++++++ .../injector/BoundingBoxFixer.java | 18 +++++++++++++ .../legacysupport/injector/NMSReflection.java | 18 +++++++++++++ .../listener/AreaEffectCloudListener.java | 18 +++++++++++++ .../listener/BounceListener.java | 18 +++++++++++++ .../listener/BrewingListener.java | 18 +++++++++++++ .../listener/ElytraListener.java | 18 +++++++++++++ .../listener/EnchantingListener.java | 18 +++++++++++++ .../legacysupport/listener/SoundListener.java | 18 +++++++++++++ .../reflection/MethodSignature.java | 18 +++++++++++++ .../reflection/ReflectionAPI.java | 26 ++++++++++++++----- .../versioninfo/VersionInformer.java | 18 +++++++++++++ 17 files changed, 237 insertions(+), 9 deletions(-) create mode 100644 .idea/copyright/profile_settings.xml create mode 100644 .idea/copyright/viarewind_ls_gpl.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4cebf59..70e8a88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 - name: Set up JDK 8 diff --git a/.idea/copyright/profile_settings.xml b/.idea/copyright/profile_settings.xml new file mode 100644 index 0000000..29b7b50 --- /dev/null +++ b/.idea/copyright/profile_settings.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/copyright/viarewind_ls_gpl.xml b/.idea/copyright/viarewind_ls_gpl.xml new file mode 100644 index 0000000..75c3242 --- /dev/null +++ b/.idea/copyright/viarewind_ls_gpl.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index 63b5e2f..c26c649 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ViaRewind-Legacy-Support -[![Build Status](https://github.com/ViaVersion/ViaRewind/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/ViaVersion/ViaRewind/actions) +[![Build Status](https://github.com/ViaVersion/ViaRewind-Legacy-Support/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/ViaVersion/ViaRewind/actions) [![Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord) **Provides additional features for ViaRewind for Paper servers.** diff --git a/settings.gradle b/settings.gradle index d5a3331..63e8c46 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -rootProject.name = "viarewind-legacy-support" +rootProject.name = "ViaRewind-Legacy-Support" diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/BukkitPlugin.java b/src/main/java/com/viaversion/viarewind/legacysupport/BukkitPlugin.java index 93b7b0b..677ebce 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/BukkitPlugin.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/BukkitPlugin.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport; import com.viaversion.viarewind.legacysupport.injector.BoundingBoxFixer; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/injector/BoundingBoxFixer.java b/src/main/java/com/viaversion/viarewind/legacysupport/injector/BoundingBoxFixer.java index c73e9e1..59c10be 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/injector/BoundingBoxFixer.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/injector/BoundingBoxFixer.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.injector; import com.viaversion.viarewind.legacysupport.reflection.ReflectionAPI; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/injector/NMSReflection.java b/src/main/java/com/viaversion/viarewind/legacysupport/injector/NMSReflection.java index b7eb8f1..6b6a70c 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/injector/NMSReflection.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/injector/NMSReflection.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.injector; import com.viaversion.viarewind.legacysupport.reflection.MethodSignature; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/listener/AreaEffectCloudListener.java b/src/main/java/com/viaversion/viarewind/legacysupport/listener/AreaEffectCloudListener.java index 7edaf84..c8cc01b 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/listener/AreaEffectCloudListener.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/listener/AreaEffectCloudListener.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.listener; import com.viaversion.viaversion.api.Via; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/listener/BounceListener.java b/src/main/java/com/viaversion/viarewind/legacysupport/listener/BounceListener.java index 38d661a..d0519f2 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/listener/BounceListener.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/listener/BounceListener.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.listener; import com.viaversion.viaversion.api.Via; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/listener/BrewingListener.java b/src/main/java/com/viaversion/viarewind/legacysupport/listener/BrewingListener.java index b6a6ccd..39db6ae 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/listener/BrewingListener.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/listener/BrewingListener.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.listener; import com.viaversion.viaversion.api.Via; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/listener/ElytraListener.java b/src/main/java/com/viaversion/viarewind/legacysupport/listener/ElytraListener.java index 9a22e0e..0009d22 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/listener/ElytraListener.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/listener/ElytraListener.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.listener; import com.viaversion.viaversion.api.Via; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/listener/EnchantingListener.java b/src/main/java/com/viaversion/viarewind/legacysupport/listener/EnchantingListener.java index ff513b7..6c70781 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/listener/EnchantingListener.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/listener/EnchantingListener.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.listener; import com.viaversion.viaversion.api.Via; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/listener/SoundListener.java b/src/main/java/com/viaversion/viarewind/legacysupport/listener/SoundListener.java index cc55116..e03933a 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/listener/SoundListener.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/listener/SoundListener.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.listener; import com.viaversion.viarewind.legacysupport.reflection.MethodSignature; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/reflection/MethodSignature.java b/src/main/java/com/viaversion/viarewind/legacysupport/reflection/MethodSignature.java index 69a7d48..5d3444c 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/reflection/MethodSignature.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/reflection/MethodSignature.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.reflection; import java.util.Arrays; diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/reflection/ReflectionAPI.java b/src/main/java/com/viaversion/viarewind/legacysupport/reflection/ReflectionAPI.java index 2b231c1..a8faa72 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/reflection/ReflectionAPI.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/reflection/ReflectionAPI.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.reflection; import sun.reflect.ReflectionFactory; @@ -13,7 +31,7 @@ import java.util.Map; import java.util.Objects; public class ReflectionAPI { - private static Map fields = new HashMap<>(); + private static final Map fields = new HashMap<>(); private static boolean staticFinalModificationBlocked; static { @@ -97,11 +115,7 @@ public class ReflectionAPI { } } - public static Constructor getConstructor(Class clazz, Constructor superConstructor) { - return (Constructor) ReflectionFactory.getReflectionFactory().newConstructorForSerialization(clazz, superConstructor); - } - - public static void setValue(Class clazz, Object object, String fieldname, Object value, boolean isFinal) throws NoSuchFieldException, IllegalAccessException { + public static void setValue(Class clazz, Object object, String fieldname, Object value, boolean isFinal) throws IllegalAccessException { Field field = getFieldAccessible(clazz, fieldname); if (isFinal) setFieldNotFinal(field); field.set(object, value); diff --git a/src/main/java/com/viaversion/viarewind/legacysupport/versioninfo/VersionInformer.java b/src/main/java/com/viaversion/viarewind/legacysupport/versioninfo/VersionInformer.java index a041378..b92ee10 100644 --- a/src/main/java/com/viaversion/viarewind/legacysupport/versioninfo/VersionInformer.java +++ b/src/main/java/com/viaversion/viarewind/legacysupport/versioninfo/VersionInformer.java @@ -1,3 +1,21 @@ +/* + * This file is part of ViaRewind-Legacy-Support - https://github.com/ViaVersion/ViaRewind-Legacy-Support + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.viaversion.viarewind.legacysupport.versioninfo; import com.viaversion.viaversion.api.Via;