Game launches, blocks place. Now for the content.

This commit is contained in:
Andrew-71 2023-08-02 20:42:21 +03:00
parent 987a18c360
commit 4c6939e69f
89 changed files with 1191 additions and 548 deletions

View file

@ -1,19 +0,0 @@
package com.example.examplemod;
import net.minecraftforge.fml.common.Mod;
@Mod(Constants.MOD_ID)
public class ExampleMod {
public ExampleMod() {
// This method is invoked by the Forge mod loader when it is ready
// to load your mod. You can access Forge and Common code in this
// project.
// Use Forge to bootstrap the Common mod.
Constants.LOG.info("Hello Forge world!");
CommonClass.init();
}
}

View file

@ -1,20 +0,0 @@
package com.example.examplemod.mixin;
import com.example.examplemod.Constants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class MixinTitleScreen {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
Constants.LOG.info("This line is printed by an example mod mixin from Forge!");
Constants.LOG.info("MC Version: {}", Minecraft.getInstance().getVersionType());
}
}

View file

@ -1,26 +0,0 @@
package com.example.examplemod.platform;
import com.example.examplemod.platform.services.IPlatformHelper;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.loading.FMLLoader;
public class ForgePlatformHelper implements IPlatformHelper {
@Override
public String getPlatformName() {
return "Forge";
}
@Override
public boolean isModLoaded(String modId) {
return ModList.get().isLoaded(modId);
}
@Override
public boolean isDevelopmentEnvironment() {
return !FMLLoader.isProduction();
}
}

View file

@ -0,0 +1,100 @@
package su.a71.tardim_ic.tardim_ic.redsone_input;
import com.swdteam.common.block.BlockBaseTardimPanel;
import com.swdteam.common.init.TRDDimensions;
import com.swdteam.common.init.TRDSounds;
import com.swdteam.network.NetworkHandler;
import com.swdteam.network.packets.PacketOpenEditGui;
import com.swdteam.tardim.TardimData;
import com.swdteam.tardim.TardimManager;
import com.swdteam.tileentity.TileEntityBaseTardimPanel;
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.SoundEvent;
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.level.Level;
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.material.Material;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.common.util.FakePlayerFactory;
import net.minecraftforge.server.ServerLifecycleHooks;
import org.jetbrains.annotations.NotNull;
import su.a71.tardim_ic.tardim_ic.Registration;
import javax.annotation.Nullable;
public class RedstoneInputBlock extends BlockBaseTardimPanel implements EntityBlock {
private boolean isPowered = false;
public RedstoneInputBlock() {
super(Properties.of(Material.METAL).strength(2, 4).noOcclusion());
}
@Nullable
@Override
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
return Registration.REDSTONE_TARDIM_INPUT_TILEENTITY.get().create(pos, state);
}
@Override
public InteractionResult use(BlockState blockState, Level w, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult p_60508_) {
if (!w.isClientSide) {
w.playSound((Player)null, blockPos, (SoundEvent) TRDSounds.TARDIM_BEEP.get(), SoundSource.BLOCKS, 0.3F, 0.5F);
BlockEntity be = w.getBlockEntity(blockPos);
if (be instanceof TileEntityBaseTardimPanel && w.dimension() == TRDDimensions.TARDIS) {
TardimData data = TardimManager.getFromPos(blockPos);
if (data != null && data.hasPermission(player)) {
NetworkHandler.sendTo((ServerPlayer)player, new PacketOpenEditGui(1, blockPos));
return InteractionResult.CONSUME;
}
player.displayClientMessage(
Component.literal("You do not have permission").withStyle(ChatFormatting.DARK_RED).withStyle(ChatFormatting.BOLD), true
);
}
}
return InteractionResult.CONSUME;
}
public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
return true;
}
public void neighborChanged(BlockState blockState, Level level, BlockPos blockPos, Block block, BlockPos fromPos, boolean isMoving) {
DebugPackets.sendNeighborsUpdatePacket(level, blockPos);
// get redstone signal
Direction direction = blockState.getValue(FACING);
int redstoneSignal = level.getSignal(blockPos, direction);
if (redstoneSignal > 0 && !isPowered) {
isPowered = true;
BlockEntity be = level.getBlockEntity(blockPos);
if (be instanceof TileEntityBaseTardimPanel && level.dimension() == TRDDimensions.TARDIS) {
TardimData data = TardimManager.getFromPos(blockPos);
if (data != null) {
if (((TileEntityBaseTardimPanel)be).hasCommand()) {
((TileEntityBaseTardimPanel)be).execute(FakePlayerFactory.getMinecraft(ServerLifecycleHooks.getCurrentServer().getLevel(level.dimension())));
}
}
}
} else if (redstoneSignal == 0 && isPowered)
isPowered = false;
}
}

