Skip to content

Commit

Permalink
Revert "Update"
Browse files Browse the repository at this point in the history
This reverts commit 350f1df.
  • Loading branch information
mcchampions committed Jul 4, 2024
1 parent 350f1df commit 58b0bfc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.github.thebusybiscuit.slimefun4.api.exceptions.WrongItemStackException;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.utils.HeadTexture;
import lombok.Getter;
import org.apache.commons.lang.Validate;
import org.bukkit.ChatColor;
import org.bukkit.Color;
Expand All @@ -25,7 +24,11 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.function.Consumer;

/**
Expand All @@ -34,6 +37,7 @@
*
* @author TheBusyBiscuit
* @author Walshy
*
*/
@SerializableAs("ItemStack")
public class SlimefunItemStack extends ItemStack {
Expand All @@ -44,9 +48,6 @@ public class SlimefunItemStack extends ItemStack {
private boolean locked = false;
private String texture = null;

@Getter
private final List<ItemStack> drops = new ArrayList(List.of(this));

public SlimefunItemStack(String id, ItemStack item) {
super(item);

Expand Down Expand Up @@ -226,12 +227,15 @@ public final String getItemId() {
/**
* This method returns the associated {@link SlimefunItem} and casts it to the provided
* {@link Class}.
* <p>
*
* If no item was found or the found {@link SlimefunItem} is not of the requested type,
* the method will return null.
*
* @param <T> The type of {@link SlimefunItem} to cast this to
* @param type The {@link Class} of the target {@link SlimefunItem}
* @param <T>
* The type of {@link SlimefunItem} to cast this to
* @param type
* The {@link Class} of the target {@link SlimefunItem}
*
* @return The {@link SlimefunItem} this {@link SlimefunItem} represents, casted to the given type
*/
public @Nullable <T extends SlimefunItem> T getItem(Class<T> type) {
Expand Down Expand Up @@ -334,8 +338,4 @@ public final int hashCode() {
// We don't want people to override this, it should use the super method
return super.hashCode();
}

public void addDrop(ItemStack itemStack) {
this.drops.add(itemStack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ public static boolean isDust(ItemStack item) {
public static Collection<ItemStack> getDrops(SlimefunItem sfItem, Location loc) {
Collection<ItemStack> tempDrops = new ArrayList<>(sfItem.getDrops());
tempDrops.remove(sfItem.getItem());
tempDrops.addAll(Slimefun.getDatabaseManager().getBlockDataController().getBlockData(loc).getSfItemStack().getDrops());
tempDrops.add(Slimefun.getDatabaseManager().getBlockDataController().getBlockData(loc).getSfItemStack());
return tempDrops;
}

Expand All @@ -654,7 +654,7 @@ public static Collection<ItemStack> getDrops(Location loc) {
SlimefunItem sfItem = SlimefunItem.getById(blockData.getSfId());
Collection<ItemStack> tempDrops = new ArrayList<>(sfItem.getDrops());
tempDrops.remove(sfItem.getItem());
tempDrops.addAll(blockData.getSfItemStack().getDrops());
tempDrops.add(blockData.getSfItemStack());
return tempDrops;
}
}

0 comments on commit 58b0bfc

Please sign in to comment.