Skip to content

Properties

Shane Bee edited this page Apr 5, 2020 · 1 revision

A machine can hold properties.

Furnace Properties

Creating

Furnace properties allow you to manipulate the speed of cooking and fuel burn. Let's take a look

FurnaceProperties prop = new FurnaceProperties("test");

Here we just simply create a new furnace properly with the key "test".
But what if we want to add modifiers? Well that part is easy using a fancy little builder:

FurnaceProperties prop = new FurnaceProperties("test").cookMultiplier(2.0);

In this example, we set the cook speed multiplier to 2. That means food will cook twice as fast. Want your fuel to burn slower? Well, we can do that too:

FurnaceProperties prop = new FurnaceProperties("test").cookMultiplier(2.0).fuelMultiplier(0.5);

In this example, we are going to cook our food twice as fast, but cut the fuel burn speed in half.

The FurnaceProperties class comes with a few pre-made properties:

// Mimics a vanilla Minecraft furnace
// cook speed = 1.0
// fuel speed = 1.0
FurnaceProperties furnace = FurnaceProperties.FURNACE;

// Mimics a vanilla Minecraft smoker
// cook speed = 2.0
// fuel speed = 1.0
FurnaceProperties smoker = FurnaceProperties.SMOKER;

// Mimics a vanilla Minecraft blast furnace
// cook speed = 2.0
// fuel speed = 1.0
FurnaceProperties blast = FurnaceProperties.BLAST_FURNACE;

Using

Using these properties to create a furnace is quite easy, you can create your own properties or use the pre-made properties.
Here are a couple examples of creating a new furnace, and a furnace item

// You can create a new furnace and use a pre-made furnace property
Furnace furny = new Furnace("Furny", FurnaceProperties.FURNACE);

// You can also create a new furnace and create your own properties
// In this example we create a new property which will cook 5 times faster
Furnace fast_cooker = new Furnace("Fast Cooker", new FurnaceProperties("fast").cookMultiplier(5.0));

// You can create a new item stack with an attached furnace, with a premade property
ItemStack furn = furnaceManager.createItemWithFurnace("Furn", FurnaceProperties.FURNACE, Material.FURNACE, false);

// You can also create a new item stack with an attached furnace with your own properties
// In this example we are creating a furnace item with a cook multiplier of 3
ItemStack ultra_cooker = furnaceManager.createItemWithFurnace("Ultra Cooker", new FurnaceProperties("ultra").cookMultiplier(3.0), Material.BLAST_FURNACE, true);

Now you are all setup for some ultra fast cooking!

Clone this wiki locally