mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
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:
parent
0cf0d3930e
commit
6420f54194
12 changed files with 113 additions and 99 deletions
|
@ -5194,6 +5194,8 @@ d063e12c9ef75f39518c6d129ea35d833464d547 data/create/tags/blocks/toolboxes.json
|
||||||
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
|
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
|
||||||
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/blocks/windowable.json
|
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/blocks/windowable.json
|
||||||
893a01e6004d6d8272bd1658e98da88bb572ee57 data/create/tags/blocks/wrench_pickup.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
|
5212172aee2239136c94f9868ad39ec2e17cf1c6 data/create/tags/items/create_ingots.json
|
||||||
4480f211f4a37bfee193eba945bc9f5a8d2c6e34 data/create/tags/items/crushed_ores.json
|
4480f211f4a37bfee193eba945bc9f5a8d2c6e34 data/create/tags/items/crushed_ores.json
|
||||||
bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json
|
bce28787b0271382842823d04a977912a88b01c2 data/create/tags/items/sandpaper.json
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": []
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"create:blaze_cake"
|
||||||
|
]
|
||||||
|
}
|
|
@ -100,7 +100,7 @@ public class AllItems {
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static final ItemEntry<CombustibleItem> BLAZE_CAKE = REGISTRATE.item("blaze_cake", CombustibleItem::new)
|
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))
|
.onRegister(i -> i.setBurnTime(6400))
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ public class AllTags {
|
||||||
BRITTLE,
|
BRITTLE,
|
||||||
FAN_HEATERS,
|
FAN_HEATERS,
|
||||||
FAN_TRANSPARENT,
|
FAN_TRANSPARENT,
|
||||||
|
ORE_OVERRIDE_STONE,
|
||||||
SAFE_NBT,
|
SAFE_NBT,
|
||||||
SAILS,
|
SAILS,
|
||||||
SEATS,
|
SEATS,
|
||||||
|
@ -114,8 +115,6 @@ public class AllTags {
|
||||||
WINDMILL_SAILS,
|
WINDMILL_SAILS,
|
||||||
WINDOWABLE,
|
WINDOWABLE,
|
||||||
WRENCH_PICKUP,
|
WRENCH_PICKUP,
|
||||||
|
|
||||||
ORE_OVERRIDE_STONE,
|
|
||||||
|
|
||||||
WG_STONE(FORGE),
|
WG_STONE(FORGE),
|
||||||
|
|
||||||
|
@ -184,6 +183,8 @@ public class AllTags {
|
||||||
|
|
||||||
public enum AllItemTags {
|
public enum AllItemTags {
|
||||||
|
|
||||||
|
BLAZE_BURNER_REGULAR_FUEL,
|
||||||
|
BLAZE_BURNER_SPECIAL_FUEL,
|
||||||
CREATE_INGOTS,
|
CREATE_INGOTS,
|
||||||
CRUSHED_ORES,
|
CRUSHED_ORES,
|
||||||
SANDPAPER,
|
SANDPAPER,
|
||||||
|
|
|
@ -14,84 +14,84 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
public abstract class KineticTileInstance<T extends KineticTileEntity> extends BlockEntityInstance<T> {
|
public abstract class KineticTileInstance<T extends KineticTileEntity> extends BlockEntityInstance<T> {
|
||||||
|
|
||||||
protected final Direction.Axis axis;
|
protected final Direction.Axis axis;
|
||||||
|
|
||||||
public KineticTileInstance(MaterialManager modelManager, T tile) {
|
public KineticTileInstance(MaterialManager modelManager, T tile) {
|
||||||
super(modelManager, tile);
|
super(modelManager, tile);
|
||||||
|
|
||||||
axis = ((IRotate) blockState.getBlock()).getRotationAxis(blockState);
|
axis = ((IRotate) blockState.getBlock()).getRotationAxis(blockState);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void updateRotation(RotatingData instance) {
|
protected final void updateRotation(RotatingData instance) {
|
||||||
updateRotation(instance, getRotationAxis(), getTileSpeed());
|
updateRotation(instance, getRotationAxis(), getTileSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void updateRotation(RotatingData instance, Direction.Axis axis) {
|
protected final void updateRotation(RotatingData instance, Direction.Axis axis) {
|
||||||
updateRotation(instance, axis, getTileSpeed());
|
updateRotation(instance, axis, getTileSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void updateRotation(RotatingData instance, float speed) {
|
protected final void updateRotation(RotatingData instance, float speed) {
|
||||||
updateRotation(instance, getRotationAxis(), speed);
|
updateRotation(instance, getRotationAxis(), speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final void updateRotation(RotatingData instance, Direction.Axis axis, float speed) {
|
protected final void updateRotation(RotatingData instance, Direction.Axis axis, float speed) {
|
||||||
instance.setRotationAxis(axis)
|
instance.setRotationAxis(axis)
|
||||||
.setRotationOffset(getRotationOffset(axis))
|
.setRotationOffset(getRotationOffset(axis))
|
||||||
.setRotationalSpeed(speed)
|
.setRotationalSpeed(speed)
|
||||||
.setColor(blockEntity);
|
.setColor(blockEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final RotatingData setup(RotatingData key) {
|
protected final RotatingData setup(RotatingData key) {
|
||||||
return setup(key, getRotationAxis(), getTileSpeed());
|
return setup(key, getRotationAxis(), getTileSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final RotatingData setup(RotatingData key, Direction.Axis axis) {
|
protected final RotatingData setup(RotatingData key, Direction.Axis axis) {
|
||||||
return setup(key, axis, getTileSpeed());
|
return setup(key, axis, getTileSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final RotatingData setup(RotatingData key, float speed) {
|
protected final RotatingData setup(RotatingData key, float speed) {
|
||||||
return setup(key, getRotationAxis(), speed);
|
return setup(key, getRotationAxis(), speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final RotatingData setup(RotatingData key, Direction.Axis axis, float speed) {
|
protected final RotatingData setup(RotatingData key, Direction.Axis axis, float speed) {
|
||||||
key.setRotationAxis(axis)
|
key.setRotationAxis(axis)
|
||||||
.setRotationalSpeed(speed)
|
.setRotationalSpeed(speed)
|
||||||
.setRotationOffset(getRotationOffset(axis))
|
.setRotationOffset(getRotationOffset(axis))
|
||||||
.setColor(blockEntity)
|
.setColor(blockEntity)
|
||||||
.setPosition(getInstancePosition());
|
.setPosition(getInstancePosition());
|
||||||
|
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getRotationOffset(final Direction.Axis axis) {
|
protected float getRotationOffset(final Direction.Axis axis) {
|
||||||
float offset = ICogWheel.isLargeCog(blockState) ? 11.25f : 0;
|
float offset = ICogWheel.isLargeCog(blockState) ? 11.25f : 0;
|
||||||
double d = (((axis == Direction.Axis.X) ? 0 : pos.getX()) + ((axis == Direction.Axis.Y) ? 0 : pos.getY())
|
double d = (((axis == Direction.Axis.X) ? 0 : pos.getX()) + ((axis == Direction.Axis.Y) ? 0 : pos.getY())
|
||||||
+ ((axis == Direction.Axis.Z) ? 0 : pos.getZ())) % 2;
|
+ ((axis == Direction.Axis.Z) ? 0 : pos.getZ())) % 2;
|
||||||
if (d == 0) {
|
if (d == 0) {
|
||||||
offset = 22.5f;
|
offset = 22.5f;
|
||||||
}
|
}
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Direction.Axis getRotationAxis() {
|
protected Direction.Axis getRotationAxis() {
|
||||||
return axis;
|
return axis;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getTileSpeed() {
|
protected float getTileSpeed() {
|
||||||
return blockEntity.getSpeed();
|
return blockEntity.getSpeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BlockState shaft() {
|
protected BlockState shaft() {
|
||||||
return shaft(getRotationAxis());
|
return shaft(getRotationAxis());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Material<RotatingData> getRotatingMaterial() {
|
protected Material<RotatingData> getRotatingMaterial() {
|
||||||
return materialManager.defaultSolid()
|
return materialManager.defaultSolid()
|
||||||
.material(AllMaterialSpecs.ROTATING);
|
.material(AllMaterialSpecs.ROTATING);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlockState shaft(Direction.Axis axis) {
|
public static BlockState shaft(Direction.Axis axis) {
|
||||||
return AllBlocks.SHAFT.getDefaultState()
|
return AllBlocks.SHAFT.getDefaultState()
|
||||||
.setValue(ShaftBlock.AXIS, axis);
|
.setValue(ShaftBlock.AXIS, axis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,35 +10,35 @@ public class SingleRotatingInstance extends KineticTileInstance<KineticTileEntit
|
||||||
|
|
||||||
protected RotatingData rotatingModel;
|
protected RotatingData rotatingModel;
|
||||||
|
|
||||||
public SingleRotatingInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
public SingleRotatingInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||||
super(modelManager, tile);
|
super(modelManager, tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
rotatingModel = setup(getModel().createInstance());
|
rotatingModel = setup(getModel().createInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
updateRotation(rotatingModel);
|
updateRotation(rotatingModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateLight() {
|
public void updateLight() {
|
||||||
relight(pos, rotatingModel);
|
relight(pos, rotatingModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
rotatingModel.delete();
|
rotatingModel.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BlockState getRenderedBlockState() {
|
protected BlockState getRenderedBlockState() {
|
||||||
return blockState;
|
return blockState;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Instancer<RotatingData> getModel() {
|
protected Instancer<RotatingData> getModel() {
|
||||||
return getRotatingMaterial().getModel(getRenderedBlockState());
|
return getRotatingMaterial().getModel(getRenderedBlockState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import com.simibubi.create.AllItems;
|
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.particle.CubeParticleData;
|
||||||
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
|
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
|
||||||
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||||
|
@ -169,13 +170,17 @@ public class BlazeBurnerTileEntity extends SmartTileEntity {
|
||||||
FuelType newFuel = FuelType.NONE;
|
FuelType newFuel = FuelType.NONE;
|
||||||
int newBurnTime;
|
int newBurnTime;
|
||||||
|
|
||||||
if (AllItems.BLAZE_CAKE.isIn(itemStack)) {
|
if (AllItemTags.BLAZE_BURNER_SPECIAL_FUEL.matches(itemStack)) {
|
||||||
newBurnTime = 1000;
|
newBurnTime = 1000;
|
||||||
newFuel = FuelType.SPECIAL;
|
newFuel = FuelType.SPECIAL;
|
||||||
} else {
|
} else {
|
||||||
newBurnTime = ForgeHooks.getBurnTime(itemStack, null);
|
newBurnTime = ForgeHooks.getBurnTime(itemStack, null);
|
||||||
if (newBurnTime > 0)
|
if (newBurnTime > 0)
|
||||||
newFuel = FuelType.NORMAL;
|
newFuel = FuelType.NORMAL;
|
||||||
|
else if (AllItemTags.BLAZE_BURNER_REGULAR_FUEL.matches(itemStack)) {
|
||||||
|
newBurnTime = 1600; // Same as coal
|
||||||
|
newFuel = FuelType.NORMAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newFuel == FuelType.NONE)
|
if (newFuel == FuelType.NONE)
|
||||||
|
|
|
@ -238,14 +238,9 @@ public class SandPaperItem extends Item implements CustomUseEffectsItem {
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemEnchantability(ItemStack stack) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnchantmentValue() {
|
public int getEnchantmentValue() {
|
||||||
return 5;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,6 +30,8 @@ import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
import net.minecraft.network.chat.TranslatableComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.Container;
|
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.BlockItem;
|
||||||
import net.minecraft.world.item.CreativeModeTab;
|
import net.minecraft.world.item.CreativeModeTab;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
|
@ -136,7 +138,7 @@ public interface ItemAttribute {
|
||||||
DAMAGED(ItemStack::isDamaged),
|
DAMAGED(ItemStack::isDamaged),
|
||||||
BADLY_DAMAGED(s -> s.isDamaged() && s.getDamageValue() / s.getMaxDamage() > 3 / 4f),
|
BADLY_DAMAGED(s -> s.isDamaged() && s.getDamageValue() / s.getMaxDamage() > 3 / 4f),
|
||||||
NOT_STACKABLE(((Predicate<ItemStack>) ItemStack::isStackable).negate()),
|
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),
|
FURNACE_FUEL(AbstractFurnaceBlockEntity::isFuel),
|
||||||
WASHABLE(InWorldProcessing::isWashable),
|
WASHABLE(InWorldProcessing::isWashable),
|
||||||
HAUNTABLE(InWorldProcessing::isHauntable),
|
HAUNTABLE(InWorldProcessing::isHauntable),
|
||||||
|
|
|
@ -5,22 +5,22 @@ import com.jozufozu.flywheel.core.layout.CommonItems;
|
||||||
|
|
||||||
public class AllInstanceFormats {
|
public class AllInstanceFormats {
|
||||||
|
|
||||||
public static BufferLayout ROTATING = kineticInstance()
|
public static final BufferLayout ROTATING = kineticInstance()
|
||||||
.addItems(CommonItems.NORMAL)
|
.addItems(CommonItems.NORMAL)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static BufferLayout BELT = kineticInstance()
|
public static final BufferLayout BELT = kineticInstance()
|
||||||
.addItems(CommonItems.QUATERNION, CommonItems.UV, CommonItems.VEC4,
|
.addItems(CommonItems.QUATERNION, CommonItems.UV, CommonItems.VEC4,
|
||||||
CommonItems.NORMALIZED_BYTE)
|
CommonItems.NORMALIZED_BYTE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static BufferLayout ACTOR = BufferLayout.builder()
|
public static final BufferLayout ACTOR = BufferLayout.builder()
|
||||||
.addItems(CommonItems.VEC3, CommonItems.LIGHT, CommonItems.FLOAT,
|
.addItems(CommonItems.VEC3, CommonItems.LIGHT, CommonItems.FLOAT,
|
||||||
CommonItems.NORMAL, CommonItems.QUATERNION, CommonItems.NORMAL,
|
CommonItems.NORMAL, CommonItems.QUATERNION, CommonItems.NORMAL,
|
||||||
CommonItems.FLOAT)
|
CommonItems.FLOAT)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
public static BufferLayout FLAP = BufferLayout.builder()
|
public static final BufferLayout FLAP = BufferLayout.builder()
|
||||||
.addItems(CommonItems.VEC3, CommonItems.LIGHT, CommonItems.VEC3, CommonItems.VEC3,
|
.addItems(CommonItems.VEC3, CommonItems.LIGHT, CommonItems.VEC3, CommonItems.VEC3,
|
||||||
CommonItems.FLOAT, CommonItems.FLOAT, CommonItems.FLOAT, CommonItems.FLOAT)
|
CommonItems.FLOAT, CommonItems.FLOAT, CommonItems.FLOAT, CommonItems.FLOAT)
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
public class AllProgramSpecs {
|
public class AllProgramSpecs {
|
||||||
|
|
||||||
public static final ResourceLocation ROTATING = asResource("rotating");
|
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 BELT = asResource("belt");
|
||||||
public static final ResourceLocation FLAPS = asResource("flap");
|
public static final ResourceLocation FLAPS = asResource("flap");
|
||||||
public static final ResourceLocation ACTOR = asResource("contraption_actor");
|
public static final ResourceLocation ACTOR = asResource("contraption_actor");
|
||||||
|
|
Loading…
Reference in a new issue