Flamboyant Refabricated Integration (WIP)

This commit is contained in:
paulevsGitch 2021-03-24 22:25:34 +03:00
parent a2ca5fe3df
commit b933b0e522
9 changed files with 128 additions and 17 deletions

View file

@ -0,0 +1,67 @@
package ru.betterend.integration;
import java.awt.Color;
import java.util.Map;
import com.google.common.collect.Maps;
import net.minecraft.item.ItemConvertible;
import ru.betterend.blocks.HydraluxPetalColoredBlock;
import ru.betterend.blocks.complex.ColoredMaterial;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper;
public class FlamboyantRefabricatedIntegration extends ModIntegration {
public FlamboyantRefabricatedIntegration() {
super("flamboyant");
}
@Override
public void register() {
/*Class<?> fDyeColor = getClass("com.github.EltrutCo.flamboyant.items.FDyeColor");
Object[] values = getStaticFieldValue(fDyeColor, "VALUES");
if (values == null) {
return;
}*/
Map<Integer, String> colors = Maps.newHashMap();
Map<Integer, ItemConvertible> dyes = Maps.newHashMap();
/*for (Object val: values) {
Integer color = (Integer) getFieldValue(fDyeColor, "signColor", val);
String name = (String) getFieldValue(fDyeColor, "name", val);
if (color != null && name != null) {
colors.put(color, name);
System.out.println(name + " " + color + " " + new Color(color));
dyes.put(color, getItem(name + "_dye"));
}
}*/
addColor("fead1d", "amber", colors, dyes);
addColor("bd9a5f", "beige", colors, dyes);
addColor("edeada", "cream", colors, dyes);
addColor("33430e", "dark_green", colors, dyes);
addColor("639920", "forest_green", colors, dyes);
addColor("f0618c", "hot_pink", colors, dyes);
addColor("491c7b", "indigo", colors, dyes);
addColor("65291b", "maroon", colors, dyes);
addColor("2c3969", "navy", colors, dyes);
addColor("827c17", "olive", colors, dyes);
addColor("7bc618", "pale_green", colors, dyes);
addColor("f4a4bd", "pale_pink", colors, dyes);
addColor("f8d45a", "pale_yellow", colors, dyes);
addColor("6bb1cf", "sky_blue", colors, dyes);
addColor("6e8c9c", "slate_gray", colors, dyes);
addColor("b02454", "violet", colors, dyes);
new ColoredMaterial(HydraluxPetalColoredBlock::new, EndBlocks.HYDRALUX_PETAL_BLOCK, colors, dyes, true);
}
private void addColor(String hex, String name, Map<Integer, String> colors, Map<Integer, ItemConvertible> dyes) {
int color = MHelper.color(hex);
colors.put(color, name);
dyes.put(color, getItem(name + "_dye"));
System.out.println(name + " " + color + " " + new Color(color));
}
}

View file

@ -12,6 +12,7 @@ public class Integrations {
public static final ModIntegration NOURISH = register(new NourishIntegration());
//public static final ModIntegration EXTRA_PIECES = register(new ExtraPiecesIntegration());
//public static final ModIntegration ADORN = register(new AdornIntegration());
public static final ModIntegration FLAMBOYANT_REFABRICATED = register(new FlamboyantRefabricatedIntegration());
public static void register() {
INTEGRATIONS.forEach((integration) -> {

View file

@ -28,9 +28,9 @@ import ru.betterend.world.features.EndFeature;
public abstract class ModIntegration {
private final String modID;
public abstract void register();
public void register() {}
public abstract void addBiomes();
public void addBiomes() {}
public ModIntegration(String modID) {
this.modID = modID;
@ -43,6 +43,10 @@ public abstract class ModIntegration {
public Block getBlock(String name) {
return Registry.BLOCK.get(getID(name));
}
public Item getItem(String name) {
return Registry.ITEM.get(getID(name));
}
public BlockState getDefaultState(String name) {
return getBlock(name).getDefaultState();

View file

@ -22,7 +22,4 @@ public class NourishIntegration extends ModIntegration {
TagHelper.addTag(protein, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED);
TagHelper.addTag(sweets, EndItems.SHADOW_BERRY_JELLY, EndItems.SWEET_BERRY_JELLY);
}
@Override
public void addBiomes() {}
}