Jump to content

SparkyTD

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SparkyTD's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I moved the teleportation logic over to the PlayerTickEvent, but it still freezes while loading the dimension. https://pastebin.com/7YRWiWpu
  2. I messing around with a "Dream" dimension where players get teleported when they go to bed. To detect sleeping time, I am subscribing to the SleepingTimeCheckEvent, and after the player's sleep tick reaches 100, I call entity.changeDimension() passing in my custom dimension as a parameter. After I go to bed and wait a couple seconds, the game switches over to the usual loading screen that says "Loading terrain...", but then it hangs there with no error messages or exceptions on the console (it just says "Saving and pausing game..."). As I understand, this sleep time event is server-sided, so this probably isn't a networking issue, and the teleportation itself should be handled automatically by Minecraft. I know that the dimension itself works, because I can teleport there with the following command, and it loads in with no issues: /execute in lunareclipse:sleep_dim run tp Dev ~ 120 ~ The weirdest thig is that the first time I tested this, the bed teleported me to my dimension successfully without freezing, or any other issues. I haven't changed anything in the teleportation code since, so I don't understand what's going on. I've uploaded all the relevant files on pastebin: data/lunareclipse/dimension/sleep_dim.json -> https://pastebin.com/TNiYpbhJ data/lunareclipse/dimension_type/sleep_dim.json -> https://pastebin.com/6y0th33Z DimensionsInit.java -> https://pastebin.com/hwnpLxSi onPlayerSleepInBed -> https://pastebin.com/uhhU1ZaQ The last few lines of debug output right before the player is supposed to teleport -> https://pastebin.com/cezPq7mz (there's nothing else after that, the game still shows "Loading terrain..." as I'm writing this) I figured there is no point uploading a full debug.log, because as I mentioned, there are no error messages whatsoever, and the dimension itself works with vanilla teleport commands.
  3. That was it, thanks! I didn't know level could be null. The is code works now: ItemProperties.register(this, new ResourceLocation(LunarEclipseMod.MODID, "moon_phase"), (stack, level, living, id) -> { if (living != null) return (float) living.level.getMoonPhase(); if (level != null) return (float) level.getMoonPhase(); return 0; });
  4. I am learning Forge 1.19, and as my first item I wanted to create a moon phase tracker. It is basically a copy of a clock, with eight different textures, and eight different models that are determined by a custom predicate in the base model. The predicate is just a custom ItemProperty that retrieves level.getMoonPhase(). If I hold this item in my hand, or throw it on the ground, it shows the correct moon phase texture, like it should. But if I look at the item in my inventory, or place it in an item frame, it only renders the default texture, and doesn't apply the overrides defined in the model json. What could be causing this behavior? I haven't seen any inventory-specific json files in the Clock or Compass, so I don't know what I have to do. Here are the relevant files: assets/lunareclipse/models/item/moon_dial.json -> https://pastebin.com/KPELaAuE assets/lunareclipse/models/item/moon_dial_1.json -> https://pastebin.com/iFe9i2AD (all 8 files are the same, except different texture number) ClientModEvents and MoonDialItem.java -> https://pastebin.com/Cd18rqQz Screenshot that demonstrates the issue: https://imgur.com/a/uRAjtEX
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.