alloy furnace multi block + block entity
This commit is contained in:
@@ -38,6 +38,7 @@ import net.neoforged.neoforge.registries.DeferredHolder;
|
|||||||
import net.neoforged.neoforge.registries.DeferredItem;
|
import net.neoforged.neoforge.registries.DeferredItem;
|
||||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
|
||||||
|
import static net.halbear.aotg.registries.ModBlockEntities.BLOCK_ENTITY_TYPES;
|
||||||
import static net.halbear.aotg.registries.ModBlocks.*;
|
import static net.halbear.aotg.registries.ModBlocks.*;
|
||||||
import static net.halbear.aotg.registries.ModFoliagePlacers.FOLIAGE_PLACERS;
|
import static net.halbear.aotg.registries.ModFoliagePlacers.FOLIAGE_PLACERS;
|
||||||
import static net.halbear.aotg.registries.ModItems.*;
|
import static net.halbear.aotg.registries.ModItems.*;
|
||||||
@@ -66,6 +67,7 @@ public class AgeoftheGods {
|
|||||||
output.accept(OLIVE_LEAVES_ITEM.get());
|
output.accept(OLIVE_LEAVES_ITEM.get());
|
||||||
output.accept(OLIVE_LOG_ITEM.get());
|
output.accept(OLIVE_LOG_ITEM.get());
|
||||||
output.accept(XIPHOS_SWORD.get());
|
output.accept(XIPHOS_SWORD.get());
|
||||||
|
output.accept(ALLOY_FURNACE_ITEM.get());
|
||||||
}).build());
|
}).build());
|
||||||
|
|
||||||
// The constructor for the mod class is the first code that is run when your mod is loaded.
|
// The constructor for the mod class is the first code that is run when your mod is loaded.
|
||||||
@@ -75,6 +77,7 @@ public class AgeoftheGods {
|
|||||||
modEventBus.addListener(this::commonSetup);
|
modEventBus.addListener(this::commonSetup);
|
||||||
// Register the Deferred Register to the mod event bus so blocks get registered
|
// Register the Deferred Register to the mod event bus so blocks get registered
|
||||||
BLOCKS.register(modEventBus);
|
BLOCKS.register(modEventBus);
|
||||||
|
BLOCK_ENTITY_TYPES.register(modEventBus);
|
||||||
// Register the Deferred Register to the mod event bus so items get registered
|
// Register the Deferred Register to the mod event bus so items get registered
|
||||||
ITEMS.register(modEventBus);
|
ITEMS.register(modEventBus);
|
||||||
// Register the Deferred Register to the mod event bus so tabs get registered
|
// Register the Deferred Register to the mod event bus so tabs get registered
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package net.halbear.aotg.custom.blocks;
|
||||||
|
|
||||||
|
import net.halbear.aotg.registries.ModBlocks;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.core.HolderLookup;
|
||||||
|
import net.minecraft.nbt.CompoundTag;
|
||||||
|
import net.minecraft.network.Connection;
|
||||||
|
import net.minecraft.network.protocol.Packet;
|
||||||
|
import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
||||||
|
import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Rotation;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.storage.ValueInput;
|
||||||
|
import net.minecraft.world.level.storage.ValueOutput;
|
||||||
|
|
||||||
|
import static net.halbear.aotg.custom.blocks.AlloyFurnaceMultiBlock.MULTI_BLOCK_POSITIONS;
|
||||||
|
import static net.halbear.aotg.custom.blocks.AlloyFurnaceMultiBlock.FACING;
|
||||||
|
import static net.halbear.aotg.custom.blocks.AlloyFurnaceUpdateHandler.getInverseRotationForDirection;
|
||||||
|
import static net.halbear.aotg.registries.ModBlockEntities.ALLOY_FURNACE_BLOCK_ENTITY;
|
||||||
|
|
||||||
|
public class AlloyFurnaceBlockEntity extends BlockEntity {
|
||||||
|
private boolean isFormed = false;
|
||||||
|
private float Fuel = 0.0f;
|
||||||
|
private int progress = 0;
|
||||||
|
|
||||||
|
public AlloyFurnaceBlockEntity(BlockPos worldPosition, BlockState blockState) {
|
||||||
|
super(ALLOY_FURNACE_BLOCK_ENTITY.get(), worldPosition, blockState);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean checkStructure(Level level, BlockPos masterPos, BlockState blockState) {
|
||||||
|
Direction direction = blockState.getValue(FACING);
|
||||||
|
Rotation rotation = getInverseRotationForDirection(direction);
|
||||||
|
boolean Complete =true;
|
||||||
|
for (BlockPos offset : MULTI_BLOCK_POSITIONS) {
|
||||||
|
|
||||||
|
BlockPos Rotated = offset.rotate(rotation);
|
||||||
|
BlockPos targetPos = masterPos.offset(Rotated);
|
||||||
|
BlockState state = level.getBlockState(targetPos);
|
||||||
|
|
||||||
|
if (!state.is(ModBlocks.ALLOY_FURNACE.get())) {
|
||||||
|
Complete = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Complete;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void tick(Level level, BlockPos pos, BlockState state, AlloyFurnaceBlockEntity blockEntity) {
|
||||||
|
if (level.isClientSide() || !state.getValue(AlloyFurnaceMultiBlock.PARENT_BLOCK)) return;
|
||||||
|
|
||||||
|
if (level.getGameTime() % 20 == 0) {
|
||||||
|
blockEntity.isFormed = blockEntity.checkStructure(level, pos, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (blockEntity.isFormed) {
|
||||||
|
blockEntity.progress++;
|
||||||
|
blockEntity.setChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadAdditional(ValueInput input) {
|
||||||
|
super.loadAdditional(input);
|
||||||
|
this.Fuel = input.getFloatOr("fuel", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveAdditional(ValueOutput output) {
|
||||||
|
super.saveAdditional(output);
|
||||||
|
output.putFloat("fuel", this.Fuel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompoundTag getUpdateTag(HolderLookup.Provider registries) {
|
||||||
|
return this.saveWithoutMetadata(registries);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleUpdateTag(ValueInput input) {
|
||||||
|
super.handleUpdateTag(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Packet<ClientGamePacketListener> getUpdatePacket() {
|
||||||
|
return ClientboundBlockEntityDataPacket.create(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataPacket(Connection connection, ValueInput input) {
|
||||||
|
super.onDataPacket(connection, input);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package net.halbear.aotg.custom.blocks;
|
||||||
|
|
||||||
|
import com.mojang.serialization.MapCodec;
|
||||||
|
import net.halbear.aotg.AgeoftheGods;
|
||||||
|
import net.halbear.aotg.registries.ModBlocks;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
import net.minecraft.util.TriState;
|
||||||
|
import net.minecraft.world.Containers;
|
||||||
|
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.BaseEntityBlock;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
|
import net.minecraft.world.level.block.Rotation;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.level.block.state.StateDefinition;
|
||||||
|
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||||
|
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||||
|
import net.minecraft.world.level.block.state.properties.EnumProperty;
|
||||||
|
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||||
|
import org.jspecify.annotations.Nullable;
|
||||||
|
|
||||||
|
import static net.halbear.aotg.custom.blocks.AlloyFurnaceUpdateHandler.getInverseRotationForDirection;
|
||||||
|
import static net.halbear.aotg.registries.ModBlockEntities.ALLOY_FURNACE_BLOCK_ENTITY;
|
||||||
|
|
||||||
|
public class AlloyFurnaceMultiBlock extends Block implements EntityBlock {
|
||||||
|
|
||||||
|
public static final BlockPos[] MULTI_BLOCK_POSITIONS = {
|
||||||
|
/*Master block is 0,0,0*/ new BlockPos(0,0,1),
|
||||||
|
new BlockPos(-1,0,0), new BlockPos(-1,0,1),
|
||||||
|
new BlockPos(0,1,0), new BlockPos(-1,1,0),
|
||||||
|
new BlockPos(-1,1,1), new BlockPos(0,1,1)
|
||||||
|
};
|
||||||
|
|
||||||
|
public static final EnumProperty<Direction> FACING = BlockStateProperties.HORIZONTAL_FACING;
|
||||||
|
public static final IntegerProperty MODEL_PART = IntegerProperty.create("modelpart",0,8);
|
||||||
|
public static final BooleanProperty PARENT_BLOCK = BooleanProperty.create("parent");
|
||||||
|
|
||||||
|
public AlloyFurnaceMultiBlock(Properties properties) {
|
||||||
|
super(properties);
|
||||||
|
this.registerDefaultState(this.defaultBlockState().setValue(MODEL_PART,0).setValue(PARENT_BLOCK,true).setValue(FACING,Direction.NORTH));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void affectNeighborsAfterRemoval(BlockState state, ServerLevel level, BlockPos pos, boolean movedByPiston) {
|
||||||
|
Containers.updateNeighboursAfterDestroy(state, level, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static <E extends BlockEntity, A extends BlockEntity> @javax.annotation.Nullable BlockEntityTicker<A> createTickerHelper(
|
||||||
|
BlockEntityType<A> type, BlockEntityType<E> checkedType, BlockEntityTicker<? super E> ticker
|
||||||
|
) {
|
||||||
|
return checkedType == type ? (BlockEntityTicker<A>) ticker : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, BlockState state, BlockEntityType<T> type) {
|
||||||
|
return createTickerHelper(type, ALLOY_FURNACE_BLOCK_ENTITY.get(), AlloyFurnaceBlockEntity::tick);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||||
|
BlockState blockState = this.defaultBlockState();
|
||||||
|
BlockPos position = context.getClickedPos();
|
||||||
|
Level level = context.getLevel();
|
||||||
|
blockState = blockState.setValue(FACING, context.getHorizontalDirection().getOpposite());
|
||||||
|
|
||||||
|
for(int x = -1; x < 2; x++){
|
||||||
|
for(int z = -1; z < 2; z++){
|
||||||
|
for(int y = -1; y < 2; y++){
|
||||||
|
BlockPos parentPos = position.offset(x,y,z);
|
||||||
|
BlockState state = level.getBlockState(parentPos);
|
||||||
|
|
||||||
|
if(state.is(ModBlocks.ALLOY_FURNACE.get()) && state.getValue(PARENT_BLOCK)) {
|
||||||
|
AgeoftheGods.LOGGER.debug("LOCATED PARENT BLOCK AT: " + parentPos);
|
||||||
|
Direction direction = state.getValue(FACING);
|
||||||
|
Rotation rotation = getInverseRotationForDirection(direction);
|
||||||
|
AgeoftheGods.LOGGER.debug("Placed Next to PARENT_BLOCK");
|
||||||
|
for (BlockPos offset : MULTI_BLOCK_POSITIONS) {
|
||||||
|
BlockPos Rotated = offset.rotate(rotation);
|
||||||
|
BlockPos targetPos = parentPos.offset(Rotated);
|
||||||
|
AgeoftheGods.LOGGER.debug("TARGET_POS: " + targetPos + " | CURRENT_POS: " + position + " | ROTATION: " + Rotated);
|
||||||
|
if (targetPos.getX() == position.getX() && targetPos.getY() == position.getY() && targetPos.getZ() == position.getZ()) {
|
||||||
|
blockState = blockState.setValue(PARENT_BLOCK, false);
|
||||||
|
blockState = blockState.setValue(FACING, direction);
|
||||||
|
String PosString = Math.abs(offset.getX()) + "_" + Math.abs(offset.getY()) + "_" + Math.abs(offset.getZ());
|
||||||
|
AgeoftheGods.LOGGER.debug("POS_STRING: " + PosString);
|
||||||
|
switch (PosString) {
|
||||||
|
case "0_0_0":
|
||||||
|
blockState = blockState.setValue(PARENT_BLOCK, true);
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 0);
|
||||||
|
break;
|
||||||
|
case "1_0_0":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 1);
|
||||||
|
break;
|
||||||
|
case "1_0_1":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 2);
|
||||||
|
break;
|
||||||
|
case "0_0_1":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 3);
|
||||||
|
break;
|
||||||
|
case "0_1_0":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 4);
|
||||||
|
break;
|
||||||
|
case "1_1_0":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 5);
|
||||||
|
break;
|
||||||
|
case "1_1_1":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 6);
|
||||||
|
break;
|
||||||
|
case "0_1_1":
|
||||||
|
blockState = blockState.setValue(MODEL_PART, 7);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (blockState.getValue(PARENT_BLOCK)) AgeoftheGods.LOGGER.debug("becoming PARENT_BLOCK");
|
||||||
|
return blockState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block,BlockState> builder){
|
||||||
|
builder.add(MODEL_PART);
|
||||||
|
builder.add(FACING);
|
||||||
|
builder.add(PARENT_BLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
|
return new AlloyFurnaceBlockEntity(blockPos,blockState);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package net.halbear.aotg.custom.blocks;
|
||||||
|
|
||||||
|
import net.halbear.aotg.AgeoftheGods;
|
||||||
|
import net.halbear.aotg.registries.ModBlocks;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.core.Direction;
|
||||||
|
import net.minecraft.world.level.block.Rotation;
|
||||||
|
import net.minecraft.world.level.block.TestBlock;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
|
import net.neoforged.fml.common.EventBusSubscriber;
|
||||||
|
import net.neoforged.neoforge.event.level.BlockEvent;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EventBusSubscriber(modid = AgeoftheGods.MODID)
|
||||||
|
public class AlloyFurnaceUpdateHandler {
|
||||||
|
|
||||||
|
public static final BlockPos[] parts = new BlockPos[]{new BlockPos(0,0,0),new BlockPos(-1,0,0),new BlockPos(-1,0,1),new BlockPos(0,0,1),
|
||||||
|
new BlockPos(0,1,0),new BlockPos(-1,1,0),new BlockPos(-1,1,1),new BlockPos(0,1,1)};
|
||||||
|
|
||||||
|
//@SubscribeEvent
|
||||||
|
public static void onNeighborNotify(BlockEvent.NeighborNotifyEvent event) {
|
||||||
|
var level = event.getLevel();
|
||||||
|
var pos = event.getPos();
|
||||||
|
var state = event.getState();
|
||||||
|
var notifiedSides = event.getNotifiedSides();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//@SubscribeEvent
|
||||||
|
public static void onBlockPlace(BlockEvent.EntityPlaceEvent event) {
|
||||||
|
var level = event.getLevel();
|
||||||
|
var pos = event.getPos();
|
||||||
|
var state = event.getPlacedBlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetModelPart(BlockPos MultipartLocation){
|
||||||
|
for(int i = 0; i < 8; i++){
|
||||||
|
if(MultipartLocation.getX() == parts[i].getX() && MultipartLocation.getZ() == parts[i].getZ() && MultipartLocation.getY() == parts[i].getY()){
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockPos GetMultipartLocation(int ModelPart){
|
||||||
|
return parts[Math.clamp(ModelPart,0,7)];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Rotation getInverseRotationForDirection(Direction facing) {
|
||||||
|
return switch (facing) {
|
||||||
|
case SOUTH -> Rotation.CLOCKWISE_180;
|
||||||
|
case WEST -> Rotation.COUNTERCLOCKWISE_90;
|
||||||
|
case EAST -> Rotation.CLOCKWISE_90;
|
||||||
|
default -> Rotation.NONE;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package net.halbear.aotg.registries;
|
||||||
|
|
||||||
|
import net.halbear.aotg.AgeoftheGods;
|
||||||
|
import net.halbear.aotg.custom.blocks.AlloyFurnaceBlockEntity;
|
||||||
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||||
|
import net.neoforged.neoforge.registries.DeferredBlock;
|
||||||
|
import net.neoforged.neoforge.registries.DeferredHolder;
|
||||||
|
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||||
|
import org.intellij.lang.annotations.Identifier;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public class ModBlockEntities {
|
||||||
|
public static final DeferredRegister<BlockEntityType<?>> BLOCK_ENTITY_TYPES =
|
||||||
|
DeferredRegister.create(Registries.BLOCK_ENTITY_TYPE, AgeoftheGods.MODID);
|
||||||
|
|
||||||
|
public static final Supplier<BlockEntityType<AlloyFurnaceBlockEntity>> ALLOY_FURNACE_BLOCK_ENTITY = BLOCK_ENTITY_TYPES.register(
|
||||||
|
"alloy_furnace_block_entity",
|
||||||
|
() -> new BlockEntityType<>(
|
||||||
|
AlloyFurnaceBlockEntity::new,
|
||||||
|
false,
|
||||||
|
ModBlocks.ALLOY_FURNACE.get()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package net.halbear.aotg.registries;
|
package net.halbear.aotg.registries;
|
||||||
|
|
||||||
import net.halbear.aotg.AgeoftheGods;
|
import net.halbear.aotg.AgeoftheGods;
|
||||||
|
import net.halbear.aotg.custom.blocks.AlloyFurnaceMultiBlock;
|
||||||
import net.halbear.aotg.custom.blocks.RockCoveredGrassBlock;
|
import net.halbear.aotg.custom.blocks.RockCoveredGrassBlock;
|
||||||
import net.minecraft.core.registries.Registries;
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.resources.ResourceKey;
|
import net.minecraft.resources.ResourceKey;
|
||||||
@@ -66,6 +67,13 @@ public class ModBlocks {
|
|||||||
.sound(SoundType.GRASS)
|
.sound(SoundType.GRASS)
|
||||||
.lightLevel(state -> 0)
|
.lightLevel(state -> 0)
|
||||||
));
|
));
|
||||||
|
public static final DeferredBlock<Block> ALLOY_FURNACE = RegisterBlock("alloy_furnace",
|
||||||
|
properties -> new AlloyFurnaceMultiBlock(properties.strength(1.5f)
|
||||||
|
.requiresCorrectToolForDrops()
|
||||||
|
.explosionResistance(6.0f)
|
||||||
|
.sound(SoundType.DEEPSLATE_BRICKS)
|
||||||
|
.lightLevel(state -> 0)
|
||||||
|
));
|
||||||
|
|
||||||
private static <T extends Block> DeferredBlock<T> RegisterBlock(String Name, Function<BlockBehaviour.Properties, T> function){
|
private static <T extends Block> DeferredBlock<T> RegisterBlock(String Name, Function<BlockBehaviour.Properties, T> function){
|
||||||
DeferredBlock<T> newBlock = BLOCKS.registerBlock(Name, function);
|
DeferredBlock<T> newBlock = BLOCKS.registerBlock(Name, function);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class ModItems {
|
|||||||
public static final DeferredItem<BlockItem> LIMESTONE_GRASS_ITEM = ITEMS.registerSimpleBlockItem("limestone_grass_block", LIMESTONE_GRASS_BLOCK);
|
public static final DeferredItem<BlockItem> LIMESTONE_GRASS_ITEM = ITEMS.registerSimpleBlockItem("limestone_grass_block", LIMESTONE_GRASS_BLOCK);
|
||||||
public static final DeferredItem<BlockItem> OLIVE_LEAVES_ITEM = ITEMS.registerSimpleBlockItem("olive_leaves", OLIVE_LEAVES);
|
public static final DeferredItem<BlockItem> OLIVE_LEAVES_ITEM = ITEMS.registerSimpleBlockItem("olive_leaves", OLIVE_LEAVES);
|
||||||
public static final DeferredItem<BlockItem> OLIVE_LOG_ITEM = ITEMS.registerSimpleBlockItem("olive_log", OLIVE_LOG);
|
public static final DeferredItem<BlockItem> OLIVE_LOG_ITEM = ITEMS.registerSimpleBlockItem("olive_log", OLIVE_LOG);
|
||||||
|
public static final DeferredItem<BlockItem> ALLOY_FURNACE_ITEM = ITEMS.registerSimpleBlockItem("alloy_furnace", ALLOY_FURNACE);
|
||||||
|
|
||||||
public static final DeferredItem<Item> XIPHOS_SWORD = RegisterItem("xiphos",
|
public static final DeferredItem<Item> XIPHOS_SWORD = RegisterItem("xiphos",
|
||||||
properties -> new Item(properties
|
properties -> new Item(properties
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"model": {
|
||||||
|
"type": "minecraft:model",
|
||||||
|
"model": "ageofthegods:block/alloy_furnace/alloy_furnace_mini"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=north,modelpart=0": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_000", "y": 0},
|
||||||
|
"facing=south,modelpart=0": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_000", "y": 180},
|
||||||
|
"facing=west,modelpart=0": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_000", "y": 270},
|
||||||
|
"facing=east,modelpart=0": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_000", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=1": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_100", "y": 0},
|
||||||
|
"facing=south,modelpart=1": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_100", "y": 180},
|
||||||
|
"facing=west,modelpart=1": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_100", "y": 270},
|
||||||
|
"facing=east,modelpart=1": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_100", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=2": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_101", "y": 0},
|
||||||
|
"facing=south,modelpart=2": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_101", "y": 180},
|
||||||
|
"facing=west,modelpart=2": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_101", "y": 270},
|
||||||
|
"facing=east,modelpart=2": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_101", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=3": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_001", "y": 0},
|
||||||
|
"facing=south,modelpart=3": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_001", "y": 180},
|
||||||
|
"facing=west,modelpart=3": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_001", "y": 270},
|
||||||
|
"facing=east,modelpart=3": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_001", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=4": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_010", "y": 0},
|
||||||
|
"facing=south,modelpart=4": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_010", "y": 180},
|
||||||
|
"facing=west,modelpart=4": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_010", "y": 270},
|
||||||
|
"facing=east,modelpart=4": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_010", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=5": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_110", "y": 0},
|
||||||
|
"facing=south,modelpart=5": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_110", "y": 180},
|
||||||
|
"facing=west,modelpart=5": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_110", "y": 270},
|
||||||
|
"facing=east,modelpart=5": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_110", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=6": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_111", "y": 0},
|
||||||
|
"facing=south,modelpart=6": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_111", "y": 180},
|
||||||
|
"facing=west,modelpart=6": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_111", "y": 270},
|
||||||
|
"facing=east,modelpart=6": {"model": "ageofthegods:block/alloy_furnace/alloy_furnace_111", "y": 90},
|
||||||
|
|
||||||
|
"facing=north,modelpart=7": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_011", "y": 0},
|
||||||
|
"facing=south,modelpart=7": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_011", "y": 180},
|
||||||
|
"facing=west,modelpart=7": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_011", "y": 270},
|
||||||
|
"facing=east,modelpart=7": { "model": "ageofthegods:block/alloy_furnace/alloy_furnace_011", "y": 90}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
"axis=y": [
|
"axis=y": [
|
||||||
{
|
{
|
||||||
"model": "ageofthegods:block/olive/olive_log1", "weight": 13
|
"model": "ageofthegods:block/olive/olive_log1", "weight": 13
|
||||||
},{
|
},
|
||||||
|
{
|
||||||
"model": "ageofthegods:block/olive/olive_log2", "weight":13
|
"model": "ageofthegods:block/olive/olive_log2", "weight":13
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
{
|
{
|
||||||
"itemGroup.ageofthegods": "Age of the Gods",
|
"itemGroup.ageofthegods": "Age of the Gods",
|
||||||
|
|
||||||
|
"block.ageofthegods.limestone_block": "Limestone",
|
||||||
|
"block.ageofthegods.limestone_grass_block": "Grassy Limestone",
|
||||||
|
"block.ageofthegods.shale_block": "Shale",
|
||||||
|
"block.ageofthegods.shale_grass_block": "Grassy Shale",
|
||||||
|
"block.ageofthegods.olive_leaves": "Olive Leaves",
|
||||||
|
"block.ageofthegods.olive_log": "Olive Log",
|
||||||
|
"block.ageofthegods.alloy_furnace": "Alloy Furnace Segment",
|
||||||
|
|
||||||
|
"item.ageofthegods.xiphos": "Xiphos",
|
||||||
|
|
||||||
"ageofthegods.configuration.title": "Age of the Gods Configs",
|
"ageofthegods.configuration.title": "Age of the Gods Configs",
|
||||||
"ageofthegods.configuration.section.ageofthegods.common.toml": "Age of the Gods Configs",
|
"ageofthegods.configuration.section.ageofthegods.common.toml": "Age of the Gods Configs",
|
||||||
"ageofthegods.configuration.section.ageofthegods.common.toml.title": "Age of the Gods Configs",
|
"ageofthegods.configuration.section.ageofthegods.common.toml.title": "Age of the Gods Configs",
|
||||||
|
|||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [14, 8,16, 12 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [2, 8, 4, 12], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [4, 12,6, 16], "texture": "#all", "cullface": "north" },
|
||||||
|
"west": {"uv": [8, 4,10, 8 ], "texture": "#all", "cullface": "west" },
|
||||||
|
"south": {"uv": [10,12,12, 16 ], "texture": "#all", "cullface": "south" },
|
||||||
|
"east": {"uv": [0, 4, 2,8], "texture": "#all", "cullface": "east" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [14, 12,16, 16 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [2, 12, 4, 16], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [8, 12,10, 16 ], "texture": "#all", "cullface": "north" },
|
||||||
|
"west": {"uv": [8, 4,10, 8 ], "texture": "#all", "cullface": "west" },
|
||||||
|
"south": {"uv": [2,4,4, 8 ], "texture": "#all", "cullface": "south" },
|
||||||
|
"east": {"uv": [0, 4, 2,8], "texture": "#all", "cullface": "east" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [6, 0,8, 4 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [14, 12, 16, 16], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [4, 8,6, 12], "texture": "#all", "cullface": "north" },
|
||||||
|
"west": {"uv": [8, 0,10, 4 ], "texture": "#all", "cullface": "west" },
|
||||||
|
"south": {"uv": [10,0,12, 4 ], "texture": "#all", "cullface": "south" },
|
||||||
|
"east": {"uv": [0, 0, 2,4], "texture": "#all", "cullface": "east" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [6, 4,8, 8 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [14, 8, 16, 12], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [8, 0,10, 4], "texture": "#all", "cullface": "north" },
|
||||||
|
"east": {"uv": [0, 0,2, 4 ], "texture": "#all", "cullface": "east" },
|
||||||
|
"south": {"uv": [2,0,4, 4], "texture": "#all", "cullface": "south" },
|
||||||
|
"west": {"uv": [10, 0, 12,4], "texture": "#all", "cullface": "west" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [12, 8,14, 12 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [0, 8, 2, 12], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [6, 12,8, 16], "texture": "#all", "cullface": "north" },
|
||||||
|
"east": {"uv": [8, 4,10, 8 ], "texture": "#all", "cullface": "east" },
|
||||||
|
"south": {"uv": [8,12,10, 16 ], "texture": "#all", "cullface": "south" },
|
||||||
|
"west": {"uv": [0, 4, 2,8], "texture": "#all", "cullface": "west" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [12, 12,14, 16 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [0, 12, 2, 16], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [10, 12,12, 16], "texture": "#all", "cullface": "north" },
|
||||||
|
"east": {"uv": [8, 4,10, 8 ], "texture": "#all", "cullface": "east" },
|
||||||
|
"south": {"uv": [0,4,2, 8 ], "texture": "#all", "cullface": "south" },
|
||||||
|
"west": {"uv": [2, 4, 4,8], "texture": "#all", "cullface": "west" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [4, 0,6, 4 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [12, 12, 14, 16], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [6, 8,8, 12], "texture": "#all", "cullface": "north" },
|
||||||
|
"east": {"uv": [10, 0,12, 4 ], "texture": "#all", "cullface": "east" },
|
||||||
|
"south": {"uv": [8,0,10, 4 ], "texture": "#all", "cullface": "south" },
|
||||||
|
"west": {"uv": [0, 0, 2,4], "texture": "#all", "cullface": "west" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"comment": "can't believe i'm doing this manually again - hal, 0.25 vert, 0.125 hoz",
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"all": "ageofthegods:block/alloy_furnace/alloy_furnace_sheet",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [4, 4,6, 8 ], "texture": "#all", "cullface": "up" },
|
||||||
|
"down": {"uv": [12, 8, 14, 12], "texture": "#all", "cullface": "down" },
|
||||||
|
"north": {"uv": [10, 0,12, 4], "texture": "#all", "cullface": "north" },
|
||||||
|
"west": {"uv": [0, 0,2, 4 ], "texture": "#all", "cullface": "west" },
|
||||||
|
"south": {"uv": [2,0,4, 4], "texture": "#all", "cullface": "south" },
|
||||||
|
"east": {"uv": [8, 0, 10,4], "texture": "#all", "cullface": "east" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
{
|
||||||
|
"parent": "block/block",
|
||||||
|
"textures": {
|
||||||
|
"top": "ageofthegods:block/alloy_furnace/alloy_furnace_top_mini",
|
||||||
|
"side": "ageofthegods:block/alloy_furnace/alloy_furnace_side_mini",
|
||||||
|
"front": "ageofthegods:block/alloy_furnace/alloy_furnace_front_mini",
|
||||||
|
"particle": "block/bricks"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [0, 0, 0],
|
||||||
|
"to": [16, 16, 16],
|
||||||
|
"faces": {
|
||||||
|
"up": {"uv": [0,0,16,16], "texture": "#top", "cullface": "up" },
|
||||||
|
"down": {"uv": [0,0,16,16], "texture": "#top", "cullface": "down" },
|
||||||
|
"north": {"uv": [0,0,16,16], "texture": "#front", "cullface": "north" },
|
||||||
|
"west": {"uv": [0,0,16,16], "texture": "#side", "cullface": "west" },
|
||||||
|
"south": {"uv": [0,0,16,16], "texture": "#side", "cullface": "south" },
|
||||||
|
"east": {"uv": [0,0,16,16], "texture": "#side", "cullface": "east" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
"texture_size": [32, 32],
|
"texture_size": [32, 32],
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "ageofthegods:xiphos/xiphos",
|
"0": "ageofthegods:item/xiphos",
|
||||||
"particle": "ageofthegods:xiphos/xiphos"
|
"particle": "ageofthegods:item/xiphos"
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 428 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 437 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 434 B |
Reference in New Issue
Block a user