Docked in!
This commit is contained in:
parent
926721b349
commit
93c69dec49
11 changed files with 283 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "tardim_ic:block/tardim_dock"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"block.tardim_ic.digital_tardim_interface": "Digital TARDIM Interface",
|
||||
"block.tardim_ic.redstone_tardim_input": "Redstone TARDIM Input",
|
||||
"block.tardim_ic.tardim_dock": "TARDIM Dock",
|
||||
"itemGroup.tardim_ic": "TARDIM: In Control",
|
||||
"itemGroup.minecraft.tardim_ic": "TARDIM: In Control"
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"block.tardim_ic.digital_tardim_interface": "Digital TARDIM Interface",
|
||||
"block.tardim_ic.redstone_tardim_input": "Redstone TARDIM Input",
|
||||
"block.tardim_ic.tardim_dock": "TARDIM Dock",
|
||||
"itemGroup.tardim_ic": "TARDIM: In Control",
|
||||
"itemGroup.minecraft.tardim_ic": "TARDIM: In Control"
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"block.tardim_ic.digital_tardim_interface": "Циферный Интерфейсъ Хронобудки",
|
||||
"block.tardim_ic.redstone_tardim_input": "Краснокаменный Инпутъ Хронобудки",
|
||||
"block.tardim_ic.tardim_dock": "Конюшня для TARDIM",
|
||||
"itemGroup.tardim_ic": "ТАРДИМЪ: Подъ Контрольемъ",
|
||||
"itemGroup.minecraft.tardim_ic": "ТАРДИМЪ: Подъ Контрольемъ"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"block.tardim_ic.digital_tardim_interface": "Цифровой интерфейс TARDIM",
|
||||
"block.tardim_ic.redstone_tardim_input": "Редстоуновый ввод TARDIM",
|
||||
"block.tardim_ic.tardim_dock": "Стыковочная станция для TARDIM",
|
||||
"itemGroup.tardim_ic": "TARDIM: In Control",
|
||||
"itemGroup.minecraft.tardim_ic": "TARDIM: In Control"
|
||||
}
|
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"credit": "Made with Blockbench",
|
||||
"render": "translucent",
|
||||
"texture_size": [64, 64],
|
||||
"textures": {
|
||||
"0": "tardim_ic:blocks/tardim_dock",
|
||||
"particle": "tardim_ic:blocks/tardim_dock"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"from": [2, 0, 2],
|
||||
"to": [14, 12, 14],
|
||||
"faces": {
|
||||
"north": {"uv": [4, 0, 7, 3], "texture": "#0"},
|
||||
"east": {"uv": [4, 3, 7, 6], "texture": "#0"},
|
||||
"south": {"uv": [4, 6, 7, 9], "texture": "#0"},
|
||||
"west": {"uv": [7, 0, 10, 3], "texture": "#0"},
|
||||
"up": {"uv": [10, 6, 7, 3], "texture": "#0"},
|
||||
"down": {"uv": [10, 6, 7, 9], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [0, 12, 0],
|
||||
"to": [16, 16, 16],
|
||||
"faces": {
|
||||
"north": {"uv": [0, 8, 4, 9], "texture": "#0"},
|
||||
"east": {"uv": [0, 9, 4, 10], "texture": "#0"},
|
||||
"south": {"uv": [4, 9, 8, 10], "texture": "#0"},
|
||||
"west": {"uv": [8, 9, 12, 10], "texture": "#0"},
|
||||
"up": {"uv": [4, 4, 0, 0], "texture": "#0"},
|
||||
"down": {"uv": [4, 4, 0, 8], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [12, 0, 0],
|
||||
"to": [12, 12, 2],
|
||||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"east": {"uv": [10.5, 0, 10, 3], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"west": {"uv": [10, 0, 10.5, 3], "texture": "#0"},
|
||||
"up": {"uv": [0, 0.5, 0, 0], "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 0, 0.5], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 0, 14],
|
||||
"to": [4, 12, 16],
|
||||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"east": {"uv": [10, 0, 10.5, 3], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"west": {"uv": [10.5, 0, 10, 3], "texture": "#0"},
|
||||
"up": {"uv": [0, 0.5, 0, 0], "rotation": 180, "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 0, 0.5], "rotation": 180, "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [4, 0, 0],
|
||||
"to": [4, 12, 2],
|
||||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"east": {"uv": [1.5, 10, 1, 13], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"west": {"uv": [1, 10, 1.5, 13], "texture": "#0"},
|
||||
"up": {"uv": [0, 0.5, 0, 0], "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 0, 0.5], "texture": "#0"}
|
||||
}
|
||||
},
|
||||
{
|
||||
"from": [12, 0, 14],
|
||||
"to": [12, 12, 16],
|
||||
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 8]},
|
||||
"faces": {
|
||||
"north": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"east": {"uv": [1, 10, 1.5, 13], "texture": "#0"},
|
||||
"south": {"uv": [0, 0, 0, 3], "texture": "#0"},
|
||||
"west": {"uv": [1.5, 10, 1, 13], "texture": "#0"},
|
||||
"up": {"uv": [0, 0.5, 0, 0], "rotation": 180, "texture": "#0"},
|
||||
"down": {"uv": [0, 0, 0, 0.5], "rotation": 180, "texture": "#0"}
|
||||
}
|
||||
}
|
||||
],
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"translation": [0, 0, 0.5],
|
||||
"scale": [0.3, 0.3, 0.3]
|
||||
},
|
||||
"thirdperson_lefthand": {
|
||||
"scale": [0.3, 0.3, 0.3]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"translation": [1.75, -0.25, 0],
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
"translation": [3, 0, 0],
|
||||
"scale": [0.5, 0.5, 0.5]
|
||||
},
|
||||
"ground": {
|
||||
"translation": [0, -0.25, 0],
|
||||
"scale": [0.4, 0.4, 0.4]
|
||||
},
|
||||
"gui": {
|
||||
"rotation": [18, 45, 0],
|
||||
"translation": [0, -0.5, 0],
|
||||
"scale": [0.65, 0.65, 0.65]
|
||||
},
|
||||
"head": {
|
||||
"rotation": [0, -90, 0],
|
||||
"scale": [1.2, 1.2, 1.2]
|
||||
},
|
||||
"fixed": {
|
||||
"rotation": [-90, 0, 0],
|
||||
"scale": [1.2, 1.2, 1.2]
|
||||
}
|
||||
},
|
||||
"groups": [
|
||||
{
|
||||
"name": "group",
|
||||
"origin": [8, 8, 8],
|
||||
"color": 0,
|
||||
"nbt": "{}",
|
||||
"children": [0, 1, 2, 3, 4, 5]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"parent": "tardim_ic:block/tardim_dock",
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [ 75, 45, 0 ],
|
||||
"scale": [ 0.40, 0.40, 0.40 ],
|
||||
"translation": [ 0, 1, 0 ]
|
||||
},
|
||||
"thirdperson_lefthand": {
|
||||
"rotation": [ 75, 45, 0 ],
|
||||
"scale": [ 0.40, 0.40, 0.40 ],
|
||||
"translation": [ 0, 1, 0 ]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
"rotation": [ 0, 45, 0 ],
|
||||
"scale": [ 0.40, 0.40, 0.40 ]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [ 0, 45, 0 ],
|
||||
"scale": [ 0.40, 0.40, 0.40 ]
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -23,12 +23,15 @@ import su.a71.tardim_ic.tardim_ic.redstone_input.RedstoneInputTileEntity;
|
|||
|
||||
import su.a71.tardim_ic.tardim_ic.Constants;
|
||||
import su.a71.tardim_ic.tardim_ic.registration.CommandInit;
|
||||
import su.a71.tardim_ic.tardim_ic.tardim_dock.TardimDockBlock;
|
||||
import su.a71.tardim_ic.tardim_ic.tardim_dock.TardimDockBlockEntity;
|
||||
|
||||
public class Registration {
|
||||
// Blocks
|
||||
|
||||
public static final Block DIGITAL_TARDIM_INTERFACE = new DigitalInterfaceBlock();
|
||||
public static final Block REDSTONE_TARDIM_INPUT = new RedstoneInputBlock();
|
||||
public static final Block TARDIM_DOCK = new TardimDockBlock();
|
||||
|
||||
// Tile Entities
|
||||
//public static final RegistryObject<BlockEntityType<DigitalInterfaceTileEntity>> DIGITAL_TARDIM_INTERFACE_TILEENTITY = Registration.BLOCK_ENTITIES.register("digital_tardim_interface", () -> new BlockEntityType<>(DigitalInterfaceTileEntity::new, Sets.newHashSet(DIGITAL_TARDIM_INTERFACE.get()), null));
|
||||
|
@ -44,6 +47,12 @@ public class Registration {
|
|||
FabricBlockEntityTypeBuilder.create(RedstoneInputTileEntity::new, DIGITAL_TARDIM_INTERFACE).build()
|
||||
);
|
||||
|
||||
public static final BlockEntityType<TardimDockBlockEntity> TARDIM_DOCK_BLOCKENTITY = Registry.register(
|
||||
Registry.BLOCK_ENTITY_TYPE,
|
||||
new ResourceLocation("tardim_ic", "tardim_dock"),
|
||||
FabricBlockEntityTypeBuilder.create(TardimDockBlockEntity::new, TARDIM_DOCK).build()
|
||||
);
|
||||
|
||||
private static final CreativeModeTab TARDIM_IC_TAB = FabricItemGroupBuilder
|
||||
.create(new ResourceLocation("tardim_ic"))
|
||||
.icon(() -> new ItemStack(DIGITAL_TARDIM_INTERFACE))
|
||||
|
@ -58,6 +67,9 @@ public class Registration {
|
|||
Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "digital_tardim_interface"), DIGITAL_TARDIM_INTERFACE);
|
||||
Registry.register(Registry.ITEM, new ResourceLocation(Constants.MOD_ID, "digital_tardim_interface"), new BlockItem(DIGITAL_TARDIM_INTERFACE, new FabricItemSettings().tab(TARDIM_IC_TAB)));
|
||||
|
||||
Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_dock"), TARDIM_DOCK);
|
||||
Registry.register(Registry.ITEM, new ResourceLocation(Constants.MOD_ID, "tardim_dock"), new BlockItem(TARDIM_DOCK, new FabricItemSettings().tab(TARDIM_IC_TAB)));
|
||||
|
||||
ComputerCraftAPI.registerPeripheralProvider(new DigitalInterfacePeripheralProvider());
|
||||
CommandInit.init();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
package su.a71.tardim_ic.tardim_ic.tardim_dock;
|
||||
|
||||
import com.swdteam.tardim.common.init.TRDDimensions;
|
||||
import com.swdteam.tardim.common.init.TRDSounds;
|
||||
import com.swdteam.tardim.network.NetworkHandler;
|
||||
import com.swdteam.tardim.network.PacketOpenEditGui;
|
||||
import com.swdteam.tardim.tardim.TardimData;
|
||||
import com.swdteam.tardim.tardim.TardimManager;
|
||||
import com.swdteam.tardim.tileentity.TileEntityBaseTardimPanel;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.DebugPackets;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResult;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.EntityBlock;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.IntegerProperty;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
||||
|
||||
public class TardimDockBlock extends Block implements EntityBlock {
|
||||
public TardimDockBlock() {
|
||||
super(FabricBlockSettings.of(Material.METAL).strength(2, 4).noOcclusion()); // No occlusion?
|
||||
}
|
||||
|
||||
// @Nullable
|
||||
// @Override
|
||||
// public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
||||
// return Registration.REDSTONE_TARDIM_INPUT_TILEENTITY.create(pos, state);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public InteractionResult use(BlockState blockState, Level w, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult p_60508_) {
|
||||
if (!w.isClientSide) {
|
||||
BlockEntity be = w.getBlockEntity(blockPos);
|
||||
if (be instanceof TardimDockBlockEntity) {
|
||||
|
||||
player.displayClientMessage(
|
||||
Component.literal("Dock ID: " + ((TardimDockBlockEntity) be).dock_id).withStyle(ChatFormatting.BLUE).withStyle(ChatFormatting.BOLD), true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
|
||||
public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Un-register the dock
|
||||
@Override
|
||||
public void destroy(LevelAccessor levelAccessor, BlockPos blockPos, BlockState blockState) {
|
||||
super.destroy(levelAccessor, blockPos, blockState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockEntity newBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
return Registration.TARDIM_DOCK_BLOCKENTITY.create(blockPos, blockState);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package su.a71.tardim_ic.tardim_ic.tardim_dock;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
||||
|
||||
public class TardimDockBlockEntity extends BlockEntity {
|
||||
public int dock_id;
|
||||
|
||||
public TardimDockBlockEntity(BlockPos blockPos, BlockState blockState) {
|
||||
super(Registration.TARDIM_DOCK_BLOCKENTITY, blockPos, blockState);
|
||||
this.dock_id = 123;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAdditional(CompoundTag tag) {
|
||||
tag.putInt("dock_id", dock_id);
|
||||
super.saveAdditional(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(CompoundTag tag) {
|
||||
super.load(tag);
|
||||
dock_id = tag.getInt("dock_id");
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue