Jump to content

kaydogz

Members
  • Posts

    106
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by kaydogz

  1. I am currently porting all of my former event-based registration to deferred register and I am having some problems with my custom registry. Here is the building of the custom registry (which worked fine with events): @SubscribeEvent public static void registerRegistries(final RegistryEvent.NewRegistry event) { // Quest Task RegistryBuilder<QuestTask> questTaskBuilder = new RegistryBuilder<QuestTask>(); questTaskBuilder.setType(QuestTask.class); ResourceLocation questTaskLocation = DaBoisMod.modLocation("quest_task"); questTaskBuilder.setName(questTaskLocation); questTaskBuilder.setDefaultKey(questTaskLocation); questTaskBuilder.create(); } I'm trying to use deferred register with this: public class QuestTasks { private static final DeferredRegister<QuestTask> QUEST_TASKS = new DeferredRegister<>(GameRegistry.findRegistry(QuestTask.class), DaBoisMod.MODID); public static void registerQuestTasks(IEventBus eventBus) { QuestTasks.QUEST_TASKS.register(eventBus); DaBoisMod.LOGGER.info("Quest tasks registered."); } // Break Blocks public static final RegistryObject<BreakBlocksQuestTask> BREAK_DIRT = QUEST_TASKS.register("break_dirt", () -> new BreakBlocksQuestTask(Blocks.DIRT, 30, 200)); } For the most part, all of my other registries work, but my custom one causes the mod to fail to load: Am I doing something wrong? Is it not possible to use DeferredRegister with custom registries?
  2. Your packet class is the class which has the Handlersubclass.
  3. net.minecraftforge.client.event.InputEvent.KeyInputEvent
  4. Do you have a packet system? If not then look at the Forge documentation to make one
  5. All you need to get rid of the portal is to override placeEntity and return an application of repositionEntity with the parameter being false.
  6. See BlockState#getBlockHardness
  7. Update your mappings and forge in the build.gradle file.
  8. Bump. I'm not entirely sure how to fix this.
  9. I haven't looked into it too much but passing in an ItemPredicate into InventoryChangeTrigger.Instance#forItems then using InventoryChangeTrigger.Instance#test seems promising.
  10. Ensure that the package names are in the right order and have no typos. Your json file should work if it's in the right place.
  11. 1. Wrong sub forum. 2. OptiFine is not currently compatible with Forge. And you have two versions of OptiFine in your mods folder.
  12. It seems that the player is being ticked while you are trying to change it's dimension (remove it from the world), which causes an illegal state exception.
  13. For the action bar message, you can just use ServerPlayerEntity#sendStatusMessage with the second parameter being true to send an action bar message to a player. For the Totem of Undying animation, you have to create your own server-to-client packet which has the line Minecraft.getInstance().gameRenderer.displayItemActivation(...)
  14. Screw what I said before about renaming the 'blocks' to 'block'. I misread your folder names.
  15. How would I go about fixing the deadlock? I removed the DBMChunkManager class as I realized I didn't need it. Here is the new code: @SubscribeEvent public static void chunkLoad(final ChunkEvent.Load event) { if (event.getWorld() != null) if (event.getWorld().chunkExists(event.getChunk().getPos().x, event.getChunk().getPos().z)) if (!event.getWorld().isRemote()) { ServerWorld world = (ServerWorld) event.getWorld(); if (world.dimension.getType() == DBMDimensions.realm_of_the_ancients) { // Force Loads Corresponding Chunks in the Overworld world.getServer().getWorld(DimensionType.OVERWORLD).forceChunk(event.getChunk().getPos().x, event.getChunk().getPos().z, true); } else if (world.dimension.getType() == DimensionType.OVERWORLD && DBMDimensions.realm_of_the_ancients != null) { // Force Loads Corresponding Chunks in the Realm of the Ancients world.getServer().getWorld(DBMDimensions.realm_of_the_ancients).forceChunk(event.getChunk().getPos().x, event.getChunk().getPos().z, true); } } } @SubscribeEvent public static void chunkUnload(final ChunkEvent.Unload event) { if (event.getWorld() != null) if (event.getWorld().chunkExists(event.getChunk().getPos().x, event.getChunk().getPos().z)) if (!event.getWorld().isRemote()) { ServerWorld world = (ServerWorld) event.getWorld(); if (world.dimension.getType() == DBMDimensions.realm_of_the_ancients) { // Force Unloads Corresponding Chunks in the Overworld world.getServer().getWorld(DimensionType.OVERWORLD).forceChunk(event.getChunk().getPos().x, event.getChunk().getPos().z, false); } else if (world.dimension.getType() == DimensionType.OVERWORLD && DBMDimensions.realm_of_the_ancients != null) { // Force Unloads Corresponding Chunks in the Realm of the Ancients world.getServer().getWorld(DBMDimensions.realm_of_the_ancients).forceChunk(event.getChunk().getPos().x, event.getChunk().getPos().z, false); } } } Still gets stuck at 0%.
  16. Oh I misunderstood his question. Yeah you cant have it in a separate recipe tab if its in a custom tab yet unfortunately
  17. Create a json in data.[MODID].advancements.recipes . Look at the vanilla code for examples
  18. Try removing the 'minecraft:' from the 'minecraft:block/cube_all'
  19. The dimension tick does not work because the variable gets set back to zero every tick. It effectively does nothing. Try checking if the player is in the same world as the entity: this.world.getPlayers().contains(getMaster())
  20. Ok i figured out why. The package your texture is in is called 'blocks', not 'block'
  21. Did you change block/cube_all to minecraft:block/cube_all ? Post your new model file
×
×
  • Create New...

Important Information

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