From a65a00e2d27afa9ef57dccc792ea10bf3deb51da Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 May 2019 01:42:01 +0200 Subject: [PATCH] Implemented remote controller for ships - explicitly warn players of the new 'remote' nature of the controller - more explicit boot screen in LUA scripts for CC and OC - add core signature parameter --- src/main/java/cr0s/warpdrive/Commons.java | 4 +- .../api/IStarMapRegistryTileEntity.java | 11 +- .../api/computer/ICoreSignature.java | 19 ++ .../computer/IMultiBlockCoreOrController.java | 4 +- .../block/TileEntityAbstractBase.java | 19 ++ ...eEntityAbstractEnergyCoreOrController.java | 53 +++++- .../block/TileEntityAbstractMachine.java | 9 +- .../TileEntityAcceleratorController.java | 21 +-- .../block/movement/BlockShipController.java | 40 +++++ .../block/movement/ItemBlockController.java | 170 ++++++++++++++++++ .../movement/ItemBlockTransporterBeacon.java | 86 +-------- .../movement/TileEntityJumpGateCore.java | 29 +-- .../movement/TileEntityShipController.java | 115 ++++++++---- .../block/movement/TileEntityShipCore.java | 29 +-- .../movement/TileEntityTransporterBeacon.java | 11 +- .../movement/TileEntityTransporterCore.java | 36 ++-- .../java/cr0s/warpdrive/data/JumpBlock.java | 7 +- .../java/cr0s/warpdrive/data/JumpShip.java | 3 +- .../cr0s/warpdrive/data/StarMapRegistry.java | 3 +- .../warpdrive/data/StarMapRegistryItem.java | 27 +-- .../assets/warpdrive/lang/de_de.lang | 28 ++- .../assets/warpdrive/lang/en_us.lang | 27 ++- .../assets/warpdrive/lang/fr_fr.lang | 33 +++- .../assets/warpdrive/lang/nl_nl.lang | 28 ++- .../assets/warpdrive/lang/ru_ru.lang | 28 ++- .../assets/warpdrive/lang/zh_cn.lang | 28 ++- .../assets/warpdrive/lang/zh_tw.lang | 27 ++- .../lua.ComputerCraft/common/warpdriveCommons | 2 +- .../warpdriveMainframe/startup | 2 +- .../warpdriveShipController/startup | 10 +- .../common/usr/lib/warpdriveCommons.lua | 2 +- .../warpdriveShipController/startup | 10 +- 32 files changed, 628 insertions(+), 293 deletions(-) create mode 100644 src/main/java/cr0s/warpdrive/api/computer/ICoreSignature.java create mode 100644 src/main/java/cr0s/warpdrive/block/movement/ItemBlockController.java diff --git a/src/main/java/cr0s/warpdrive/Commons.java b/src/main/java/cr0s/warpdrive/Commons.java index f3e9473c..52c4a28b 100644 --- a/src/main/java/cr0s/warpdrive/Commons.java +++ b/src/main/java/cr0s/warpdrive/Commons.java @@ -889,8 +889,8 @@ public class Commons { public static void messageToAllPlayersInArea(@Nonnull final IStarMapRegistryTileEntity tileEntity, @Nonnull final WarpDriveText textComponent) { assert tileEntity instanceof TileEntity; final AxisAlignedBB starMapArea = tileEntity.getStarMapArea(); - final WarpDriveText messagePrefixed = Commons.getChatPrefix(tileEntity.getStarMapName()) - .appendSibling(textComponent); + final WarpDriveText messagePrefixed = Commons.getNamedPrefix(tileEntity.getSignatureName()) + .appendSibling(textComponent); WarpDrive.logger.info(String.format("%s messageToAllPlayersInArea: %s", tileEntity, textComponent.getFormattedText())); diff --git a/src/main/java/cr0s/warpdrive/api/IStarMapRegistryTileEntity.java b/src/main/java/cr0s/warpdrive/api/IStarMapRegistryTileEntity.java index 0e538e21..4d56ae02 100644 --- a/src/main/java/cr0s/warpdrive/api/IStarMapRegistryTileEntity.java +++ b/src/main/java/cr0s/warpdrive/api/IStarMapRegistryTileEntity.java @@ -1,21 +1,17 @@ package cr0s.warpdrive.api; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.data.EnumStarMapEntryType; import cr0s.warpdrive.data.VectorI; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.AxisAlignedBB; -import java.util.UUID; - -public interface IStarMapRegistryTileEntity { +public interface IStarMapRegistryTileEntity extends ICoreSignature { // get the registry type EnumStarMapEntryType getStarMapType(); - // get the unique id - UUID getUUID(); - // get the area controlled by this tile entity AxisAlignedBB getStarMapArea(); @@ -25,9 +21,6 @@ public interface IStarMapRegistryTileEntity { // isolation rate from radars double getIsolationRate(); - // name to report for Friend-or-Foe - String getStarMapName(); - // report an update in the area void onBlockUpdatedInArea(final VectorI vector, final IBlockState blockState); } diff --git a/src/main/java/cr0s/warpdrive/api/computer/ICoreSignature.java b/src/main/java/cr0s/warpdrive/api/computer/ICoreSignature.java new file mode 100644 index 00000000..728bf97a --- /dev/null +++ b/src/main/java/cr0s/warpdrive/api/computer/ICoreSignature.java @@ -0,0 +1,19 @@ +package cr0s.warpdrive.api.computer; + +import java.util.UUID; + +public interface ICoreSignature { + + String NAME_TAG = "name"; + String UUID_LEAST_TAG = "uuidLeast"; + String UUID_MOST_TAG = "uuidMost"; + + // get the unique id + UUID getSignatureUUID(); + + // get the name for Friend-or-Foe + String getSignatureName(); + + // update signature, returns false if the latest is immutable + boolean setSignature(final UUID uuidSignature, final String nameSignature); +} diff --git a/src/main/java/cr0s/warpdrive/api/computer/IMultiBlockCoreOrController.java b/src/main/java/cr0s/warpdrive/api/computer/IMultiBlockCoreOrController.java index 89de147b..b4f84eba 100644 --- a/src/main/java/cr0s/warpdrive/api/computer/IMultiBlockCoreOrController.java +++ b/src/main/java/cr0s/warpdrive/api/computer/IMultiBlockCoreOrController.java @@ -1,5 +1,5 @@ package cr0s.warpdrive.api.computer; -public interface IMultiBlockCoreOrController extends IMultiBlock { - +public interface IMultiBlockCoreOrController extends IMultiBlock, ICoreSignature { + } diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractBase.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractBase.java index 15bd6876..9893129a 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractBase.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractBase.java @@ -8,6 +8,7 @@ import cr0s.warpdrive.api.IBlockBase; import cr0s.warpdrive.api.IBlockUpdateDetector; import cr0s.warpdrive.api.IVideoChannel; import cr0s.warpdrive.api.WarpDriveText; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.data.CameraRegistryItem; import cr0s.warpdrive.data.EnumTier; @@ -295,6 +296,16 @@ public abstract class TileEntityAbstractBase extends TileEntity implements IBloc } } + @Nonnull + protected WarpDriveText getCoreSignatureStatus(final String nameSignature) { + // note: we only report 'undefined' status for Remote controllers + if (nameSignature != null && !nameSignature.isEmpty()) { + return new WarpDriveText(Commons.styleCorrect, "warpdrive.core_signature.status_line.defined", + nameSignature); + } + return new WarpDriveText(); + } + public WarpDriveText getStatusHeader() { return new WarpDriveText(); } @@ -319,6 +330,14 @@ public abstract class TileEntityAbstractBase extends TileEntity implements IBloc } } + if (this instanceof ICoreSignature) { + // only show in item form or from client side + if ( world == null + || world.isRemote ) { + message.append( getCoreSignatureStatus(((ICoreSignature) this).getSignatureName()) ); + } + } + if (isUpgradeable()) { message.append( getUpgradeStatus() ); } diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergyCoreOrController.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergyCoreOrController.java index 6f420463..8dfbe953 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergyCoreOrController.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractEnergyCoreOrController.java @@ -1,15 +1,19 @@ package cr0s.warpdrive.block; import cr0s.warpdrive.Commons; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.api.computer.IEnergyConsumer; import cr0s.warpdrive.api.computer.IMultiBlockCoreOrController; import cr0s.warpdrive.api.computer.IMultiBlockCore; import javax.annotation.Nonnull; +import java.util.UUID; + +import net.minecraft.nbt.NBTTagCompound; public abstract class TileEntityAbstractEnergyCoreOrController extends TileEntityAbstractEnergyConsumer implements IMultiBlockCoreOrController, IEnergyConsumer { // persistent properties - // (none) + public UUID uuid = null; // computed properties // (none) @@ -28,6 +32,53 @@ public abstract class TileEntityAbstractEnergyCoreOrController extends TileEntit name = ((TileEntityAbstractEnergyCoreOrController) multiblockCore).name; } + + @Override + public void readFromNBT(final NBTTagCompound tagCompound) { + super.readFromNBT(tagCompound); + + uuid = new UUID(tagCompound.getLong(ICoreSignature.UUID_MOST_TAG), tagCompound.getLong(ICoreSignature.UUID_LEAST_TAG)); + if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { + uuid = UUID.randomUUID(); + } + } + + @Nonnull + @Override + public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { + tagCompound = super.writeToNBT(tagCompound); + + if (uuid != null) { + tagCompound.setLong(ICoreSignature.UUID_MOST_TAG, uuid.getMostSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_LEAST_TAG, uuid.getLeastSignificantBits()); + } + + return tagCompound; + } + + // writeItemDropNBT + + @Override + public UUID getSignatureUUID() { + return uuid; + } + + @Override + public String getSignatureName() { + return name; + } + + @Override + public boolean setSignature(final UUID uuidSignature, final String nameSignature) { + if (this instanceof IMultiBlockCore) { + return false; + } + + uuid = uuidSignature; + name = nameSignature; + return true; + } + // Common OC/CC methods // (none) diff --git a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractMachine.java b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractMachine.java index 1416fe87..d08fb5cd 100644 --- a/src/main/java/cr0s/warpdrive/block/TileEntityAbstractMachine.java +++ b/src/main/java/cr0s/warpdrive/block/TileEntityAbstractMachine.java @@ -2,6 +2,7 @@ package cr0s.warpdrive.block; import cr0s.warpdrive.Commons; import cr0s.warpdrive.WarpDrive; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.api.computer.IMachine; import cr0s.warpdrive.config.WarpDriveConfig; @@ -23,7 +24,7 @@ import net.minecraftforge.fml.common.Optional; public abstract class TileEntityAbstractMachine extends TileEntityAbstractInterfaced implements IMachine { // persistent properties - public String name = "default"; + public String name = ""; protected boolean isEnabled = true; // allow only one computation at a time @@ -70,7 +71,7 @@ public abstract class TileEntityAbstractMachine extends TileEntityAbstractInterf public void readFromNBT(final NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - name = tagCompound.getString("name"); + name = tagCompound.getString(ICoreSignature.NAME_TAG); isEnabled = !tagCompound.hasKey("isEnabled") || tagCompound.getBoolean("isEnabled"); } @@ -79,7 +80,9 @@ public abstract class TileEntityAbstractMachine extends TileEntityAbstractInterf public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { tagCompound = super.writeToNBT(tagCompound); - tagCompound.setString("name", name); + if (!name.equals("")) { + tagCompound.setString(ICoreSignature.NAME_TAG, name); + } tagCompound.setBoolean("isEnabled", isEnabled); return tagCompound; } diff --git a/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorController.java b/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorController.java index 52abdcfb..2ad0b24c 100644 --- a/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorController.java +++ b/src/main/java/cr0s/warpdrive/block/atomic/TileEntityAcceleratorController.java @@ -1,16 +1,14 @@ package cr0s.warpdrive.block.atomic; import cr0s.warpdrive.api.IStarMapRegistryTileEntity; -import cr0s.warpdrive.block.TileEntityAbstractEnergy; +import cr0s.warpdrive.block.TileEntityAbstractEnergyCoreOrController; import cr0s.warpdrive.data.EnumStarMapEntryType; import cr0s.warpdrive.data.VectorI; -import java.util.UUID; - import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.AxisAlignedBB; -public class TileEntityAcceleratorController extends TileEntityAbstractEnergy implements IStarMapRegistryTileEntity { +public class TileEntityAcceleratorController extends TileEntityAbstractEnergyCoreOrController implements IStarMapRegistryTileEntity { public TileEntityAcceleratorController() { super(); @@ -27,11 +25,6 @@ public class TileEntityAcceleratorController extends TileEntityAbstractEnergy im return EnumStarMapEntryType.ACCELERATOR; } - @Override - public UUID getUUID() { - return null; - } - @Override public AxisAlignedBB getStarMapArea() { return null; @@ -47,13 +40,13 @@ public class TileEntityAcceleratorController extends TileEntityAbstractEnergy im return 0.0; } - @Override - public String getStarMapName() { - return null; - } - @Override public void onBlockUpdatedInArea(final VectorI vector, final IBlockState blockState) { } + + @Override + public Object[] getEnergyRequired() { + return new Object[0]; + } } diff --git a/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java b/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java index 298c52e8..52e2609b 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java +++ b/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java @@ -1,16 +1,24 @@ package cr0s.warpdrive.block.movement; +import cr0s.warpdrive.Commons; +import cr0s.warpdrive.api.WarpDriveText; import cr0s.warpdrive.block.BlockAbstractContainer; import cr0s.warpdrive.data.EnumShipCommand; import cr0s.warpdrive.data.EnumTier; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockPos.MutableBlockPos; import net.minecraft.world.World; public class BlockShipController extends BlockAbstractContainer { @@ -51,4 +59,36 @@ public class BlockShipController extends BlockAbstractContainer { public TileEntity createNewTileEntity(@Nonnull final World world, final int metadata) { return new TileEntityShipController(); } + + @Nullable + @Override + public ItemBlock createItemBlock() { + return new ItemBlockController(this); + } + + @Override + public boolean canPlaceBlockOnSide(@Nonnull final World world, @Nonnull final BlockPos blockPos, final EnumFacing side) { + // ancestor + if (!super.canPlaceBlockOnSide(world, blockPos, side)) { + return false; + } + if (side == EnumFacing.UP || side == EnumFacing.DOWN) { + // highlight the breaking change when going from 1.7.10 to 1.10+ + final MutableBlockPos mutableBlockPos = new MutableBlockPos(blockPos); + for (final EnumFacing enumFacing : EnumFacing.HORIZONTALS) { + mutableBlockPos.setPos( + blockPos.getX() + enumFacing.getXOffset(), + blockPos.getY() + enumFacing.getYOffset(), + blockPos.getZ() + enumFacing.getZOffset()); + if (world.getBlockState(mutableBlockPos).getBlock() instanceof BlockShipCore) { + final EntityPlayer entityPlayer = world.getClosestPlayer(blockPos.getX() + 0.5D, blockPos.getY() + 0.5D, blockPos.getZ() + 0.5D, 5, false); + if (entityPlayer != null) { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleWarning, "tile.warpdrive.movement.ship_controller.away_from_core")); + } + return false; + } + } + } + return true; + } } \ No newline at end of file diff --git a/src/main/java/cr0s/warpdrive/block/movement/ItemBlockController.java b/src/main/java/cr0s/warpdrive/block/movement/ItemBlockController.java new file mode 100644 index 00000000..9c6059a8 --- /dev/null +++ b/src/main/java/cr0s/warpdrive/block/movement/ItemBlockController.java @@ -0,0 +1,170 @@ +package cr0s.warpdrive.block.movement; + +import cr0s.warpdrive.Commons; +import cr0s.warpdrive.api.WarpDriveText; +import cr0s.warpdrive.api.computer.ICoreSignature; +import cr0s.warpdrive.api.computer.IMultiBlockCoreOrController; +import cr0s.warpdrive.block.ItemBlockAbstractBase; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.UUID; + +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.SoundEvents; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.SoundCategory; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +public class ItemBlockController extends ItemBlockAbstractBase { + + public ItemBlockController(final Block block) { + super(block, false, false); + + setMaxStackSize(1); + } + + protected static String getName(@Nonnull final ItemStack itemStack) { + if (!(itemStack.getItem() instanceof ItemBlockController)) { + return ""; + } + final NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) { + return ""; + } + final String name = tagCompound.getString(ICoreSignature.NAME_TAG); + final UUID uuid = new UUID(tagCompound.getLong(ICoreSignature.UUID_MOST_TAG), tagCompound.getLong(ICoreSignature.UUID_LEAST_TAG)); + if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { + return ""; + } + return name; + } + + @Nullable + protected static UUID getSignature(@Nonnull final ItemStack itemStack) { + if (!(itemStack.getItem() instanceof ItemBlockController)) { + return null; + } + final NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) { + return null; + } + final UUID uuid = new UUID(tagCompound.getLong(ICoreSignature.UUID_MOST_TAG), tagCompound.getLong(ICoreSignature.UUID_LEAST_TAG)); + if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { + return null; + } + return uuid; + } + + protected static ItemStack setNameAndSignature(@Nonnull final ItemStack itemStack, @Nullable final String name, @Nullable final UUID uuid) { + if (!(itemStack.getItem() instanceof ItemBlockController)) { + return itemStack; + } + NBTTagCompound tagCompound = itemStack.getTagCompound(); + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + } + if ( name == null + || name.isEmpty() ) { + tagCompound.removeTag(ICoreSignature.NAME_TAG); + } else { + tagCompound.setString(ICoreSignature.NAME_TAG, name); + } + if (uuid == null) { + tagCompound.removeTag(ICoreSignature.UUID_MOST_TAG); + tagCompound.removeTag(ICoreSignature.UUID_LEAST_TAG); + } else { + tagCompound.setLong(ICoreSignature.UUID_MOST_TAG, uuid.getMostSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_LEAST_TAG, uuid.getLeastSignificantBits()); + } + itemStack.setTagCompound(tagCompound); + return itemStack; + } + + @Nonnull + @Override + public EnumActionResult onItemUse(@Nonnull final EntityPlayer entityPlayer, + @Nonnull final World world, @Nonnull final BlockPos blockPos, @Nonnull final EnumHand hand, + @Nonnull final EnumFacing facing, final float hitX, final float hitY, final float hitZ) { + if (world.isRemote) { + return EnumActionResult.FAIL; + } + + // get context + final ItemStack itemStackHeld = entityPlayer.getHeldItem(hand); + if (itemStackHeld.isEmpty()) { + return EnumActionResult.FAIL; + } + + // check if clicked block can be interacted with + final IBlockState blockState = world.getBlockState(blockPos); + final TileEntity tileEntity = world.getTileEntity(blockPos); + + if (!(tileEntity instanceof IMultiBlockCoreOrController)) { + return super.onItemUse(entityPlayer, world, blockPos, hand, facing, hitX, hitY, hitZ); + } + if (!entityPlayer.canPlayerEdit(blockPos, facing, itemStackHeld)) { + return EnumActionResult.FAIL; + } + + final UUID uuidSignatureFromItem = getSignature(itemStackHeld); + final String nameSignatureFromItem = getName(itemStackHeld); + final UUID uuidSignatureFromBlock = ((IMultiBlockCoreOrController) tileEntity).getSignatureUUID(); + final String nameSignatureFromBlock = ((IMultiBlockCoreOrController) tileEntity).getSignatureName(); + final String nameItem = itemStackHeld.getDisplayName(); + final String nameBlock = Commons.format(blockState, world, blockPos); + if (entityPlayer.isSneaking()) {// get block signature + if ( uuidSignatureFromBlock == null + || nameSignatureFromBlock == null + || nameSignatureFromBlock.isEmpty() ) { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleWarning, "warpdrive.core_signature.get_missing", + null, nameItem, nameBlock )); + + } else if (uuidSignatureFromBlock.equals(uuidSignatureFromItem)) { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleCorrect, "warpdrive.core_signature.get_same", + nameSignatureFromItem, nameItem, nameBlock )); + + } else { + final ItemStack itemStackNew = setNameAndSignature(itemStackHeld, nameSignatureFromBlock, uuidSignatureFromBlock); + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleCorrect, "warpdrive.core_signature.get", + nameSignatureFromBlock, nameItem, nameBlock )); + world.playSound(entityPlayer.posX + 0.5D, entityPlayer.posY + 0.5D, entityPlayer.posZ + 0.5D, + SoundEvents.ENTITY_ZOMBIE_VILLAGER_CURE, SoundCategory.PLAYERS, + 1.0F, 1.8F + 0.2F * world.rand.nextFloat(), false); + } + + } else {// set block signature + if (uuidSignatureFromItem == null) { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleWarning, "warpdrive.core_signature.set_missing", + null, nameItem, nameBlock )); + + } else if (uuidSignatureFromItem.equals(uuidSignatureFromBlock)) { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleCorrect, "warpdrive.core_signature.set_same", + nameSignatureFromItem, nameItem, nameBlock )); + + } else { + final boolean isSuccess = ((IMultiBlockCoreOrController) tileEntity).setSignature(uuidSignatureFromItem, nameSignatureFromItem); + if (isSuccess) { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleCorrect, "warpdrive.core_signature.set", + nameSignatureFromItem, nameItem, nameBlock)); + world.playSound(entityPlayer.posX + 0.5D, entityPlayer.posY + 0.5D, entityPlayer.posZ + 0.5D, + SoundEvents.ENTITY_ZOMBIE_VILLAGER_CONVERTED, SoundCategory.PLAYERS, + 1.0F, 1.2F + 0.2F * world.rand.nextFloat(), false); + } else { + Commons.addChatMessage(entityPlayer, new WarpDriveText(Commons.styleWarning, "warpdrive.core_signature.set_not_supported", + null, nameItem, nameBlock )); + } + } + } + + return EnumActionResult.SUCCESS; + } +} diff --git a/src/main/java/cr0s/warpdrive/block/movement/ItemBlockTransporterBeacon.java b/src/main/java/cr0s/warpdrive/block/movement/ItemBlockTransporterBeacon.java index ac5e8726..a26d43d6 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/ItemBlockTransporterBeacon.java +++ b/src/main/java/cr0s/warpdrive/block/movement/ItemBlockTransporterBeacon.java @@ -4,7 +4,6 @@ import cr0s.warpdrive.Commons; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IItemTransporterBeacon; import cr0s.warpdrive.api.computer.ITransporterCore; -import cr0s.warpdrive.block.ItemBlockAbstractBase; import cr0s.warpdrive.config.WarpDriveConfig; import cr0s.warpdrive.data.EnergyWrapper; @@ -35,10 +34,10 @@ import java.util.UUID; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class ItemBlockTransporterBeacon extends ItemBlockAbstractBase implements IItemTransporterBeacon { +public class ItemBlockTransporterBeacon extends ItemBlockController implements IItemTransporterBeacon { public ItemBlockTransporterBeacon(final Block block) { - super(block, false, false); + super(block); setMaxStackSize(1); setMaxDamage(100 * 8); @@ -63,75 +62,7 @@ public class ItemBlockTransporterBeacon extends ItemBlockAbstractBase implements return new ModelResourceLocation(resourceLocation.toString() + "-item", "inventory"); } - private static String getTransporterName(final ItemStack itemStack) { - if (!(itemStack.getItem() instanceof ItemBlockTransporterBeacon)) { - return ""; - } - final NBTTagCompound tagCompound = itemStack.getTagCompound(); - if (tagCompound == null) { - return ""; - } - final String name = tagCompound.getString("name"); - final UUID uuid = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); - if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { - return ""; - } - return name; - } - - private static ItemStack setTransporterName(final ItemStack itemStack, final String name) { - if (!(itemStack.getItem() instanceof ItemBlockTransporterBeacon)) { - return itemStack; - } - NBTTagCompound tagCompound = itemStack.getTagCompound(); - if (tagCompound == null) { - tagCompound = new NBTTagCompound(); - } - if ( name == null - || name.isEmpty() ) { - tagCompound.removeTag("name"); - } else { - tagCompound.setString("name", name); - } - itemStack.setTagCompound(tagCompound); - return itemStack; - } - - private static UUID getTransporterSignature(final ItemStack itemStack) { - if (!(itemStack.getItem() instanceof ItemBlockTransporterBeacon)) { - return null; - } - final NBTTagCompound tagCompound = itemStack.getTagCompound(); - if (tagCompound == null) { - return null; - } - final UUID uuid = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); - if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { - return null; - } - return uuid; - } - - private static ItemStack setTransporterSignature(final ItemStack itemStack, final UUID uuid) { - if (!(itemStack.getItem() instanceof ItemBlockTransporterBeacon)) { - return itemStack; - } - NBTTagCompound tagCompound = itemStack.getTagCompound(); - if (tagCompound == null) { - tagCompound = new NBTTagCompound(); - } - if (uuid == null) { - tagCompound.removeTag("uuidMost"); - tagCompound.removeTag("uuidLeast"); - } else { - tagCompound.setLong("uuidMost", uuid.getMostSignificantBits()); - tagCompound.setLong("uuidLeast", uuid.getLeastSignificantBits()); - } - itemStack.setTagCompound(tagCompound); - return itemStack; - } - - private static int getEnergy(final ItemStack itemStack) { + private static int getEnergy(@Nonnull final ItemStack itemStack) { if (!(itemStack.getItem() instanceof ItemBlockTransporterBeacon)) { return 0; } @@ -232,11 +163,11 @@ public class ItemBlockTransporterBeacon extends ItemBlockAbstractBase implements return EnumActionResult.FAIL; } - final UUID uuidBeacon = getTransporterSignature(itemStackHeld); - final String nameBeacon = getTransporterName(itemStackHeld); - final UUID uuidTransporter = ((ITransporterCore) tileEntity).getUUID(); + final UUID uuidBeacon = getSignature(itemStackHeld); + final String nameBeacon = getName(itemStackHeld); + final UUID uuidTransporter = ((ITransporterCore) tileEntity).getSignatureUUID(); if (entityPlayer.isSneaking()) {// update transporter signature - final String nameTransporter = ((ITransporterCore) tileEntity).getStarMapName(); + final String nameTransporter = ((ITransporterCore) tileEntity).getSignatureName(); if ( uuidTransporter == null || nameTransporter == null @@ -248,8 +179,7 @@ public class ItemBlockTransporterBeacon extends ItemBlockAbstractBase implements nameTransporter)); } else { - final ItemStack itemStackNew = setTransporterName(itemStackHeld, nameTransporter); - setTransporterSignature(itemStackNew, uuidTransporter); + final ItemStack itemStackNew = setNameAndSignature(itemStackHeld, nameTransporter, uuidTransporter); Commons.addChatMessage(entityPlayer, new TextComponentTranslation("warpdrive.transporter_signature.get", nameTransporter)); world.playSound(entityPlayer.posX + 0.5D, entityPlayer.posY + 0.5D, entityPlayer.posZ + 0.5D, diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityJumpGateCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityJumpGateCore.java index 06a2ca39..09125d65 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityJumpGateCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityJumpGateCore.java @@ -3,10 +3,9 @@ package cr0s.warpdrive.block.movement; import cr0s.warpdrive.Commons; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IStarMapRegistryTileEntity; -import cr0s.warpdrive.block.TileEntityAbstractMachine; +import cr0s.warpdrive.block.TileEntityAbstractEnergyCoreOrController; import cr0s.warpdrive.config.WarpDriveConfig; import cr0s.warpdrive.data.EnumStarMapEntryType; -import cr0s.warpdrive.data.EnumTier; import cr0s.warpdrive.data.Vector3; import cr0s.warpdrive.data.VectorI; import cr0s.warpdrive.render.EntityFXBoundingBox; @@ -26,7 +25,7 @@ import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -public class TileEntityJumpGateCore extends TileEntityAbstractMachine implements IStarMapRegistryTileEntity { +public class TileEntityJumpGateCore extends TileEntityAbstractEnergyCoreOrController implements IStarMapRegistryTileEntity { private static final int BOUNDING_BOX_INTERVAL_TICKS = 60; @@ -149,10 +148,6 @@ public class TileEntityJumpGateCore extends TileEntityAbstractMachine implements public void readFromNBT(final NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - uuid = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); - if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { - uuid = UUID.randomUUID(); - } minX = tagCompound.getInteger("minX"); maxX = tagCompound.getInteger("maxX"); minY = tagCompound.getInteger("minY"); @@ -168,10 +163,6 @@ public class TileEntityJumpGateCore extends TileEntityAbstractMachine implements public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { tagCompound = super.writeToNBT(tagCompound); - if (uuid != null) { - tagCompound.setLong("uuidMost", uuid.getMostSignificantBits()); - tagCompound.setLong("uuidLeast", uuid.getLeastSignificantBits()); - } tagCompound.setInteger("minX", minX); tagCompound.setInteger("maxX", maxX); tagCompound.setInteger("minY", minY); @@ -221,11 +212,6 @@ public class TileEntityJumpGateCore extends TileEntityAbstractMachine implements return EnumStarMapEntryType.JUMP_GATE; } - @Override - public UUID getUUID() { - return uuid; - } - @Override public AxisAlignedBB getStarMapArea() { return new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ); @@ -241,17 +227,18 @@ public class TileEntityJumpGateCore extends TileEntityAbstractMachine implements return 0.0D; } - @Override - public String getStarMapName() { - return name; - } - @Override public void onBlockUpdatedInArea(final VectorI vector, final IBlockState blockState) { // no operation } // Common OC/CC methods + + @Override + public Object[] getEnergyRequired() { + return new Object[0]; + } + public Object[] area(final Object[] arguments) { try { if (arguments != null && arguments.length == 6) { diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java index 2b58d758..b22d3022 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipController.java @@ -1,14 +1,21 @@ package cr0s.warpdrive.block.movement; +import cr0s.warpdrive.Commons; +import cr0s.warpdrive.WarpDrive; +import cr0s.warpdrive.api.WarpDriveText; import cr0s.warpdrive.config.WarpDriveConfig; import cr0s.warpdrive.data.CelestialObjectManager; +import cr0s.warpdrive.data.EnumStarMapEntryType; +import cr0s.warpdrive.data.StarMapRegistryItem; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.lang.ref.WeakReference; import java.util.Collections; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.WorldServer; public class TileEntityShipController extends TileEntityAbstractShipController { @@ -19,6 +26,7 @@ public class TileEntityShipController extends TileEntityAbstractShipController { private final int updateInterval_ticks = 20 * WarpDriveConfig.SHIP_CONTROLLER_UPDATE_INTERVAL_SECONDS; private int updateTicks = updateInterval_ticks; private int bootTicks = 20; + private WarpDriveText reason = new WarpDriveText(); private WeakReference tileEntityShipCoreWeakReference = null; @@ -49,22 +57,8 @@ public class TileEntityShipController extends TileEntityAbstractShipController { if (updateTicks <= 0) { updateTicks = updateInterval_ticks; - final TileEntityShipCore tileEntityShipCore = findCoreBlock(); - if (tileEntityShipCore != null) { - if ( tileEntityShipCoreWeakReference == null - || tileEntityShipCore != tileEntityShipCoreWeakReference.get() ) { - tileEntityShipCoreWeakReference = new WeakReference<>(tileEntityShipCore); - } - - final boolean isSynchronized = tileEntityShipCore.refreshLink(this); - if (isSynchronized) { - onCoreUpdated(tileEntityShipCore); - if ( !tileEntityShipCore.isCommandConfirmed - && isCommandConfirmed ) { - tileEntityShipCore.command(new Object[] { enumShipCommand.getName(), true }); - } - } - } + reason = new WarpDriveText(); + final TileEntityShipCore tileEntityShipCore = updateLink(reason); updateBlockState(null, BlockShipController.COMMAND, enumShipCommand); } @@ -90,30 +84,70 @@ public class TileEntityShipController extends TileEntityAbstractShipController { return tagCompound; } - private TileEntityShipCore findCoreBlock() { - TileEntity tileEntity; - - tileEntity = world.getTileEntity(pos.add(1, 0, 0)); - if (tileEntity instanceof TileEntityShipCore) { - return (TileEntityShipCore) tileEntity; + @Nullable + private TileEntityShipCore updateLink(final WarpDriveText reason) { + // validate existing link + TileEntityShipCore tileEntityShipCore = tileEntityShipCoreWeakReference != null ? tileEntityShipCoreWeakReference.get() : null; + if ( tileEntityShipCore == null + || !tileEntityShipCore.getSignatureUUID().equals(uuid) ) { + tileEntityShipCore = null; + tileEntityShipCoreWeakReference = null; } - tileEntity = world.getTileEntity(pos.add(-1, 0, 0)); - if (tileEntity instanceof TileEntityShipCore) { - return (TileEntityShipCore) tileEntity; + // refresh as needed + // note: it's up to players to break the link, so if the world is partially restored we won't lose the link + if (tileEntityShipCore == null) { + final StarMapRegistryItem starMapRegistryItem = WarpDrive.starMap.getByUUID(EnumStarMapEntryType.SHIP, uuid); + if (starMapRegistryItem == null) { + reason.append(Commons.styleWarning, "warpdrive.core_signature.status_line.unknown_core_signature"); + return null; + } + final WorldServer worldServer = starMapRegistryItem.getWorldServerIfLoaded(); + if (worldServer == null) { + reason.append(Commons.styleWarning, "warpdrive.core_signature.status_line.world_not_loaded"); + return null; + } + final TileEntity tileEntity = worldServer.getTileEntity(starMapRegistryItem.getBlockPos()); + if ( !(tileEntity instanceof TileEntityShipCore) + || tileEntity.isInvalid() + || !((TileEntityShipCore) tileEntity).getSignatureUUID().equals(uuid) ) { + reason.append(Commons.styleWarning, "warpdrive.core_signature.status_line.unknown_core_signature"); + return null; + } + tileEntityShipCore = (TileEntityShipCore) tileEntity; + tileEntityShipCoreWeakReference = new WeakReference<>(tileEntityShipCore); + } + // (tileEntityShipCore is defined and valid) + + final boolean isSynchronized = tileEntityShipCore.refreshLink(this); + if (isSynchronized) { + onCoreUpdated(tileEntityShipCore); + // send command as soon as link is re-established + if ( !tileEntityShipCore.isCommandConfirmed + && isCommandConfirmed ) { + tileEntityShipCore.command(new Object[] { enumShipCommand.getName(), true }); + } } - tileEntity = world.getTileEntity(pos.add(0, 0, 1)); - if (tileEntity instanceof TileEntityShipCore) { - return (TileEntityShipCore) tileEntity; + return tileEntityShipCore; + } + + @Nonnull + @Override + protected WarpDriveText getCoreSignatureStatus(final String nameSignature) { + if (nameSignature == null || nameSignature.isEmpty()) { + return new WarpDriveText(Commons.styleWarning, "warpdrive.core_signature.status_line.undefined"); } - - tileEntity = world.getTileEntity(pos.add(0, 0, -1)); - if (tileEntity instanceof TileEntityShipCore) { - return (TileEntityShipCore) tileEntity; + return super.getCoreSignatureStatus(nameSignature); + } + + @Override + public WarpDriveText getStatus() { + if (reason.getUnformattedText().isEmpty()) { + return super.getStatus(); + } else { + return super.getStatus().append(reason); } - - return null; } // Common OC/CC methods @@ -169,7 +203,7 @@ public class TileEntityShipController extends TileEntityAbstractShipController { if (tileEntityShipCore == null) { return super.dim_positive(null); // return current local values } - return new Object[] { tileEntityShipCore.dim_positive(arguments) }; + return tileEntityShipCore.dim_positive(arguments); } @Override @@ -178,7 +212,7 @@ public class TileEntityShipController extends TileEntityAbstractShipController { if (tileEntityShipCore == null) { return super.dim_negative(null); // return current local values } - return new Object[] { tileEntityShipCore.dim_negative(arguments) }; + return tileEntityShipCore.dim_negative(arguments); } @Override @@ -199,6 +233,15 @@ public class TileEntityShipController extends TileEntityAbstractShipController { return tileEntityShipCore.getEnergyStatus(); } + @Override + public Object[] command(final Object[] arguments) { + final TileEntityShipCore tileEntityShipCore = tileEntityShipCoreWeakReference == null ? null : tileEntityShipCoreWeakReference.get(); + if (tileEntityShipCore == null) { + return null; + } + return tileEntityShipCore.command(arguments); + } + @Override public Object[] getShipSize() { final TileEntityShipCore tileEntityShipCore = tileEntityShipCoreWeakReference == null ? null : tileEntityShipCoreWeakReference.get(); diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java index 7438f75b..b89495a6 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java @@ -67,7 +67,6 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme // persistent properties public EnumFacing facing; - public UUID uuid = null; private double isolationRate = 0.0D; private final Set blockPosShipControllers = new CopyOnWriteArraySet<>(); private int ticksCooldown = 0; @@ -184,7 +183,9 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme } // enforce emergency stop - if (!isEnabled) { + if ( !isEnabled + || ( isCommandConfirmed + && enumShipCommand == EnumShipCommand.OFFLINE ) ) { stateCurrent = EnumShipCoreState.IDLE; } @@ -1128,10 +1129,6 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme public void readFromNBT(final NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - uuid = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); - if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { - uuid = UUID.randomUUID(); - } isolationRate = tagCompound.getDouble("isolationRate"); ticksCooldown = tagCompound.getInteger("cooldownTime"); warmupTime_ticks = tagCompound.getInteger("warmupTime"); @@ -1142,10 +1139,7 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme @Override public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { tagCompound = super.writeToNBT(tagCompound); - if (uuid != null) { - tagCompound.setLong("uuidMost", uuid.getMostSignificantBits()); - tagCompound.setLong("uuidLeast", uuid.getLeastSignificantBits()); - } + tagCompound.setDouble("isolationRate", isolationRate); tagCompound.setInteger("cooldownTime", ticksCooldown); tagCompound.setInteger("warmupTime", warmupTime_ticks); @@ -1198,17 +1192,17 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme super.invalidate(); } + @Override + public String getSignatureName() { + return name; + } + // IStarMapRegistryTileEntity overrides @Override public EnumStarMapEntryType getStarMapType() { return EnumStarMapEntryType.SHIP; } - @Override - public UUID getUUID() { - return uuid; - } - @Override public AxisAlignedBB getStarMapArea() { return new AxisAlignedBB(minX, minY, minZ, maxX + 1.0D, maxY + 1.0D, maxZ + 1.0D); @@ -1224,11 +1218,6 @@ public class TileEntityShipCore extends TileEntityAbstractShipController impleme return isolationRate; } - @Override - public String getStarMapName() { - return name.isEmpty() ? "ShipCore" : name; - } - @Override public void onBlockUpdatedInArea(final VectorI vector, final IBlockState blockState) { // no operation diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterBeacon.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterBeacon.java index ca71fd4e..40113c93 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterBeacon.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterBeacon.java @@ -3,6 +3,7 @@ package cr0s.warpdrive.block.movement; import cr0s.warpdrive.Commons; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.WarpDriveText; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.api.computer.ITransporterBeacon; import cr0s.warpdrive.block.TileEntityAbstractEnergyConsumer; import cr0s.warpdrive.config.WarpDriveConfig; @@ -228,9 +229,9 @@ public class TileEntityTransporterBeacon extends TileEntityAbstractEnergyConsume tagCompound = super.writeToNBT(tagCompound); if (uuidTransporterCore != null) { - tagCompound.setString("name", nameTransporterCore); - tagCompound.setLong("uuidMost", uuidTransporterCore.getMostSignificantBits()); - tagCompound.setLong("uuidLeast", uuidTransporterCore.getLeastSignificantBits()); + tagCompound.setString(ICoreSignature.NAME_TAG, nameTransporterCore); + tagCompound.setLong(ICoreSignature.UUID_MOST_TAG, uuidTransporterCore.getMostSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_LEAST_TAG, uuidTransporterCore.getLeastSignificantBits()); } tagCompound.setInteger("tickDeploying", tickDeploying); @@ -241,8 +242,8 @@ public class TileEntityTransporterBeacon extends TileEntityAbstractEnergyConsume public void readFromNBT(final NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - nameTransporterCore = tagCompound.getString("name"); - uuidTransporterCore = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); + nameTransporterCore = tagCompound.getString(ICoreSignature.NAME_TAG); + uuidTransporterCore = new UUID(tagCompound.getLong(ICoreSignature.UUID_MOST_TAG), tagCompound.getLong(ICoreSignature.UUID_LEAST_TAG)); if (uuidTransporterCore.getMostSignificantBits() == 0 && uuidTransporterCore.getLeastSignificantBits() == 0) { uuidTransporterCore = null; nameTransporterCore = ""; diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java index ed249cc5..56875ee5 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityTransporterCore.java @@ -6,9 +6,10 @@ import cr0s.warpdrive.api.IBeamFrequency; import cr0s.warpdrive.api.IItemTransporterBeacon; import cr0s.warpdrive.api.IStarMapRegistryTileEntity; import cr0s.warpdrive.api.WarpDriveText; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.api.computer.ITransporterBeacon; import cr0s.warpdrive.api.computer.ITransporterCore; -import cr0s.warpdrive.block.TileEntityAbstractEnergyConsumer; +import cr0s.warpdrive.block.TileEntityAbstractEnergyCoreOrController; import cr0s.warpdrive.block.forcefield.BlockForceField; import cr0s.warpdrive.block.forcefield.TileEntityForceField; import cr0s.warpdrive.config.Dictionary; @@ -78,7 +79,7 @@ import net.minecraftforge.common.ForgeChunkManager.Type; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.common.Optional; -public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer implements ITransporterCore, IBeamFrequency, IStarMapRegistryTileEntity { +public class TileEntityTransporterCore extends TileEntityAbstractEnergyCoreOrController implements ITransporterCore, IBeamFrequency, IStarMapRegistryTileEntity { // persistent properties private UUID uuid = null; @@ -531,11 +532,6 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer return EnumStarMapEntryType.TRANSPORTER; } - @Override - public UUID getUUID() { - return uuid; - } - @Override public AxisAlignedBB getStarMapArea() { return new AxisAlignedBB( @@ -557,11 +553,6 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer return 0.0D; } - @Override - public String getStarMapName() { - return name; - } - @Override public void onBlockUpdatedInArea(final VectorI vector, final IBlockState blockState) { // skip in case of explosion, etc. @@ -1524,8 +1515,8 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer tagCompound = super.writeToNBT(tagCompound); if (uuid != null) { - tagCompound.setLong("uuidMost", uuid.getMostSignificantBits()); - tagCompound.setLong("uuidLeast", uuid.getLeastSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_MOST_TAG, uuid.getMostSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_LEAST_TAG, uuid.getLeastSignificantBits()); } if ( vLocalScanners != null @@ -1551,8 +1542,8 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer NBTTagCompound tagRemoteLocation = new NBTTagCompound(); if (remoteLocationRequested instanceof UUID) { - tagRemoteLocation.setLong("uuidMost", ((UUID) remoteLocationRequested).getMostSignificantBits()); - tagRemoteLocation.setLong("uuidLeast", ((UUID) remoteLocationRequested).getLeastSignificantBits()); + tagRemoteLocation.setLong(ICoreSignature.UUID_MOST_TAG, ((UUID) remoteLocationRequested).getMostSignificantBits()); + tagRemoteLocation.setLong(ICoreSignature.UUID_LEAST_TAG, ((UUID) remoteLocationRequested).getLeastSignificantBits()); } else if (remoteLocationRequested instanceof VectorI) { tagRemoteLocation = ((VectorI) remoteLocationRequested).writeToNBT(tagRemoteLocation); } else if (remoteLocationRequested instanceof String) { @@ -1573,7 +1564,7 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer public void readFromNBT(final NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); - uuid = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); + uuid = new UUID(tagCompound.getLong(ICoreSignature.UUID_MOST_TAG), tagCompound.getLong(ICoreSignature.UUID_LEAST_TAG)); if (uuid.getMostSignificantBits() == 0 && uuid.getLeastSignificantBits() == 0) { uuid = UUID.randomUUID(); } @@ -1603,10 +1594,10 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer final NBTBase tagRemoteLocation = tagCompound.getTag("remoteLocation"); if (tagRemoteLocation instanceof NBTTagCompound) { final NBTTagCompound tagCompoundRemoteLocation = (NBTTagCompound) tagRemoteLocation; - if (tagCompoundRemoteLocation.hasKey("uuidMost")) { + if (tagCompoundRemoteLocation.hasKey(ICoreSignature.UUID_MOST_TAG)) { remoteLocationRequested = new UUID( - tagCompoundRemoteLocation.getLong("uuidMost"), - tagCompoundRemoteLocation.getLong("uuidLeast")); + tagCompoundRemoteLocation.getLong(ICoreSignature.UUID_MOST_TAG), + tagCompoundRemoteLocation.getLong(ICoreSignature.UUID_LEAST_TAG)); } else if (tagCompoundRemoteLocation.hasKey("x")) { remoteLocationRequested = new VectorI(); @@ -1633,8 +1624,9 @@ public class TileEntityTransporterCore extends TileEntityAbstractEnergyConsumer public NBTTagCompound getUpdateTag() { final NBTTagCompound tagCompound = new NBTTagCompound(); writeToNBT(tagCompound); - tagCompound.removeTag("uuidMost"); - tagCompound.removeTag("uuidLeast"); + + tagCompound.removeTag(ICoreSignature.UUID_MOST_TAG); + tagCompound.removeTag(ICoreSignature.UUID_LEAST_TAG); tagCompound.removeTag(IBeamFrequency.BEAM_FREQUENCY_TAG); return tagCompound; diff --git a/src/main/java/cr0s/warpdrive/data/JumpBlock.java b/src/main/java/cr0s/warpdrive/data/JumpBlock.java index dc116ec9..6b4698df 100644 --- a/src/main/java/cr0s/warpdrive/data/JumpBlock.java +++ b/src/main/java/cr0s/warpdrive/data/JumpBlock.java @@ -5,6 +5,7 @@ import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IBlockBase; import cr0s.warpdrive.api.IBlockTransformer; import cr0s.warpdrive.api.ITransformation; +import cr0s.warpdrive.api.computer.ICoreSignature; import cr0s.warpdrive.block.energy.BlockCapacitor; import cr0s.warpdrive.block.movement.BlockShipCore; import cr0s.warpdrive.compat.CompatForgeMultipart; @@ -536,9 +537,9 @@ public class JumpBlock { } // WarpDrive UUID - if (tagCompound.hasKey("uuidMost")) { - tagCompound.removeTag("uuidMost"); - tagCompound.removeTag("uuidLeast"); + if (tagCompound.hasKey(ICoreSignature.UUID_MOST_TAG)) { + tagCompound.removeTag(ICoreSignature.UUID_MOST_TAG); + tagCompound.removeTag(ICoreSignature.UUID_LEAST_TAG); } // WarpDrive any OC connected tile diff --git a/src/main/java/cr0s/warpdrive/data/JumpShip.java b/src/main/java/cr0s/warpdrive/data/JumpShip.java index 1b819e35..64537064 100644 --- a/src/main/java/cr0s/warpdrive/data/JumpShip.java +++ b/src/main/java/cr0s/warpdrive/data/JumpShip.java @@ -291,7 +291,8 @@ public class JumpShip { public void messageToAllPlayersOnShip(final WarpDriveText textComponent) { final String name = (shipCore != null && !shipCore.name.isEmpty()) ? shipCore.name : "ShipCore"; - final ITextComponent messageFormatted = Commons.getNamedPrefix(name).appendSibling(textComponent); + final ITextComponent messageFormatted = Commons.getNamedPrefix(name) + .appendSibling(textComponent); if (entitiesOnShip == null) { // entities not saved yet, get them now final WarpDriveText reason = new WarpDriveText(); diff --git a/src/main/java/cr0s/warpdrive/data/StarMapRegistry.java b/src/main/java/cr0s/warpdrive/data/StarMapRegistry.java index fbf16b81..f894df16 100644 --- a/src/main/java/cr0s/warpdrive/data/StarMapRegistry.java +++ b/src/main/java/cr0s/warpdrive/data/StarMapRegistry.java @@ -75,7 +75,7 @@ public class StarMapRegistry { // get entry final ArrayList listToRemove = new ArrayList<>(3); - final UUID uuidTileEntity = tileEntity.getUUID(); + final UUID uuidTileEntity = tileEntity.getSignatureUUID(); for (final StarMapRegistryItem registryItem : setRegistryItems) { if (registryItem.uuid == null) { WarpDrive.logger.error(String.format("Removing invalid StarMapRegistryItem %s", @@ -551,6 +551,7 @@ public class StarMapRegistry { isValid = block instanceof BlockShipCore && tileEntity != null && !tileEntity.isInvalid(); break; case JUMP_GATE: + // isValid = block == WarpDrive.blockJumpGateCore && tileEntity != null && !tileEntity.isInvalid(); break; case PLANET: break; diff --git a/src/main/java/cr0s/warpdrive/data/StarMapRegistryItem.java b/src/main/java/cr0s/warpdrive/data/StarMapRegistryItem.java index f15c35a2..8f640396 100644 --- a/src/main/java/cr0s/warpdrive/data/StarMapRegistryItem.java +++ b/src/main/java/cr0s/warpdrive/data/StarMapRegistryItem.java @@ -2,6 +2,7 @@ package cr0s.warpdrive.data; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.api.IStarMapRegistryTileEntity; +import cr0s.warpdrive.api.computer.ICoreSignature; import javax.annotation.Nonnull; import java.util.UUID; @@ -18,8 +19,8 @@ public class StarMapRegistryItem extends GlobalPosition { public int maxX, maxY, maxZ; public int minX, minY, minZ; public int mass; - public double isolationRate = 0.0D; - public String name = "default"; + public double isolationRate; + public String name; public StarMapRegistryItem( final EnumStarMapEntryType type, final UUID uuid, @@ -52,12 +53,12 @@ public class StarMapRegistryItem extends GlobalPosition { public StarMapRegistryItem(final IStarMapRegistryTileEntity tileEntity) { this( - tileEntity.getStarMapType(), tileEntity.getUUID(), + tileEntity.getStarMapType(), tileEntity.getSignatureUUID(), ((TileEntity) tileEntity).getWorld().provider.getDimension(), ((TileEntity) tileEntity).getPos().getX(), ((TileEntity) tileEntity).getPos().getY(), ((TileEntity) tileEntity).getPos().getZ(), tileEntity.getStarMapArea(), tileEntity.getMass(), tileEntity.getIsolationRate(), - tileEntity.getStarMapName()); + tileEntity.getSignatureName() ); } public boolean sameCoordinates(final IStarMapRegistryTileEntity tileEntity) { @@ -72,7 +73,7 @@ public class StarMapRegistryItem extends GlobalPosition { if (WarpDrive.isDev) { assert tileEntity instanceof TileEntity; assert type == tileEntity.getStarMapType(); - assert uuid.equals(tileEntity.getUUID()); + assert uuid.equals(tileEntity.getSignatureUUID()); } final AxisAlignedBB aabbArea = tileEntity.getStarMapArea(); if (aabbArea != null) { @@ -85,7 +86,7 @@ public class StarMapRegistryItem extends GlobalPosition { } mass = tileEntity.getMass(); isolationRate = tileEntity.getIsolationRate(); - name = tileEntity.getStarMapName(); + name = tileEntity.getSignatureName(); } public boolean contains(@Nonnull final BlockPos blockPos) { @@ -101,7 +102,8 @@ public class StarMapRegistryItem extends GlobalPosition { public StarMapRegistryItem(final NBTTagCompound tagCompound) { super(tagCompound); type = EnumStarMapEntryType.getByName(tagCompound.getString("type")); - UUID uuidLocal = new UUID(tagCompound.getLong("uuidMost"), tagCompound.getLong("uuidLeast")); + name = tagCompound.getString(ICoreSignature.NAME_TAG); + UUID uuidLocal = new UUID(tagCompound.getLong(ICoreSignature.UUID_MOST_TAG), tagCompound.getLong(ICoreSignature.UUID_LEAST_TAG)); if (uuidLocal.getMostSignificantBits() == 0 && uuidLocal.getLeastSignificantBits() == 0) { uuidLocal = UUID.randomUUID(); } @@ -114,16 +116,18 @@ public class StarMapRegistryItem extends GlobalPosition { minZ = tagCompound.getInteger("minZ"); mass = tagCompound.getInteger("mass"); isolationRate = tagCompound.getDouble("isolationRate"); - name = tagCompound.getString("name"); } @Override public void writeToNBT(final NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setString("type", type.getName()); + if (name != null && !name.isEmpty()) { + tagCompound.setString(ICoreSignature.NAME_TAG, name); + } if (uuid != null) { - tagCompound.setLong("uuidMost", uuid.getMostSignificantBits()); - tagCompound.setLong("uuidLeast", uuid.getLeastSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_MOST_TAG, uuid.getMostSignificantBits()); + tagCompound.setLong(ICoreSignature.UUID_LEAST_TAG, uuid.getLeastSignificantBits()); } tagCompound.setInteger("maxX", maxX); tagCompound.setInteger("maxY", maxY); @@ -133,9 +137,6 @@ public class StarMapRegistryItem extends GlobalPosition { tagCompound.setInteger("minZ", minZ); tagCompound.setInteger("mass", mass); tagCompound.setDouble("isolationRate", isolationRate); - if (name != null && !name.isEmpty()) { - tagCompound.setString("name", name); - } } public String getFormattedLocation() { diff --git a/src/main/resources/assets/warpdrive/lang/de_de.lang b/src/main/resources/assets/warpdrive/lang/de_de.lang index c4c53c17..d726205a 100644 --- a/src/main/resources/assets/warpdrive/lang/de_de.lang +++ b/src/main/resources/assets/warpdrive/lang/de_de.lang @@ -333,19 +333,19 @@ tile.warpdrive.force_field.relay.superior.name=Überlegenes Kraftfeld Relais tile.warpdrive.force_field.relay.superior.tooltip=Unterstützt bis zu 1 Upgrade im Netzwerk tile.warpdrive.movement.lift.name=Lift -tile.warpdrive.movement.ship_controller.basic.name=Shuttle Raumschiff Steuerung -tile.warpdrive.movement.ship_controller.advanced.name=Corvette Raumschiff Steuerung -tile.warpdrive.movement.ship_controller.superior.name=Frigate Raumschiff Steuerung -tile.warpdrive.movement.ship_controller.exceptional.name=Capital Raumschiff Steuerung -tile.warpdrive.movement.ship_controller.legendary.name=Planetary Raumschiff Steuerung -tile.warpdrive.movement.ship_controller.tooltip=Link to a ship core to control it remotely. Schließe einen Computer an, um das Interface zu öffnen. +tile.warpdrive.movement.ship_controller.basic.name=Remote Shuttle Raumschiff Steuerung +tile.warpdrive.movement.ship_controller.advanced.name=Remote Corvette Raumschiff Steuerung +tile.warpdrive.movement.ship_controller.superior.name=Remote Frigate Raumschiff Steuerung +tile.warpdrive.movement.ship_controller.exceptional.name=Remote Capital Raumschiff Steuerung +tile.warpdrive.movement.ship_controller.legendary.name=Remote Planetary Raumschiff Steuerung +tile.warpdrive.movement.ship_controller.tooltip=Optional block to control a ship core remotely. Schließe einen Computer an, um das Interface zu öffnen. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Shuttle Raumschiff Kern tile.warpdrive.movement.ship_core.advanced.name=Corvette Raumschiff Kern tile.warpdrive.movement.ship_core.superior.name=Frigate Raumschiff Kern tile.warpdrive.movement.ship_core.exceptional.name=Capital Raumschiff Kern tile.warpdrive.movement.ship_core.legendary.name=Planetary Raumschiff Kern tile.warpdrive.movement.ship_core.tooltip=Defines your ship center. Schließe eine Energiequelle an, um den Kern zu laden. Schließe einen Computer an, um das Interface zu öffnen. - tile.warpdrive.movement.ship_core.bounding_box.disabled=Bounding box display have been disabled. tile.warpdrive.movement.ship_core.bounding_box.enabled=Bounding box display is now enabled. Only you can see it.\nSneak right-click the Ship core again to disable it. tile.warpdrive.movement.transporter_beacon.name=Transporter Leuchtfeuer @@ -665,6 +665,20 @@ warpdrive.control_channel.status_line.undefined=Nicht definierter Steuerungskana warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature is set to %1$d +warpdrive.core_signature.get_missing=%3$s has no signature yet! +warpdrive.core_signature.get_same=%2$s is already linked to %1$s. +warpdrive.core_signature.get=%2$s is now linked to %1$s. +warpdrive.core_signature.set_not_supported=You can't change the signature of a %3$s. +warpdrive.core_signature.set_missing=%2$s needs to be linked first! +warpdrive.core_signature.set_same=%3$s is already linked to %1$s. +warpdrive.core_signature.set=%3$s is now linked to %1$s. +warpdrive.core_signature.status_line.defined=Signature is %1$d.\n§bRight-click a remote controller§r to apply this signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bSneak right-click§r a core or controller to set it. +warpdrive.core_signature.status_line.unknown_core_signature=Unknown core signature! +warpdrive.core_signature.status_line.world_not_loaded=Core world is not loaded! + warpdrive.tooltip.item_tag.breathing_helmet=§bRaumatmung§r verbraucht Luftkanister oder IC2 Druckluftzellen. warpdrive.tooltip.item_tag.fly_in_space=§bRaumtaugliches Jetpack§r. warpdrive.tooltip.item_tag.no_fall_damage=§bAbsorbiert Fallschaden§r. diff --git a/src/main/resources/assets/warpdrive/lang/en_us.lang b/src/main/resources/assets/warpdrive/lang/en_us.lang index 7097b695..8321ce82 100644 --- a/src/main/resources/assets/warpdrive/lang/en_us.lang +++ b/src/main/resources/assets/warpdrive/lang/en_us.lang @@ -331,12 +331,13 @@ tile.warpdrive.force_field.relay.superior.name=Superior Force Field Relay tile.warpdrive.force_field.relay.superior.tooltip=Supports up to 1 force field upgrade shared within its network tile.warpdrive.movement.lift.name=Lift -tile.warpdrive.movement.ship_controller.basic.name=Shuttle Ship Controller -tile.warpdrive.movement.ship_controller.advanced.name=Corvette Ship Controller -tile.warpdrive.movement.ship_controller.superior.name=Frigate Ship Controller -tile.warpdrive.movement.ship_controller.exceptional.name=Capital Ship Controller -tile.warpdrive.movement.ship_controller.legendary.name=Planetary Ship Controller -tile.warpdrive.movement.ship_controller.tooltip=Link to a ship core to control it remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.basic.name=Remote Shuttle Ship Controller +tile.warpdrive.movement.ship_controller.advanced.name=Remote Corvette Ship Controller +tile.warpdrive.movement.ship_controller.superior.name=Remote Frigate Ship Controller +tile.warpdrive.movement.ship_controller.exceptional.name=Remote Capital Ship Controller +tile.warpdrive.movement.ship_controller.legendary.name=Remote Planetary Ship Controller +tile.warpdrive.movement.ship_controller.tooltip=Optional block to control a ship core remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Shuttle Ship Core tile.warpdrive.movement.ship_core.advanced.name=Corvette Ship Core tile.warpdrive.movement.ship_core.superior.name=Frigate Ship Core @@ -662,6 +663,20 @@ warpdrive.control_channel.status_line.undefined=Undefined Control channel.\n§bU warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature is set to %1$d +warpdrive.core_signature.get_missing=%3$s has no signature yet! +warpdrive.core_signature.get_same=%2$s is already linked to %1$s. +warpdrive.core_signature.get=%2$s is now linked to %1$s. +warpdrive.core_signature.set_not_supported=You can't change the signature of a %3$s. +warpdrive.core_signature.set_missing=%2$s needs to be linked first! +warpdrive.core_signature.set_same=%3$s is already linked to %1$s. +warpdrive.core_signature.set=%3$s is now linked to %1$s. +warpdrive.core_signature.status_line.defined=Signature is %1$d.\n§bRight-click a remote controller§r to apply this signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bSneak right-click§r a core or controller to set it. +warpdrive.core_signature.status_line.unknown_core_signature=Unknown core signature! +warpdrive.core_signature.status_line.world_not_loaded=Core world is not loaded! + warpdrive.tooltip.item_tag.breathing_helmet=§bSpace breathing§r consuming Air canisters and IC2 Compressed air cells from your inventory. warpdrive.tooltip.item_tag.fly_in_space=§bSpace compatible jetpack§r. warpdrive.tooltip.item_tag.no_fall_damage=§bAbsorbs fall damage§r. diff --git a/src/main/resources/assets/warpdrive/lang/fr_fr.lang b/src/main/resources/assets/warpdrive/lang/fr_fr.lang index 141b061e..72414232 100644 --- a/src/main/resources/assets/warpdrive/lang/fr_fr.lang +++ b/src/main/resources/assets/warpdrive/lang/fr_fr.lang @@ -283,7 +283,7 @@ tile.warpdrive.detection.cloaking_core.name=Noyau d'invisibilité tile.warpdrive.detection.monitor.name=Moniteur tile.warpdrive.detection.radar.name=Radar tile.warpdrive.detection.warp_isolation.name=Bloc d'isolation de champ de Warp -tile.warpdrive.detection.warp_isolation.tooltip.usage=Placer jusqu'à %5$d m par rapport au coeur de vaisseau\nUtilise %1$d à %3$d blocs d'isolation pour absorber %2$d %% à %4$d %% des ondes radar +tile.warpdrive.detection.warp_isolation.tooltip.usage=Placer jusqu'à %5$d m par rapport au cœur de vaisseau\nUtilise %1$d à %3$d blocs d'isolation pour absorber %2$d %% à %4$d %% des ondes radar tile.warpdrive.detection.siren_industrial.basic.name=Sirène industrielle basique tile.warpdrive.detection.siren_industrial.advanced.name=Sirène industrielle avancée @@ -331,21 +331,22 @@ tile.warpdrive.force_field.relay.superior.name=Relais supérieur de champ de for tile.warpdrive.force_field.relay.superior.tooltip=Supporte jusqu'à 1 augmentation de champ de force partagée avec son réseau tile.warpdrive.movement.lift.name=Ascenseur -tile.warpdrive.movement.ship_controller.basic.name=Controlleur de vaisseau navette -tile.warpdrive.movement.ship_controller.advanced.name=Controlleur de vaisseau corvette -tile.warpdrive.movement.ship_controller.superior.name=Controlleur de vaisseau frégate -tile.warpdrive.movement.ship_controller.exceptional.name=Controlleur de vaisseau capital -tile.warpdrive.movement.ship_controller.legendary.name=Controlleur de vaisseau planétaire -tile.warpdrive.movement.ship_controller.tooltip=Lie à un cœur de vaisseau pour le contrôler à distance. Attache un ordinateur pour ouvrir l'interface utilisateur. +tile.warpdrive.movement.ship_controller.basic.name=Controlleur distant de vaisseau navette +tile.warpdrive.movement.ship_controller.advanced.name=Controlleur distant de vaisseau corvette +tile.warpdrive.movement.ship_controller.superior.name=Controlleur distant de vaisseau frégate +tile.warpdrive.movement.ship_controller.exceptional.name=Controlleur distant de vaisseau capital +tile.warpdrive.movement.ship_controller.legendary.name=Controlleur distant de vaisseau planétaire +tile.warpdrive.movement.ship_controller.tooltip=Block optional pour à distance d'un cœur de vaisseau. Attache un ordinateur pour ouvrir l'interface utilisateur. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Cœur de vaisseau navette tile.warpdrive.movement.ship_core.advanced.name=Cœur de vaisseau corvette tile.warpdrive.movement.ship_core.superior.name=Cœur de vaisseau frégate tile.warpdrive.movement.ship_core.exceptional.name=Cœur de vaisseau capital tile.warpdrive.movement.ship_core.legendary.name=Cœur de vaisseau planétaire -tile.warpdrive.movement.ship_core.tooltip=Défini le centre du vaisseau. Connecte une source d'énergie pour charger le coeur. Attache un ordinateur pour ouvrir l'interface utilisateur. +tile.warpdrive.movement.ship_core.tooltip=Défini le centre du vaisseau. Connecte une source d'énergie pour charger le cœur. Attache un ordinateur pour ouvrir l'interface utilisateur. tile.warpdrive.movement.ship_core.bounding_box.disabled=L'affichage des déliminations a été désactivé. -tile.warpdrive.movement.ship_core.bounding_box.enabled=L'affichage des déliminations est maintement activé. Seul toi peut les voir.\n§bShift-clique droit§7 le coeur de vaisseau à nouveau pour le désactiver. +tile.warpdrive.movement.ship_core.bounding_box.enabled=L'affichage des déliminations est maintement activé. Seul toi peut les voir.\n§bShift-clique droit§7 le cœur de vaisseau à nouveau pour le désactiver. tile.warpdrive.movement.transporter_beacon.name=Balise de transporteur tile.warpdrive.movement.transporter_beacon.tooltip=§bRight click a Transporter Core§7 to set its remote location\n§bSneak§7 to retrieve its signature\n§bPlace as a block§7 to trigger emergency transportation tile.warpdrive.movement.transporter_containment.name=Confinement de transporteur @@ -663,6 +664,20 @@ warpdrive.control_channel.status_line.undefined=Le canal de contrôle est non d warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature est définie à %1$d. +warpdrive.core_signature.get_missing=%3$s n'a pas encore de signature! +warpdrive.core_signature.get_same=%2$s est déjà relié à %1$s. +warpdrive.core_signature.get=%2$s est désormais lié à %1$s. +warpdrive.core_signature.set_not_supported=Tu ne peux pas changer la signature de %3$s. +warpdrive.core_signature.set_missing=%2$s doit d'abord être relié! +warpdrive.core_signature.set_same=%3$s est déjà relié à %1$s. +warpdrive.core_signature.set=%3$s est désormais lié à %1$s. +warpdrive.core_signature.status_line.defined=Signature est définie à %1$d.\n§bClique droit un controller à distance§r pour appliquer cette signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bShift-clique droit§r un cœur ou controller pour prendre sa signature. +warpdrive.core_signature.status_line.unknown_core_signature=Signature de cœur inconnue! +warpdrive.core_signature.status_line.world_not_loaded=Le monde du cœur n'est pas chargé! + warpdrive.tooltip.item_tag.breathing_helmet=Permet de §brespirer dans le vide§r en consommant des cartouches d'air et des cellules d'air comprimé de IC2 depuis l'inventaire. warpdrive.tooltip.item_tag.fly_in_space=Jetpack compatible avec une utilisation §bspatiale§r. warpdrive.tooltip.item_tag.no_fall_damage=§bAbsorbe les damages de chute§r. diff --git a/src/main/resources/assets/warpdrive/lang/nl_nl.lang b/src/main/resources/assets/warpdrive/lang/nl_nl.lang index b96ba305..8427019b 100644 --- a/src/main/resources/assets/warpdrive/lang/nl_nl.lang +++ b/src/main/resources/assets/warpdrive/lang/nl_nl.lang @@ -331,19 +331,19 @@ tile.warpdrive.force_field.relay.superior.name=Superieure Krachtvelds-relais tile.warpdrive.force_field.relay.superior.tooltip=Kan tot maar 1 krachtveld-upgrade delen in zijn netwerk tile.warpdrive.movement.lift.name=Lift -tile.warpdrive.movement.ship_controller.basic.name=Shuttle Schips-Bestuurder -tile.warpdrive.movement.ship_controller.advanced.name=Corvette Schips-Bestuurder -tile.warpdrive.movement.ship_controller.superior.name=Frigate Schips-Bestuurder -tile.warpdrive.movement.ship_controller.exceptional.name=Capital Schips-Bestuurder -tile.warpdrive.movement.ship_controller.legendary.name=Planetary Schips-Bestuurder -tile.warpdrive.movement.ship_controller.tooltip=Link to a ship core to control it remotely. Sluit een computer aan om de interface te openen. +tile.warpdrive.movement.ship_controller.basic.name=Remote Shuttle Schips-Bestuurder +tile.warpdrive.movement.ship_controller.advanced.name=Remote Corvette Schips-Bestuurder +tile.warpdrive.movement.ship_controller.superior.name=Remote Frigate Schips-Bestuurder +tile.warpdrive.movement.ship_controller.exceptional.name=Remote Capital Schips-Bestuurder +tile.warpdrive.movement.ship_controller.legendary.name=Remote Planetary Schips-Bestuurder +tile.warpdrive.movement.ship_controller.tooltip=Optional block to control a ship core remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Shuttle Schip-Kern tile.warpdrive.movement.ship_core.advanced.name=Corvette Schip-Kern tile.warpdrive.movement.ship_core.superior.name=Frigate Schip-Kern tile.warpdrive.movement.ship_core.exceptional.name=Capital Schip-Kern tile.warpdrive.movement.ship_core.legendary.name=Planetary Schip-Kern tile.warpdrive.movement.ship_core.tooltip=Defines your ship center. Sluit een stroombron aan om de kern op te laden. Sluit een computer aan om de interface te openen. - tile.warpdrive.movement.ship_core.bounding_box.disabled=Bounding box display have been disabled. tile.warpdrive.movement.ship_core.bounding_box.enabled=Bounding box display is now enabled. Only you can see it.\n§bSneak right-click the Ship core§7 again to disable it. tile.warpdrive.movement.transporter_beacon.name=Transport-baken @@ -663,6 +663,20 @@ warpdrive.control_channel.status_line.undefined=Niet gedefinieerde controlekanaa warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature is set to %1$d +warpdrive.core_signature.get_missing=%3$s has no signature yet! +warpdrive.core_signature.get_same=%2$s is already linked to %1$s. +warpdrive.core_signature.get=%2$s is now linked to %1$s. +warpdrive.core_signature.set_not_supported=You can't change the signature of a %3$s. +warpdrive.core_signature.set_missing=%2$s needs to be linked first! +warpdrive.core_signature.set_same=%3$s is already linked to %1$s. +warpdrive.core_signature.set=%3$s is now linked to %1$s. +warpdrive.core_signature.status_line.defined=Signature is %1$d.\n§bRight-click a remote controller§r to apply this signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bSneak right-click§r a core or controller to set it. +warpdrive.core_signature.status_line.unknown_core_signature=Unknown core signature! +warpdrive.core_signature.status_line.world_not_loaded=Core world is not loaded! + warpdrive.tooltip.item_tag.breathing_helmet=§Ademhalen in de ruimte§r consumeert de inhoud van een Zuurstoffles en/of IC2 Gecompresseerde Luchtcellen uit je inventory. warpdrive.tooltip.item_tag.fly_in_space=§bJetpack Die werkt in de ruimte§r. warpdrive.tooltip.item_tag.no_fall_damage=§bAbsorbeert Schade van vallen§r. diff --git a/src/main/resources/assets/warpdrive/lang/ru_ru.lang b/src/main/resources/assets/warpdrive/lang/ru_ru.lang index 7c4532d1..40cedcf4 100644 --- a/src/main/resources/assets/warpdrive/lang/ru_ru.lang +++ b/src/main/resources/assets/warpdrive/lang/ru_ru.lang @@ -331,19 +331,19 @@ tile.warpdrive.force_field.relay.superior.name=Superior Force Field Relay tile.warpdrive.force_field.relay.superior.tooltip=Supports up to 1 force field upgrade shared within its network tile.warpdrive.movement.lift.name=Лифт -tile.warpdrive.movement.ship_controller.basic.name=Shuttle Контроллер корабля -tile.warpdrive.movement.ship_controller.advanced.name=Corvette Контроллер корабля -tile.warpdrive.movement.ship_controller.superior.name=Frigate Контроллер корабля -tile.warpdrive.movement.ship_controller.exceptional.name=Capital Контроллер корабля -tile.warpdrive.movement.ship_controller.legendary.name=Planetary Контроллер корабля -tile.warpdrive.movement.ship_controller.tooltip=Link to a ship core to control it remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.basic.name=Remote Shuttle Контроллер корабля +tile.warpdrive.movement.ship_controller.advanced.name=Remote Corvette Контроллер корабля +tile.warpdrive.movement.ship_controller.superior.name=Remote Frigate Контроллер корабля +tile.warpdrive.movement.ship_controller.exceptional.name=Remote Capital Контроллер корабля +tile.warpdrive.movement.ship_controller.legendary.name=Remote Planetary Контроллер корабля +tile.warpdrive.movement.ship_controller.tooltip=Optional block to control a ship core remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Shuttle Ядро корабля tile.warpdrive.movement.ship_core.advanced.name=Corvette Ядро корабля tile.warpdrive.movement.ship_core.superior.name=FrigateЯдро корабля tile.warpdrive.movement.ship_core.exceptional.name=Capital Ядро корабля tile.warpdrive.movement.ship_core.legendary.name=Planetary Ядро корабля tile.warpdrive.movement.ship_core.tooltip=Defines your ship center. Connecting an energy source will charge the core. Attach a computer to open the user interface. - tile.warpdrive.movement.ship_core.bounding_box.disabled=Bounding box display have been disabled. tile.warpdrive.movement.ship_core.bounding_box.enabled=Bounding box display is now enabled. Only you can see it.\n§bSneak right-click the Ship core§7 again to disable it. tile.warpdrive.movement.transporter_beacon.name=Маяк для транспортера @@ -663,6 +663,20 @@ warpdrive.control_channel.status_line.undefined=Undefined Control channel.\n§bU warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature is set to %1$d +warpdrive.core_signature.get_missing=%3$s has no signature yet! +warpdrive.core_signature.get_same=%2$s is already linked to %1$s. +warpdrive.core_signature.get=%2$s is now linked to %1$s. +warpdrive.core_signature.set_not_supported=You can't change the signature of a %3$s. +warpdrive.core_signature.set_missing=%2$s needs to be linked first! +warpdrive.core_signature.set_same=%3$s is already linked to %1$s. +warpdrive.core_signature.set=%3$s is now linked to %1$s. +warpdrive.core_signature.status_line.defined=Signature is %1$d.\n§bRight-click a remote controller§r to apply this signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bSneak right-click§r a core or controller to set it. +warpdrive.core_signature.status_line.unknown_core_signature=Unknown core signature! +warpdrive.core_signature.status_line.world_not_loaded=Core world is not loaded! + warpdrive.tooltip.item_tag.breathing_helmet=§bSpace breathing§r consuming Air canisters and IC2 Compressed air cells from your inventory. warpdrive.tooltip.item_tag.fly_in_space=§bSpace compatible jetpack§r. warpdrive.tooltip.item_tag.no_fall_damage=§bAbsorbs fall damage§r. diff --git a/src/main/resources/assets/warpdrive/lang/zh_cn.lang b/src/main/resources/assets/warpdrive/lang/zh_cn.lang index 24bfbfb0..f17a34c4 100644 --- a/src/main/resources/assets/warpdrive/lang/zh_cn.lang +++ b/src/main/resources/assets/warpdrive/lang/zh_cn.lang @@ -332,19 +332,19 @@ tile.warpdrive.force_field.relay.superior.name=卓越力场继电器 tile.warpdrive.force_field.relay.superior.tooltip=支持一个力场升级在其网络内共享 tile.warpdrive.movement.lift.name=电梯 -tile.warpdrive.movement.ship_controller.basic.name=Shuttle 飞船控制仪 -tile.warpdrive.movement.ship_controller.advanced.name=Corvette 飞船控制仪 -tile.warpdrive.movement.ship_controller.superior.name=Frigate 飞船控制仪 -tile.warpdrive.movement.ship_controller.exceptional.name=Capital 飞船控制仪 -tile.warpdrive.movement.ship_controller.legendary.name=Planetary 飞船控制仪 -tile.warpdrive.movement.ship_controller.tooltip=Link to a ship core to control it remotely. 在相连的电脑上打开交互界面. +tile.warpdrive.movement.ship_controller.basic.name=Remote Shuttle 飞船控制仪 +tile.warpdrive.movement.ship_controller.advanced.name=Remote Corvette 飞船控制仪 +tile.warpdrive.movement.ship_controller.superior.name=Remote Frigate 飞船控制仪 +tile.warpdrive.movement.ship_controller.exceptional.name=Remote Capital 飞船控制仪 +tile.warpdrive.movement.ship_controller.legendary.name=Remote Planetary 飞船控制仪 +tile.warpdrive.movement.ship_controller.tooltip=Optional block to control a ship core remotely. 在相连的电脑上打开交互界面. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Shuttle 飞船核心 tile.warpdrive.movement.ship_core.advanced.name=Corvette 飞船核心 tile.warpdrive.movement.ship_core.superior.name=Frigate 飞船核心 tile.warpdrive.movement.ship_core.exceptional.name=Capital 飞船核心 tile.warpdrive.movement.ship_core.legendary.name=Planetary 飞船核心 tile.warpdrive.movement.ship_core.tooltip=Defines your ship center. 连接供能设备充能. 在相连的电脑上打开交互界面. - tile.warpdrive.movement.ship_core.bounding_box.disabled=边界显示已禁用. tile.warpdrive.movement.ship_core.bounding_box.enabled=边界显示启用. 只有你可见.\n再次潜行右击核心可关闭. tile.warpdrive.movement.transporter_beacon.name=运输信标 @@ -664,6 +664,20 @@ warpdrive.control_channel.status_line.undefined=未定义控制连接.\n§b使 warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature is set to %1$d +warpdrive.core_signature.get_missing=%3$s has no signature yet! +warpdrive.core_signature.get_same=%2$s is already linked to %1$s. +warpdrive.core_signature.get=%2$s is now linked to %1$s. +warpdrive.core_signature.set_not_supported=You can't change the signature of a %3$s. +warpdrive.core_signature.set_missing=%2$s needs to be linked first! +warpdrive.core_signature.set_same=%3$s is already linked to %1$s. +warpdrive.core_signature.set=%3$s is now linked to %1$s. +warpdrive.core_signature.status_line.defined=Signature is %1$d.\n§bRight-click a remote controller§r to apply this signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bSneak right-click§r a core or controller to set it. +warpdrive.core_signature.status_line.unknown_core_signature=Unknown core signature! +warpdrive.core_signature.status_line.world_not_loaded=Core world is not loaded! + warpdrive.tooltip.item_tag.breathing_helmet=§b太空中呼吸§r消耗背包中的IC压缩空气 warpdrive.tooltip.item_tag.fly_in_space=§b太空喷气背包§r. warpdrive.tooltip.item_tag.no_fall_damage=§b减少摔落伤害§r. diff --git a/src/main/resources/assets/warpdrive/lang/zh_tw.lang b/src/main/resources/assets/warpdrive/lang/zh_tw.lang index 84266d45..4fb57e55 100644 --- a/src/main/resources/assets/warpdrive/lang/zh_tw.lang +++ b/src/main/resources/assets/warpdrive/lang/zh_tw.lang @@ -331,12 +331,13 @@ tile.warpdrive.force_field.relay.superior.name=Superior Force Field Relay tile.warpdrive.force_field.relay.superior.tooltip=支持在其網絡內共享最多1個力場升級 tile.warpdrive.movement.lift.name=升降機 -tile.warpdrive.movement.ship_controller.basic.name=Shuttle 船艦制禦器 -tile.warpdrive.movement.ship_controller.advanced.name=Corvette 船艦制禦器 -tile.warpdrive.movement.ship_controller.superior.name=Frigate 船艦制禦器 -tile.warpdrive.movement.ship_controller.exceptional.name=Capital 船艦制禦器 -tile.warpdrive.movement.ship_controller.legendary.name=Planetary 船艦制禦器 -tile.warpdrive.movement.ship_controller.tooltip=Link to a ship core to control it remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.basic.name=Remote Shuttle 船艦制禦器 +tile.warpdrive.movement.ship_controller.advanced.name=Remote Corvette 船艦制禦器 +tile.warpdrive.movement.ship_controller.superior.name=Remote Frigate 船艦制禦器 +tile.warpdrive.movement.ship_controller.exceptional.name=Remote Capital 船艦制禦器 +tile.warpdrive.movement.ship_controller.legendary.name=Remote Planetary 船艦制禦器 +tile.warpdrive.movement.ship_controller.tooltip=Optional block to control a ship core remotely. Attach a computer to open the user interface. +tile.warpdrive.movement.ship_controller.away_from_core=Remote controller is for remote usage, also they're optional now... tile.warpdrive.movement.ship_core.basic.name=Shuttle 波動核心 tile.warpdrive.movement.ship_core.advanced.name=Corvette 波動核心 tile.warpdrive.movement.ship_core.superior.name=Frigate 波動核心 @@ -661,6 +662,20 @@ warpdrive.control_channel.status_line.undefined=Undefined Control channel.\n§bU warpdrive.is_enabled.set.enabled=Switched ON! warpdrive.is_enabled.set.disabled=Switched off! +# %1 is signature name, %2 is item name, %3 is block name +warpdrive.core_signature.tooltip=Signature is set to %1$d +warpdrive.core_signature.get_missing=%3$s has no signature yet! +warpdrive.core_signature.get_same=%2$s is already linked to %1$s. +warpdrive.core_signature.get=%2$s is now linked to %1$s. +warpdrive.core_signature.set_not_supported=You can't change the signature of a %3$s. +warpdrive.core_signature.set_missing=%2$s needs to be linked first! +warpdrive.core_signature.set_same=%3$s is already linked to %1$s. +warpdrive.core_signature.set=%3$s is now linked to %1$s. +warpdrive.core_signature.status_line.defined=Signature is %1$d.\n§bRight-click a remote controller§r to apply this signature. +warpdrive.core_signature.status_line.undefined=Undefined signature.\n§bSneak right-click§r a core or controller to set it. +warpdrive.core_signature.status_line.unknown_core_signature=Unknown core signature! +warpdrive.core_signature.status_line.world_not_loaded=Core world is not loaded! + warpdrive.tooltip.item_tag.breathing_helmet-legacyTranslation=§b空間呼吸§r 正在從您的庫存消耗IC2的壓縮空氣囊。 warpdrive.tooltip.item_tag.breathing_helmet=§bSpace breathing§r consuming Air canisters and IC2 Compressed air cells from your inventory. warpdrive.tooltip.item_tag.fly_in_space=§b空間噴氣背包§r. diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons b/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons index d594da8f..3eac2344 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/common/warpdriveCommons @@ -1012,7 +1012,7 @@ local function data_shouldUpdateName() for name, handlers in pairs(data_handlers) do if handlers.name ~= nil then local componentName = handlers.name() - if componentName == "default" or componentName == "" then + if componentName == "" then shouldUpdateName = true elseif shouldUpdateName then data_name = componentName diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMainframe/startup b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMainframe/startup index e8f9d329..3cb85614 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMainframe/startup +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveMainframe/startup @@ -1738,7 +1738,7 @@ function radar_scanDone() for i = 0, numResults do local success, type, name, x, y, z = radar.getResult(i) if success then - if name == "default" then + if name == "" then name = "?" end data.radar_results[i] = { x = x, y = y, z = z, name = name, type = type } diff --git a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveShipController/startup b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveShipController/startup index 451132c2..22dc5ce9 100644 --- a/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveShipController/startup +++ b/src/main/resources/assets/warpdrive/lua.ComputerCraft/warpdriveShipController/startup @@ -44,7 +44,7 @@ function ship_boot() w.setColorNormal() w.writeLn("Booting Ship") - w.write("- internal parameters: ") + w.write("- acquiring parameters: ") ship_front, ship_right, ship_up = ship.dim_positive() ship_back, ship_left, ship_down = ship.dim_negative() ship_isInHyper = ship.isInHyperspace() @@ -54,7 +54,7 @@ function ship_boot() w.writeLn("ok") w.setColorNormal() - w.write("- detecting Ship Core: ") + w.write("- checking assembly : ") local timeout = 10 local isValid, message repeat @@ -71,12 +71,12 @@ function ship_boot() -- don't reboot as the player might need to set new dimensions to fix it else w.setColorSuccess() - w.writeLn("linked") + w.writeLn("passed") end w.sleep(0.2) w.setColorNormal() - w.write("- global position : ") + w.write("- celestial position : ") timeout = 10 local pos repeat @@ -100,7 +100,7 @@ function ship_boot() w.sleep(0.2) w.setColorNormal() - w.write("- integrity check : ") + w.write("- integrity check : ") timeout = 10 local shipSize repeat diff --git a/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua b/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua index ab0004bf..0fdf7a38 100644 --- a/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua +++ b/src/main/resources/assets/warpdrive/lua.OpenComputers/common/usr/lib/warpdriveCommons.lua @@ -999,7 +999,7 @@ local function data_shouldUpdateName() for name, handlers in pairs(data_handlers) do if handlers.name ~= nil then local componentName = handlers.name() - if componentName == "default" or componentName == "" then + if componentName == "" then shouldUpdateName = true elseif shouldUpdateName then data_name = componentName diff --git a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveShipController/startup b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveShipController/startup index 14c0a861..616c604f 100644 --- a/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveShipController/startup +++ b/src/main/resources/assets/warpdrive/lua.OpenComputers/warpdriveShipController/startup @@ -45,7 +45,7 @@ function ship_boot() w.setColorNormal() w.writeLn("Booting Ship") - w.write("- internal parameters: ") + w.write("- acquiring parameters: ") ship_front, ship_right, ship_up = ship.dim_positive() ship_back, ship_left, ship_down = ship.dim_negative() ship_isInHyper = ship.isInHyperspace() @@ -55,7 +55,7 @@ function ship_boot() w.writeLn("ok") w.setColorNormal() - w.write("- detecting Ship Core: ") + w.write("- checking assembly : ") local timeout = 10 local isValid, message repeat @@ -72,12 +72,12 @@ function ship_boot() -- don't reboot as the player might need to set new dimensions to fix it else w.setColorSuccess() - w.writeLn("linked") + w.writeLn("validated") end w.sleep(0.2) w.setColorNormal() - w.write("- global position : ") + w.write("- celestial position : ") timeout = 10 local pos repeat @@ -101,7 +101,7 @@ function ship_boot() w.sleep(0.2) w.setColorNormal() - w.write("- integrity check : ") + w.write("- integrity check : ") timeout = 10 local shipSize repeat