Skip to content

Instantly share code, notes, and snippets.

@Daomephsta
Created July 14, 2020 04:48
Show Gist options
  • Save Daomephsta/4ee36827f03c9e0433aaf076d09a110a to your computer and use it in GitHub Desktop.
Save Daomephsta/4ee36827f03c9e0433aaf076d09a110a to your computer and use it in GitHub Desktop.
RemovalSafeLootEntryIterator
public class RemovalSafeLootEntryIterator implements Iterator<RemovalSafeLootEntryIterator>, LootEntryRepresentation
{
private final Iterator<? extends LootEntryRepresentation> delegate;
private LootEntryRepresentation currentEntry;
public RemovalSafeLootEntryIterator(Iterator<? extends LootEntryRepresentation> delegate)
{
this.delegate = delegate;
}
@Override
public RemovalSafeLootEntryIterator next()
{
this.currentEntry = delegate.next();
return this;
}
@Override
public boolean hasNext()
{
return delegate.hasNext();
}
@Override
@ZenMethod
public void remove()
{
delegate.remove();
}
@Override
public LootEntryRepresentation setWeight(int weight)
{
return currentEntry.setWeight(weight);
}
@Override
public LootEntryRepresentation setQuality(int quality)
{
return currentEntry.setQuality(quality);
}
@Override
public LootEntryRepresentation setName(String name)
{
return currentEntry.setName(name);
}
@Override
public LootEntryRepresentation setConditionsJson(IData... conditions)
{
return currentEntry.setConditionsJson(conditions);
}
@Override
public LootEntryRepresentation setConditions(LootConditionRepresentation... conditions)
{
return currentEntry.setConditions(conditions);
}
@Override
public LootEntryRepresentation addConditionsJson(IData... conditions)
{
return currentEntry.addConditionsJson(conditions);
}
@Override
public LootEntryRepresentation addConditions(LootConditionRepresentation... conditions)
{
return currentEntry.addConditions(conditions);
}
@Override
public LootEntryRepresentation removeAllConditions()
{
return currentEntry.removeAllConditions();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment