Skip to content

Commit

Permalink
fix: Методы получения типов, базовая версия
Browse files Browse the repository at this point in the history
  • Loading branch information
MaXFeeD committed Jan 3, 2024
1 parent b86d2b3 commit 89b2e50
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
9 changes: 4 additions & 5 deletions src/main/java/com/reider745/InnerCoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.reider745.event.EventListener;
import com.reider745.event.InnerCorePlugin;
import com.reider745.hooks.BiomesHooks;
import com.reider745.hooks.SnowfallEverywhere;
import com.reider745.item.CustomItem;

import com.reider745.item.ItemMethod;
Expand Down Expand Up @@ -300,7 +299,7 @@ public void afterload() {

Logger.info("Registering ZoteCore events...");
pluginManager.registerEvents(new EventListener(), plugin);
pluginManager.registerEvents(new SnowfallEverywhere(), plugin);
// pluginManager.registerEvents(new SnowfallEverywhere(), plugin);

CustomBlock.init();
CustomItem.postInit();
Expand All @@ -319,7 +318,7 @@ public void reload() {
PluginManager pluginManager = Server.getInstance().getPluginManager();
pluginManager.getPlugins().put(plugin.getDescription().getName(), plugin);
pluginManager.registerEvents(new EventListener(), plugin);
pluginManager.registerEvents(new SnowfallEverywhere(), plugin);
// pluginManager.registerEvents(new SnowfallEverywhere(), plugin);
}

public void start() {
Expand Down Expand Up @@ -448,11 +447,11 @@ public static String getName() {
}

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() {
return singleton.getPropertyInt("pack-version-code", 153);
return singleton.getPropertyInt("pack-version-code", 152);
}

private static void handleUnsupportedMethod(String message) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/reider745/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public static void main(String[] args) throws Throwable {
loader.registerHooksInitializationForClass(LevelHooks.class);
loader.registerHooksInitializationForClass(ItemUtils.class);
loader.registerHooksInitializationForClass(AndroidHooks.class);
//loader.registerHooksInitializationForClass(SnowfallEverywhere.class);
//loader.registerHooksInitializationForClass(BiomesHooks.class);
// loader.registerHooksInitializationForClass(SnowfallEverywhere.class);
// loader.registerHooksInitializationForClass(BiomesHooks.class);
loader.registerHooksInitializationForClass(GlobalBanList.class);

//bug fix
// bug fix
loader.registerHooksInitializationForClass(EntityItemHooks.class);

loader.init();
Expand Down
15 changes: 12 additions & 3 deletions src/main/java/com/reider745/entity/EntityMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.reider745.hooks.ItemUtils;
import com.reider745.world.BlockSourceMethods;
import com.zhekasmirnov.apparatus.minecraft.enums.GameEnums;
import com.zhekasmirnov.innercore.api.constants.EntityType;

import java.util.Map;
import java.util.function.Consumer;
Expand Down Expand Up @@ -301,9 +302,14 @@ public static int getEntityType(long entityUid) {
return validateThen(entityUid, entity -> {
int networkId = entity.getNetworkId();
if (networkId == -1) {
Identifier identifier = entity.getIdentifier();
if (identifier != null) {
networkId = GameEnums.getInt(GameEnums.getSingleton().getEnum("entity_type", identifier.getPath()));
if (entity.isPlayer) {
networkId = EntityType.PLAYER;
}
if (networkId == -1) {
Identifier identifier = entity.getIdentifier();
if (identifier != null) {
networkId = GameEnums.getInt(GameEnums.getSingleton().getEnum("entity_type", identifier.getPath()));
}
}
}
return networkId;
Expand All @@ -313,6 +319,9 @@ public static int getEntityType(long entityUid) {
public static String getEntityTypeName(long entityUid) {
return validateThen(entityUid, entity -> {
Identifier identifier = entity.getIdentifier();
if (identifier == null && entity.isPlayer) {
identifier = Identifier.of("minecraft", "player");
}
return identifier != null ? identifier + "<>" : null;
}, null);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/zotecore.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Change resolution of pack that client should have to log into server.
# However, no deprecated or unimplemented methods will be added.
pack: Inner Core Test
pack-version: 2.3.0b116 test
pack-version-code: 153
pack-version: 2.3.0b115 test
pack-version-code: 152

# Sets the list of mods and configs to load, you can specify
# name, folder name of a modpack from /modpacks or a path.
Expand Down

0 comments on commit 89b2e50

Please sign in to comment.