-
Posts
106 -
Joined
-
Last visited
-
Days Won
1
Everything posted by kaydogz
-
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?
-
See BlockState#getBlockHardness
-
[1.15.2] How to properly force load/unload chunks across dimensions?
kaydogz replied to kaydogz's topic in Modder Support
Bump. I'm not entirely sure how to fix this. -
Check player picked up a certain item at the first time
kaydogz replied to poopoodice's topic in Modder Support
I haven't looked into it too much but passing in an ItemPredicate into InventoryChangeTrigger.Instance#forItems then using InventoryChangeTrigger.Instance#test seems promising. -
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.
-
Forge keeps crashing and i dont know which mod it is
kaydogz replied to Kossi's topic in Support & Bug Reports
1. Wrong sub forum. 2. OptiFine is not currently compatible with Forge. And you have two versions of OptiFine in your mods folder. -
[SOLVED][1.15.2] Problems with PlayerEntity#changeDimension
kaydogz replied to Novârch's topic in Modder Support
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. -
[Solved][1.15.2] How to send action-bar message
kaydogz replied to Slastic's topic in Modder Support
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(...) -
Screw what I said before about renaming the 'blocks' to 'block'. I misread your folder names.
-
[1.15.2] How to properly force load/unload chunks across dimensions?
kaydogz replied to kaydogz's topic in Modder Support
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%. -
post your code
-
Oh I misunderstood his question. Yeah you cant have it in a separate recipe tab if its in a custom tab yet unfortunately
-
Create a json in data.[MODID].advancements.recipes . Look at the vanilla code for examples
-
Try removing the 'minecraft:' from the 'minecraft:block/cube_all'
-
[SOLVED][1.15.2] Problems with PlayerEntity#changeDimension
kaydogz replied to Novârch's topic in Modder Support
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()) -
Ok i figured out why. The package your texture is in is called 'blocks', not 'block'
-
Did you change block/cube_all to minecraft:block/cube_all ? Post your new model file