Refactoring
This commit is contained in:
@@ -43,7 +43,7 @@ public class ElementPageList<T, K> extends Element
|
|||||||
if(this.values.getObject() == null)
|
if(this.values.getObject() == null)
|
||||||
{
|
{
|
||||||
this.values.setObject(0);
|
this.values.setObject(0);
|
||||||
this.values.setIndex(Math.max(0, this.list.indexOf(this.logic.convert(initial))));
|
this.values.setIndex(Math.max(0, this.list.indexOf(this.logic.getObject(initial))));
|
||||||
|
|
||||||
if(initial == null)
|
if(initial == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ public interface ILogicPageList<T, K> extends ILogic
|
|||||||
void onClick(T clicked);
|
void onClick(T clicked);
|
||||||
void onRegister(int id, int x, int y, int width, int height, String display, String registryKey, boolean enabled, T value, Container container);
|
void onRegister(int id, int x, int y, int width, int height, String display, String registryKey, boolean enabled, T value, Container container);
|
||||||
|
|
||||||
T convert(K object);
|
T getObject(K object);
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ public class ContentAdvancements extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Advancement convert(String object)
|
public Advancement getObject(String object)
|
||||||
{
|
{
|
||||||
return helper.ADVANCEMENT_MANAGER.getAdvancement(Type.parseResourceLocation(object));
|
return helper.ADVANCEMENT_MANAGER.getAdvancement(Type.parseResourceLocation(object));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ public class ContentCustomItem extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation convert(String object)
|
public ResourceLocation getObject(String object)
|
||||||
{
|
{
|
||||||
if(object != null)
|
if(object != null)
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ public class ContentCustomItem extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumAttributes convert(Object object)
|
public EnumAttributes getObject(Object object)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class ContentEnchantment extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation convert(String object)
|
public ResourceLocation getObject(String object)
|
||||||
{
|
{
|
||||||
return Type.parseResourceLocation(object);
|
return Type.parseResourceLocation(object);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class ContentGamerules extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String convert(String object)
|
public String getObject(String object)
|
||||||
{
|
{
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class ContentPotions extends ContentChild
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation convert(Potion object)
|
public ResourceLocation getObject(Potion object)
|
||||||
{
|
{
|
||||||
if(object != null)
|
if(object != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class ContentRecipes extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IRecipe convert(String object)
|
public IRecipe getObject(String object)
|
||||||
{
|
{
|
||||||
return CraftingManager.REGISTRY.getObject(Type.parseResourceLocation(object));
|
return CraftingManager.REGISTRY.getObject(Type.parseResourceLocation(object));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ public class ContentSummon extends Content
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EnumAttributes convert(Object object)
|
public EnumAttributes getObject(Object object)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user