Skip to content

Commit

Permalink
Use List instead of ImmutableList to allow nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
unascribed committed Mar 1, 2017
1 parent 7ddace9 commit 1afb9ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/elytradev/probe/api/IProbeData.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.elytradev.probe.api;

import javax.annotation.Nonnull;
import java.util.List;

import com.google.common.collect.ImmutableList;
import javax.annotation.Nonnull;

import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
Expand Down Expand Up @@ -120,10 +120,10 @@ public interface IProbeData {
/**
* Gets any inventory associated with this ProbeData. In the case where only a single itemslot is exposed, a probe
* implementation may choose to enlarge the displayed item.
* @return an ImmutableList containing all visible inventory slots, empty or filled, in this inventory. A probe
* @return a List containing all visible inventory slots, empty or filled, in this inventory. A probe
* implementation is then free to elide stacks or slots in order to present the inventory more succinctly, or
* depending on its configuration.
*/
@Nonnull
public ImmutableList<ItemStack> getInventory();
public List<ItemStack> getInventory();
}
8 changes: 3 additions & 5 deletions src/main/java/com/elytradev/probe/api/impl/ProbeData.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

import com.elytradev.probe.api.IProbeData;
import com.elytradev.probe.api.IUnit;
import com.google.common.collect.ImmutableList;

import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
Expand All @@ -19,7 +17,7 @@ public class ProbeData implements IProbeData {
private double barCur = Double.NaN;
private double barMax = Double.NaN;
private IUnit barUnit = null;
private ImmutableList<ItemStack> inventory = null;
private List<ItemStack> inventory = null;

/**
* Creates a blank data line
Expand Down Expand Up @@ -83,7 +81,7 @@ public ProbeData withBar(double minimum, double current, double maximum, IUnit u
* @param inventory the contents of all itemslots, full or empty, in this datum.
* @return this ProbeData
*/
public ProbeData withInventory(@Nonnull ImmutableList<ItemStack> inventory) {
public ProbeData withInventory(@Nonnull List<ItemStack> inventory) {
this.inventory = inventory;
return this;
}
Expand Down Expand Up @@ -132,7 +130,7 @@ public boolean hasInventory() {

@Override
@Nullable
public ImmutableList<ItemStack> getInventory() {
public List<ItemStack> getInventory() {
return inventory;
}

Expand Down

0 comments on commit 1afb9ea

Please sign in to comment.