View file

@ -0,0 +1,19 @@
package su.a71.tardim_ic.tardim_ic.redsone_input;
import com.swdteam.tileentity.TileEntityBaseTardimPanel;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.state.BlockState;
import su.a71.tardim_ic.tardim_ic.Registration;
public class RedstoneInputTileEntity extends TileEntityBaseTardimPanel {
public RedstoneInputTileEntity(BlockPos pos, BlockState state) {
super(Registration.REDSTONE_TARDIM_INPUT_TILEENTITY.get(), pos, state);
}
public BlockPos getPos() {
return this.worldPosition;
}
}

View file

@ -0,0 +1,22 @@
package su.a71.tardim_ic.tardim_ic.sonic;
import net.minecraft.world.item.Item;
import com.swdteam.tardim.TardimData;
import com.swdteam.tardim.TardimManager;
import com.swdteam.client.gui.GuiCommandScreen;
public class SonicProbe extends Item {
private TardimData tardim;
public SonicProbe(Properties properties) {
super(properties.stacksTo(1));
}
public void setTardim(TardimData tardim) {
this.tardim = tardim;
}
// Add tile entity
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tardim_ic:block/digital_tardim_interface"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "tardim_ic:block/redstone_tardim_input"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -0,0 +1,5 @@
{
"block.tardim_ic.digital_tardim_interface": "Digital TARDIM Interface",
"block.tardim_ic.redstone_tardim_input": "Redstone TARDIM Input",
"itemGroup.tardim_ic": "TARDIM: In Control"
}

View file

@ -0,0 +1,5 @@
{
"block.tardim_ic.digital_tardim_interface": "Digital TARDIM Interface",
"block.tardim_ic.redstone_tardim_input": "Redstone TARDIM Input",
"itemGroup.tardim_ic": "TARDIM: In Control"
}

View file

@ -0,0 +1,5 @@
{
"block.tardim_ic.digital_tardim_interface": "Циферный Интерфейсъ Хронобудки",
"block.tardim_ic.redstone_tardim_input": "Краснокаменный Инпутъ Хронобудки",
"itemGroup.tardim_ic": "ТАРДИМЪ: Подъ Контрольемъ"
}

View file

@ -0,0 +1,5 @@
{
"block.tardim_ic.digital_tardim_interface": "Цифровой интерфейс TARDIM",
"block.tardim_ic.redstone_tardim_input": "Редстоуновый ввод TARDIM",
"itemGroup.tardim_ic": "TARDIM: In Control"
}

View file

@ -0,0 +1,213 @@
{
"credit": "Made with Blockbench",
"parent": "digital_tardim_interface",
"texture_size": [64, 64],
"textures": {
"1": "tardim_ic:blocks/digital_tardim_interface",
"particle": "tardim_ic:blocks/digital_tardim_interface"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 14, 16],
"faces": {
"north": {"uv": [4, 4, 8, 7.5], "texture": "#1"},
"east": {"uv": [0, 4, 4, 7.5], "texture": "#1"},
"south": {"uv": [12, 4, 16, 7.5], "texture": "#1"},
"west": {"uv": [8, 4, 12, 7.5], "texture": "#1"},
"up": {"uv": [8, 4, 4, 0], "texture": "#1"},
"down": {"uv": [12, 0, 8, 4], "texture": "#1"}
}
},
{
"from": [5, 14, 5],
"to": [11, 16, 11],
"faces": {
"north": {"uv": [1.5, 9, 3, 9.5], "texture": "#1"},
"east": {"uv": [0, 9, 1.5, 9.5], "texture": "#1"},
"south": {"uv": [4.5, 9, 6, 9.5], "texture": "#1"},
"west": {"uv": [3, 9, 4.5, 9.5], "texture": "#1"},
"up": {"uv": [3, 9, 1.5, 7.5], "texture": "#1"},
"down": {"uv": [4.5, 7.5, 3, 9], "texture": "#1"}
}
},
{
"from": [11, 14, 7],
"to": [14, 16, 9],
"faces": {
"north": {"uv": [12.5, 0.5, 13.25, 1], "texture": "#1"},
"east": {"uv": [12, 0.5, 12.5, 1], "texture": "#1"},
"south": {"uv": [13.75, 0.5, 14.5, 1], "texture": "#1"},
"west": {"uv": [13.25, 0.5, 13.75, 1], "texture": "#1"},
"up": {"uv": [13.25, 0.5, 12.5, 0], "texture": "#1"},
"down": {"uv": [14, 0, 13.25, 0.5], "texture": "#1"}
}
},
{
"from": [12.5, 14, 3.5],
"to": [12.5, 15, 12.5],
"faces": {
"north": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"east": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"south": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"west": {"uv": [13, 3.75, 15.25, 4], "texture": "#1"},
"up": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"down": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"}
}
},
{
"from": [3.5, 14, 12.5],
"to": [12.5, 15, 12.5],
"faces": {
"north": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"east": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"south": {"uv": [12.5, 3.75, 14.75, 4], "texture": "#1"},
"west": {"uv": [13.5, 3.75, 15.75, 4], "texture": "#1"},
"up": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"down": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"}
}
},
{
"from": [3.5, 14, 3.5],
"to": [12.5, 15, 3.5],
"faces": {
"north": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"east": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"south": {"uv": [12.5, 3.75, 14.75, 4], "texture": "#1"},
"west": {"uv": [13.5, 3.75, 15.75, 4], "texture": "#1"},
"up": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"down": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"}
}
},
{
"from": [3.5, 14, 3.5],
"to": [3.5, 15, 12.5],
"faces": {
"north": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"east": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"south": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"west": {"uv": [13, 3.75, 15.25, 4], "texture": "#1"},
"up": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"},
"down": {"uv": [12, 3.75, 14.25, 4], "texture": "#1"}
}
},
{
"from": [2, 14, 7],
"to": [5, 16, 9],
"faces": {
"north": {"uv": [5, 8, 5.75, 8.5], "texture": "#1"},
"east": {"uv": [4.5, 8, 5, 8.5], "texture": "#1"},
"south": {"uv": [6.25, 8, 7, 8.5], "texture": "#1"},
"west": {"uv": [5.75, 8, 6.25, 8.5], "texture": "#1"},
"up": {"uv": [5.75, 8, 5, 7.5], "texture": "#1"},
"down": {"uv": [6.5, 7.5, 5.75, 8], "texture": "#1"}
}
},
{
"from": [7, 14, 2],
"to": [9, 16, 5],
"faces": {
"north": {"uv": [3.25, 12.5, 3.75, 13], "texture": "#1"},
"east": {"uv": [2.5, 12.5, 3.25, 13], "texture": "#1"},
"south": {"uv": [4.5, 12.5, 5, 13], "texture": "#1"},
"west": {"uv": [3.75, 12.5, 4.5, 13], "texture": "#1"},
"up": {"uv": [3.75, 12.5, 3.25, 11.75], "texture": "#1"},
"down": {"uv": [4.25, 11.75, 3.75, 12.5], "texture": "#1"}
}
},
{
"from": [7, 14, 11],
"to": [9, 16, 14],
"faces": {
"north": {"uv": [0.75, 12.5, 1.25, 13], "texture": "#1"},
"east": {"uv": [0, 12.5, 0.75, 13], "texture": "#1"},
"south": {"uv": [2, 12.5, 2.5, 13], "texture": "#1"},
"west": {"uv": [1.25, 12.5, 2, 13], "texture": "#1"},
"up": {"uv": [1.25, 12.5, 0.75, 11.75], "texture": "#1"},
"down": {"uv": [1.75, 11.75, 1.25, 12.5], "texture": "#1"}
}
},
{
"from": [6, 13, -2],
"to": [10, 17, 2],
"faces": {
"north": {"uv": [10, 9.5, 11, 10.5], "texture": "#1"},
"east": {"uv": [9, 9.5, 10, 10.5], "texture": "#1"},
"south": {"uv": [12, 9.5, 13, 10.5], "texture": "#1"},
"west": {"uv": [11, 9.5, 12, 10.5], "texture": "#1"},
"up": {"uv": [11, 9.5, 10, 8.5], "texture": "#1"},
"down": {"uv": [12, 8.5, 11, 9.5], "texture": "#1"}
}
},
{
"from": [6, 13, 14],
"to": [10, 17, 18],
"faces": {
"north": {"uv": [7, 8.5, 8, 9.5], "texture": "#1"},
"east": {"uv": [6, 8.5, 7, 9.5], "texture": "#1"},
"south": {"uv": [9, 8.5, 10, 9.5], "texture": "#1"},
"west": {"uv": [8, 8.5, 9, 9.5], "texture": "#1"},
"up": {"uv": [8, 8.5, 7, 7.5], "texture": "#1"},
"down": {"uv": [9, 7.5, 8, 8.5], "texture": "#1"}
}
},
{
"from": [-2, 13, 6],
"to": [2, 17, 10],
"faces": {
"north": {"uv": [1, 3, 2, 4], "texture": "#1"},
"east": {"uv": [0, 3, 1, 4], "texture": "#1"},
"south": {"uv": [3, 3, 4, 4], "texture": "#1"},
"west": {"uv": [2, 3, 3, 4], "texture": "#1"},
"up": {"uv": [2, 3, 1, 2], "texture": "#1"},
"down": {"uv": [3, 2, 2, 3], "texture": "#1"}
}
},
{
"from": [14, 13, 6],
"to": [18, 17, 10],
"faces": {
"north": {"uv": [1, 1, 2, 2], "texture": "#1"},
"east": {"uv": [0, 1, 1, 2], "texture": "#1"},
"south": {"uv": [3, 1, 4, 2], "texture": "#1"},
"west": {"uv": [2, 1, 3, 2], "texture": "#1"},
"up": {"uv": [2, 1, 1, 0], "texture": "#1"},
"down": {"uv": [3, 0, 2, 1], "texture": "#1"}
}
}
],
"display": {
"thirdperson_righthand": {
"translation": [0, -1.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"thirdperson_lefthand": {
"translation": [0, -1.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"firstperson_righthand": {
"translation": [-1.25, 0, 0],
"scale": [0.5, 0.5, 0.5]
},
"firstperson_lefthand": {
"translation": [3.75, -1.5, 0],
"scale": [0.5, 0.5, 0.5]
},
"ground": {
"translation": [0, -0.5, 0],
"scale": [0.35, 0.35, 0.35]
},
"gui": {
"rotation": [33, 45, 0],
"scale": [0.6, 0.6, 0.6]
},
"head": {
"translation": [0, 0.75, 0],
"scale": [1.1, 1.1, 1.1]
},
"fixed": {
"rotation": [-90, 0, 0],
"translation": [0, 0, 4.25]
}
}
}

View file

@ -0,0 +1,36 @@
{
"credit": "Made with Blockbench",
"parent": "block/cube_all",
"ambientocclusion": false,
"textures": {
"1": "tardim_ic:blocks/red_contr",
"2": "tardim_ic:blocks/red_contr2",
"particle": "tardim_ic:blocks/red_contr"
},
"elements": [
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#2"},
"east": {"uv": [0, 0, 16, 16], "texture": "#2"},
"south": {"uv": [0, 0, 16, 16], "texture": "#2"},
"west": {"uv": [0, 0, 16, 16], "texture": "#2"},
"up": {"uv": [0, 0, 16, 16], "texture": "#2"},
"down": {"uv": [0, 0, 16, 16], "texture": "#2"}
}
},
{
"from": [-0.325, -0.35, -0.35],
"to": [16.35, 16.525, 16.275],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#1"},
"east": {"uv": [0, 0, 16, 16], "texture": "#1"},
"south": {"uv": [0, 0, 16, 16], "texture": "#1"},
"west": {"uv": [0, 0, 16, 16], "texture": "#1"},
"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
}
}
]
}

