Use Xlib guava some more
This commit is contained in:
parent
5a380503e0
commit
9c5f6a06a4
@ -1,58 +0,0 @@
|
||||
package com.massivecraft.massivecore.item;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
|
||||
public class ConverterListImmutable<EX, EY> extends Converter<Iterable<EX>, ImmutableList<EY>>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// FIELD
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Converter<EX, EY> converterElement;
|
||||
public Converter<EX, EY> getConverterElement() { return this.converterElement; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// CREATE
|
||||
// -------------------------------------------- //
|
||||
|
||||
public ConverterListImmutable(Converter<EX, EY> converterElement)
|
||||
{
|
||||
this.converterElement = converterElement;
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
public ImmutableList<EY> convert(Iterable<EX> exs)
|
||||
{
|
||||
// Null
|
||||
if (exs == null) return null;
|
||||
|
||||
// Create
|
||||
Builder<EY> eys = ImmutableList.builder();
|
||||
|
||||
// Fill
|
||||
for (EX ex : exs)
|
||||
{
|
||||
EY ey = null;
|
||||
try
|
||||
{
|
||||
ey = this.getConverterElement().convert(ex);
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
t.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
|
||||
eys.add(ey);
|
||||
}
|
||||
|
||||
// Return
|
||||
return eys.build();
|
||||
}
|
||||
|
||||
}
|
@ -2,7 +2,7 @@ package com.massivecraft.massivecore.item;
|
||||
|
||||
import org.bukkit.Color;
|
||||
|
||||
public class ConverterToColors extends ConverterListImmutable<Integer, Color>
|
||||
public class ConverterToColors extends ConverterList<Integer, Color>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.massivecraft.massivecore.item;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.ImmutableBiMap;
|
||||
import com.massivecraft.massivecore.xlib.guava.collect.BiMap;
|
||||
import com.massivecraft.massivecore.xlib.guava.collect.ImmutableBiMap;
|
||||
import org.bukkit.potion.Potion;
|
||||
import org.bukkit.potion.PotionData;
|
||||
import org.bukkit.potion.PotionType;
|
||||
|
@ -1,12 +1,11 @@
|
||||
package com.massivecraft.massivecore.item;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WriterFireworkEffectColors extends WriterAbstractFireworkEffect<List<Integer>, ImmutableList<Color>>
|
||||
public class WriterFireworkEffectColors extends WriterAbstractFireworkEffect<List<Integer>, List<Color>>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -38,9 +37,9 @@ public class WriterFireworkEffectColors extends WriterAbstractFireworkEffect<Lis
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<Color> getB(FireworkEffect cb, Object d)
|
||||
public List<Color> getB(FireworkEffect cb, Object d)
|
||||
{
|
||||
return (ImmutableList<Color>) cb.getColors();
|
||||
return cb.getColors();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
package com.massivecraft.massivecore.item;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.FireworkEffect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class WriterFireworkEffectFadeColors extends WriterAbstractFireworkEffect<List<Integer>, ImmutableList<Color>>
|
||||
public class WriterFireworkEffectFadeColors extends WriterAbstractFireworkEffect<List<Integer>, List<Color>>
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// INSTANCE & CONSTRUCT
|
||||
@ -38,9 +37,9 @@ public class WriterFireworkEffectFadeColors extends WriterAbstractFireworkEffect
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableList<Color> getB(FireworkEffect cb, Object d)
|
||||
public List<Color> getB(FireworkEffect cb, Object d)
|
||||
{
|
||||
return (ImmutableList<Color>) cb.getFadeColors();
|
||||
return cb.getFadeColors();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.massivecraft.massivecore.mson;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.massivecraft.massivecore.adapter.AdapterLowercaseEnum;
|
||||
import com.massivecraft.massivecore.adapter.AdapterMsonEventFix;
|
||||
import com.massivecraft.massivecore.collections.MassiveList;
|
||||
@ -14,6 +13,7 @@ import com.massivecraft.massivecore.xlib.gson.GsonBuilder;
|
||||
import com.massivecraft.massivecore.xlib.gson.JsonElement;
|
||||
import com.massivecraft.massivecore.xlib.gson.JsonNull;
|
||||
import com.massivecraft.massivecore.xlib.gson.JsonPrimitive;
|
||||
import com.massivecraft.massivecore.xlib.guava.collect.ImmutableList;
|
||||
import org.apache.commons.lang.mutable.MutableInt;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.massivecraft.massivecore.nms;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.massivecraft.massivecore.particleeffect.ReflectionUtils.PackageType;
|
||||
import com.massivecraft.massivecore.util.ReflectionUtil;
|
||||
import com.massivecraft.massivecore.xlib.guava.collect.ImmutableSet;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.massivecraft.massivecore.predicate;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.massivecraft.massivecore.xlib.guava.collect.ImmutableList;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.massivecraft.massivecore.store;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.massivecraft.massivecore.Named;
|
||||
import com.massivecraft.massivecore.PlayerState;
|
||||
import com.massivecraft.massivecore.event.EventMassiveCoreAknowledge;
|
||||
@ -13,6 +12,7 @@ import com.massivecraft.massivecore.mson.Mson;
|
||||
import com.massivecraft.massivecore.store.cleanable.Cleanable;
|
||||
import com.massivecraft.massivecore.util.IdUtil;
|
||||
import com.massivecraft.massivecore.util.PermissionUtil;
|
||||
import com.massivecraft.massivecore.xlib.guava.base.Objects;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.massivecraft.massivecore.util;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.massivecraft.massivecore.SenderPresence;
|
||||
import com.massivecraft.massivecore.SenderType;
|
||||
import com.massivecraft.massivecore.xlib.guava.collect.ImmutableList;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
|
Loading…
Reference in New Issue
Block a user