Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
81d80d8
Basic upgrade to 1.16
Combustible Oct 8, 2020
c59fa04
Change UUID storage format for 1.16
Combustible Oct 24, 2020
7a52838
Rename the attribute modifiers for 1.16
Combustible Oct 24, 2020
bb62fda
Fix summoning stacked mobs with a BoS
Combustible Oct 25, 2020
c0d7575
Prevent right click with BoS summoning mob in 1.15+
Combustible Oct 25, 2020
94e4e09
Rename 'Potion' -> 'Item' for 1.16
Combustible Oct 25, 2020
094facb
Merge pull request #51 from Combustible/116
goncalomb Nov 1, 2020
9985415
Update version to 3.3-SNAPSHOT for next development iteration
goncalomb Nov 1, 2020
b490d19
Fix namespace on mob attributes
Combustible Nov 12, 2020
f8012cc
Merge pull request #54 from Combustible/fix_attributes
goncalomb Nov 14, 2020
6842c24
Add zoglin/hoglin/strider, expand bee/dolphin/turtle variables
Combustible May 20, 2021
4f1d0bc
Add CustomModelData field to items
Combustible May 20, 2021
e7661f9
Fixed UUIDs being parsed incorrectly
Njol Dec 13, 2021
2143866
Now works on 1.17, not backwards compatible
Combustible Dec 5, 2021
8ee3193
Migrate build from maven to gradle, move src -> plugin/src
Combustible Apr 16, 2022
b83faf7
Move plugin.yml generation into gradle build
Combustible Apr 16, 2022
5cd15da
WIP: Add version adapter scaffolding; revert to 1.16
Combustible Apr 16, 2022
8224d76
Initial 1.18 adapter with untested NBTUtils implementation
Combustible Apr 16, 2022
aaaab23
Port NBTBase to adapters
Combustible Apr 17, 2022
9b6099b
Port NBTTagCompound to adapters
Combustible Apr 17, 2022
e733f23
Port NBTTagList to adapters
Combustible Apr 17, 2022
1622379
Port BukkitVersion to adapters
Combustible Apr 17, 2022
68cab37
Port NBTTypes to adapters
Combustible Apr 17, 2022
0bf14b7
Port BukkitReflect to adapters
Combustible Apr 17, 2022
dc0472c
Move namemaps to adapter_api
Combustible Apr 18, 2022
7b0b28f
Move spawners to wrapped version adapter
Combustible Apr 24, 2022
8053ea3
Add support for 1.18.2
Combustible Aug 15, 2022
4f07c05
Fixed passengers not being added to the world properly
Njol Sep 2, 2022
420d9c3
Added 1.17 mobs and fixed 1.18 NBT calls (#3)
Njol Sep 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 140 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,146 @@
# Maven
target/
dependency-reduced-pom.xml
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties

# Vim
*.swp
*.swo

# IntelliJ IDEA
.idea/
*.iml
*.ipr
*.iws

# Eclipse
.settings/
.classpath
.project
/bin/
*/bin/

# User-specific stuff
.idea/

*.iml
*.ipr
*.iws

# IntelliJ
out/

# Eclipse
.classpath
.project
.settings/
bin/
plugin/bin/
api/bin/

# Maven
/target
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

target/

pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next

release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml

# Common working directory
run/
build
.gradle
/*.jar
2 changes: 2 additions & 0 deletions adapter_api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
upload*.sh
.factorypath
10 changes: 10 additions & 0 deletions adapter_api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
id("com.goncalomb.bukkit.java-conventions")
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.16.3-R0.1-SNAPSHOT")
}

description = "adapter_api"
version = rootProject.version
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public final class EnchantmentsMap {
_enchantments.put("Multishot", Enchantment.MULTISHOT);
_enchantments.put("Piercing", Enchantment.PIERCING);
_enchantments.put("QuickCharge", Enchantment.QUICK_CHARGE);
_enchantments.put("SoulSpeed", Enchantment.SOUL_SPEED);

List<String> enchantmentNames = new ArrayList<String>(_enchantments.names());
Collections.sort(enchantmentNames, String.CASE_INSENSITIVE_ORDER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public final class EntityTypeMap {
_legacyNames.put("Zombie".toLowerCase(), EntityType.ZOMBIE);
_legacyNames.put("Slime".toLowerCase(), EntityType.SLIME);
_legacyNames.put("Ghast".toLowerCase(), EntityType.GHAST);
_legacyNames.put("PigZombie".toLowerCase(), EntityType.PIG_ZOMBIE);
_legacyNames.put("PigZombie".toLowerCase(), EntityType.ZOMBIFIED_PIGLIN);
_legacyNames.put("Enderman".toLowerCase(), EntityType.ENDERMAN);
_legacyNames.put("CaveSpider".toLowerCase(), EntityType.CAVE_SPIDER);
_legacyNames.put("Silverfish".toLowerCase(), EntityType.SILVERFISH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class SpawnEggMap {
if (entityName.equals("MOOSHROOM")) {
_spawnEggs.put(EntityTypeMap.getName(EntityType.MUSHROOM_COW), mat);
} else if (entityName.equals("ZOMBIE_PIGMAN")) {
_spawnEggs.put(EntityTypeMap.getName(EntityType.PIG_ZOMBIE), mat);
_spawnEggs.put(EntityTypeMap.getName(EntityType.ZOMBIFIED_PIGLIN), mat);
} else {
EntityType entityType = EntityType.valueOf(entityName);
if (entityType != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2013-2018 Gonçalo Baltazar <me@goncalomb.com>
*
* This file is part of NBTEditor.
*
* NBTEditor 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.
*
* NBTEditor 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 NBTEditor. If not, see <http://www.gnu.org/licenses/>.
*/

package com.goncalomb.bukkit.mylib.reflect;

import java.util.logging.Logger;

import org.bukkit.command.SimpleCommandMap;

public final class BukkitReflect {

private static BukkitReflectAdapter adapter = null;

public static void prepareReflection(Class<?> serverClass, Logger logger) throws Exception {
String packageName = serverClass.getPackage().getName();
String version = packageName.substring(packageName.lastIndexOf('.') + 1);

Class<?> clazz = Class.forName("com.goncalomb.bukkit.mylib.reflect.BukkitReflectAdapter_" + version);
adapter = (BukkitReflectAdapter) clazz.getConstructor().newInstance();
logger.info("Loaded BukkitReflect adapter for " + version);
}


public static SimpleCommandMap getCommandMap() {
ensureAdapter(adapter);
return adapter.getCommandMap();
}

public static boolean isValidRawJSON(String text) {
ensureAdapter(adapter);
return adapter.isValidRawJSON(text);
}

public static String textToRawJSON(String text) {
ensureAdapter(adapter);
return adapter.textToRawJSON(text);
}

public static void ensureAdapter(Object adapter) throws RuntimeException {
if (adapter == null) {
throw new RuntimeException("Version adapter is not loaded");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2013-2018 Gonçalo Baltazar <me@goncalomb.com>
*
* This file is part of NBTEditor.
*
* NBTEditor 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.
*
* NBTEditor 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 NBTEditor. If not, see <http://www.gnu.org/licenses/>.
*/

package com.goncalomb.bukkit.mylib.reflect;

import org.bukkit.command.SimpleCommandMap;

public interface BukkitReflectAdapter {
SimpleCommandMap getCommandMap();

boolean isValidRawJSON(String text);

String textToRawJSON(String text);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.goncalomb.bukkit.mylib.reflect;

import java.util.logging.Logger;

public final class BukkitVersion {

private static BukkitVersionAdapter adapter = null;

public static void prepareReflection(Class<?> serverClass, Logger logger) throws Exception {
String packageName = serverClass.getPackage().getName();
String version = packageName.substring(packageName.lastIndexOf('.') + 1);

Class<?> clazz = Class.forName("com.goncalomb.bukkit.mylib.reflect.BukkitVersionAdapter_" + version);
adapter = (BukkitVersionAdapter) clazz.getConstructor().newInstance();
logger.info("Loaded BukkitVersion adapter for " + version);
}

public static void prepareForTest() throws Exception {
Class<?> clazz = Class.forName("com.goncalomb.bukkit.mylib.reflect.BukkitVersionAdapter_v1_18_R2");
adapter = (BukkitVersionAdapter) clazz.getConstructor().newInstance();
}

public static boolean isVersion(int minor) {
return isVersion(minor, 1);
}

public static boolean isVersion(int minor, int major) {
ensureAdapter(adapter);
return adapter.isVersion(minor, major);
}

private static void ensureAdapter(Object adapter) throws RuntimeException {
if (adapter == null) {
throw new RuntimeException("Version adapter is not loaded");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) 2013-2018 Gonçalo Baltazar <me@goncalomb.com>
*
* This file is part of NBTEditor.
*
* NBTEditor 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.
*
* NBTEditor 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 NBTEditor. If not, see <http://www.gnu.org/licenses/>.
*/

package com.goncalomb.bukkit.mylib.reflect;

public interface BukkitVersionAdapter {
boolean isVersion(int minor, int major);
}
Loading