Add tags for blaze burner fuel

- `#create:blaze_burner_regular_fuel`: these items are treated like coal
by the blaze burner if they cannot be used as fuel in a furnace
- `#create:blaze_burner_special_fuel`: these items cause the blaze
burner to become superheated
- Fix equipable item attribute
- Fix SandPaperItem overriding both getItemEnchantability and
getEnchantmentValue
This commit is contained in:
PepperCode1 2022-02-24 17:32:33 -08:00
parent 0cf0d3930e
commit 6420f54194
12 changed files with 113 additions and 99 deletions

View file

@ -5194,6 +5194,8 @@ d063e12c9ef75f39518c6d129ea35d833464d547 data/create/tags/blocks/toolboxes.json
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/blocks/windowable.json
893a01e6004d6d8272bd1658e98da88bb572ee57 data/create/tags/blocks/wrench_pickup.json
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_regular_fuel.json
97061ef67cac1fafd869493d06115b968bcb99bf data/create/tags/items/blaze_burner_special_fuel.json
5212172aee2239136c94f9868ad39ec2e17cf1c6 data/create/tags/items/create_ingots.json
4480f211f4a37bfee193eba945bc9f5a8d2c6e34 data/create/tags/items/crushed_ores.json
bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json

View file

@ -0,0 +1,4 @@
{
"replace": false,
"values": []
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"create:blaze_cake"
]
}

View file

@ -100,7 +100,7 @@ public class AllItems {
.register();
public static final ItemEntry<CombustibleItem> BLAZE_CAKE = REGISTRATE.item("blaze_cake", CombustibleItem::new)
.tag(AllItemTags.UPRIGHT_ON_BELT.tag)
.tag(AllItemTags.BLAZE_BURNER_SPECIAL_FUEL.tag, AllItemTags.UPRIGHT_ON_BELT.tag)
.onRegister(i -> i.setBurnTime(6400))
.register();

View file

@ -106,6 +106,7 @@ public class AllTags {
BRITTLE,
FAN_HEATERS,
FAN_TRANSPARENT,
ORE_OVERRIDE_STONE,
SAFE_NBT,
SAILS,
SEATS,
@ -115,8 +116,6 @@ public class AllTags {
WINDOWABLE,
WRENCH_PICKUP,
ORE_OVERRIDE_STONE,
WG_STONE(FORGE),
SLIMY_LOGS(TIC),
@ -184,6 +183,8 @@ public class AllTags {
public enum AllItemTags {
BLAZE_BURNER_REGULAR_FUEL,
BLAZE_BURNER_SPECIAL_FUEL,
CREATE_INGOTS,
CRUSHED_ORES,
SANDPAPER,

View file

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Random;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllTags.AllItemTags;
import com.simibubi.create.content.contraptions.particle.CubeParticleData;
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
@ -169,13 +170,17 @@ public class BlazeBurnerTileEntity extends SmartTileEntity {
FuelType newFuel = FuelType.NONE;
int newBurnTime;
if (AllItems.BLAZE_CAKE.isIn(itemStack)) {
if (AllItemTags.BLAZE_BURNER_SPECIAL_FUEL.matches(itemStack)) {
newBurnTime = 1000;
newFuel = FuelType.SPECIAL;
} else {
newBurnTime = ForgeHooks.getBurnTime(itemStack, null);
if (newBurnTime > 0)
newFuel = FuelType.NORMAL;
else if (AllItemTags.BLAZE_BURNER_REGULAR_FUEL.matches(itemStack)) {
newBurnTime = 1600; // Same as coal
newFuel = FuelType.NORMAL;
}
}
if (newFuel == FuelType.NONE)

View file

@ -238,14 +238,9 @@ public class SandPaperItem extends Item implements CustomUseEffectsItem {
return 32;
}
@Override
public int getItemEnchantability(ItemStack stack) {
return 1;
}
@Override
public int getEnchantmentValue() {
return 5;
return 1;
}
@Override

View file

@ -30,6 +30,8 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
@ -136,7 +138,7 @@ public interface ItemAttribute {
DAMAGED(ItemStack::isDamaged),
BADLY_DAMAGED(s -> s.isDamaged() && s.getDamageValue() / s.getMaxDamage() > 3 / 4f),
NOT_STACKABLE(((Predicate<ItemStack>) ItemStack::isStackable).negate()),
EQUIPABLE(s -> s.getEquipmentSlot() != null),
EQUIPABLE(s -> LivingEntity.getEquipmentSlotForItem(s).getType() != EquipmentSlot.Type.HAND),
FURNACE_FUEL(AbstractFurnaceBlockEntity::isFuel),
WASHABLE(InWorldProcessing::isWashable),
HAUNTABLE(InWorldProcessing::isHauntable),

View file

@ -5,22 +5,22 @@ import com.jozufozu.flywheel.core.layout.CommonItems;
public class AllInstanceFormats {
public static BufferLayout ROTATING = kineticInstance()
public static final BufferLayout ROTATING = kineticInstance()
.addItems(CommonItems.NORMAL)
.build();
public static BufferLayout BELT = kineticInstance()
public static final BufferLayout BELT = kineticInstance()
.addItems(CommonItems.QUATERNION, CommonItems.UV, CommonItems.VEC4,
CommonItems.NORMALIZED_BYTE)
.build();
public static BufferLayout ACTOR = BufferLayout.builder()
public static final BufferLayout ACTOR = BufferLayout.builder()
.addItems(CommonItems.VEC3, CommonItems.LIGHT, CommonItems.FLOAT,
CommonItems.NORMAL, CommonItems.QUATERNION, CommonItems.NORMAL,
CommonItems.FLOAT)
.build();
public static BufferLayout FLAP = BufferLayout.builder()
public static final BufferLayout FLAP = BufferLayout.builder()
.addItems(CommonItems.VEC3, CommonItems.LIGHT, CommonItems.VEC3, CommonItems.VEC3,
CommonItems.FLOAT, CommonItems.FLOAT, CommonItems.FLOAT, CommonItems.FLOAT)
.build();

View file

@ -7,7 +7,6 @@ import net.minecraft.resources.ResourceLocation;
public class AllProgramSpecs {
public static final ResourceLocation ROTATING = asResource("rotating");
public static final ResourceLocation CHROMATIC = asResource("chromatic");
public static final ResourceLocation BELT = asResource("belt");
public static final ResourceLocation FLAPS = asResource("flap");
public static final ResourceLocation ACTOR = asResource("contraption_actor");