Flattened dusts.
This commit is contained in:
parent
1ee9ffb007
commit
edd4e0df3e
23 changed files with 365 additions and 856 deletions
88
src/main/java/techreborn/init/ModDusts.java
Normal file
88
src/main/java/techreborn/init/ModDusts.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
package techreborn.init;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.google.common.base.CaseFormat;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.RebornRegistry;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
public enum ModDusts implements IStringSerializable {
|
||||
ALMANDINE, ALUMINUM, ANDESITE, ANDRADITE, ASHES, BASALT, BAUXITE, BRASS, BRONZE, CALCITE, CHARCOAL, CHROME,
|
||||
CINNABAR, CLAY, COAL, COPPER, DARK_ASHES, DIAMOND, DIORITE, ELECTRUM, EMERALD, ENDER_EYE, ENDER_PEARL, ENDSTONE,
|
||||
FLINT, GALENA, GOLD, GRANITE, GROSSULAR, INVAR, IRON, LAZURITE, LEAD, MAGNESIUM, MANGANESE, MARBLE, NETHERRACK,
|
||||
NICKEL, OBSIDIAN, OLIVINE, PERIDOT, PHOSPHOROUS, PLATINUM, PYRITE, PYROPE, RED_GARNET, RUBY, SALTPETER, SAPPHIRE,
|
||||
SAW, SILVER, SODALITE, SPESSARTINE, SPHALERITE, STEEL, SULFUR, TIN, TITANIUM, TUNGSTEN, UVAROVITE,
|
||||
YELLOW_GARNET, ZINC;
|
||||
|
||||
public final String name;
|
||||
public final Item item;
|
||||
|
||||
private ModDusts() {
|
||||
name = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, "DUST_" + this.toString());
|
||||
item = new ItemDusts();
|
||||
item.setRegistryName(new ResourceLocation(ModInfo.MOD_ID, name));
|
||||
item.setTranslationKey(ModInfo.MOD_ID + "." + name);
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(item);
|
||||
}
|
||||
|
||||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
Arrays.stream(ModDusts.values()).forEach(dust -> RebornRegistry.registerItem(dust.item));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void registerModel() {
|
||||
ResourceLocation blockstateJson = new ResourceLocation(ModInfo.MOD_ID, "items/materials/dusts");
|
||||
Arrays.stream(ModDusts.values()).forEach(dust -> ModelLoader.setCustomModelResourceLocation(dust.item, 0,
|
||||
new ModelResourceLocation(blockstateJson, "type=" + dust.name)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
|
@ -45,7 +45,6 @@ import javax.annotation.Nullable;
|
|||
|
||||
public class ModItems {
|
||||
|
||||
public static Item DUSTS;
|
||||
public static Item SMALL_DUSTS;
|
||||
public static Item PARTS;
|
||||
public static Item ROCK_CUTTER;
|
||||
|
@ -154,11 +153,10 @@ public class ModItems {
|
|||
|
||||
public static void init() {
|
||||
|
||||
DUSTS = new ItemDusts();
|
||||
registerItem(DUSTS, "dust");
|
||||
SMALL_DUSTS = new ItemDustsSmall();
|
||||
registerItem(SMALL_DUSTS, "smallDust");
|
||||
|
||||
ModDusts.register();
|
||||
ModIngots.register();
|
||||
ModGems.register();
|
||||
ModPlates.register();
|
||||
|
|
|
@ -81,8 +81,8 @@ public class OreDict {
|
|||
OreUtil.registerOre("materialResin", ItemParts.getPartByName("rubberSap"));
|
||||
OreUtil.registerOre("materialRubber", ItemParts.getPartByName("rubber"));
|
||||
OreUtil.registerOre("itemRubber", ItemParts.getPartByName("rubber"));
|
||||
OreUtil.registerOre("pulpWood", ItemDusts.getDustByName("saw_dust"));
|
||||
OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes"));
|
||||
// OreUtil.registerOre("pulpWood", ItemDusts.getDustByName("saw_dust"));
|
||||
// OreUtil.registerOre("dustAsh", ItemDusts.getDustByName("ashes"));
|
||||
|
||||
// TODO: fix recipe
|
||||
// for (String type : ItemGems.types) {
|
||||
|
|
|
@ -46,22 +46,26 @@ public class SubItemRetriever implements ISubItemRetriever {
|
|||
|
||||
@Override
|
||||
public ItemStack getDustByName(String name) {
|
||||
return ItemDusts.getDustByName(name);
|
||||
// return ItemDusts.getDustByName(name);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getDustByName(String name, int count) {
|
||||
return ItemDusts.getDustByName(name, count);
|
||||
// return ItemDusts.getDustByName(name, count);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getSmallDustByName(String name) {
|
||||
return ItemDustsSmall.getSmallDustByName(name);
|
||||
// return ItemDustsSmall.getSmallDustByName(name);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getSmallDustByName(String name, int count) {
|
||||
return ItemDustsSmall.getSmallDustByName(name, count);
|
||||
// return ItemDustsSmall.getSmallDustByName(name, count);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,7 +40,7 @@ import reborncore.common.registration.impl.ConfigRegistry;
|
|||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.init.ModDusts;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
@ -116,7 +116,7 @@ public class IndustrialSawmillRecipes extends RecipeMethods {
|
|||
|
||||
public static void addRecipe(ItemStack log, ItemStack plank) {
|
||||
plank.setCount(plankCount);
|
||||
register(log, WATER, 100, 128, plank, ItemDusts.getDustByName("sawDust", 3), getStack(Items.PAPER, 1));
|
||||
register(log, WATER, 100, 128, plank, ModDusts.SAW.getStack(3), getStack(Items.PAPER, 1));
|
||||
}
|
||||
|
||||
static void register(ItemStack input1, FluidStack fluid, int ticks, int euPerTick, ItemStack... outputs) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue