mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-10 09:02:09 -07:00
#898: Use Java Consumer instead of Bukkit Consumer
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package org.bukkit;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
@@ -10,7 +11,6 @@ import org.bukkit.block.data.BlockData;
|
|||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.util.Consumer;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
@@ -6,6 +6,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@@ -33,7 +34,6 @@ import org.bukkit.persistence.PersistentDataHolder;
|
|||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
||||||
import org.bukkit.util.BoundingBox;
|
import org.bukkit.util.BoundingBox;
|
||||||
import org.bukkit.util.Consumer;
|
|
||||||
import org.bukkit.util.RayTraceResult;
|
import org.bukkit.util.RayTraceResult;
|
||||||
import org.bukkit.util.StructureSearchResult;
|
import org.bukkit.util.StructureSearchResult;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
@@ -521,7 +521,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* @param delegate A class to call for each block changed as a result of
|
* @param delegate A class to call for each block changed as a result of
|
||||||
* this method
|
* this method
|
||||||
* @return true if the tree was created successfully, otherwise false
|
* @return true if the tree was created successfully, otherwise false
|
||||||
* @see #generateTree(org.bukkit.Location, java.util.Random, org.bukkit.TreeType, org.bukkit.util.Consumer)
|
* @see #generateTree(org.bukkit.Location, java.util.Random, org.bukkit.TreeType, java.util.function.Consumer)
|
||||||
* @deprecated this method does not handle tile entities (bee nests)
|
* @deprecated this method does not handle tile entities (bee nests)
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@@ -5,13 +5,19 @@ package org.bukkit.util;
|
|||||||
* result.
|
* result.
|
||||||
*
|
*
|
||||||
* @param <T> the type of the input to the operation
|
* @param <T> the type of the input to the operation
|
||||||
|
* @deprecated Use {@link java.util.function.Consumer} instead
|
||||||
*/
|
*/
|
||||||
public interface Consumer<T> {
|
// Bukkit developer note (NOT plugin developers):
|
||||||
|
// NEVER use this consumer in the API.
|
||||||
|
// API methods which use this consumer will be remapped to Java's consumer at runtime, resulting in an error.
|
||||||
|
@Deprecated
|
||||||
|
public interface Consumer<T> extends java.util.function.Consumer<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs this operation on the given argument.
|
* Performs this operation on the given argument.
|
||||||
*
|
*
|
||||||
* @param t the input argument
|
* @param t the input argument
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
void accept(T t);
|
void accept(T t);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user