mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-07 07:50:27 +00:00
Merge branch 'mc-1.15.x' into mc-1.16.x
This commit is contained in:
commit
5ef8d52c13
12
.gitattributes
vendored
12
.gitattributes
vendored
@ -1,3 +1,15 @@
|
|||||||
# Ignore changes in generated files
|
# Ignore changes in generated files
|
||||||
src/generated/resources/data/** linguist-generated
|
src/generated/resources/data/** linguist-generated
|
||||||
src/test/server-files/structures linguist-generated
|
src/test/server-files/structures linguist-generated
|
||||||
|
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
*.gradle eol=lf diff=java
|
||||||
|
*.java eol=lf diff=java
|
||||||
|
*.kt eol=lf diff=java
|
||||||
|
*.lua eol=lf
|
||||||
|
*.md eol=lf diff=markdown
|
||||||
|
*.txt eol=lf
|
||||||
|
|
||||||
|
*.png binary
|
||||||
|
*.jar binary
|
||||||
|
2
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@ -1,5 +1,5 @@
|
|||||||
name: Bug report
|
name: Bug report
|
||||||
about: Report some misbehaviour in the mod
|
description: Report some misbehaviour in the mod
|
||||||
labels: [ bug ]
|
labels: [ bug ]
|
||||||
body:
|
body:
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
|
@ -36,7 +36,6 @@ public final class ComputerCraft
|
|||||||
public static int maximumFilesOpen = 128;
|
public static int maximumFilesOpen = 128;
|
||||||
public static boolean disableLua51Features = false;
|
public static boolean disableLua51Features = false;
|
||||||
public static String defaultComputerSettings = "";
|
public static String defaultComputerSettings = "";
|
||||||
public static boolean debugEnable = true;
|
|
||||||
public static boolean logComputerErrors = true;
|
public static boolean logComputerErrors = true;
|
||||||
public static boolean commandRequireCreative = true;
|
public static boolean commandRequireCreative = true;
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import io.netty.channel.ChannelPipeline;
|
|||||||
import io.netty.channel.socket.SocketChannel;
|
import io.netty.channel.socket.SocketChannel;
|
||||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||||
import io.netty.handler.codec.http.HttpClientCodec;
|
import io.netty.handler.codec.http.HttpClientCodec;
|
||||||
|
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||||
import io.netty.handler.codec.http.HttpHeaders;
|
import io.netty.handler.codec.http.HttpHeaders;
|
||||||
import io.netty.handler.codec.http.HttpObjectAggregator;
|
import io.netty.handler.codec.http.HttpObjectAggregator;
|
||||||
import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker;
|
import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker;
|
||||||
@ -150,8 +151,9 @@ public class Websocket extends Resource<Websocket>
|
|||||||
p.addLast( sslContext.newHandler( ch.alloc(), uri.getHost(), socketAddress.getPort() ) );
|
p.addLast( sslContext.newHandler( ch.alloc(), uri.getHost(), socketAddress.getPort() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String subprotocol = headers.get( HttpHeaderNames.SEC_WEBSOCKET_PROTOCOL );
|
||||||
WebSocketClientHandshaker handshaker = WebSocketClientHandshakerFactory.newHandshaker(
|
WebSocketClientHandshaker handshaker = WebSocketClientHandshakerFactory.newHandshaker(
|
||||||
uri, WebSocketVersion.V13, null, true, headers,
|
uri, WebSocketVersion.V13, subprotocol, true, headers,
|
||||||
options.websocketMessage <= 0 ? MAX_MESSAGE_SIZE : options.websocketMessage
|
options.websocketMessage <= 0 ? MAX_MESSAGE_SIZE : options.websocketMessage
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public class CobaltLuaMachine implements ILuaMachine
|
|||||||
globals.load( state, new CoroutineLib() );
|
globals.load( state, new CoroutineLib() );
|
||||||
globals.load( state, new Bit32Lib() );
|
globals.load( state, new Bit32Lib() );
|
||||||
globals.load( state, new Utf8Lib() );
|
globals.load( state, new Utf8Lib() );
|
||||||
if( ComputerCraft.debugEnable ) globals.load( state, new DebugLib() );
|
globals.load( state, new DebugLib() );
|
||||||
|
|
||||||
// Remove globals we don't want to expose
|
// Remove globals we don't want to expose
|
||||||
globals.rawset( "collectgarbage", Constants.NIL );
|
globals.rawset( "collectgarbage", Constants.NIL );
|
||||||
|
@ -42,7 +42,6 @@ public final class Config
|
|||||||
private static final ConfigValue<Integer> maximumFilesOpen;
|
private static final ConfigValue<Integer> maximumFilesOpen;
|
||||||
private static final ConfigValue<Boolean> disableLua51Features;
|
private static final ConfigValue<Boolean> disableLua51Features;
|
||||||
private static final ConfigValue<String> defaultComputerSettings;
|
private static final ConfigValue<String> defaultComputerSettings;
|
||||||
private static final ConfigValue<Boolean> debugEnabled;
|
|
||||||
private static final ConfigValue<Boolean> logComputerErrors;
|
private static final ConfigValue<Boolean> logComputerErrors;
|
||||||
private static final ConfigValue<Boolean> commandRequireCreative;
|
private static final ConfigValue<Boolean> commandRequireCreative;
|
||||||
|
|
||||||
@ -120,10 +119,6 @@ public final class Config
|
|||||||
"autocompletion" )
|
"autocompletion" )
|
||||||
.define( "default_computer_settings", ComputerCraft.defaultComputerSettings );
|
.define( "default_computer_settings", ComputerCraft.defaultComputerSettings );
|
||||||
|
|
||||||
debugEnabled = builder
|
|
||||||
.comment( "Enable Lua's debug library. This is sandboxed to each computer, so is generally safe to be used by players." )
|
|
||||||
.define( "debug_enabled", ComputerCraft.debugEnable );
|
|
||||||
|
|
||||||
logComputerErrors = builder
|
logComputerErrors = builder
|
||||||
.comment( "Log exceptions thrown by peripherals and other Lua objects.\n" +
|
.comment( "Log exceptions thrown by peripherals and other Lua objects.\n" +
|
||||||
"This makes it easier for mod authors to debug problems, but may result in log spam should people use buggy methods." )
|
"This makes it easier for mod authors to debug problems, but may result in log spam should people use buggy methods." )
|
||||||
@ -317,7 +312,6 @@ public final class Config
|
|||||||
ComputerCraft.maximumFilesOpen = maximumFilesOpen.get();
|
ComputerCraft.maximumFilesOpen = maximumFilesOpen.get();
|
||||||
ComputerCraft.disableLua51Features = disableLua51Features.get();
|
ComputerCraft.disableLua51Features = disableLua51Features.get();
|
||||||
ComputerCraft.defaultComputerSettings = defaultComputerSettings.get();
|
ComputerCraft.defaultComputerSettings = defaultComputerSettings.get();
|
||||||
ComputerCraft.debugEnable = debugEnabled.get();
|
|
||||||
ComputerCraft.computerThreads = computerThreads.get();
|
ComputerCraft.computerThreads = computerThreads.get();
|
||||||
ComputerCraft.logComputerErrors = logComputerErrors.get();
|
ComputerCraft.logComputerErrors = logComputerErrors.get();
|
||||||
ComputerCraft.commandRequireCreative = commandRequireCreative.get();
|
ComputerCraft.commandRequireCreative = commandRequireCreative.get();
|
||||||
|
@ -51,10 +51,8 @@ local function expect(index, value, ...)
|
|||||||
|
|
||||||
-- If we can determine the function name with a high level of confidence, try to include it.
|
-- If we can determine the function name with a high level of confidence, try to include it.
|
||||||
local name
|
local name
|
||||||
if native_type(debug) == "table" and native_type(debug.getinfo) == "function" then
|
|
||||||
local ok, info = pcall(debug.getinfo, 3, "nS")
|
local ok, info = pcall(debug.getinfo, 3, "nS")
|
||||||
if ok and info.name and info.name ~= "" and info.what ~= "C" then name = info.name end
|
if ok and info.name and info.name ~= "" and info.what ~= "C" then name = info.name end
|
||||||
end
|
|
||||||
|
|
||||||
local type_names = get_type_names(...)
|
local type_names = get_type_names(...)
|
||||||
if name then
|
if name then
|
||||||
@ -94,7 +92,7 @@ end
|
|||||||
|
|
||||||
--- Expect a number to be within a specific range.
|
--- Expect a number to be within a specific range.
|
||||||
--
|
--
|
||||||
-- @tparam number num, The value to check.
|
-- @tparam number num The value to check.
|
||||||
-- @tparam number min The minimum value, if nil then `-math.huge` is used.
|
-- @tparam number min The minimum value, if nil then `-math.huge` is used.
|
||||||
-- @tparam number max The maximum value, if nil then `math.huge` is used.
|
-- @tparam number max The maximum value, if nil then `math.huge` is used.
|
||||||
-- @return The given `value`.
|
-- @return The given `value`.
|
||||||
|
@ -28,8 +28,7 @@ local expect = require "cc.expect"
|
|||||||
local expect, field = expect.expect, expect.field
|
local expect, field = expect.expect, expect.field
|
||||||
|
|
||||||
local type, getmetatable, setmetatable, colours, str_write, tostring = type, getmetatable, setmetatable, colours, write, tostring
|
local type, getmetatable, setmetatable, colours, str_write, tostring = type, getmetatable, setmetatable, colours, write, tostring
|
||||||
local debug_info = type(debug) == "table" and type(debug.getinfo) == "function" and debug.getinfo
|
local debug_info, debug_local = debug.getinfo, debug.getlocal
|
||||||
local debug_local = type(debug) == "table" and type(debug.getlocal) == "function" and debug.getlocal
|
|
||||||
|
|
||||||
--- @{table.insert} alternative, but with the length stored inline.
|
--- @{table.insert} alternative, but with the length stored inline.
|
||||||
local function append(out, value)
|
local function append(out, value)
|
||||||
|
Loading…
Reference in New Issue
Block a user