net.minecraft.util.Unit Java Examples
The following examples show how to use
net.minecraft.util.Unit.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ChunkTicketManager_spawnChunksMixin.java From fabric-carpet with MIT License | 5 votes |
@Override public void changeSpawnChunks(ChunkPos chunkPos, int distance) { long pos = chunkPos.toLong(); SortedArraySet<ChunkTicket<?>> set = ticketsByPosition.get(pos); ChunkTicket existingTicket = null; if (set != null) { Iterator<ChunkTicket<?>> iter = set.iterator(); while(iter.hasNext()) { ChunkTicket ticket = iter.next(); if (ticket.getType() == ChunkTicketType.START) { existingTicket = ticket; iter.remove(); } } set.add(existingTicket); } // the reason we are removing the ticket this way is that there are sideeffects of removal if (existingTicket != null) { removeTicket(pos, existingTicket); } // set optionally new spawn ticket if (distance > 0) addTicket(ChunkTicketType.START, chunkPos, distance, Unit.INSTANCE); }
Example #2
Source File: MixinReloadableResourceManagerImpl.java From multiconnect with MIT License | 4 votes |
@Inject(method = "beginMonitoredReload", at = @At("HEAD")) private void onResourceReload(Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage, List<ResourcePack> packs, CallbackInfoReturnable<ResourceReloadMonitor> ci) { ConnectionInfo.startReloadingResources(); ProtocolRegistry.latest().setup(true); }
Example #3
Source File: MixinMinecraftClient.java From Sandbox with GNU Lesser General Public License v3.0 | 4 votes |
@Redirect(method = "reloadResources", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ReloadableResourceManager;beginMonitoredReload(Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lnet/minecraft/resource/ResourceReloadMonitor;")) public ResourceReloadMonitor reloadResources(ReloadableResourceManager manager, Executor var1, Executor var2, CompletableFuture<Unit> var3, List<ResourcePack> var4) { addonResourcePackModifications(var4); System.out.println(var4); return manager.beginMonitoredReload(var1, var2, var3, var4); }