/** Adds a new pattern to craft to the stenciltable. NBT sensitive. Has to be a Pattern. */ public static void registerStencilTableCrafting(ItemStack stencil) { if(!(stencil.getItem() instanceof IPattern)) { error(String.format( "Stencil Table Crafting has to be a pattern (%s)", stencil.toString())); return; } stencilTableCrafting.add(stencil); }
public static void addMaterialStats(String materialIdentifier, IMaterialStats stats) { if(cancelledMaterials.contains(materialIdentifier)) { return; } if(!materials.containsKey(materialIdentifier)) { error(String.format("Could not add Stats \"%s\" to \"%s\": Unknown Material", stats.getIdentifier(), materialIdentifier)); return; } Material material = materials.get(materialIdentifier); addMaterialStats(material, stats); }
public static void addMaterialTrait(String materialIdentifier, ITrait trait, String stats) { if(cancelledMaterials.contains(materialIdentifier)) { return; } if(!materials.containsKey(materialIdentifier)) { error(String.format("Could not add Trait \"%s\" to \"%s\": Unknown Material", trait.getIdentifier(), materialIdentifier)); return; } Material material = materials.get(materialIdentifier); addMaterialTrait(material, trait, stats); }
public static void registerAlloy(FluidStack result, FluidStack... inputs) { if(result.amount < 1) { error("Alloy Recipe: Resulting alloy %s has to have an amount (%d)", result.getLocalizedName(), result.amount); } if(inputs.length < 2) { error("Alloy Recipe: Alloy for %s must consist of at least 2 liquids", result.getLocalizedName()); } registerAlloy(new AlloyRecipe(result, inputs)); }
/** Register an entity to melt into the given fluidstack. The fluidstack is returned for 1 heart damage */ public static void registerEntityMelting(Class<? extends Entity> clazz, FluidStack liquid) { ResourceLocation name = EntityList.getKey(clazz); if(name == null) { error("Entity Melting: Entity %s is not registered in the EntityList", clazz.getSimpleName()); } TinkerRegisterEvent.EntityMeltingRegisterEvent event = new TinkerRegisterEvent.EntityMeltingRegisterEvent(clazz, liquid); if(event.fire()) { entityMeltingRegistry.put(name, event.getNewFluidStack()); } else { try { String output = liquid.getUnlocalizedName(); log.debug("Registration of entity melting for " + clazz.getName() + " into " + output + " has been cancelled by event"); } catch(Exception e) { log.error("Error when logging entity melting event", e); } } }
error("Could not register Material \"%s\": Material identifier must not contain any spaces.", material.identifier); return; error("Could not register Material \"%s\": Material identifier must be completely lowercase.", material.identifier); return; error(String.format( "Could not register Material \"%s\": It was already registered by %s", material.identifier,
public static void addMaterialStats(Material material, IMaterialStats stats) { if(material == null) { error(String.format("Could not add Stats \"%s\": Material is null", stats.getIdentifier())); return; error(String.format( "Could not add Stats to \"%s\": Stats of type \"%s\" were already registered by %s. Use the events to modify stats.", identifier, stats.getIdentifier(), registeredBy)); error("Could not add Stat of type \"%s\": Default Material does not have default stats for said type. Please add default-values to the default material \"unknown\" first.", stats .getIdentifier()); return;