View file

@ -0,0 +1,23 @@
{
"parent": "tardim_ic:block/digital_tardim_interface",
"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 ]
}
}
}

View file

@ -0,0 +1,23 @@
{
"parent": "tardim_ic:block/redstone_tardim_input",
"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.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

View file

@ -0,0 +1,7 @@
{
"animation": {
"frametime": 10,
"interpolate": true,
"frames": [0, 1, 2, 3]
}
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"name": "tardim_ic:digital_tardim_interface",
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
]
}

View file

@ -0,0 +1,20 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"bonus_rolls": 0,
"entries": [
{
"type": "minecraft:item",
"name": "tardim_ic:redstone_tardim_input",
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}
]
}

View file

@ -0,0 +1,30 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"DDD",
"R0R",
"GRG"
],
"key": {
"G": {
"item": "minecraft:gold_ingot",
"count": 1
},
"R": {
"item": "minecraft:redstone",
"count": 1
},
"0": {
"item": "minecraft:ender_eye",
"count": 1
},
"D": {
"item": "minecraft:polished_deepslate",
"count": 1
}
},
"result": {
"item": "tardim_ic:digital_tardim_interface",
"count": 1
}
}

View file

@ -0,0 +1,26 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"GRG",
"RBR",
"GRG"
],
"key": {
"G": {
"item": "minecraft:gold_ingot",
"count": 1
},
"R": {
"item": "minecraft:redstone",
"count": 1
},
"B": {
"item": "minecraft:redstone_block",
"count": 1
}
},
"result": {
"item": "tardim_ic:redstone_tardim_input",
"count": 1
}
}

View file

@ -0,0 +1,7 @@
{
"pack": {
"description": "TARDIM: In Control resources",
"pack_format": 6,
"_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
}
}