mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 14:53:05 +00:00
Convert old honey using the still #390
This commit is contained in:
1 parent
43bd276389
commit
305be1b979
4 files changed
+26
-18
No files matched your search
@@ -89,8 +89,6 @@ public class EventHandlerCore {
|
||||
if(event.map.getTextureType() == 1) {
|
||||
ErrorStateRegistry.initIcons(event.map);
|
||||
TextureManager.getInstance().initDefaultIcons(event.map);
|
||||
} else if(event.map.getTextureType() == 0) {
|
||||
ForestryFluids.resetFluidIcons(event.map);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,11 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
*/
|
||||
public enum Fluids {
|
||||
|
||||
WATER, LAVA, FUEL, BIOMASS, BIOFUEL, CREOSOTE, STEAM, BIOETHANOL,
|
||||
COAL, PYROTHEUM, HONEY("for.honey"), MILK, JUICE, ICE, GLASS, OIL, SEEDOIL, SHORT_MEAD("short.mead");
|
||||
WATER, LAVA,
|
||||
FUEL, OIL, BIOFUEL,
|
||||
CREOSOTE, STEAM,
|
||||
COAL, PYROTHEUM,
|
||||
BIOMASS, BIOETHANOL, LEGACY_HONEY("honey"), HONEY("for.honey"), MILK, JUICE, ICE, GLASS, SEEDOIL, SHORT_MEAD("short.mead");
|
||||
|
||||
private final String tag;
|
||||
|
||||
@@ -69,6 +72,4 @@ public enum Fluids {
|
||||
return true;
|
||||
return fluid == null && fluidStack == null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -99,6 +99,7 @@ public enum ForestryFluids {
|
||||
);
|
||||
}
|
||||
},
|
||||
LEGACY_HONEY(Fluids.LEGACY_HONEY, new Color(224, 194, 57), 1420, 73600),
|
||||
ICE(Fluids.ICE, new Color(175, 242, 255), 920, 1000, 265) {
|
||||
@Override
|
||||
public Block makeBlock() {
|
||||
@@ -177,6 +178,10 @@ public enum ForestryFluids {
|
||||
protected Fluid fluid;
|
||||
protected Block fluidBlock;
|
||||
|
||||
private ForestryFluids(Fluids standardFluid, Color color) {
|
||||
this(standardFluid, color, 1000, 1000, 295);
|
||||
}
|
||||
|
||||
private ForestryFluids(Fluids standardFluid, Color color, int density, int viscosity) {
|
||||
this(standardFluid, color, density, viscosity, 295);
|
||||
}
|
||||
@@ -192,9 +197,12 @@ public enum ForestryFluids {
|
||||
|
||||
private void initFluid() {
|
||||
if (fluid == null && Config.isFluidEnabled(this)) {
|
||||
fluid = new Fluid(standardFluid.getTag()).setDensity(density).setViscosity(viscosity).setTemperature(temperature);
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
initBlock();
|
||||
String fluidName = standardFluid.getTag();
|
||||
if (!FluidRegistry.isFluidRegistered(fluidName)) {
|
||||
fluid = new Fluid(fluidName).setDensity(density).setViscosity(viscosity).setTemperature(temperature);
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
initBlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +210,9 @@ public enum ForestryFluids {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
abstract Block makeBlock();
|
||||
Block makeBlock() {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void initBlock() {
|
||||
if (fluidBlock != null)
|
||||
@@ -217,8 +227,10 @@ public enum ForestryFluids {
|
||||
if (Config.isBlockEnabled(tag))
|
||||
if (fluidBlock == null) {
|
||||
fluidBlock = makeBlock();
|
||||
fluidBlock.setBlockName("forestry." + tag);
|
||||
Proxies.common.registerBlock(fluidBlock, ItemBlock.class);
|
||||
if (fluidBlock != null) {
|
||||
fluidBlock.setBlockName("forestry." + tag);
|
||||
Proxies.common.registerBlock(fluidBlock, ItemBlock.class);
|
||||
}
|
||||
} else {
|
||||
GameRegistry.UniqueIdentifier blockID = GameRegistry.findUniqueIdentifierFor(fluidBlock);
|
||||
Proxies.log.severe("Pre-existing {0} fluid block detected, deferring to {1}:{2}, "
|
||||
@@ -227,12 +239,6 @@ public enum ForestryFluids {
|
||||
}
|
||||
}
|
||||
|
||||
public static void resetFluidIcons(IIconRegister register) {
|
||||
for (ForestryFluids fluid : VALUES) {
|
||||
fluid.getBlock().registerBlockIcons(register);
|
||||
}
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
return fluidBlock;
|
||||
}
|
||||
|
||||
@@ -299,6 +299,9 @@ public class PluginFactory extends ForestryPlugin {
|
||||
RecipeManagers.stillManager.addRecipe(Defaults.STILL_DESTILLATION_DURATION, Fluids.BIOMASS.get(Defaults.STILL_DESTILLATION_INPUT),
|
||||
Fluids.BIOETHANOL.get(Defaults.STILL_DESTILLATION_OUTPUT));
|
||||
|
||||
// convert old honey to new honey
|
||||
RecipeManagers.stillManager.addRecipe(1, Fluids.LEGACY_HONEY.get(1000), Fluids.HONEY.get(1000));
|
||||
|
||||
// MOISTENER
|
||||
RecipeManagers.moistenerManager.addRecipe(new ItemStack(Items.wheat_seeds), new ItemStack(Blocks.mycelium), 5000);
|
||||
RecipeManagers.moistenerManager.addRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone), 20000);
|
||||
|
||||
Reference in new issue
Block a user