Game launches, blocks place. Now for the content.
This commit is contained in:
parent
987a18c360
commit
4c6939e69f
89 changed files with 1191 additions and 548 deletions
|
@ -1,17 +0,0 @@
|
||||||
TODO: Rewrite for 1.20
|
|
||||||
|
|
||||||
Added list-biomes and list-dimensions TARDIM commands + Corresponding ComputerCraft methods
|
|
||||||
This is a community-requested QOL feature that lets users scroll through available biomes and,
|
|
||||||
with lua methods, make advanced navigation dashboards even easier.
|
|
||||||
|
|
||||||
Computercraft compatibility improvements
|
|
||||||
Made ComputerCraft optional
|
|
||||||
Added peripherals for fuel storage, time rotor and scanner blocks
|
|
||||||
Added digital interface methods that list biomes and dimensions
|
|
||||||
|
|
||||||
Added Create compatibility
|
|
||||||
Added various display sources for fuel storage
|
|
||||||
|
|
||||||
Improved TARDIM's fuel system
|
|
||||||
Any item that can be used as fuel in furnace should now be able to power up a TARDIM
|
|
||||||
Buckets no longer get destroyed, and only get their fluids taken
|
|
|
@ -20,6 +20,8 @@ dependencies {
|
||||||
|
|
||||||
// ComputerCraft
|
// ComputerCraft
|
||||||
compileOnly("cc.tweaked:cc-tweaked-$minecraft_version-common-api:$cc_version")
|
compileOnly("cc.tweaked:cc-tweaked-$minecraft_version-common-api:$cc_version")
|
||||||
|
|
||||||
|
compileOnly(files("./tardim-1.2.2-dev.jar"))
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
package su.a71.tardim_ic;
|
|
||||||
|
|
||||||
public class Registration {
|
|
||||||
|
|
||||||
public static void register() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,6 +6,7 @@ import com.swdteam.tardim.tardim.TardimData;
|
||||||
import com.swdteam.tardim.tardim.TardimManager;
|
import com.swdteam.tardim.tardim.TardimManager;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.inventory.FurnaceFuelSlot;
|
import net.minecraft.world.inventory.FurnaceFuelSlot;
|
||||||
|
@ -26,7 +27,7 @@ public class CommandListBiomes implements ICommand{
|
||||||
TardimData data = TardimManager.getFromPos(pos);
|
TardimData data = TardimManager.getFromPos(pos);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (data.hasPermission(player)) {
|
if (data.hasPermission(player)) {
|
||||||
Registry<Biome> biomeRegistry = player.getLevel().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY);
|
Registry<Biome> biomeRegistry = player.level().registryAccess().registryOrThrow(Registries.BIOME);
|
||||||
biomeRegistry.keySet().forEach(
|
biomeRegistry.keySet().forEach(
|
||||||
(ResourceLocation res) -> {
|
(ResourceLocation res) -> {
|
||||||
String out = res.toString();
|
String out = res.toString();
|
|
@ -18,7 +18,7 @@ public class CommandListDimensions implements ICommand{
|
||||||
TardimData data = TardimManager.getFromPos(pos);
|
TardimData data = TardimManager.getFromPos(pos);
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (data.hasPermission(player)) {
|
if (data.hasPermission(player)) {
|
||||||
for (ServerLevel serverLevel : player.getLevel().getServer().getAllLevels()) {
|
for (ServerLevel serverLevel : player.level().getServer().getAllLevels()) {
|
||||||
CommandTardimBase.sendResponse(player, serverLevel.dimension().location().toString(), CommandTardimBase.ResponseType.INFO, source);
|
CommandTardimBase.sendResponse(player, serverLevel.dimension().location().toString(), CommandTardimBase.ResponseType.INFO, source);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
|
@ -38,10 +38,10 @@ public class CommandModemTransmit implements ICommand {
|
||||||
|
|
||||||
if (allDimensions)
|
if (allDimensions)
|
||||||
{
|
{
|
||||||
ComputerCraftAPI.getWirelessNetwork().transmitInterdimensional(new Packet(sendChannel, replyChannel, message, new CommandSender(player, data.getTravelLocation().getPos())));
|
ComputerCraftAPI.getWirelessNetwork(player.getServer()).transmitInterdimensional(new Packet(sendChannel, replyChannel, message, new CommandSender(player, data.getTravelLocation().getPos())));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ComputerCraftAPI.getWirelessNetwork().transmitSameDimension(new Packet(sendChannel, replyChannel, message,
|
ComputerCraftAPI.getWirelessNetwork(player.getServer()).transmitSameDimension(new Packet(sendChannel, replyChannel, message,
|
||||||
new CommandSender(player, data.getTravelLocation().getPos())), 300);
|
new CommandSender(player, data.getTravelLocation().getPos())), 300);
|
||||||
}
|
}
|
||||||
CommandTardimBase.sendResponse(player, "Sent modem message", CommandTardimBase.ResponseType.COMPLETE, source);
|
CommandTardimBase.sendResponse(player, "Sent modem message", CommandTardimBase.ResponseType.COMPLETE, source);
|
|
@ -1,13 +1,13 @@
|
||||||
package su.a71.tardim_ic.command;
|
package su.a71.tardim_ic.command;
|
||||||
|
|
||||||
import dan200.computercraft.api.network.IPacketSender;
|
import dan200.computercraft.api.network.PacketSender;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public class CommandSender implements IPacketSender {
|
public class CommandSender implements PacketSender {
|
||||||
|
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private final Level level;
|
private final Level level;
|
||||||
|
@ -15,7 +15,7 @@ public class CommandSender implements IPacketSender {
|
||||||
|
|
||||||
CommandSender(Player player, BlockPos pos) {
|
CommandSender(Player player, BlockPos pos) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.level = player.level;
|
this.level = player.level();
|
||||||
this.pos = pos;
|
this.pos = pos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat;
|
package su.a71.tardim_ic.computercraft_compat.entity;
|
||||||
|
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import com.swdteam.tardim.tardim.TardimManager;
|
import com.swdteam.tardim.tardim.TardimManager;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
|
||||||
public class FakeTardimPeripheralTileEntity implements ITardimPeripheralTileEntity {
|
public class FakeTardimPeripheralTileEntity implements ITardimPeripheralTileEntity {
|
||||||
public BlockPos blockPos;
|
public BlockPos blockPos;
|
||||||
public Level level;
|
public Level level;
|
||||||
public TardimData data; // Our TARDIM
|
public TardimData data; // Our TARDIM
|
||||||
|
|
||||||
|
|
||||||
public FakeTardimPeripheralTileEntity(BlockPos in_block, Level in_level) {
|
public FakeTardimPeripheralTileEntity(BlockPos in_block, Level in_level) {
|
||||||
this.blockPos = in_block;
|
this.blockPos = in_block;
|
||||||
this.level = in_level;
|
this.level = in_level;
|
||||||
|
@ -32,6 +32,11 @@ public class FakeTardimPeripheralTileEntity implements ITardimPeripheralTileEnti
|
||||||
return this.data;
|
return this.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Block getBlock() {
|
||||||
|
return this.level.getBlockState(this.blockPos).getBlock();
|
||||||
|
}
|
||||||
|
|
||||||
public TardimData getTardimDataInitial() {
|
public TardimData getTardimDataInitial() {
|
||||||
int X = this.getPos().getX(), Z = this.getPos().getZ();
|
int X = this.getPos().getX(), Z = this.getPos().getZ();
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat;
|
package su.a71.tardim_ic.computercraft_compat.entity;
|
||||||
|
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
|
||||||
// This is used to getPost(), getLevel() and getTardim() nicely without refactoring code to account for PeripheralProvider
|
// This is used to getPost(), getLevel() and getTardim() nicely without refactoring code to account for PeripheralProvider
|
||||||
// At least I believe so. Otherwise don't really remember why I don't just pass these methods to the peripherals.
|
// At least I believe so. Otherwise, don't really remember why I don't just pass these methods to the peripherals.
|
||||||
public interface ITardimPeripheralTileEntity {
|
public interface ITardimPeripheralTileEntity {
|
||||||
public BlockPos getPos();
|
public BlockPos getPos();
|
||||||
public Level getLevel();
|
public Level getLevel();
|
||||||
|
|
||||||
public TardimData getTardim();
|
public TardimData getTardim();
|
||||||
|
|
||||||
|
public Block getBlock();
|
||||||
}
|
}
|
|
@ -1,35 +1,27 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
||||||
|
|
||||||
|
import com.swdteam.tardim.common.block.BlockFuelStorage;
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import dan200.computercraft.api.lua.LuaException;
|
import dan200.computercraft.api.lua.LuaException;
|
||||||
import dan200.computercraft.api.lua.LuaFunction;
|
import dan200.computercraft.api.lua.LuaFunction;
|
||||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import su.a71.tardim_ic.computercraft_compat.FakeTardimPeripheralTileEntity;
|
import su.a71.tardim_ic.computercraft_compat.entity.FakeTardimPeripheralTileEntity;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CC Peripheral for TARDIM's fuel storage block.
|
* CC Peripheral for TARDIM's fuel storage block.
|
||||||
* Only provides getters for the fuel parts for people who cannot afford or don't need the digital interface.
|
* Only provides getters for the fuel parts for people who cannot afford or don't need the digital interface.
|
||||||
*/
|
*/
|
||||||
public class FuelStoragePeripheral extends TardimPeripheral implements IPeripheral {
|
public class FuelStoragePeripheral extends TardimPeripheral<BlockFuelStorage> implements IPeripheral {
|
||||||
/**
|
/**
|
||||||
* @param tileEntity the tile entity of this peripheral
|
* @param tileEntity the tile entity of this peripheral
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
public FuelStoragePeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
public FuelStoragePeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
||||||
super(tileEntity);
|
super(tileEntity, "tardim_fuel_storage", (BlockFuelStorage) tileEntity.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Setting name for the peripheral. A computer will see it as "digital_tardim_interface_n"
|
|
||||||
* @hidden
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public String getType() { return "tardim_fuel_storage"; }
|
|
||||||
|
|
||||||
|
|
||||||
// Peripheral methods ===============================================================
|
// Peripheral methods ===============================================================
|
||||||
|
|
|
@ -4,25 +4,44 @@ import com.swdteam.tardim.tardim.TardimData;
|
||||||
import dan200.computercraft.api.lua.LuaException;
|
import dan200.computercraft.api.lua.LuaException;
|
||||||
import dan200.computercraft.api.peripheral.IComputerAccess;
|
import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||||
import su.a71.tardim_ic.computercraft_compat.ITardimPeripheralTileEntity;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import su.a71.tardim_ic.computercraft_compat.entity.ITardimPeripheralTileEntity;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
// Base CC peripheral for whn you need something with access to a TARDIM
|
// Base CC peripheral for whn you need something with access to a TARDIM
|
||||||
public abstract class TardimPeripheral implements IPeripheral {
|
public abstract class TardimPeripheral<BL extends Block> implements IPeripheral {
|
||||||
|
|
||||||
private final List<IComputerAccess> connectedComputers = new ArrayList<>(); // List of computers connected to the peripheral
|
private final List<IComputerAccess> connectedComputers = new ArrayList<>(); // List of computers connected to the peripheral
|
||||||
public final ITardimPeripheralTileEntity tileEntity; // Peripheral's BlockEntity, used for accessing coordinates
|
public final ITardimPeripheralTileEntity tileEntity; // Peripheral's BlockEntity, used for accessing coordinates
|
||||||
|
public final String name;
|
||||||
|
private final BL block;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param tileEntity the tile entity of this peripheral
|
* @param tileEntity the tile entity of this peripheral
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
public TardimPeripheral(ITardimPeripheralTileEntity tileEntity) {
|
public TardimPeripheral(ITardimPeripheralTileEntity tileEntity, String name, BL block) {
|
||||||
this.tileEntity = tileEntity;
|
this.tileEntity = tileEntity;
|
||||||
|
this.name = name;
|
||||||
|
this.block = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BL getTarget() {
|
||||||
|
return this.block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Setting name for the peripheral. A computer will see it as "digital_tardim_interface_n"
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
@Nonnull
|
||||||
|
@Override
|
||||||
|
public String getType() { return this.name; }
|
||||||
|
|
||||||
/** Apparently CC uses this to check if the peripheral in front of a modem is this one
|
/** Apparently CC uses this to check if the peripheral in front of a modem is this one
|
||||||
* @hidden
|
* @hidden
|
||||||
* @param iPeripheral The peripheral to compare against. This may be {@code null}.
|
* @param iPeripheral The peripheral to compare against. This may be {@code null}.
|
|
@ -1,5 +1,6 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
||||||
|
|
||||||
|
import com.swdteam.tardim.common.block.BlockTardimScanner;
|
||||||
import com.swdteam.tardim.common.init.TardimRegistry;
|
import com.swdteam.tardim.common.init.TardimRegistry;
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import dan200.computercraft.api.lua.LuaException;
|
import dan200.computercraft.api.lua.LuaException;
|
||||||
|
@ -12,9 +13,8 @@ import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.server.players.PlayerList;
|
import net.minecraft.server.players.PlayerList;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import su.a71.tardim_ic.computercraft_compat.FakeTardimPeripheralTileEntity;
|
import su.a71.tardim_ic.computercraft_compat.entity.FakeTardimPeripheralTileEntity;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -25,22 +25,15 @@ import java.util.Map;
|
||||||
* Only provides getters for data-related (mostly table output) methods e.g. biome or companion list
|
* Only provides getters for data-related (mostly table output) methods e.g. biome or companion list
|
||||||
* for people who cannot afford or don't need the digital interface.
|
* for people who cannot afford or don't need the digital interface.
|
||||||
*/
|
*/
|
||||||
public class TardimScannerPeripheral extends TardimPeripheral implements IPeripheral {
|
public class TardimScannerPeripheral extends TardimPeripheral<BlockTardimScanner> implements IPeripheral {
|
||||||
/**
|
/**
|
||||||
* @param tileEntity the tile entity of this peripheral
|
* @param tileEntity the tile entity of this peripheral
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
public TardimScannerPeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
public TardimScannerPeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
||||||
super(tileEntity);
|
super(tileEntity, "tardim_scanner", (BlockTardimScanner) tileEntity.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Setting name for the peripheral. A computer will see it as "digital_tardim_interface_n"
|
|
||||||
* @hidden
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public String getType() { return "tardim_scanner"; }
|
|
||||||
|
|
||||||
|
|
||||||
// Peripheral methods ===============================================================
|
// Peripheral methods ===============================================================
|
||||||
|
|
|
@ -1,35 +1,28 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
||||||
|
|
||||||
|
import com.swdteam.tardim.common.block.BlockRotor;
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import dan200.computercraft.api.lua.LuaException;
|
import dan200.computercraft.api.lua.LuaException;
|
||||||
import dan200.computercraft.api.lua.LuaFunction;
|
import dan200.computercraft.api.lua.LuaFunction;
|
||||||
import dan200.computercraft.api.lua.ObjectLuaTable;
|
import dan200.computercraft.api.lua.ObjectLuaTable;
|
||||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
import dan200.computercraft.api.peripheral.IPeripheral;
|
||||||
import su.a71.tardim_ic.computercraft_compat.FakeTardimPeripheralTileEntity;
|
import su.a71.tardim_ic.computercraft_compat.entity.FakeTardimPeripheralTileEntity;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CC Peripheral for TARDIM's time rotor block.
|
* CC Peripheral for TARDIM's time rotor block.
|
||||||
* Only provides getters for the flight status for people who cannot afford or don't need the digital interface.
|
* Only provides getters for the flight status for people who cannot afford or don't need the digital interface.
|
||||||
*/
|
*/
|
||||||
public class TimeRotorPeripheral extends TardimPeripheral implements IPeripheral {
|
public class TimeRotorPeripheral extends TardimPeripheral<BlockRotor> implements IPeripheral {
|
||||||
/**
|
/**
|
||||||
* @param tileEntity the tile entity of this peripheral
|
* @param tileEntity the tile entity of this peripheral
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
public TimeRotorPeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
public TimeRotorPeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
||||||
super(tileEntity);
|
super(tileEntity, "tardim_time_rotor", (BlockRotor) tileEntity.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Setting name for the peripheral. A computer will see it as "digital_tardim_interface_n"
|
|
||||||
* @hidden
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public String getType() { return "tardim_time_rotor"; }
|
|
||||||
|
|
||||||
|
|
||||||
// Peripheral methods ===============================================================
|
// Peripheral methods ===============================================================
|
||||||
|
|
|
@ -9,23 +9,15 @@ import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
|
||||||
import static com.swdteam.tardim.tardim.TardimManager.FUEL_MAP;
|
import static com.swdteam.tardim.tardim.TardimManager.FUEL_MAP;
|
||||||
|
|
||||||
// This mixin aims to make TARDIM fuel system less awful by allowing users to put standard furance fuel into it.
|
// This mixin aims to make TARDIM fuel system less awful by allowing users to put standard furnace fuel into it.
|
||||||
@Mixin(value = TardimManager.class, remap = true)
|
@Mixin(value = TardimManager.class, remap = false)
|
||||||
public class BetterFuelMapMixin {
|
public class BetterFuelMapMixin {
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Andrew_7_1
|
|
||||||
* @reason The original function is too small to bother with insert
|
|
||||||
*/
|
|
||||||
@Overwrite
|
@Overwrite
|
||||||
public static boolean isFuel(Item i) {
|
public static boolean isFuel(Item i) {
|
||||||
return FUEL_MAP.containsKey(i) || AbstractFurnaceBlockEntity.getFuel().containsKey(i);
|
return FUEL_MAP.containsKey(i) || AbstractFurnaceBlockEntity.getFuel().containsKey(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Andrew_7_1
|
|
||||||
* @reason The code change is drastic enough to warrant an overwrite
|
|
||||||
*/
|
|
||||||
@Overwrite
|
@Overwrite
|
||||||
public static double getFuel(Item i) {
|
public static double getFuel(Item i) {
|
||||||
if (!isFuel(i)) {
|
if (!isFuel(i)) {
|
|
@ -33,7 +33,6 @@ public class BetterFuelStorageMixin {
|
||||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/HopperBlockEntity;removeItem(II)Lnet/minecraft/world/item/ItemStack;"),
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/entity/HopperBlockEntity;removeItem(II)Lnet/minecraft/world/item/ItemStack;"),
|
||||||
locals = LocalCapture.CAPTURE_FAILHARD)
|
locals = LocalCapture.CAPTURE_FAILHARD)
|
||||||
private static void saveLavaBuckets(Level world, BlockPos pos, BlockState state, TileEntityFuelStorage blockEntity, CallbackInfo ci) {
|
private static void saveLavaBuckets(Level world, BlockPos pos, BlockState state, TileEntityFuelStorage blockEntity, CallbackInfo ci) {
|
||||||
//CAPTURE_FAILHARD: If the calculated locals are different from the expected values, throws an error.
|
|
||||||
HopperBlockEntity mixin_hopper = (HopperBlockEntity)world.getBlockEntity(blockEntity.getBlockPos().above());
|
HopperBlockEntity mixin_hopper = (HopperBlockEntity)world.getBlockEntity(blockEntity.getBlockPos().above());
|
||||||
for(int j = 0; j < mixin_hopper.getContainerSize(); ++j) {
|
for(int j = 0; j < mixin_hopper.getContainerSize(); ++j) {
|
||||||
ItemStack stack = mixin_hopper.getItem(j);
|
ItemStack stack = mixin_hopper.getItem(j);
|
|
@ -4,24 +4,13 @@ import com.swdteam.tardim.common.command.tardim.CommandLocate;
|
||||||
import com.swdteam.tardim.common.command.tardim.CommandTardimBase;
|
import com.swdteam.tardim.common.command.tardim.CommandTardimBase;
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import com.swdteam.tardim.tardim.TardimManager;
|
import com.swdteam.tardim.tardim.TardimManager;
|
||||||
import dan200.computercraft.api.lua.LuaException;
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.network.chat.Component;
|
|
||||||
import net.minecraft.network.chat.contents.TranslatableContents;
|
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
|
||||||
import su.a71.tardim_ic.tardim_ic.registration.CommandInit;
|
|
||||||
|
|
||||||
import static com.swdteam.tardim.common.command.tardim.CommandTardimBase.sendResponse;
|
import static com.swdteam.tardim.common.command.tardim.CommandTardimBase.sendResponse;
|
||||||
import static su.a71.tardim_ic.tardim_ic.Constants.LOG;
|
|
||||||
import static su.a71.tardim_ic.tardim_ic.Registration.PERSONAL_JAMMER;
|
|
||||||
|
|
||||||
@Mixin(value = CommandLocate.class, remap = false)
|
@Mixin(value = CommandLocate.class, remap = false)
|
||||||
public class JammerMixin {
|
public class JammerMixin {
|
||||||
|
@ -46,12 +35,13 @@ public class JammerMixin {
|
||||||
Player otherPlayer = player.getServer().getPlayerList().getPlayerByName(args[0]);
|
Player otherPlayer = player.getServer().getPlayerList().getPlayerByName(args[0]);
|
||||||
if (otherPlayer != null) {
|
if (otherPlayer != null) {
|
||||||
for (ItemStack armour : otherPlayer.getArmorSlots()) {
|
for (ItemStack armour : otherPlayer.getArmorSlots()) {
|
||||||
if (armour.is(PERSONAL_JAMMER)) {
|
// if (armour.is(PERSONAL_JAMMER)) {
|
||||||
sendResponse(player, otherPlayer.getGameProfile().getName() + "'s location is jammed", CommandTardimBase.ResponseType.FAIL, source);
|
// sendResponse(player, otherPlayer.getGameProfile().getName() + "'s location is jammed", CommandTardimBase.ResponseType.FAIL, source);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
// TODO: Re-add
|
||||||
}
|
}
|
||||||
data.setTravelLocation(new TardimData.Location(otherPlayer.blockPosition(), otherPlayer.level.dimension()));
|
data.setTravelLocation(new TardimData.Location(otherPlayer.blockPosition(), otherPlayer.level().dimension()));
|
||||||
sendResponse(player, "Coords locked on to " + otherPlayer.getGameProfile().getName(), CommandTardimBase.ResponseType.COMPLETE, source);
|
sendResponse(player, "Coords locked on to " + otherPlayer.getGameProfile().getName(), CommandTardimBase.ResponseType.COMPLETE, source);
|
||||||
} else {
|
} else {
|
||||||
sendResponse(player, "Player does not exist", CommandTardimBase.ResponseType.FAIL, source);
|
sendResponse(player, "Player does not exist", CommandTardimBase.ResponseType.FAIL, source);
|
|
@ -1,6 +1,6 @@
|
||||||
package su.a71.tardim_ic.platform;
|
package su.a71.tardim_ic.platform;
|
||||||
|
|
||||||
import com.example.examplemod.Constants;
|
import su.a71.tardim_ic.Constants;
|
||||||
import su.a71.tardim_ic.platform.services.IPlatformHelper;
|
import su.a71.tardim_ic.platform.services.IPlatformHelper;
|
||||||
|
|
||||||
import java.util.ServiceLoader;
|
import java.util.ServiceLoader;
|
||||||
|
@ -19,7 +19,7 @@ public class Services {
|
||||||
final T loadedService = ServiceLoader.load(clazz)
|
final T loadedService = ServiceLoader.load(clazz)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName()));
|
.orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName()));
|
||||||
Constants.LOG.debug("Loaded {} for service {}", loadedService, clazz);
|
// Constants.LOG.debug("Loaded {} for service {}", loadedService, clazz);
|
||||||
return loadedService;
|
return loadedService;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,16 @@
|
||||||
package su.a71.tardim_ic.platform.services;
|
package su.a71.tardim_ic.platform.services;
|
||||||
|
|
||||||
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.MobCategory;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
public interface IPlatformHelper {
|
public interface IPlatformHelper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,6 +44,4 @@ public interface IPlatformHelper {
|
||||||
|
|
||||||
return isDevelopmentEnvironment() ? "development" : "production";
|
return isDevelopmentEnvironment() ? "development" : "production";
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add registration stuff here?
|
|
||||||
}
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"parent": "tardim_ic:block/redstone_tardim_input",
|
||||||
|
"textures": {
|
||||||
|
"1": "tardim_ic:block/redstone_input_lit",
|
||||||
|
"2": "tardim_ic:block/redstone_input_lit",
|
||||||
|
"particle": "tardim_ic:block/redstone_input_lit"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,20 +1,13 @@
|
||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "su.a71.tardim_ic.mixin",
|
"package": "su.a71.tardim_ic.mixin",
|
||||||
"refmap": "${mod_id}.refmap.json",
|
"refmap": "${mod_id}.refmap.json",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
"client": [
|
"injectors": {
|
||||||
],
|
"defaultRequire": 1
|
||||||
"server": [
|
}
|
||||||
"BetterFuelMapMixin",
|
|
||||||
"BetterFuelStorageMixin",
|
|
||||||
"JammerMixin"
|
|
||||||
],
|
|
||||||
"injectors": {
|
|
||||||
"defaultRequire": 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
Common/tardim-1.2.2-dev.jar
Normal file
BIN
Common/tardim-1.2.2-dev.jar
Normal file
Binary file not shown.
|
@ -15,8 +15,7 @@ dependencies {
|
||||||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
|
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1'
|
||||||
implementation project(":common")
|
implementation project(":common")
|
||||||
|
|
||||||
// Obfuscation forced my hand, TARDIM will be here for now :/
|
modImplementation("curse.maven:tardim-531315:4668945")
|
||||||
modImplementation(files("/Users/andreynikitin/Downloads/tardim.jar"))
|
|
||||||
modCompileOnly("cc.tweaked:cc-tweaked-$minecraft_version-fabric-api:$cc_version")
|
modCompileOnly("cc.tweaked:cc-tweaked-$minecraft_version-fabric-api:$cc_version")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
package com.example.examplemod;
|
|
||||||
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
|
||||||
|
|
||||||
public class ExampleMod implements ModInitializer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onInitialize() {
|
|
||||||
|
|
||||||
// This method is invoked by the Fabric mod loader when it is ready
|
|
||||||
// to load your mod. You can access Fabric and Common code in this
|
|
||||||
// project.
|
|
||||||
|
|
||||||
// Use Fabric to bootstrap the Common mod.
|
|
||||||
Constants.LOG.info("Hello Fabric world!");
|
|
||||||
CommonClass.init();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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 Fabric!");
|
|
||||||
Constants.LOG.info("MC Version: {}", Minecraft.getInstance().getVersionType());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
package com.example.examplemod.platform;
|
|
||||||
|
|
||||||
import com.example.examplemod.platform.services.IPlatformHelper;
|
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
|
||||||
|
|
||||||
public class FabricPlatformHelper implements IPlatformHelper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getPlatformName() {
|
|
||||||
return "Fabric";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isModLoaded(String modId) {
|
|
||||||
|
|
||||||
return FabricLoader.getInstance().isModLoaded(modId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isDevelopmentEnvironment() {
|
|
||||||
|
|
||||||
return FabricLoader.getInstance().isDevelopmentEnvironment();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
package su.a71.tardim_ic;
|
package su.a71.tardim_ic;
|
||||||
|
|
||||||
import net.fabricmc.api.ModInitializer;
|
import net.fabricmc.api.ModInitializer;
|
||||||
|
import su.a71.tardim_ic.tardim_ic.registration.Registration;
|
||||||
|
|
||||||
public class TardimInControl implements ModInitializer {
|
public class TardimInControl implements ModInitializer {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.world.level.material.MapColor;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import su.a71.tardim_ic.Registration;
|
import su.a71.tardim_ic.tardim_ic.registration.Registration;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class FoodMachineBlock extends HorizontalDirectionalBlock implements Enti
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
||||||
return Registration.FOOD_MACHINE_TILEENTITY.create(pos, state);
|
return Registration.FOOD_MACHINE_BE.create(pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,7 +60,7 @@ public class FoodMachineBlock extends HorizontalDirectionalBlock implements Enti
|
||||||
if (!w.isClientSide) {
|
if (!w.isClientSide) {
|
||||||
w.playSound(null, blockPos, TRDSounds.TARDIM_BEEP, SoundSource.BLOCKS, 0.3F, 0.5F);
|
w.playSound(null, blockPos, TRDSounds.TARDIM_BEEP, SoundSource.BLOCKS, 0.3F, 0.5F);
|
||||||
BlockEntity be = w.getBlockEntity(blockPos);
|
BlockEntity be = w.getBlockEntity(blockPos);
|
||||||
if (be instanceof FoodMachineTileEntity && w.dimension() == TRDDimensions.TARDIS) {
|
if (be instanceof FoodMachineBlockEntity && w.dimension() == TRDDimensions.TARDIS) {
|
||||||
TardimData data = TardimManager.getFromPos(blockPos);
|
TardimData data = TardimManager.getFromPos(blockPos);
|
||||||
if (data != null && data.hasPermission(player)) {
|
if (data != null && data.hasPermission(player)) {
|
||||||
if (data.getFuel() >= 0.05) {
|
if (data.getFuel() >= 0.05) {
|
||||||
|
|
|
@ -2,20 +2,15 @@ package su.a71.tardim_ic.blocks.food_machine;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraft.world.item.Items;
|
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
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 net.minecraft.world.level.block.state.BlockState;
|
||||||
import su.a71.tardim_ic.Registration;
|
import su.a71.tardim_ic.tardim_ic.registration.Registration;
|
||||||
|
|
||||||
import java.util.UUID;
|
public class FoodMachineBlockEntity extends BlockEntity {
|
||||||
|
|
||||||
public class FoodMachineTileEntity extends BlockEntity {
|
|
||||||
public int curr_food_index;
|
public int curr_food_index;
|
||||||
|
|
||||||
public FoodMachineTileEntity(BlockPos pos, BlockState state) {
|
public FoodMachineBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(Registration.FOOD_MACHINE_TILEENTITY, pos, state);
|
super(Registration.FOOD_MACHINE_BE, pos, state);
|
||||||
this.curr_food_index = 0;
|
this.curr_food_index = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,24 +26,25 @@ import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.EntityBlock;
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.MapColor;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
import su.a71.tardim_ic.tardim_ic.registration.Registration;
|
||||||
import su.a71.tardim_ic.tardim_ic.utils.FakePlayer;
|
import su.a71.tardim_ic.utils.FakePlayer;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class RedstoneInputBlock extends BlockBaseTardimPanel implements EntityBlock {
|
public class RedstoneInputBlock extends BlockBaseTardimPanel implements EntityBlock {
|
||||||
|
|
||||||
public RedstoneInputBlock() {
|
public RedstoneInputBlock() {
|
||||||
super(FabricBlockSettings.of(Material.METAL).strength(2, 4)); // No occlusion?
|
super(FabricBlockSettings.create().strength(2, 4).mapColor(MapColor.TERRACOTTA_ORANGE)); // No occlusion? this.setDefaultState((BlockState)this.getDefaultState().with(ON, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
||||||
return Registration.REDSTONE_TARDIM_INPUT_TILEENTITY.create(pos, state);
|
return Registration.REDSTONE_INPUT_BE.create(pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,10 +54,10 @@ public class RedstoneInputBlock extends BlockBaseTardimPanel implements EntityBl
|
||||||
w.playSound(null, blockPos, TRDSounds.TARDIM_BEEP, SoundSource.BLOCKS, 0.3F, 0.5F);
|
w.playSound(null, blockPos, TRDSounds.TARDIM_BEEP, SoundSource.BLOCKS, 0.3F, 0.5F);
|
||||||
|
|
||||||
BlockEntity be = w.getBlockEntity(blockPos);
|
BlockEntity be = w.getBlockEntity(blockPos);
|
||||||
if (be instanceof RedstoneInputTileEntity && w.dimension() == TRDDimensions.TARDIS) {
|
if (be instanceof RedstoneInputBlockEntity && w.dimension() == TRDDimensions.TARDIS) {
|
||||||
TardimData data = TardimManager.getFromPos(blockPos);
|
TardimData data = TardimManager.getFromPos(blockPos);
|
||||||
if (data != null && data.hasPermission(player)) {
|
if (data != null && data.hasPermission(player)) {
|
||||||
((RedstoneInputTileEntity) be).lastPlayer = player.getGameProfile().getId();
|
((RedstoneInputBlockEntity) be).lastPlayer = player.getGameProfile().getId();
|
||||||
NetworkHandler.sendTo((ServerPlayer)player, new PacketOpenEditGui(blockPos, 1));
|
NetworkHandler.sendTo((ServerPlayer)player, new PacketOpenEditGui(blockPos, 1));
|
||||||
return InteractionResult.CONSUME;
|
return InteractionResult.CONSUME;
|
||||||
}
|
}
|
||||||
|
@ -78,25 +79,26 @@ public class RedstoneInputBlock extends BlockBaseTardimPanel implements EntityBl
|
||||||
DebugPackets.sendNeighborsUpdatePacket(level, blockPos);
|
DebugPackets.sendNeighborsUpdatePacket(level, blockPos);
|
||||||
|
|
||||||
BlockEntity be = level.getBlockEntity(blockPos);
|
BlockEntity be = level.getBlockEntity(blockPos);
|
||||||
if (!(be instanceof RedstoneInputTileEntity)) {
|
if (!(be instanceof RedstoneInputBlockEntity)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get redstone signal
|
// get redstone signal
|
||||||
Direction direction = blockState.getValue(FACING);
|
Direction direction = blockState.getValue(FACING);
|
||||||
int redstoneSignal = level.getSignal(blockPos, direction);
|
int redstoneSignal = level.getSignal(blockPos, direction);
|
||||||
if (redstoneSignal > 0 && !((RedstoneInputTileEntity) be).isPowered) {
|
if (redstoneSignal > 0 && !((RedstoneInputBlockEntity) be).isPowered) {
|
||||||
((RedstoneInputTileEntity) be).isPowered = true;
|
((RedstoneInputBlockEntity) be).isPowered = true;
|
||||||
if (level.dimension() == TRDDimensions.TARDIS) {
|
if (level.dimension() == TRDDimensions.TARDIS) {
|
||||||
TardimData data = TardimManager.getFromPos(blockPos);
|
TardimData data = TardimManager.getFromPos(blockPos);
|
||||||
if (data != null && !level.isClientSide && ((RedstoneInputTileEntity) be).lastPlayer != null) {
|
if (data != null && !level.isClientSide && ((RedstoneInputBlockEntity) be).lastPlayer != null) {
|
||||||
if (((TileEntityBaseTardimPanel)be).hasCommand()) {
|
if (((TileEntityBaseTardimPanel)be).hasCommand()) {
|
||||||
((TileEntityBaseTardimPanel)be).execute(new FakePlayer(level, blockPos, ((RedstoneInputTileEntity) be).lastPlayer));
|
((TileEntityBaseTardimPanel)be).execute(new FakePlayer(level, blockPos, ((RedstoneInputBlockEntity) be).lastPlayer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (redstoneSignal == 0 && ((RedstoneInputTileEntity) be).isPowered)
|
} else if (redstoneSignal == 0 && ((RedstoneInputBlockEntity) be).isPowered) {
|
||||||
((RedstoneInputTileEntity) be).isPowered = false;
|
((RedstoneInputBlockEntity) be).isPowered = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,17 +5,17 @@ import com.swdteam.tardim.tileentity.TileEntityBaseTardimPanel;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
import su.a71.tardim_ic.tardim_ic.registration.Registration;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
public class RedstoneInputTileEntity extends TileEntityBaseTardimPanel {
|
public class RedstoneInputBlockEntity extends TileEntityBaseTardimPanel {
|
||||||
public boolean isPowered = false;
|
public boolean isPowered = false;
|
||||||
public UUID lastPlayer = null;
|
public UUID lastPlayer = null;
|
||||||
|
|
||||||
public RedstoneInputTileEntity(BlockPos pos, BlockState state) {
|
public RedstoneInputBlockEntity(BlockPos pos, BlockState state) {
|
||||||
super(Registration.REDSTONE_TARDIM_INPUT_TILEENTITY, pos, state);
|
super(Registration.REDSTONE_INPUT_BE, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockPos getPos() {
|
public BlockPos getPos() {
|
|
@ -10,7 +10,6 @@ import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
|
||||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This command transmits the cloister bell sound in a big enough radius that you could hear it in any reasonably sized interior.
|
This command transmits the cloister bell sound in a big enough radius that you could hear it in any reasonably sized interior.
|
||||||
|
@ -23,16 +22,17 @@ public class CommandCloisterBell implements ICommand {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
if (data.hasPermission(player)) {
|
if (data.hasPermission(player)) {
|
||||||
try {
|
try {
|
||||||
Level lvl = player.getLevel();
|
Level lvl = player.level();
|
||||||
if (!lvl.isClientSide) {
|
if (!lvl.isClientSide) {
|
||||||
lvl.playSound(
|
// lvl.playSound(
|
||||||
null,
|
// null,
|
||||||
pos,
|
// pos,
|
||||||
Registration.CLOISTER_SOUND_EVENT,
|
// Registration.CLOISTER_SOUND_EVENT,
|
||||||
SoundSource.BLOCKS,
|
// SoundSource.BLOCKS,
|
||||||
1.5f,
|
// 1.5f,
|
||||||
1f
|
// 1f
|
||||||
);
|
// );
|
||||||
|
// TODO: Re-add
|
||||||
}
|
}
|
||||||
} catch (Exception var9) {
|
} catch (Exception var9) {
|
||||||
CommandTardimBase.sendResponse(player, "There was an error", CommandTardimBase.ResponseType.FAIL, source);
|
CommandTardimBase.sendResponse(player, "There was an error", CommandTardimBase.ResponseType.FAIL, source);
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
package su.a71.tardim_ic.tardim_ic.registration;
|
package su.a71.tardim_ic.command;
|
||||||
|
|
||||||
|
|
||||||
import com.swdteam.tardim.common.init.CommandManager;
|
import com.swdteam.tardim.common.init.CommandManager;
|
||||||
|
|
||||||
import su.a71.tardim_ic.command.CommandCloisterBell;
|
|
||||||
import su.a71.tardim_ic.command.CommandListBiomes;
|
|
||||||
import su.a71.tardim_ic.command.CommandListDimensions;
|
|
||||||
|
|
||||||
public class CommandInit {
|
public class CommandInit {
|
||||||
public static void init() {
|
public static void init() {
|
||||||
|
CommandManager.register(new CommandCloisterBell());
|
||||||
CommandManager.register(new CommandListBiomes());
|
CommandManager.register(new CommandListBiomes());
|
||||||
CommandManager.register(new CommandListDimensions());
|
CommandManager.register(new CommandListDimensions());
|
||||||
CommandManager.register(new CommandCloisterBell());
|
}
|
||||||
|
|
||||||
|
public static void addCC() {
|
||||||
|
CommandManager.register(new CommandModemTransmit());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,37 +0,0 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat;
|
|
||||||
|
|
||||||
import com.swdteam.tardim.common.block.BlockFuelStorage;
|
|
||||||
import com.swdteam.tardim.common.block.BlockRotor;
|
|
||||||
import com.swdteam.tardim.common.block.BlockTardimScanner;
|
|
||||||
import dan200.computercraft.api.peripheral.IPeripheral;
|
|
||||||
import dan200.computercraft.api.peripheral.IPeripheralProvider;
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.core.Direction;
|
|
||||||
import net.minecraft.world.level.Level;
|
|
||||||
import net.minecraft.world.level.block.Block;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import su.a71.tardim_ic.computercraft_compat.peripherals.TimeRotorPeripheral;
|
|
||||||
import su.a71.tardim_ic.computercraft_compat.peripherals.FuelStoragePeripheral;
|
|
||||||
import su.a71.tardim_ic.computercraft_compat.peripherals.TardimScannerPeripheral;
|
|
||||||
import su.a71.tardim_ic.computercraft_compat.blocks.digital_interface.DigitalInterfaceBlock;
|
|
||||||
import su.a71.tardim_ic.computercraft_compat.peripherals.DigitalInterfacePeripheral;
|
|
||||||
|
|
||||||
public class TardimPeripheralProvider implements IPeripheralProvider {
|
|
||||||
@Override
|
|
||||||
public IPeripheral getPeripheral(@NotNull Level level, @NotNull BlockPos blockPos, @NotNull Direction direction) {
|
|
||||||
if (level.isClientSide()) return null; // Please...?
|
|
||||||
|
|
||||||
Block block = level.getBlockState(blockPos).getBlock();
|
|
||||||
if (block instanceof DigitalInterfaceBlock) {
|
|
||||||
return new DigitalInterfacePeripheral(new FakeTardimPeripheralTileEntity(blockPos, level));
|
|
||||||
} else if (block instanceof BlockFuelStorage) {
|
|
||||||
return new FuelStoragePeripheral(new FakeTardimPeripheralTileEntity(blockPos, level));
|
|
||||||
} else if (block instanceof BlockRotor) {
|
|
||||||
return new TimeRotorPeripheral(new FakeTardimPeripheralTileEntity(blockPos, level));
|
|
||||||
} else if (block instanceof BlockTardimScanner) {
|
|
||||||
return new TardimScannerPeripheral(new FakeTardimPeripheralTileEntity(blockPos, level));
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat.blocks.digital_interface;
|
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
|
||||||
|
|
||||||
import su.a71.tardim_ic.tardim_ic.registration.ComputerCraftCompat;
|
|
||||||
|
|
||||||
|
|
||||||
public class DigitalInterfaceTileEntity extends BlockEntity {//implements IDigitalInterfaceEntity {
|
|
||||||
public DigitalInterfaceTileEntity(BlockPos pos, BlockState state) {
|
|
||||||
super(ComputerCraftCompat.DIGITAL_TARDIM_INTERFACE_TILEENTITY, pos, state);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +1,12 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat.blocks.digital_interface;
|
package su.a71.tardim_ic.computercraft_compat.digital_interface;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.EntityBlock;
|
import net.minecraft.world.level.block.EntityBlock;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
import net.minecraft.world.level.material.MapColor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
|
||||||
import su.a71.tardim_ic.tardim_ic.registration.ComputerCraftCompat;
|
import su.a71.tardim_ic.tardim_ic.registration.ComputerCraftCompat;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
@ -16,12 +15,12 @@ import javax.annotation.Nullable;
|
||||||
public class DigitalInterfaceBlock extends Block implements EntityBlock {
|
public class DigitalInterfaceBlock extends Block implements EntityBlock {
|
||||||
|
|
||||||
public DigitalInterfaceBlock() {
|
public DigitalInterfaceBlock() {
|
||||||
super(Properties.of(Material.METAL).strength(2, 4).noOcclusion());
|
super(Properties.of().strength(2, 4).noOcclusion().mapColor(MapColor.METAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
|
||||||
return ComputerCraftCompat.DIGITAL_TARDIM_INTERFACE_TILEENTITY.create(pos, state);
|
return ComputerCraftCompat.DIGITAL_INTERFACE_BE.create(pos, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package su.a71.tardim_ic.computercraft_compat.digital_interface;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
|
import static su.a71.tardim_ic.tardim_ic.registration.ComputerCraftCompat.DIGITAL_INTERFACE_BE;
|
||||||
|
|
||||||
|
|
||||||
|
public class DigitalInterfaceTileEntity extends BlockEntity {
|
||||||
|
public DigitalInterfaceTileEntity(BlockPos pos, BlockState state) {
|
||||||
|
super(DIGITAL_INTERFACE_BE, pos, state);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +1,9 @@
|
||||||
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
package su.a71.tardim_ic.computercraft_compat.peripherals;
|
||||||
|
|
||||||
import com.swdteam.tardim.common.command.tardim.CommandTravel;
|
import com.swdteam.tardim.common.command.tardim.CommandTravel;
|
||||||
import com.swdteam.tardim.common.data.DimensionMapReloadListener;
|
|
||||||
import com.swdteam.tardim.common.init.TRDSounds;
|
import com.swdteam.tardim.common.init.TRDSounds;
|
||||||
import com.swdteam.tardim.common.init.TardimRegistry;
|
import com.swdteam.tardim.common.init.TardimRegistry;
|
||||||
import com.swdteam.tardim.common.item.ItemTardim;
|
import com.swdteam.tardim.common.item.ItemTardim;
|
||||||
import com.swdteam.tardim.main.Tardim;
|
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
import com.swdteam.tardim.tardim.TardimData;
|
||||||
import com.swdteam.tardim.tardim.TardimData.Location;
|
import com.swdteam.tardim.tardim.TardimData.Location;
|
||||||
import com.swdteam.tardim.tardim.TardimManager;
|
import com.swdteam.tardim.tardim.TardimManager;
|
||||||
|
@ -32,34 +30,27 @@ import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.levelgen.Heightmap;
|
import net.minecraft.world.level.levelgen.Heightmap;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
import su.a71.tardim_ic.computercraft_compat.FakeTardimPeripheralTileEntity;
|
import su.a71.tardim_ic.computercraft_compat.digital_interface.DigitalInterfaceBlock;
|
||||||
import su.a71.tardim_ic.Registration;
|
import su.a71.tardim_ic.computercraft_compat.entity.FakeTardimPeripheralTileEntity;
|
||||||
import su.a71.tardim_ic.utils.FakePlayer;
|
import su.a71.tardim_ic.utils.FakePlayer;
|
||||||
import static su.a71.tardim_ic.Registration.PERSONAL_JAMMER;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
public class DigitalInterfacePeripheral extends TardimPeripheral implements IPeripheral {
|
public class DigitalInterfacePeripheral extends TardimPeripheral<DigitalInterfaceBlock> implements IPeripheral {
|
||||||
/**
|
/**
|
||||||
* @param tileEntity the tile entity of this peripheral
|
* @param tileEntity the tile entity of this peripheral
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
public DigitalInterfacePeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
public DigitalInterfacePeripheral(FakeTardimPeripheralTileEntity tileEntity) {
|
||||||
super(tileEntity);
|
super(tileEntity, "digital_tardim_interface", (DigitalInterfaceBlock) tileEntity.getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Setting name for the peripheral. A computer will see it as "digital_tardim_interface_n"
|
|
||||||
* @hidden
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public String getType() { return "digital_tardim_interface"; }
|
|
||||||
|
|
||||||
// Peripheral methods ===============================================================
|
// Peripheral methods ===============================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -219,7 +210,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
* SWDteam pls fix
|
* SWDteam pls fix
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
private static boolean isValidPathTemp(String s) {
|
private boolean isValidPathTemp(String s) {
|
||||||
for(int i = 0; i < s.length(); ++i) {
|
for(int i = 0; i < s.length(); ++i) {
|
||||||
if (!CommandTravel.validPathChar(s.charAt(i))) {
|
if (!CommandTravel.validPathChar(s.charAt(i))) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -228,6 +219,32 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DimensionMapReloadListener.toTitleCase is unavailable so we reverse engineer it! :D
|
||||||
|
* Fabric... pls fix?
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
private String toTitleCase(String input) {
|
||||||
|
StringBuilder titleCase = new StringBuilder(input.length());
|
||||||
|
boolean nextTitleCase = true;
|
||||||
|
char[] var3 = input.toCharArray();
|
||||||
|
int var4 = var3.length;
|
||||||
|
|
||||||
|
for(int var5 = 0; var5 < var4; ++var5) {
|
||||||
|
char c = var3[var5];
|
||||||
|
if (Character.isSpaceChar(c)) {
|
||||||
|
nextTitleCase = true;
|
||||||
|
} else if (nextTitleCase) {
|
||||||
|
c = Character.toTitleCase(c);
|
||||||
|
nextTitleCase = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
titleCase.append(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
return titleCase.toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set dimension for the TARDIM to travel to
|
* Set dimension for the TARDIM to travel to
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -241,7 +258,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
TardimData data = getTardimData();
|
TardimData data = getTardimData();
|
||||||
|
|
||||||
String key = dimension;
|
String key = dimension;
|
||||||
dimension = DimensionMapReloadListener.toTitleCase(dimension);
|
dimension = toTitleCase(dimension);
|
||||||
if (TardimManager.DIMENSION_MAP.containsKey(dimension)) {
|
if (TardimManager.DIMENSION_MAP.containsKey(dimension)) {
|
||||||
key = (String)TardimManager.DIMENSION_MAP.get(dimension);
|
key = (String)TardimManager.DIMENSION_MAP.get(dimension);
|
||||||
} else {
|
} else {
|
||||||
|
@ -251,7 +268,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
if (!isValidPathTemp(key)) {
|
if (!isValidPathTemp(key)) {
|
||||||
throw new LuaException("Invalid dimension");
|
throw new LuaException("Invalid dimension");
|
||||||
} else {
|
} else {
|
||||||
ResourceKey<Level> dim = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(dimension));
|
ResourceKey<Level> dim = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(dimension));
|
||||||
if (data.getTravelLocation() == null) {
|
if (data.getTravelLocation() == null) {
|
||||||
data.setTravelLocation(new Location(data.getCurrentLocation()));
|
data.setTravelLocation(new Location(data.getCurrentLocation()));
|
||||||
}
|
}
|
||||||
|
@ -327,9 +344,10 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemStack armour : player.getArmorSlots()) {
|
for (ItemStack armour : player.getArmorSlots()) {
|
||||||
if (armour.is(PERSONAL_JAMMER)) {
|
// if (armour.is(PERSONAL_JAMMER)) {
|
||||||
throw new LuaException("Player location jammed");
|
// throw new LuaException("Player location jammed");
|
||||||
};
|
// };
|
||||||
|
// TODO: Re-add
|
||||||
}
|
}
|
||||||
|
|
||||||
ResourceKey<Level> dim = player.getCommandSenderWorld().dimension();
|
ResourceKey<Level> dim = player.getCommandSenderWorld().dimension();
|
||||||
|
@ -474,11 +492,29 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
|
|
||||||
// TODO: This is a horrendous way of doing this. Please fix.
|
// TODO: This is a horrendous way of doing this. Please fix.
|
||||||
String level_str = "tardim:tardis_dimension";
|
String level_str = "tardim:tardis_dimension";
|
||||||
this.tileEntity.getLevel().getServer().getLevel(ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(level_str))).playSound(null, this.tileEntity.getPos(), (SoundEvent) TRDSounds.TARDIM_TAKEOFF, SoundSource.AMBIENT, 1.0F, 1.0F);
|
this.tileEntity.getLevel().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(level_str))).playSound(null, this.tileEntity.getPos(), (SoundEvent) TRDSounds.TARDIM_TAKEOFF, SoundSource.AMBIENT, 1.0F, 1.0F);
|
||||||
|
|
||||||
data.save();
|
data.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Way to use function from Tardim (ModInitializer)
|
||||||
|
* 1WTC pls fix
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
public static boolean isPosValid(Level level, BlockPos pos) {
|
||||||
|
return validPos(level, pos) && validPos(level, pos.above()) && validPos(level, pos.above().above()) && validPos(level, pos.north()) && validPos(level, pos.north().above()) && validPos(level, pos.south()) && validPos(level, pos.south().above()) && validPos(level, pos.east()) && validPos(level, pos.east().above()) && validPos(level, pos.west()) && validPos(level, pos.west().above());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see DigitalInterfacePeripheral#isPosValid(Level, BlockPos)
|
||||||
|
* @hidden
|
||||||
|
*/
|
||||||
|
private static boolean validPos(Level l, BlockPos pos) {
|
||||||
|
BlockState blockstate = l.getBlockState(pos);
|
||||||
|
return !blockstate.canBeReplaced() && blockstate.getBlock() != Blocks.SNOW ? blockstate.isAir() : true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Materialize the TARDIM at the destination
|
* Materialize the TARDIM at the destination
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -555,7 +591,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
|
|
||||||
if (Block.canSupportRigidBlock(level, landingPosButBetter.below())) {
|
if (Block.canSupportRigidBlock(level, landingPosButBetter.below())) {
|
||||||
loc.setPosition(landingPosButBetter.getX(), landingPosButBetter.getY(), landingPosButBetter.getZ());
|
loc.setPosition(landingPosButBetter.getX(), landingPosButBetter.getY(), landingPosButBetter.getZ());
|
||||||
if (Tardim.isPosValid(level, loc.getPos())) {
|
if (isPosValid(level, loc.getPos())) {
|
||||||
TardimRegistry.TardimBuilder builder = TardimRegistry.getTardimBuilder(data.getTardimID());
|
TardimRegistry.TardimBuilder builder = TardimRegistry.getTardimBuilder(data.getTardimID());
|
||||||
builder.buildTardim(level, loc.getPos(), data.getTravelLocation().getFacing(), data.getId());
|
builder.buildTardim(level, loc.getPos(), data.getTravelLocation().getFacing(), data.getId());
|
||||||
data.setCurrentLocation(data.getTravelLocation());
|
data.setCurrentLocation(data.getTravelLocation());
|
||||||
|
@ -572,7 +608,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
// }
|
// }
|
||||||
|
|
||||||
String level_str = "tardim:tardis_dimension";
|
String level_str = "tardim:tardis_dimension";
|
||||||
this.tileEntity.getLevel().getServer().getLevel(ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(level_str))).playSound(null, this.tileEntity.getPos(), (SoundEvent) TRDSounds.TARDIM_LANDING, SoundSource.AMBIENT, 1.0F, 1.0F);
|
this.tileEntity.getLevel().getServer().getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(level_str))).playSound(null, this.tileEntity.getPos(), (SoundEvent) TRDSounds.TARDIM_LANDING, SoundSource.AMBIENT, 1.0F, 1.0F);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new LuaException("TARDIM landing obstructed. Aborting...");
|
throw new LuaException("TARDIM landing obstructed. Aborting...");
|
||||||
|
@ -608,7 +644,7 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
|
|
||||||
Optional<Biome> biome = this.tileEntity.getLevel().getServer()
|
Optional<Biome> biome = this.tileEntity.getLevel().getServer()
|
||||||
.registryAccess()
|
.registryAccess()
|
||||||
.registryOrThrow(Registry.BIOME_REGISTRY)
|
.registryOrThrow(Registries.BIOME)
|
||||||
.getOptional(new ResourceLocation(biome_str));
|
.getOptional(new ResourceLocation(biome_str));
|
||||||
if (biome != null && biome.isPresent()) {
|
if (biome != null && biome.isPresent()) {
|
||||||
if (data.getTravelLocation() == null) {
|
if (data.getTravelLocation() == null) {
|
||||||
|
@ -740,14 +776,15 @@ public class DigitalInterfacePeripheral extends TardimPeripheral implements IPer
|
||||||
try {
|
try {
|
||||||
Level lvl = this.tileEntity.getLevel();
|
Level lvl = this.tileEntity.getLevel();
|
||||||
if (!lvl.isClientSide) {
|
if (!lvl.isClientSide) {
|
||||||
lvl.playSound(
|
// lvl.playSound(
|
||||||
null,
|
// null,
|
||||||
this.tileEntity.getPos(),
|
// this.tileEntity.getPos(),
|
||||||
Registration.CLOISTER_SOUND_EVENT,
|
// Registration.CLOISTER_SOUND_EVENT,
|
||||||
SoundSource.BLOCKS,
|
// SoundSource.BLOCKS,
|
||||||
1.5f,
|
// 1.5f,
|
||||||
1f
|
// 1f
|
||||||
);
|
// );
|
||||||
|
// TODO: Re-add
|
||||||
}
|
}
|
||||||
} catch (Exception var9) {
|
} catch (Exception var9) {
|
||||||
throw new LuaException("There was an error trying to play the sound");
|
throw new LuaException("There was an error trying to play the sound");
|
||||||
|
|
|
@ -1,61 +1,61 @@
|
||||||
package su.a71.tardim_ic.display_source.fuel_storage;
|
//package su.a71.tardim_ic.display_source.fuel_storage;
|
||||||
|
//
|
||||||
|
//
|
||||||
import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext;
|
//import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext;
|
||||||
import com.simibubi.create.content.redstone.displayLink.source.PercentOrProgressBarDisplaySource;
|
//import com.simibubi.create.content.redstone.displayLink.source.PercentOrProgressBarDisplaySource;
|
||||||
import com.simibubi.create.foundation.gui.ModularGuiLineBuilder;
|
//import com.simibubi.create.foundation.gui.ModularGuiLineBuilder;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
//import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
//
|
||||||
import com.swdteam.tardim.common.init.TRDDimensions;
|
//import com.swdteam.tardim.common.init.TRDDimensions;
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
//import com.swdteam.tardim.tardim.TardimData;
|
||||||
import com.swdteam.tardim.tardim.TardimManager;
|
//import com.swdteam.tardim.tardim.TardimManager;
|
||||||
import com.swdteam.tardim.tileentity.TileEntityFuelStorage;
|
//import com.swdteam.tardim.tileentity.TileEntityFuelStorage;
|
||||||
|
//
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
//import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.fabricmc.api.EnvType;
|
//import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
//import net.fabricmc.api.Environment;
|
||||||
|
//
|
||||||
import static su.a71.tardim_ic.tardim_ic.Constants.LOG;
|
//import static su.a71.tardim_ic.tardim_ic.Constants.LOG;
|
||||||
|
//
|
||||||
public class FuelLevelDisplaySource extends PercentOrProgressBarDisplaySource {
|
//public class FuelLevelDisplaySource extends PercentOrProgressBarDisplaySource {
|
||||||
@Override
|
// @Override
|
||||||
protected Float getProgress(DisplayLinkContext context) {
|
// protected Float getProgress(DisplayLinkContext context) {
|
||||||
if (context.level() != context.level().getServer().getLevel(TRDDimensions.TARDIS)) {
|
// if (context.level() != context.level().getServer().getLevel(TRDDimensions.TARDIS)) {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
BlockEntity te = context.getSourceBlockEntity();
|
// BlockEntity te = context.getSourceBlockEntity();
|
||||||
if (!(te instanceof TileEntityFuelStorage fuelStorage))
|
// if (!(te instanceof TileEntityFuelStorage fuelStorage))
|
||||||
return null;
|
// return null;
|
||||||
TardimData data = TardimManager.getFromPos(fuelStorage.getBlockPos());
|
// TardimData data = TardimManager.getFromPos(fuelStorage.getBlockPos());
|
||||||
LOG.info(String.valueOf((float) (data.getFuel())));
|
// LOG.info(String.valueOf((float) (data.getFuel())));
|
||||||
return (float) (data.getFuel() / 100);
|
// return (float) (data.getFuel() / 100);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected boolean progressBarActive(DisplayLinkContext context) {
|
// protected boolean progressBarActive(DisplayLinkContext context) {
|
||||||
return context.sourceConfig()
|
// return context.sourceConfig()
|
||||||
.getInt("Mode") != 0;
|
// .getInt("Mode") != 0;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected String getTranslationKey() {
|
// protected String getTranslationKey() {
|
||||||
return "fuel_level";
|
// return "fuel_level";
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
@Environment(EnvType.CLIENT)
|
// @Environment(EnvType.CLIENT)
|
||||||
public void initConfigurationWidgets(DisplayLinkContext context, ModularGuiLineBuilder builder, boolean isFirstLine) {
|
// public void initConfigurationWidgets(DisplayLinkContext context, ModularGuiLineBuilder builder, boolean isFirstLine) {
|
||||||
super.initConfigurationWidgets(context, builder, isFirstLine);
|
// super.initConfigurationWidgets(context, builder, isFirstLine);
|
||||||
if (isFirstLine)
|
// if (isFirstLine)
|
||||||
return;
|
// return;
|
||||||
builder.addSelectionScrollInput(0, 120,
|
// builder.addSelectionScrollInput(0, 120,
|
||||||
(si, l) -> si.forOptions(Lang.translatedOptions("display_source.fuel_level", "percent", "progress_bar"))
|
// (si, l) -> si.forOptions(Lang.translatedOptions("display_source.fuel_level", "percent", "progress_bar"))
|
||||||
.titled(Lang.translateDirect("display_source.fuel_level.display")),
|
// .titled(Lang.translateDirect("display_source.fuel_level.display")),
|
||||||
"Mode");
|
// "Mode");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
protected boolean allowsLabeling(DisplayLinkContext context) {
|
// protected boolean allowsLabeling(DisplayLinkContext context) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
package su.a71.tardim_ic.display_source.fuel_storage;
|
//package su.a71.tardim_ic.display_source.fuel_storage;
|
||||||
|
//
|
||||||
import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext;
|
//import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext;
|
||||||
import com.simibubi.create.content.redstone.displayLink.source.NumericSingleLineDisplaySource;
|
//import com.simibubi.create.content.redstone.displayLink.source.NumericSingleLineDisplaySource;
|
||||||
import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats;
|
//import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats;
|
||||||
import com.simibubi.create.foundation.utility.Components;
|
//import com.simibubi.create.foundation.utility.Components;
|
||||||
|
//
|
||||||
import com.swdteam.tardim.common.init.TRDDimensions;
|
//import com.swdteam.tardim.common.init.TRDDimensions;
|
||||||
import com.swdteam.tardim.tardim.TardimData;
|
//import com.swdteam.tardim.tardim.TardimData;
|
||||||
import com.swdteam.tardim.tardim.TardimManager;
|
//import com.swdteam.tardim.tardim.TardimManager;
|
||||||
import com.swdteam.tardim.tileentity.TileEntityFuelStorage;
|
//import com.swdteam.tardim.tileentity.TileEntityFuelStorage;
|
||||||
|
//
|
||||||
import net.minecraft.network.chat.MutableComponent;
|
//import net.minecraft.network.chat.MutableComponent;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
//import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.phys.Vec3;
|
//import net.minecraft.world.phys.Vec3;
|
||||||
|
//
|
||||||
public class RequiredFuelDisplaySource extends NumericSingleLineDisplaySource {
|
//public class RequiredFuelDisplaySource extends NumericSingleLineDisplaySource {
|
||||||
@Override
|
// @Override
|
||||||
protected MutableComponent provideLine(DisplayLinkContext displayLinkContext, DisplayTargetStats displayTargetStats) {
|
// protected MutableComponent provideLine(DisplayLinkContext displayLinkContext, DisplayTargetStats displayTargetStats) {
|
||||||
if (displayLinkContext.level() != displayLinkContext.level().getServer().getLevel(TRDDimensions.TARDIS))
|
// if (displayLinkContext.level() != displayLinkContext.level().getServer().getLevel(TRDDimensions.TARDIS))
|
||||||
return null;
|
// return null;
|
||||||
BlockEntity te = displayLinkContext.getSourceBlockEntity();
|
// BlockEntity te = displayLinkContext.getSourceBlockEntity();
|
||||||
if (!(te instanceof TileEntityFuelStorage fuelStorage))
|
// if (!(te instanceof TileEntityFuelStorage fuelStorage))
|
||||||
return null;
|
// return null;
|
||||||
TardimData data = TardimManager.getFromPos(fuelStorage.getBlockPos());
|
// TardimData data = TardimManager.getFromPos(fuelStorage.getBlockPos());
|
||||||
|
//
|
||||||
if (data.getTravelLocation() == null) return ZERO.copy();
|
// if (data.getTravelLocation() == null) return ZERO.copy();
|
||||||
|
//
|
||||||
TardimData.Location curr = data.getCurrentLocation();
|
// TardimData.Location curr = data.getCurrentLocation();
|
||||||
TardimData.Location dest = data.getTravelLocation();
|
// TardimData.Location dest = data.getTravelLocation();
|
||||||
|
//
|
||||||
double fuel = 0.0;
|
// double fuel = 0.0;
|
||||||
|
//
|
||||||
if (curr.getLevel() != dest.getLevel())
|
// if (curr.getLevel() != dest.getLevel())
|
||||||
{
|
// {
|
||||||
fuel = 10.0;
|
// fuel = 10.0;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Vec3 posA = new Vec3(curr.getPos().getX(), curr.getPos().getY(), curr.getPos().getZ());
|
// Vec3 posA = new Vec3(curr.getPos().getX(), curr.getPos().getY(), curr.getPos().getZ());
|
||||||
Vec3 posB = new Vec3(dest.getPos().getX(), dest.getPos().getY(), dest.getPos().getZ());
|
// Vec3 posB = new Vec3(dest.getPos().getX(), dest.getPos().getY(), dest.getPos().getZ());
|
||||||
fuel += posA.distanceTo(posB) / 100.0;
|
// fuel += posA.distanceTo(posB) / 100.0;
|
||||||
if (fuel > 100.0) fuel = 100.0;
|
// if (fuel > 100.0) fuel = 100.0;
|
||||||
|
//
|
||||||
return Components.literal(String.valueOf(fuel));
|
// return Components.literal(String.valueOf(fuel));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
protected String getTranslationKey() {
|
// protected String getTranslationKey() {
|
||||||
return "required_fuel";
|
// return "required_fuel";
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
protected boolean allowsLabeling(DisplayLinkContext context) {
|
// protected boolean allowsLabeling(DisplayLinkContext context) {
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package su.a71.tardim_ic.jammer;
|
||||||
|
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.sounds.SoundEvents;
|
import net.minecraft.sounds.SoundEvents;
|
||||||
import net.minecraft.world.entity.EquipmentSlot;
|
import net.minecraft.world.item.ArmorItem;
|
||||||
import net.minecraft.world.item.ArmorMaterial;
|
import net.minecraft.world.item.ArmorMaterial;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
|
@ -14,13 +14,13 @@ public class PersonalJammerMaterial implements ArmorMaterial {
|
||||||
private static final int[] PROTECTION_VALUES = new int[] {1, 1, 1, 1};
|
private static final int[] PROTECTION_VALUES = new int[] {1, 1, 1, 1};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDurabilityForSlot(EquipmentSlot slot) {
|
public int getDurabilityForType(ArmorItem.Type type) {
|
||||||
return BASE_DURABILITY[slot.getIndex()] * 33;
|
return BASE_DURABILITY[type.getSlot().getIndex()] * 33;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDefenseForSlot(EquipmentSlot slot) {
|
public int getDefenseForType(ArmorItem.Type type) {
|
||||||
return PROTECTION_VALUES[slot.getIndex()];
|
return PROTECTION_VALUES[type.getSlot().getIndex()];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package su.a71.tardim_ic.mixin;
|
||||||
|
|
||||||
|
import com.swdteam.tardim.common.init.CommandManager;
|
||||||
|
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;
|
||||||
|
import su.a71.tardim_ic.command.CommandInit;
|
||||||
|
import su.a71.tardim_ic.platform.Services;
|
||||||
|
|
||||||
|
@Mixin(value = CommandManager.class, remap = false)
|
||||||
|
public class CommandsMixin {
|
||||||
|
@Inject(method="init()V", at=@At("TAIL"))
|
||||||
|
private static void init(CallbackInfo ci) {
|
||||||
|
CommandInit.init();
|
||||||
|
if (Services.PLATFORM.isModLoaded("computercraft")) {
|
||||||
|
CommandInit.addCC();
|
||||||
|
}
|
||||||
|
System.out.println("TARDIM: IC added commands using mixin");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,10 +1,9 @@
|
||||||
package su.a71.tardim_ic.platform;
|
package su.a71.tardim_ic.platform;
|
||||||
|
|
||||||
import com.example.examplemod.platform.services.IPlatformHelper;
|
import su.a71.tardim_ic.platform.services.IPlatformHelper;
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
|
||||||
public class FabricPlatformHelper implements IPlatformHelper {
|
public class FabricPlatformHelper implements IPlatformHelper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPlatformName() {
|
public String getPlatformName() {
|
||||||
return "Fabric";
|
return "Fabric";
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.swdteam.tardim.common.init.TRDTiles;
|
||||||
import com.swdteam.tardim.tileentity.TileEntityTardim;
|
import com.swdteam.tardim.tileentity.TileEntityTardim;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
|
||||||
import su.a71.tardim_ic.tardim_ic.registration.Exteriors;
|
import su.a71.tardim_ic.tardim_ic.registration.Exteriors;
|
||||||
|
|
||||||
public class SovietChronoboxTileEntity extends TileEntityTardim {
|
public class SovietChronoboxTileEntity extends TileEntityTardim {
|
||||||
|
|
|
@ -2,25 +2,29 @@ package su.a71.tardim_ic.tardim_ic.registration;
|
||||||
|
|
||||||
import com.swdteam.tardim.common.init.CommandManager;
|
import com.swdteam.tardim.common.init.CommandManager;
|
||||||
import dan200.computercraft.api.ComputerCraftAPI;
|
import dan200.computercraft.api.ComputerCraftAPI;
|
||||||
|
import dan200.computercraft.api.peripheral.PeripheralLookup;
|
||||||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
|
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
import net.minecraft.core.registries.Registries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.world.item.BlockItem;
|
import net.minecraft.world.item.BlockItem;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import su.a71.tardim_ic.tardim_ic.Constants;
|
import su.a71.tardim_ic.Constants;
|
||||||
import su.a71.tardim_ic.tardim_ic.Registration;
|
|
||||||
import su.a71.tardim_ic.command.CommandModemTransmit;
|
import su.a71.tardim_ic.command.CommandModemTransmit;
|
||||||
import su.a71.tardim_ic.computercraft_compat.TardimPeripheralProvider;
|
import su.a71.tardim_ic.computercraft_compat.digital_interface.DigitalInterfaceBlock;
|
||||||
import su.a71.tardim_ic.computercraft_compat.blocks.digital_interface.DigitalInterfaceBlock;
|
import su.a71.tardim_ic.computercraft_compat.digital_interface.DigitalInterfaceTileEntity;
|
||||||
import su.a71.tardim_ic.computercraft_compat.blocks.digital_interface.DigitalInterfaceTileEntity;
|
|
||||||
|
import static su.a71.tardim_ic.tardim_ic.registration.Registration.registerBlock;
|
||||||
|
//import su.a71.tardim_ic.computercraft_compat.blocks.digital_interface.DigitalInterfaceTileEntity;
|
||||||
|
|
||||||
public class ComputerCraftCompat {
|
public class ComputerCraftCompat {
|
||||||
public static final Block DIGITAL_TARDIM_INTERFACE = new DigitalInterfaceBlock();
|
public static final Block DIGITAL_TARDIM_INTERFACE = new DigitalInterfaceBlock();
|
||||||
|
|
||||||
public static final BlockEntityType<DigitalInterfaceTileEntity> DIGITAL_TARDIM_INTERFACE_TILEENTITY = Registry.register(
|
public static final BlockEntityType<DigitalInterfaceTileEntity> DIGITAL_INTERFACE_BE = Registry.register(
|
||||||
Registry.BLOCK_ENTITY_TYPE,
|
BuiltInRegistries.BLOCK_ENTITY_TYPE,
|
||||||
new ResourceLocation("tardim_ic", "digital_tardim_interface"),
|
new ResourceLocation("tardim_ic", "digital_tardim_interface"),
|
||||||
FabricBlockEntityTypeBuilder.create(DigitalInterfaceTileEntity::new, DIGITAL_TARDIM_INTERFACE).build()
|
FabricBlockEntityTypeBuilder.create(DigitalInterfaceTileEntity::new, DIGITAL_TARDIM_INTERFACE).build()
|
||||||
);
|
);
|
||||||
|
@ -28,10 +32,15 @@ public class ComputerCraftCompat {
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Constants.LOG.info("Loaded ComputerCraft compatibility!");
|
Constants.LOG.info("Loaded ComputerCraft compatibility!");
|
||||||
|
|
||||||
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(Registration.TARDIM_IC_TAB)));
|
|
||||||
|
|
||||||
CommandManager.register(new CommandModemTransmit());
|
registerBlock("digital_tardim_interface", () -> DIGITAL_TARDIM_INTERFACE, null);
|
||||||
ComputerCraftAPI.registerPeripheralProvider(new TardimPeripheralProvider());
|
//
|
||||||
|
// 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(Registration.TARDIM_IC_TAB)));
|
||||||
|
|
||||||
|
// CommandManager.register(new CommandModemTransmit());
|
||||||
|
// PeripheralLookup.get().registerSelf();
|
||||||
|
|
||||||
|
// ComputerCraftAPI.registerPeripheralProvider(new TardimPeripheralProvider());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
package su.a71.tardim_ic.tardim_ic.registration;
|
package su.a71.tardim_ic.tardim_ic.registration;
|
||||||
|
|
||||||
|
|
||||||
import com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours;
|
//import com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import su.a71.tardim_ic.tardim_ic.Constants;
|
import su.a71.tardim_ic.Constants;
|
||||||
import su.a71.tardim_ic.display_source.fuel_storage.FuelLevelDisplaySource;
|
//import su.a71.tardim_ic.display_source.fuel_storage.FuelLevelDisplaySource;
|
||||||
import su.a71.tardim_ic.display_source.fuel_storage.RequiredFuelDisplaySource;
|
//import su.a71.tardim_ic.display_source.fuel_storage.RequiredFuelDisplaySource;
|
||||||
|
//
|
||||||
import static com.swdteam.tardim.common.init.TRDTiles.TILE_FUEL_STORAGE;
|
//import static com.swdteam.tardim.common.init.TRDTiles.TILE_FUEL_STORAGE;
|
||||||
|
|
||||||
public class CreateCompat {
|
public class CreateCompat {
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Constants.LOG.info("Loaded Create compatibility!");
|
Constants.LOG.info("Loaded Create compatibility!");
|
||||||
|
//
|
||||||
AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(Constants.MOD_ID, "fuel_storage_display_source"), new FuelLevelDisplaySource()), TILE_FUEL_STORAGE);
|
// AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(Constants.MOD_ID, "fuel_storage_display_source"), new FuelLevelDisplaySource()), TILE_FUEL_STORAGE);
|
||||||
AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(Constants.MOD_ID, "fuel_required_display_source"), new RequiredFuelDisplaySource()), TILE_FUEL_STORAGE);
|
// AllDisplayBehaviours.assignBlockEntity(AllDisplayBehaviours.register(new ResourceLocation(Constants.MOD_ID, "fuel_required_display_source"), new RequiredFuelDisplaySource()), TILE_FUEL_STORAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityT
|
||||||
import net.minecraft.Util;
|
import net.minecraft.Util;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.datafix.fixes.References;
|
import net.minecraft.util.datafix.fixes.References;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
|
@ -19,8 +20,7 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
import net.minecraft.world.level.block.entity.BlockEntityTicker;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
import su.a71.tardim_ic.Constants;
|
||||||
import su.a71.tardim_ic.tardim_ic.Constants;
|
|
||||||
import su.a71.tardim_ic.soviet_chronobox.SovietChronoboxTileEntity;
|
import su.a71.tardim_ic.soviet_chronobox.SovietChronoboxTileEntity;
|
||||||
|
|
||||||
public class Exteriors {
|
public class Exteriors {
|
||||||
|
@ -33,11 +33,11 @@ public class Exteriors {
|
||||||
|
|
||||||
private static <T extends BlockEntity> BlockEntityType<T> createTardimTile(String string, FabricBlockEntityTypeBuilder<T> builder) {
|
private static <T extends BlockEntity> BlockEntityType<T> createTardimTile(String string, FabricBlockEntityTypeBuilder<T> builder) {
|
||||||
Type<?> type = Util.fetchChoiceType(References.BLOCK_ENTITY, string);
|
Type<?> type = Util.fetchChoiceType(References.BLOCK_ENTITY, string);
|
||||||
return (BlockEntityType) Registry.register(Registry.BLOCK_ENTITY_TYPE, new ResourceLocation(Constants.MOD_ID, string), builder.build(type));
|
return (BlockEntityType) Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, new ResourceLocation(Constants.MOD_ID, string), builder.build(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
FLOOR_SOVIET_CHRONOBOX = Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_floor_soviet"), new BlockTardimFloor(FabricBlockSettings.of(Material.WOOD).sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion(), new BlockTardimFloor.TardimTileData() {
|
FLOOR_SOVIET_CHRONOBOX = Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_floor_soviet"), new BlockTardimFloor(FabricBlockSettings.create().sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion(), new BlockTardimFloor.TardimTileData() {
|
||||||
public BlockEntityType<TileEntityTardim> getType() {
|
public BlockEntityType<TileEntityTardim> getType() {
|
||||||
return TILE_SOVIET_CHRONOBOX;
|
return TILE_SOVIET_CHRONOBOX;
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,8 @@ public class Exteriors {
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
TILE_SOVIET_CHRONOBOX = createTardimTile("tardim_soviet_chronobox", FabricBlockEntityTypeBuilder.create(SovietChronoboxTileEntity::new, new Block[]{FLOOR_SOVIET_CHRONOBOX}));
|
TILE_SOVIET_CHRONOBOX = createTardimTile("tardim_soviet_chronobox", FabricBlockEntityTypeBuilder.create(SovietChronoboxTileEntity::new, new Block[]{FLOOR_SOVIET_CHRONOBOX}));
|
||||||
DOOR_SOVIET_CHRONOBOX = Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_door_soviet"), new BlockTardimDoors(FabricBlockSettings.of(Material.WOOD).sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion()));
|
DOOR_SOVIET_CHRONOBOX = Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_door_soviet"), new BlockTardimDoors(FabricBlockSettings.create().sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion()));
|
||||||
ROOF_SOVIET_CHRONOBOX = Registry.register(Registry.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_roof_soviet"), new BlockTardimRoof(FabricBlockSettings.of(Material.WOOD).sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion()));
|
ROOF_SOVIET_CHRONOBOX = Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Constants.MOD_ID, "tardim_roof_soviet"), new BlockTardimRoof(FabricBlockSettings.create().sounds(SoundType.WOOD).strength(-1.0F, 3600000.0F).noLootTable().noOcclusion()));
|
||||||
TARDIM_TYPE_SOVIET = new TardimRegistry.TardimBuilder(new ResourceLocation(Constants.MOD_ID, "tardim_soviet_chronobox"), "TARDIM Soviet Chronobox", ROOF_SOVIET_CHRONOBOX, DOOR_SOVIET_CHRONOBOX, FLOOR_SOVIET_CHRONOBOX);
|
TARDIM_TYPE_SOVIET = new TardimRegistry.TardimBuilder(new ResourceLocation(Constants.MOD_ID, "tardim_soviet_chronobox"), "TARDIM Soviet Chronobox", ROOF_SOVIET_CHRONOBOX, DOOR_SOVIET_CHRONOBOX, FLOOR_SOVIET_CHRONOBOX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package su.a71.tardim_ic.tardim_ic.registration;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
||||||
|
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
|
||||||
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
import net.minecraft.core.Registry;
|
||||||
|
import net.minecraft.core.registries.BuiltInRegistries;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.item.BlockItem;
|
||||||
|
import net.minecraft.world.item.CreativeModeTab;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
|
import su.a71.tardim_ic.Constants;
|
||||||
|
import su.a71.tardim_ic.blocks.food_machine.FoodMachineBlock;
|
||||||
|
import su.a71.tardim_ic.blocks.food_machine.FoodMachineBlockEntity;
|
||||||
|
import su.a71.tardim_ic.blocks.redstone_input.RedstoneInputBlock;
|
||||||
|
import su.a71.tardim_ic.blocks.redstone_input.RedstoneInputBlockEntity;
|
||||||
|
import su.a71.tardim_ic.computercraft_compat.digital_interface.DigitalInterfaceBlock;
|
||||||
|
import su.a71.tardim_ic.computercraft_compat.digital_interface.DigitalInterfaceTileEntity;
|
||||||
|
import su.a71.tardim_ic.platform.Services;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
public class Registration {
|
||||||
|
public static final Block REDSTONE_INPUT = new RedstoneInputBlock();
|
||||||
|
public static final BlockEntityType<RedstoneInputBlockEntity> REDSTONE_INPUT_BE = Registry.register(
|
||||||
|
BuiltInRegistries.BLOCK_ENTITY_TYPE,
|
||||||
|
new ResourceLocation("tardim_ic", "redstone_tardim_input"),
|
||||||
|
FabricBlockEntityTypeBuilder.create(RedstoneInputBlockEntity::new, REDSTONE_INPUT).build()
|
||||||
|
);
|
||||||
|
|
||||||
|
public static final Block FOOD_MACHINE = new FoodMachineBlock();
|
||||||
|
public static final BlockEntityType<FoodMachineBlockEntity> FOOD_MACHINE_BE = Registry.register(
|
||||||
|
BuiltInRegistries.BLOCK_ENTITY_TYPE,
|
||||||
|
new ResourceLocation("tardim_ic", "food_machine"),
|
||||||
|
FabricBlockEntityTypeBuilder.create(FoodMachineBlockEntity::new, FOOD_MACHINE).build()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
public static void registerBlock(String name, Supplier<? extends Block> supplier, CreativeModeTab tab)
|
||||||
|
{
|
||||||
|
Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Constants.MOD_ID, name), supplier.get());
|
||||||
|
BlockItem blockItem = new BlockItem(supplier.get(), new FabricItemSettings());
|
||||||
|
Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(Constants.MOD_ID, name), blockItem);
|
||||||
|
|
||||||
|
// Optional<ResourceKey<CreativeModeTab>> key = Optional.ofNullable(BuiltInRegistries.CREATIVE_MODE_TAB.getKey(tab));
|
||||||
|
// key.ifPresent(itemGroupRegistryKey -> ItemGroupEvents.modifyEntriesEvent(itemGroupRegistryKey).register(content -> {
|
||||||
|
// content.add(blockItem);
|
||||||
|
// }));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
registerBlock("redstone_tardim_input", () -> REDSTONE_INPUT, null);
|
||||||
|
registerBlock("food_machine", () -> FOOD_MACHINE, null);
|
||||||
|
|
||||||
|
Exteriors.register();
|
||||||
|
if (FabricLoader.getInstance().isModLoaded("computercraft")) {
|
||||||
|
ComputerCraftCompat.register();
|
||||||
|
}
|
||||||
|
if (FabricLoader.getInstance().isModLoaded("create")) {
|
||||||
|
CreateCompat.register();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
com.example.examplemod.platform.FabricPlatformHelper
|
|
|
@ -0,0 +1 @@
|
||||||
|
su.a71.tardim_ic.platform.FabricPlatformHelper
|
|
@ -2,7 +2,7 @@
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "tardim_ic",
|
"id": "tardim_ic",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"name": "${mod_name}",
|
"name": "TARDIM: In Control",
|
||||||
"description": "All of time and space, now automated and improved. This mod aims to improve your TARDIM experience",
|
"description": "All of time and space, now automated and improved. This mod aims to improve your TARDIM experience",
|
||||||
"authors": [
|
"authors": [
|
||||||
"${mod_author}"
|
"${mod_author}"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.14",
|
"fabricloader": ">=0.14",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "1.20",
|
"minecraft": ">=1.20.1",
|
||||||
"java": ">=17",
|
"java": ">=17",
|
||||||
"tardim": ">=1.2.2"
|
"tardim": ">=1.2.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
{
|
{
|
||||||
"required": true,
|
"required": true,
|
||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "com.example.examplemod.mixin",
|
"package": "su.a71.tardim_ic.mixin",
|
||||||
"refmap": "${mod_id}.refmap.json",
|
"refmap": "${mod_id}.refmap.json",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"MixinTitleScreen"
|
|
||||||
],
|
],
|
||||||
"server": [
|
"server": [
|
||||||
],
|
],
|
||||||
|
|
|
@ -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();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "tardim_ic:block/digital_tardim_interface"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "tardim_ic:block/redstone_tardim_input"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
Forge/src/main/resources/assets/tardim_ic/icon.png
Normal file
BIN
Forge/src/main/resources/assets/tardim_ic/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 72 KiB |
|
@ -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"
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
5
Forge/src/main/resources/assets/tardim_ic/lang/rpr.json
Normal file
5
Forge/src/main/resources/assets/tardim_ic/lang/rpr.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"block.tardim_ic.digital_tardim_interface": "Циферный Интерфейсъ Хронобудки",
|
||||||
|
"block.tardim_ic.redstone_tardim_input": "Краснокаменный Инпутъ Хронобудки",
|
||||||
|
"itemGroup.tardim_ic": "ТАРДИМЪ: Подъ Контрольемъ"
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"block.tardim_ic.digital_tardim_interface": "Цифровой интерфейс TARDIM",
|
||||||
|
"block.tardim_ic.redstone_tardim_input": "Редстоуновый ввод TARDIM",
|
||||||
|
"itemGroup.tardim_ic": "TARDIM: In Control"
|
||||||
|
}
|
|
@ -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]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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 ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 |
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"animation": {
|
||||||
|
"frametime": 10,
|
||||||
|
"interpolate": true,
|
||||||
|
"frames": [0, 1, 2, 3]
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
||||||
|
}
|
||||||
|
}
|
7
Forge/src/main/resources/pack.mcmeta
Normal file
7
Forge/src/main/resources/pack.mcmeta
Normal 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."
|
||||||
|
}
|
||||||
|
}
|
13
TODO
13
TODO
|
@ -1,5 +1,10 @@
|
||||||
== TODO for v1.2 ==
|
=== TODO ===
|
||||||
(Yes we had a lot of these)
|
Doing every fucking thing over again
|
||||||
|
|
||||||
* Good-looking documentation (MKDocs maybe?) hosted on https://tardim.a71.su
|
* Basics
|
||||||
* Full 1.20 port
|
* Registrate creative mode tab
|
||||||
|
* Registrate a single block. Any block will do
|
||||||
|
|
||||||
|
* Digital Interface for TARDIM
|
||||||
|
* Block
|
||||||
|
* Peripheral
|
|
@ -57,6 +57,12 @@ subprojects {
|
||||||
includeModule("org.squiddev", "Cobalt")
|
includeModule("org.squiddev", "Cobalt")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Curseforge
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url "https://cursemaven.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
|
20
docs/computercraft/index.md
Normal file
20
docs/computercraft/index.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# ComputerCraft compatibility
|
||||||
|
If you have ComputerCraft: Tweaked installed,
|
||||||
|
TARDIM: IC provides quite a few peripherals.
|
||||||
|
The main one is new Digital TARDIM Interface,
|
||||||
|
which gives you complete control over your TARDIM.
|
||||||
|
However, some TARDIM blocks also recieve getters for information related to them.
|
||||||
|
|
||||||
|
## ComputerCraft for beginners
|
||||||
|
ComputerCraft adds working computers to minecraft, controlled by Lua language.
|
||||||
|
If you are new, [CC's official discord](https://discord.com/servers/minecraft-computer-mods-477910221872824320) has a lot of people who can help.\
|
||||||
|
I also suggest taking a look at [Lua's website](https://www.lua.org/start.html) and [CC: Tweaked's documentaion](https://tweaked.cc)\
|
||||||
|
Please do not ask questions about CC itself in TARDIM: IC's Discord.
|
||||||
|
|
||||||
|
## Available peripherals
|
||||||
|
| Type | Description |
|
||||||
|
|-----------------------------------------------------------|----------------------------------------------------------------------------------------|
|
||||||
|
| [**Digital Interface**](peripherals/digital_interface.md) | Total control over your TARDIM. |
|
||||||
|
| [**Fuel Storage**](peripherals/fuel_storage.md) | Gives info about fuel. |
|
||||||
|
| [**TARDIM Scanner**](peripherals/tardim_scanner.md) | Gives info about TARDIM's inhabitants and things like existing biomes, online players. |
|
||||||
|
| [**Time Rotor**](peripherals/time_rotor.md) | Gives info about flight status, destination and current location. |
|
1
docs/computercraft/peripherals/digital_interface.md
Normal file
1
docs/computercraft/peripherals/digital_interface.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# Digital TARDIM Interface
|
0
docs/computercraft/peripherals/fuel_storage.md
Normal file
0
docs/computercraft/peripherals/fuel_storage.md
Normal file
0
docs/computercraft/peripherals/tardim_scanner.md
Normal file
0
docs/computercraft/peripherals/tardim_scanner.md
Normal file
0
docs/computercraft/peripherals/time_rotor.md
Normal file
0
docs/computercraft/peripherals/time_rotor.md
Normal file
3
docs/index.md
Normal file
3
docs/index.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
## Welcome to TARDIM: IC docs!
|
||||||
|
This mod aims to improve TARDIM by adding new features and integration with other mods such as ComputerCraft or Create.
|
||||||
|
|
1
docs/recipes.md
Normal file
1
docs/recipes.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
# Crafting recipes for the mod's blocks
|
|
@ -3,17 +3,17 @@ version=1.2
|
||||||
group=su.a71.tardim_ic
|
group=su.a71.tardim_ic
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
minecraft_version=1.20
|
minecraft_version=1.20.1
|
||||||
|
|
||||||
# Forge
|
# Forge
|
||||||
forge_version=46.0.12
|
forge_version=47.1.0
|
||||||
|
|
||||||
# Fabric
|
# Fabric
|
||||||
fabric_version=0.83.0+1.20
|
fabric_version=0.86.1+1.20.1
|
||||||
fabric_loader_version=0.14.21
|
fabric_loader_version=0.14.21
|
||||||
|
|
||||||
# Mod options
|
# Mod options
|
||||||
mod_name=tardim_in_control
|
mod_name=TARDIM-IC
|
||||||
mod_author=Andrew_7_1
|
mod_author=Andrew_7_1
|
||||||
mod_id=tardim_ic
|
mod_id=tardim_ic
|
||||||
|
|
||||||
|
|
92
mkdocs.yml
Normal file
92
mkdocs.yml
Normal file
|
@ -0,0 +1,92 @@
|
||||||
|
site_name: "Tardim: In Control"
|
||||||
|
site_description: "Documentation for mod TARDIM: In Control"
|
||||||
|
site_author: Andrew_7_1
|
||||||
|
|
||||||
|
copyright: Copyright © 2023 Andrey N.
|
||||||
|
|
||||||
|
nav:
|
||||||
|
- Home:
|
||||||
|
- Home: "index.md"
|
||||||
|
- Crafting recipes:
|
||||||
|
- Recipes: "recipes.md"
|
||||||
|
- ComputerCraft compatibility:
|
||||||
|
- computercraft/index.md
|
||||||
|
- Peripherals:
|
||||||
|
- Digital TARDIM Interface: computercraft/peripherals/digital_interface.md
|
||||||
|
- Fuel Storage Block: computercraft/peripherals/fuel_storage.md
|
||||||
|
- TARDIM Scanner Block: computercraft/peripherals/tardim_scanner.md
|
||||||
|
- Time Rotor Block: computercraft/peripherals/time_rotor.md
|
||||||
|
- Guides:
|
||||||
|
- guides/index.md
|
||||||
|
- Wrenches and You: guides/wrenches.md
|
||||||
|
- "Using Animatronics: The Analog Way": guides/positioningAnimatronicAnalog.md
|
||||||
|
|
||||||
|
site_url: https://tardim.a71.su/
|
||||||
|
repo_name: Andrew71/Tardim-In-Control
|
||||||
|
repo_url: https://git.a71.su/Andrew71/Tardim-In-Control
|
||||||
|
edit_uri: https://git.a71.su/Andrew71/Tardim-In-Control/src/branch/1.20/docs
|
||||||
|
|
||||||
|
extra:
|
||||||
|
social:
|
||||||
|
- icon: simple/modrinth
|
||||||
|
link: https://modrinth.com/mod/tardim_ic
|
||||||
|
name: Modrinth
|
||||||
|
- icon: simple/curseforge
|
||||||
|
link: https://www.curseforge.com/minecraft/mc-mods/tardim_ic
|
||||||
|
name: CurseForge
|
||||||
|
|
||||||
|
markdown_extensions:
|
||||||
|
- attr_list
|
||||||
|
|
||||||
|
- pymdownx.highlight:
|
||||||
|
anchor_linenums: true
|
||||||
|
line_spans: __span
|
||||||
|
pygments_lang_class: true
|
||||||
|
- pymdownx.inlinehilite
|
||||||
|
- pymdownx.snippets
|
||||||
|
- pymdownx.superfences
|
||||||
|
|
||||||
|
- admonition
|
||||||
|
- pymdownx.details
|
||||||
|
|
||||||
|
- pymdownx.emoji:
|
||||||
|
emoji_index: !!python/name:materialx.emoji.twemoji
|
||||||
|
emoji_generator: !!python/name:materialx.emoji.to_svg
|
||||||
|
|
||||||
|
- toc:
|
||||||
|
permalink: true
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- minify:
|
||||||
|
minify_html: true
|
||||||
|
minify_js: true
|
||||||
|
minify_css: true
|
||||||
|
htmlmin_opts:
|
||||||
|
remove_comments: true
|
||||||
|
- social:
|
||||||
|
- glightbox:
|
||||||
|
- search:
|
||||||
|
|
||||||
|
theme:
|
||||||
|
name: material
|
||||||
|
|
||||||
|
features:
|
||||||
|
- content.code.copy
|
||||||
|
- navigation.tracking
|
||||||
|
- navigation.instant
|
||||||
|
- navigation.tabs
|
||||||
|
- navigation.indexes
|
||||||
|
|
||||||
|
font: false
|
||||||
|
palette:
|
||||||
|
scheme: slate
|
||||||
|
primary: custom
|
||||||
|
accent: custom
|
||||||
|
|
||||||
|
icon:
|
||||||
|
repo: fontawesome/brands/git
|
||||||
|
logo: assets/images/cccbridge-icon.png
|
||||||
|
favicon: assets/images/tweaked-programs-icon.png
|
||||||
|
|
||||||
|
extra_css:
|
||||||
|
- assets/stylesheets/extra.css
|
Loading…
Add table
Reference in a new issue