fix: Методы получения типов, базовая версия

This commit is contained in:
MaXFeeD
2024-01-03 22:20:19 +03:00
parent b86d2b3abe
commit 89b2e50052
4 changed files with 21 additions and 13 deletions
@@ -11,7 +11,6 @@ import com.reider745.commands.CommandsHelper;
import com.reider745.event.EventListener; import com.reider745.event.EventListener;
import com.reider745.event.InnerCorePlugin; import com.reider745.event.InnerCorePlugin;
import com.reider745.hooks.BiomesHooks; import com.reider745.hooks.BiomesHooks;
import com.reider745.hooks.SnowfallEverywhere;
import com.reider745.item.CustomItem; import com.reider745.item.CustomItem;
import com.reider745.item.ItemMethod; import com.reider745.item.ItemMethod;
@@ -300,7 +299,7 @@ public class InnerCoreServer {
Logger.info("Registering ZoteCore events..."); Logger.info("Registering ZoteCore events...");
pluginManager.registerEvents(new EventListener(), plugin); pluginManager.registerEvents(new EventListener(), plugin);
pluginManager.registerEvents(new SnowfallEverywhere(), plugin); // pluginManager.registerEvents(new SnowfallEverywhere(), plugin);
CustomBlock.init(); CustomBlock.init();
CustomItem.postInit(); CustomItem.postInit();
@@ -319,7 +318,7 @@ public class InnerCoreServer {
PluginManager pluginManager = Server.getInstance().getPluginManager(); PluginManager pluginManager = Server.getInstance().getPluginManager();
pluginManager.getPlugins().put(plugin.getDescription().getName(), plugin); pluginManager.getPlugins().put(plugin.getDescription().getName(), plugin);
pluginManager.registerEvents(new EventListener(), plugin); pluginManager.registerEvents(new EventListener(), plugin);
pluginManager.registerEvents(new SnowfallEverywhere(), plugin); // pluginManager.registerEvents(new SnowfallEverywhere(), plugin);
} }
public void start() { public void start() {
@@ -448,11 +447,11 @@ public class InnerCoreServer {
} }
public static String getVersionName() { public static String getVersionName() {
return singleton.getPropertyString("pack-version", "2.3.1b116 test"); return singleton.getPropertyString("pack-version", "2.3.1b115 test");
} }
public static int getVersionCode() { public static int getVersionCode() {
return singleton.getPropertyInt("pack-version-code", 153); return singleton.getPropertyInt("pack-version-code", 152);
} }
private static void handleUnsupportedMethod(String message) { private static void handleUnsupportedMethod(String message) {
+3 -3
View File
@@ -75,11 +75,11 @@ public class Main {
loader.registerHooksInitializationForClass(LevelHooks.class); loader.registerHooksInitializationForClass(LevelHooks.class);
loader.registerHooksInitializationForClass(ItemUtils.class); loader.registerHooksInitializationForClass(ItemUtils.class);
loader.registerHooksInitializationForClass(AndroidHooks.class); loader.registerHooksInitializationForClass(AndroidHooks.class);
//loader.registerHooksInitializationForClass(SnowfallEverywhere.class); // loader.registerHooksInitializationForClass(SnowfallEverywhere.class);
//loader.registerHooksInitializationForClass(BiomesHooks.class); // loader.registerHooksInitializationForClass(BiomesHooks.class);
loader.registerHooksInitializationForClass(GlobalBanList.class); loader.registerHooksInitializationForClass(GlobalBanList.class);
//bug fix // bug fix
loader.registerHooksInitializationForClass(EntityItemHooks.class); loader.registerHooksInitializationForClass(EntityItemHooks.class);
loader.init(); loader.init();
@@ -27,6 +27,7 @@ import com.reider745.event.EventListener;
import com.reider745.hooks.ItemUtils; import com.reider745.hooks.ItemUtils;
import com.reider745.world.BlockSourceMethods; import com.reider745.world.BlockSourceMethods;
import com.zhekasmirnov.apparatus.minecraft.enums.GameEnums; import com.zhekasmirnov.apparatus.minecraft.enums.GameEnums;
import com.zhekasmirnov.innercore.api.constants.EntityType;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -301,9 +302,14 @@ public class EntityMethod {
return validateThen(entityUid, entity -> { return validateThen(entityUid, entity -> {
int networkId = entity.getNetworkId(); int networkId = entity.getNetworkId();
if (networkId == -1) { if (networkId == -1) {
Identifier identifier = entity.getIdentifier(); if (entity.isPlayer) {
if (identifier != null) { networkId = EntityType.PLAYER;
networkId = GameEnums.getInt(GameEnums.getSingleton().getEnum("entity_type", identifier.getPath())); }
if (networkId == -1) {
Identifier identifier = entity.getIdentifier();
if (identifier != null) {
networkId = GameEnums.getInt(GameEnums.getSingleton().getEnum("entity_type", identifier.getPath()));
}
} }
} }
return networkId; return networkId;
@@ -313,6 +319,9 @@ public class EntityMethod {
public static String getEntityTypeName(long entityUid) { public static String getEntityTypeName(long entityUid) {
return validateThen(entityUid, entity -> { return validateThen(entityUid, entity -> {
Identifier identifier = entity.getIdentifier(); Identifier identifier = entity.getIdentifier();
if (identifier == null && entity.isPlayer) {
identifier = Identifier.of("minecraft", "player");
}
return identifier != null ? identifier + "<>" : null; return identifier != null ? identifier + "<>" : null;
}, null); }, null);
} }
+2 -2
View File
@@ -1,8 +1,8 @@
# Change resolution of pack that client should have to log into server. # Change resolution of pack that client should have to log into server.
# However, no deprecated or unimplemented methods will be added. # However, no deprecated or unimplemented methods will be added.
pack: Inner Core Test pack: Inner Core Test
pack-version: 2.3.0b116 test pack-version: 2.3.0b115 test
pack-version-code: 153 pack-version-code: 152
# Sets the list of mods and configs to load, you can specify # Sets the list of mods and configs to load, you can specify
# name, folder name of a modpack from /modpacks or a path. # name, folder name of a modpack from /modpacks or a path.