Jump to content

YorickBM

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by YorickBM

  1. None with someone information about this problem? Is more code required to be attached?
  2. for(ChunkAccess chunkaccess1 : list) { chunkaccess1.fillBiomesFromNoise( makeResolver(mutableint, chunkaccess1, boundingbox, p_262612_, p_262697_), serverlevel.getChunkSource().randomState().sampler()); chunkaccess1.setUnsaved(true); serverlevel.getChunkSource().chunkMap.resendChunk(chunkaccess1); } Above code seems to be missing the function .randomState() & .resenChunk() tho.... (in 1.18.2 it says those two functions do not exist) For the first one i simply changed it to use the 'serverlevel.getChunkSource().getGenerator().climateSampler()' since this returns the correct paramater for the function. I can not find a replacement for the part '.chunkMap.resendChunk(chunkaccess1)' since chunkMap contains no function taking argument ChunkAccess
  3. The command is not the actual problem since that is what i did for that, but the code to change the biome between the 2 locations is what I am troubled with.
  4. Heey, I have been trying to find a way to have a command that allows 2 set of coordinates & biome type. Just like minecrafts fillbiome command... Sadly it does not exist in minecraft forge 1.18.2. I cannot find that much online on how to implement this into a mod (server-sided)... Since everything that is online is on an older version, and does not work anymore or has non existent functions. Im quite new to forge development so don't mind semi spoon feeding, would love to learn.
  5. Hey Everyone, im developing a small mod for 1.18.2 forge that stores some data attached to the player with a custom capability. This works fine on disconnect & reconnect. Server restart & on death of player. For some reason when returning from the end the data gets lost & the player gets the capability recreated... Below some code attached of the capability Code below are my player events. They all trigger correctly, on returning from the end the respawn player event is triggerd as far as i can understand from debugging. Should reviveCaps() be called on player respawn aswell?? @SubscribeEvent public static void onPlayerCloned(PlayerEvent.Clone event) { if(!event.isWasDeath()) return; event.getOriginal().reviveCaps(); LOGGER.info("CLONE EVENT TRIGGERD!!"); event.getOriginal().getCapability(PlayerIslandProvider.PLAYER_ISLAND).ifPresent(oldStore -> { if(oldStore.hasOne()) LOGGER.info("We found island data!"); event.getPlayer().getCapability(PlayerIslandProvider.PLAYER_ISLAND).ifPresent(newStore -> { newStore.copyFrom(oldStore); }); }); event.getOriginal().invalidateCaps(); } @SubscribeEvent public static void onDimensionChange (PlayerEvent.PlayerChangedDimensionEvent event) { event.getPlayer().reviveCaps(); } @SubscribeEvent public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) { event.getPlayer().getCapability(PlayerIslandProvider.PLAYER_ISLAND).ifPresent(i -> { if(i.hasOne()) event.getPlayer().teleportTo(i.getLocation().getX(), i.getLocation().getY(), i.getLocation().getZ()); }); } @SubscribeEvent public static void onAttachCapabilitiesPlayer(AttachCapabilitiesEvent<Entity> event) { if(!(event.getObject() instanceof Player)) return; if(event.getObject().getCapability(PlayerIslandProvider.PLAYER_ISLAND).isPresent()) return; event.addCapability(new ResourceLocation(Main.MOD_ID, "islanddata"), new PlayerIslandProvider()); }
  6. Heey, i have been stuck on this for a while now. But i have been trying to find a way to check if a user is in the overworld when executing a command. And ONLY the overworld. No modded dimension, nether or end.... I got as far as getting the 'level' or 'dimensiontype' but no way from there to check if its the overworld one. import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.world.entity.player.Player; import yorickbm.skyblockaddon.capabilities.PlayerIslandProvider; if(!(command.getEntity() instanceof Player)) { //Executed by non-player command.sendFailure(new TranslatableComponent("commands.nonplayer")); } Player player = (Player)command.getEntity(); player.sendMessage(new TextComponent("You are in world: " + player.getLevel().dimensionType()), player.getUUID()); //Just prints the serialized class
×
×
  • Create New...

Important Information

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