mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-02-14 18:10:05 +00:00
Merge branch 'mc-1.15.x' into mc-1.16.x
This commit is contained in:
commit
d0a973fa46
@ -50,12 +50,12 @@ I'd generally recommend you don't contact me directly (email, DM, etc...) unless
|
|||||||
report exploits). You'll get a far quicker response if you ask the whole community!
|
report exploits). You'll get a far quicker response if you ask the whole community!
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
If you want to depend on CC: Tweaked, we have a maven repo. However, you should be wary that some functionality is only
|
CC: Tweaked is hosted on my maven repo, and so is relatively simple to depend on. You may wish to add a soft (or hard)
|
||||||
exposed by CC:T's API and not vanilla ComputerCraft. If you wish to support all variations of ComputerCraft, I recommend
|
dependency in your `mods.toml` file, with the appropriate version bounds, to ensure that API functionality you depend
|
||||||
using [cc.crzd.me's maven](https://cc.crzd.me/maven/) instead.
|
on is present.
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
repositories {
|
||||||
maven { url 'https://squiddev.cc/maven/' }
|
maven { url 'https://squiddev.cc/maven/' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Mod properties
|
# Mod properties
|
||||||
mod_version=1.91.1
|
mod_version=1.92.0
|
||||||
|
|
||||||
# Minecraft properties (update mods.toml when changing)
|
# Minecraft properties (update mods.toml when changing)
|
||||||
mc_version=1.16.2
|
mc_version=1.16.2
|
||||||
|
@ -39,6 +39,7 @@ public final class ComputerCraft
|
|||||||
public static final String[] DEFAULT_HTTP_ALLOW = new String[] { "*" };
|
public static final String[] DEFAULT_HTTP_ALLOW = new String[] { "*" };
|
||||||
public static final String[] DEFAULT_HTTP_DENY = new String[] {
|
public static final String[] DEFAULT_HTTP_DENY = new String[] {
|
||||||
"127.0.0.0/8",
|
"127.0.0.0/8",
|
||||||
|
"0.0.0.0/8",
|
||||||
"10.0.0.0/8",
|
"10.0.0.0/8",
|
||||||
"172.16.0.0/12",
|
"172.16.0.0/12",
|
||||||
"192.168.0.0/16",
|
"192.168.0.0/16",
|
||||||
|
@ -124,7 +124,7 @@ public class FileSystemWrapperMount implements IFileSystem
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return m_filesystem.exists( path );
|
return m_filesystem.isDir( path );
|
||||||
}
|
}
|
||||||
catch( FileSystemException e )
|
catch( FileSystemException e )
|
||||||
{
|
{
|
||||||
|
@ -42,8 +42,6 @@ public final class DropConsumer
|
|||||||
dropEntity = entity;
|
dropEntity = entity;
|
||||||
dropWorld = entity.world;
|
dropWorld = entity.world;
|
||||||
dropBounds = new AxisAlignedBB( entity.getPosition() ).grow( 2, 2, 2 );
|
dropBounds = new AxisAlignedBB( entity.getPosition() ).grow( 2, 2, 2 );
|
||||||
|
|
||||||
entity.captureDrops( new ArrayList<>() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void set( World world, BlockPos pos, Function<ItemStack, ItemStack> consumer )
|
public static void set( World world, BlockPos pos, Function<ItemStack, ItemStack> consumer )
|
||||||
@ -86,7 +84,7 @@ public final class DropConsumer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent( priority = EventPriority.LOW )
|
||||||
public static void onLivingDrops( LivingDropsEvent drops )
|
public static void onLivingDrops( LivingDropsEvent drops )
|
||||||
{
|
{
|
||||||
if( dropEntity == null || drops.getEntity() != dropEntity ) return;
|
if( dropEntity == null || drops.getEntity() != dropEntity ) return;
|
||||||
|
48
src/main/resources/assets/computercraft/lang/vi.json
Normal file
48
src/main/resources/assets/computercraft/lang/vi.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"gui.computercraft.tooltip.disk_id": "ID của đĩa: %s",
|
||||||
|
"upgrade.computercraft.speaker.adjective": "Ồn ào",
|
||||||
|
"upgrade.computercraft.wireless_modem_advanced.adjective": "Ender",
|
||||||
|
"upgrade.computercraft.wireless_modem_normal.adjective": "Không dây",
|
||||||
|
"upgrade.minecraft.crafting_table.adjective": "Chế tạo",
|
||||||
|
"upgrade.minecraft.diamond_hoe.adjective": "Trồng trọt",
|
||||||
|
"upgrade.minecraft.diamond_axe.adjective": "Đốn",
|
||||||
|
"upgrade.minecraft.diamond_pickaxe.adjective": "Khai thác",
|
||||||
|
"upgrade.minecraft.diamond_shovel.adjective": "Đào",
|
||||||
|
"item.computercraft.pocket_computer_advanced.upgraded": "Máy tính bỏ túi tiên tiến %s",
|
||||||
|
"item.computercraft.pocket_computer_advanced": "Máy tính bỏ túi tiên tiến",
|
||||||
|
"item.computercraft.pocket_computer_normal.upgraded": "Máy tính bỏ túi %s",
|
||||||
|
"item.computercraft.pocket_computer_normal": "Máy tính bỏ túi",
|
||||||
|
"item.computercraft.printed_book": "Sách in",
|
||||||
|
"item.computercraft.printed_page": "Trang in",
|
||||||
|
"item.computercraft.treasure_disk": "Đĩa mềm",
|
||||||
|
"item.computercraft.disk": "Đĩa mềm",
|
||||||
|
"block.computercraft.turtle_advanced.upgraded_twice": "Rùa tiên tiến %s %s",
|
||||||
|
"block.computercraft.turtle_advanced.upgraded": "Rùa tiên tiến %s",
|
||||||
|
"block.computercraft.turtle_advanced": "Rùa tiên tiến",
|
||||||
|
"block.computercraft.turtle_normal.upgraded_twice": "Rùa %s %s",
|
||||||
|
"block.computercraft.turtle_normal.upgraded": "Rùa %s",
|
||||||
|
"block.computercraft.turtle_normal": "Rùa",
|
||||||
|
"block.computercraft.wired_modem_full": "Modem có dây",
|
||||||
|
"block.computercraft.cable": "Dây cáp mạng",
|
||||||
|
"block.computercraft.wired_modem": "Modem có dây",
|
||||||
|
"block.computercraft.wireless_modem_advanced": "Modem Ender",
|
||||||
|
"block.computercraft.wireless_modem_normal": "Modem không dây",
|
||||||
|
"block.computercraft.monitor_advanced": "Màn hình tiên tiếng",
|
||||||
|
"block.computercraft.monitor_normal": "Màn hình",
|
||||||
|
"block.computercraft.speaker": "Loa",
|
||||||
|
"block.computercraft.printer": "Máy in",
|
||||||
|
"block.computercraft.disk_drive": "Ỗ đĩa",
|
||||||
|
"block.computercraft.computer_command": "Máy tính điều khiển",
|
||||||
|
"block.computercraft.computer_normal": "Máy tính",
|
||||||
|
"itemGroup.computercraft": "ComputerCraft",
|
||||||
|
"block.computercraft.computer_advanced": "Máy tính tiên tiến",
|
||||||
|
"tracking_field.computercraft.websocket_incoming.name": "Websocket đến",
|
||||||
|
"tracking_field.computercraft.websocket_outgoing.name": "Websocket đi",
|
||||||
|
"gui.computercraft.tooltip.computer_id": "ID của máy tính: %s",
|
||||||
|
"tracking_field.computercraft.coroutines_dead.name": "Coroutine bỏ đi",
|
||||||
|
"tracking_field.computercraft.coroutines_created.name": "Coroutine đã tạo",
|
||||||
|
"tracking_field.computercraft.http_download.name": "HTTP tải xuống",
|
||||||
|
"tracking_field.computercraft.http_upload.name": "HTTP tải lên",
|
||||||
|
"tracking_field.computercraft.http.name": "Yêu cầu HTTP",
|
||||||
|
"gui.computercraft.tooltip.copy": "Sao chép vào clipboard"
|
||||||
|
}
|
@ -432,7 +432,7 @@ do
|
|||||||
|
|
||||||
--- Skip any whitespace
|
--- Skip any whitespace
|
||||||
local function skip(str, pos)
|
local function skip(str, pos)
|
||||||
local _, last = find(str, "^[ \n\r\v]+", pos)
|
local _, last = find(str, "^[ \n\r\t]+", pos)
|
||||||
if last then return last + 1 else return pos end
|
if last then return last + 1 else return pos end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ do
|
|||||||
buf[n], n, pos = utf8.char(tonumber(num_str, 16)), n + 1, pos + 6
|
buf[n], n, pos = utf8.char(tonumber(num_str, 16)), n + 1, pos + 6
|
||||||
else
|
else
|
||||||
local unesc = escapes[c]
|
local unesc = escapes[c]
|
||||||
if not unesc then error_at(pos + 1, "Unknown escape character %q.", unesc) end
|
if not unesc then error_at(pos + 1, "Unknown escape character %q.", c) end
|
||||||
buf[n], n, pos = unesc, n + 1, pos + 2
|
buf[n], n, pos = unesc, n + 1, pos + 2
|
||||||
end
|
end
|
||||||
elseif c >= '\x20' then
|
elseif c >= '\x20' then
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
# New features in CC: Tweaked 1.92.0
|
||||||
|
|
||||||
|
* Bump Cobalt version:
|
||||||
|
* Add support for the __pairs metamethod.
|
||||||
|
* string.format now uses the __tostring metamethod.
|
||||||
|
* Add date-specific MOTDs (MCJack123).
|
||||||
|
|
||||||
|
And several bug fixes:
|
||||||
|
* Correctly handle tabs within textutils.unserailizeJSON.
|
||||||
|
* Fix sheep not dropping items when sheered by turtles.
|
||||||
|
|
||||||
# New features in CC: Tweaked 1.91.1
|
# New features in CC: Tweaked 1.91.1
|
||||||
|
|
||||||
* Fix crash when turtles interact with an entity.
|
* Fix crash when turtles interact with an entity.
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
New features in CC: Tweaked 1.91.1
|
New features in CC: Tweaked 1.92.0
|
||||||
|
|
||||||
* Fix crash when turtles interact with an entity.
|
* Bump Cobalt version:
|
||||||
|
* Add support for the __pairs metamethod.
|
||||||
|
* string.format now uses the __tostring metamethod.
|
||||||
|
* Add date-specific MOTDs (MCJack123).
|
||||||
|
|
||||||
|
And several bug fixes:
|
||||||
|
* Correctly handle tabs within textutils.unserailizeJSON.
|
||||||
|
* Fix sheep not dropping items when sheered by turtles.
|
||||||
|
|
||||||
Type "help changelog" to see the full version history.
|
Type "help changelog" to see the full version history.
|
||||||
|
@ -1,15 +1,24 @@
|
|||||||
local tMotd = {}
|
local date = os.date("*t")
|
||||||
|
if date.month == 1 and date.day == 1 then
|
||||||
|
print("Happy new year!")
|
||||||
|
elseif date.month == 12 and date.day == 24 then
|
||||||
|
print("Merry X-mas!")
|
||||||
|
elseif date.month == 10 and date.day == 31 then
|
||||||
|
print("OOoooOOOoooo! Spooky!")
|
||||||
|
else
|
||||||
|
local tMotd = {}
|
||||||
|
|
||||||
for sPath in string.gmatch(settings.get("motd.path"), "[^:]+") do
|
for sPath in string.gmatch(settings.get("motd.path"), "[^:]+") do
|
||||||
if fs.exists(sPath) then
|
if fs.exists(sPath) then
|
||||||
for sLine in io.lines(sPath) do
|
for sLine in io.lines(sPath) do
|
||||||
table.insert(tMotd, sLine)
|
table.insert(tMotd, sLine)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if #tMotd == 0 then
|
if #tMotd == 0 then
|
||||||
print("missingno")
|
print("missingno")
|
||||||
else
|
else
|
||||||
print(tMotd[math.random(1, #tMotd)])
|
print(tMotd[math.random(1, #tMotd)])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
[ ]
|
@ -1,14 +1,36 @@
|
|||||||
local capture = require "test_helpers".capture_program
|
local capture = require "test_helpers".capture_program
|
||||||
|
|
||||||
describe("The motd program", function()
|
describe("The motd program", function()
|
||||||
|
local function setup_date(month, day)
|
||||||
|
stub(os, "date", function() return { month = month, day = day } end)
|
||||||
|
end
|
||||||
|
|
||||||
it("displays MODT", function()
|
it("displays MOTD", function()
|
||||||
local file = fs.open("/modt_check.txt", "w")
|
setup_date(0, 0)
|
||||||
|
local file = fs.open("/motd_check.txt", "w")
|
||||||
file.write("Hello World!")
|
file.write("Hello World!")
|
||||||
file.close()
|
file.close()
|
||||||
settings.set("motd.path", "/modt_check.txt")
|
settings.set("motd.path", "/motd_check.txt")
|
||||||
|
|
||||||
expect(capture(stub, "motd"))
|
expect(capture(stub, "motd"))
|
||||||
:matches { ok = true, output = "Hello World!\n", error = "" }
|
:matches { ok = true, output = "Hello World!\n", error = "" }
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("displays date-specific MOTD (1/1)", function()
|
||||||
|
setup_date(1, 1)
|
||||||
|
expect(capture(stub, "motd"))
|
||||||
|
:matches { ok = true, output = "Happy new year!\n", error = "" }
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("displays date-specific MOTD (10/31)", function()
|
||||||
|
setup_date(10, 31)
|
||||||
|
expect(capture(stub, "motd"))
|
||||||
|
:matches { ok = true, output = "OOoooOOOoooo! Spooky!\n", error = "" }
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("displays date-specific MOTD (12/24)", function()
|
||||||
|
setup_date(12, 24)
|
||||||
|
expect(capture(stub, "motd"))
|
||||||
|
:matches { ok = true, output = "Merry X-mas!\n", error = "" }
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user