Giter Site home page Giter Site logo

cc-tweaked / cc-tweaked Goto Github PK

View Code? Open in Web Editor NEW
854.0 28.0 202.0 20.53 MB

Just another ComputerCraft fork

Home Page: https://tweaked.cc

Java 69.70% Lua 23.58% Common Lisp 0.10% Python 0.34% GLSL 0.12% JavaScript 0.10% TypeScript 0.69% CSS 0.09% Kotlin 5.27%
computercraft minecraft minecraft-forge forge minecraft-mod lua fabric

cc-tweaked's Introduction

CC: Tweaked

Current build status Download CC: Tweaked on CurseForge Download CC: Tweaked on Modrinth

CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the much-beloved ComputerCraft, it continues its legacy with improved performance and stability, along with a wealth of new features.

CC: Tweaked can be installed from CurseForge or Modrinth. It runs on both Minecraft Forge and Fabric.

Contributing

Any contribution is welcome, be that using the mod, reporting bugs or contributing code. If you want to get started developing the mod, check out the instructions here.

Community

If you need help getting started with CC: Tweaked, want to show off your latest project, or just want to chat about ComputerCraft, do check out our forum and GitHub discussions page! There's also a fairly populated, albeit quiet IRC channel, if that's more your cup of tea.

We also host fairly comprehensive documentation at tweaked.cc.

Using

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) dependency in your mods.toml file, with the appropriate version bounds, to ensure that API functionality you depend on is present.

repositories {
  maven {
    url "https://squiddev.cc/maven/"
    content {
      includeGroup("cc.tweaked")
    }
  }
}

dependencies {
  // Vanilla (i.e. for multi-loader systems)
  compileOnly("cc.tweaked:cc-tweaked-$mcVersion-common-api:$cctVersion")

  // Forge Gradle
  compileOnly("cc.tweaked:cc-tweaked-$mcVersion-core-api:$cctVersion")
  compileOnly(fg.deobf("cc.tweaked:cc-tweaked-$mcVersion-forge-api:$cctVersion"))
  runtimeOnly(fg.deobf("cc.tweaked:cc-tweaked-$mcVersion-forge:$cctVersion"))

  // Fabric Loom
  modCompileOnly("cc.tweaked:cc-tweaked-$mcVersion-fabric-api:$cctVersion")
  modRuntimeOnly("cc.tweaked:cc-tweaked-$mcVersion-fabric:$cctVersion")
}

When using ForgeGradle, you may also need to add the following:

minecraft {
    runs {
        configureEach {
            property 'mixin.env.remapRefMap', 'true'
            property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
        }
    }
}

You should also be careful to only use classes within the dan200.computercraft.api package. Non-API classes are subject to change at any point. If you depend on functionality outside the API (or need to mixin to CC:T), please file an issue to let me know!

We bundle the API sources with the jar, so documentation should be easily viewable within your editor. Alternatively, the generated documentation can be browsed online.

cc-tweaked's People

Contributors

ale32bit avatar bombbloke avatar boq avatar crazedprogrammer avatar cruor avatar dan200 avatar dirthsj avatar dmarcuse avatar emmachase avatar erb3 avatar fatboychummy avatar jakobdev avatar jlleitschuh avatar lemmmy avatar lignum avatar liquiad avatar luca0208 avatar lupus590 avatar mcjack123 avatar minerobber9000 avatar osmarks avatar restioson avatar ronan-h avatar sirendii avatar skythecodemaster avatar squiddev avatar timia2109 avatar toad-dev avatar weblate avatar wojbie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cc-tweaked's Issues

Events (Shutdown/Startup)

It would be nice if we could have a file named .events or something, a bit like .htaccess in a webserver.

Here's my idea. A file named .events could be located in the root, and you could link a file like this.

.devents/startup.event startup.lua .devents/shutdown.event shutdown.lua

That would be the default file (as an example)

You could also add your own events to the .devents directory, and fire them like this:

os.fireevent(.devents/EVENTNAME.event)

This can be used to fire events for multiple other programs to run from and can be used somewhat like functions. Default events such as startup or shutdown cannot be fired manually, and only fire upon the respective times. startup and shutdown are readonly events, meaning they cannot be deleted.

Creating an event would be simple. Just do:

edit .devents/EVENTNAME.event

This will create an empty file, which cannot be edited, and is only visible (and can be deleted). Upon an event not being found with fireevent, it will cause an error and terminate.

Obviously a lot can be tweaked. I'm also very new to Github so yeah.

Bug when using the mining turtle and it mines a certain ore

When using the mining turtle, it works great, however when it mines a certain ore, "Dye Ore" from a mod called "PattysMoreStuff", it doesn't drop dye like it should, it drops the ore, but the ore, has a no texture icon. When you, (yourself) mine the ore, it drops dye like it should, only seems to be when the turtle mines the ore, it doesn't mine correctly. If i place the no textured Dye Ore the turtle mines, and I break it myself, it drops dye like normal. Not a game breaking bug, just letting you know.

turtle.place() caused server crash

Placing any block into minecart with chest will crash server in multiplayer or client in single player.

There was rail with full rail chest with various garbage in it in front of the turtle and 16 vanilla glass panes in turtle's selected slot. I've called turtle.place() from lua console and expected to get false and some kind of error message as second return value in lua console in game but instead of that server crashed:

[03:43:32] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking block entity
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:771) ~[MinecraftServer.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) ~[nz.class:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666) ~[MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_161]
Caused by: java.lang.NullPointerException
	at net.minecraft.entity.player.EntityPlayerMP.func_71007_a(EntityPlayerMP.java:898) ~[oq.class:?]
	at net.minecraft.entity.item.EntityMinecartContainer.func_184230_a(EntityMinecartContainer.java:208) ~[afh.class:?]
	at dan200.computercraft.shared.turtle.core.TurtlePlaceCommand.deployOnEntity(TurtlePlaceCommand.java:275) ~[TurtlePlaceCommand.class:?]
	at dan200.computercraft.shared.turtle.core.TurtlePlaceCommand.deploy(TurtlePlaceCommand.java:138) ~[TurtlePlaceCommand.class:?]
	at dan200.computercraft.shared.turtle.core.TurtlePlaceCommand.execute(TurtlePlaceCommand.java:91) ~[TurtlePlaceCommand.class:?]
	at dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands(TurtleBrain.java:1092) ~[TurtleBrain.class:?]
	at dan200.computercraft.shared.turtle.core.TurtleBrain.update(TurtleBrain.java:208) ~[TurtleBrain.class:?]
	at dan200.computercraft.shared.turtle.blocks.TileTurtle.func_73660_a(TileTurtle.java:290) ~[TileTurtle.class:?]
	at net.minecraft.world.World.func_72939_s(World.java:1832) ~[amu.class:?]
	at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613) ~[oo.class:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:765) ~[MinecraftServer.class:?]
	... 4 more
[03:43:32] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: This crash report has been saved to: S:\Servers\Minecraft23mods\.\crash-reports\crash-2018-04-16_03.43.32-server.txt

Exactly same, but with different line numbers happened with original ComputerCraft.

CC addon Plethora Peripherals demands ComputerCraft 1.80pr1

With ComputerCraft 1.80pr1, I can use Plethora Peripherals and Peripherals Plus One. When I disable ComputerCraft and enable CC:Tweaked (1.80pr1.5), making sure that Plethora and PlusOne are still enabled (I'm using Twitch Launcher, Forge 2655, plus several dozen other mods), one of two things happen. Either 1: ComputerCraft gets reenabled. Or 2: Plethora gets disabled. (1: get an error at the end of launch telling me about duplicate mods or 2: get a warning when I try to go into my world with Plethora stuff in it)

I don't know if this is a problem with pr1.5 or with Plethora. I would really like to use Plethora along with pr1.5, for obvious reasons.

The only other thing I can think of to do what I want to do (connect to chests via wired modem) is to use the "Slightly larger chest" from Extra Utilities (or another solid-block inventory), unless I'm missing something here...

Some sort of indicator lights in the bottom of the GUI

Perhaps in the bottom left of the terminal border? The purpose of it should be to indicate if the computer is on/off, as well as a brief flash when the computer is restarting (as it is currently impossible to tell if a computer rebooted when a startup program draws nothing)

Here's a very crude mockup of what I'm thinking of:

It could be green when on, dark grey when off, and ensure a brief flash (0.25s?) when rebooting.

Limiting HTTP

ComputerCraft added very rudimentary limiting system to the filesystem (a fixed number of handles per computer), but no similar system was added to the HTTP API. It would be nice to add some more fine grained control to the http API, to prevent abuse by malicious/badly implemented programs.

One nice thing about HTTP is that, as it is asynchronous, we can delay requests instead of outright rejecting them. I suspect this will be required as many installers/updaters will download multiple files in parallel.

Configuration options could be server wide and per-computer. While the latter is more important (normally it will be a few computers playing up), it may be useful to enforce some global constraints too. If so, we will have to establish some level of scheduling, prioritising requests from computers which don't access the network very often, etc...

Request limits

These limits are designed to control individual requests. They are not going to prevent abuse of the HTTP API, but should stop people doing insanely stupid things with it.

HTTP Requests

  • Max requests: The maximum number of requests a computer can be making at one time. Additional requests can be pushed to a queue.
  • Max download size: The maximum size an incoming response can be before the connection is terminated.
  • Max upload size: The maximum size an outgoing request can be.

Websockets

  • Max websockets: The maximum number of open websockets a computer can have. Unlike HTTP requests, it is probably save to error if this limit is reached.
  • Max packet size: The maximum size a websocket message can be (incoming and outgoing).

It's also worth noting that many of these options could be configured on a per-domain/per-IP-range level. For instance, you could allow downloading larger files from GitHub, or limit the upload size to Pastebin.

Rate limiting

While the above has some utility, it doesn't prevent people making lots of requests in a short period of time. Instead, we should also investigate ways of limiting the amount of bandwidth a computer may consume.


If people have ideas, suggestions or if there's anything else we could look into limiting, do comment!

Modems attached to turtles disappear on chunk unload


Replacing the turtle fixes the issue. The modem was first attached with the equip program, but it appears to happen too if it was crafted with the modem. The issue happens 100% of the time when unloading its chunk.

function variable preview

it would be nice if, when writing functions from the lua terminal or when coding, the computer would display the next input variable name in grayed-out text until a character is typed (similar to the default values on most text inputs)

ex: foo(a,stuff,bar)
and when you type:
foo(a
foo(1,stuff
foo(1,'thi
foo(1,'thing',bar)

Duplicated Floppy-Disks

Hey!,

i encountered a duplicating bug while using the latest CC:Tweaked within FTB Direwolf 20 ModPack.

Sometimes (after a Reboot of the MC-Server for example) the computers freezes (you cant interact with them) - i then tried the /computercraft shutdown and /computer turn-on command to reboot the computers but if they stay in this state i can duplicate disks by putting them into a disk drive (which is connected to the computer all the time).

If this happens, there is a stacktrace in the console:

java.util.concurrent.ExecutionException: java.lang.IllegalStateException: File system has not been created
        at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_111]
        at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_111]
        at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
        at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:721) [MinecraftServer.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:396) [nz.class:?]
        at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:666) [MinecraftServer.class:?]
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:524) [MinecraftServer.class:?]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111]
Caused by: java.lang.IllegalStateException: File system has not been created
        at dan200.computercraft.core.apis.ComputerAccess.mountWritable(ComputerAccess.java:85) ~[ComputerAccess.class:?]
        at dan200.computercraft.core.apis.PeripheralAPI$PeripheralWrapper.mountWritable(PeripheralAPI.java:140) ~[PeripheralAPI$PeripheralWrapper.class:?]
        at dan200.computercraft.core.apis.ComputerAccess.mountWritable(ComputerAccess.java:74) ~[ComputerAccess.class:?]
        at dan200.computercraft.shared.peripheral.diskdrive.TileDiskDrive.mountDisk(TileDiskDrive.java:532) ~[TileDiskDrive.class:?]
        at dan200.computercraft.shared.peripheral.diskdrive.TileDiskDrive.func_70299_a(TileDiskDrive.java:322) ~[TileDiskDrive.class:?]
        at dan200.computercraft.shared.peripheral.diskdrive.TileDiskDrive.onActivate(TileDiskDrive.java:105) ~[TileDiskDrive.class:?]
        at dan200.computercraft.shared.common.BlockGeneric.func_180639_a(BlockGeneric.java:143) ~[BlockGeneric.class:?]
        at net.minecraft.server.management.PlayerInteractionManager.func_187251_a(PlayerInteractionManager.java:446) ~[or.class:?]
        at net.minecraft.network.NetHandlerPlayServer.func_184337_a(NetHandlerPlayServer.java:739) ~[pa.class:?]
        at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:55) ~[ma.class:?]
        at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.func_148833_a(SourceFile:11) ~[ma.class:?]
        at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) ~[hv$1.class:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_111]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_111]
        at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
        ... 5 more

Hopefully this is enough to find the error - i can provide more information is neccessary :)

Regards
SeaLife

Monitor block missing

Crash Log:

When I crash:

  • Like sometimes it's a grayish blue (kind of like Discord's dark theme. BTW it's not discord showing because I don't use discord on that computer while playing MC). The game also doesn't respond. It sits there for maybe 20 seconds before CTD (Crash To Desktop).

If any additional information is required please let me know.

Chests as Peripherals

With the wired modem, I should be able to use a chest as a peripheral, yes? I can't seem to get it to work properly, and I'm not sure what I'm doing wrong, or if it's actually a bug. Probably I just can't intuit what to do.

I can right click the full-block modem and it says "Peripheral 'computer_0' connected to the network". I can open the modem peripheral via lua. But when I try p.getNamesRemote() it gets nothing. I can't do anything (trying to right-click) with a full-block modem next to just a chest or next to the lit-up modem.

/computercraft commands don't work in sponge

They just print track or computercraft help:track - another potentially useful thing would be to print the coords of the pc when doing track in console, since otherwise there is literally no way to find where the laggy computers are

Mod integrations

  • EnderIO: Bundled cable support. Possibly also a "wired network conduit".
  • Project: Red: Bundled cable support.
  • RSWires: Bundled cable support.
  • MCMultipart: Support for wired modems and cables. I suspect this'll have to wait for 1.13, as BlockGeneric/TileGeneric rather makes this impossible.
  • SimpleLogic wires: Bundled cable support.

String:gmatch weirdness

When I run
str = "hi_my_name"
for k in str:gmatch("[^_]+") do print(k) end
In the lua program it prints
hi_my_name
hi_my_name
hi_my_name
But if run as an actual program it prints
hi
my
name

Using coroutines with a "call" debug hook set produces a NullPointerException

The following code produces a vm error: java.lang.NullPointerException on the coroutine.create:

local function abc()
    print("ABC!")
end

local function testHook(a)
    print("Hello from " .. a)
end

debug.sethook(testHook, "c")

local s, e = pcall(function()
    coroutine.create(abc)
end)

debug.sethook()

if not s then
    print(e)
end

Global coroutine manager

This issue is to discuss a potential future implementation of a global coroutine manager. This would be a system similar to rednet.run that allows a user to define add a global coroutine to manage events at the top level. It could also behave somewhat like a process manager.

The main concern with this issue is:- how far should this go? How much do we want to overhaul CraftOS?

Modems wrap all peripherals when initially attaching

When initially attaching to a computer (such as on world load), modems provide all peripherals - including the current computer. This is inconsistent with normal behaviour, where the peripheral is not exposed.

This is because attach delegates to attachPeripheralImpl instead of attachPeripheral.

Using portals

I'm not sure if a CC turtle can use a regular nether portal, but I've been playing a lot with stargates from the Atlantiscraft mod (fork from SGCraft). The CC turtle can't move through a stargate.

Now this might be a problem in the stargate mod, but since even minecarts can move through stargates I thought I'd checkin here.

Background reason: CC turtles make for excelent 'Replicators' ๐Ÿ˜‡

commands.exec takes noticably long

Computer #4412 was running about 100 commands.exec() calls, separated by 0.5s. The computer topped the server time graph, peaking ~3.2ms. The issue still occured with commands.async.execute(), and also used the same server time even when separated by 3 seconds.

local f = fs.open("lastRun", "r")
local lastRun = tonumber(f.readAll())
if math.floor(os.epoch("utc") / 1000) - (30 * 60) < lastRun then
    error("Not running - not enough time since last run")
end
f.close()

f = fs.open("lastRun", "w")
f.write(tostring(math.floor(os.epoch("utc") / 1000)))
f.close()

print("Fetching computer list to start")

local api = "REDACTED"
local h = http.get(api)

for computer in h.readLine do
  write(computer .. ", ")
  sleep(.5)
  commands.exec("computercraft turn-on " .. computer)
end

h.close()

print("Done")

It's not isolated to computercraft turn-on; this happened even with tellraw and other non-intensive commands.

debug.getlocal can get locals from bios.lua

With the debug library, it's possible to get locals from any function below your function being executed. This affects some local variables in bios.lua because some functions call global, overwritable, functions. Some of the locals in bios expose important functions, like nativeload, nativeget/setfenv, and nativeHTTPRequest. Proof of concept getting nativeload:

local oldT = type
local oldE = error
local function getvarvalue(name)
  local v,f
  local i = 1
  while true do
    local n,va = debug.getlocal(3,i)
    if not n then break end
    if n == name then
      v = va
      f = true
    end
    i = i + 1
  end
  if f then return v end
  local fu = debug.getinfo(3).func
  i = 1
  while true do
    local n, va = debug.getupvalue(fu, i)
    if not n then break end
    if n == name then return va end
    i = i + 1
  end
  return getfenv(fu)[name]
end
local log = fs.open("log", "w")
_G.type = function(a)
  local b = debug.traceback()
  log.writeLine(b)
  if b:find("bios.lua:25:") then
    _G.nativeload = getvarvalue("nativeload")
    log.writeLine("Attempted to get nativeload, stored to global.")
  end
  return oldT(a)
end
_G.error = function(a)
  log.writeLine("ERR: "..a)
  log.writeLine(debug.traceback())
end
pcall(load,9)
_G.error = oldE
_G.type = oldT
log.close()

Releases JAR files

It would be pretty cool if there were JARs of the prereleases. Thanks!

TurtlePlaceCommand causing latency issues with FakePlayer creation

TurtlePlaceCommand seems to be generating new FakePlayer's every time it is run. This is causing latency issues as shown below. This should be cached because it's not a good idea to generate new players every time this updates.

https://github.com/SquidDev-CC/CC-Tweaked/blob/master/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java#L71

net.minecraft.world.WorldServer.updateTileEntity()40.38%
org.spongepowered.common.event.tracking.TrackingUtil.tickTileEntity()40.26%
dan200.computercraft.shared.turtle.blocks.TileTurtle.update()14.16%
dan200.computercraft.shared.turtle.core.TurtleBrain.update()12.72%
dan200.computercraft.shared.turtle.core.TurtleBrain.updateCommands()12.25%
dan200.computercraft.shared.turtle.core.TurtleSuckCommand.execute()10.52%
dan200.computercraft.shared.turtle.core.TurtlePlaceCommand.createPlayer()10.29%
dan200.computercraft.shared.turtle.core.TurtlePlayer.<init>()10.29%
net.minecraftforge.common.util.FakePlayer.<init>()10.29%
net.minecraft.entity.player.EntityPlayerMP.<init>()10.29%
net.minecraft.server.management.PlayerList.func_192054_h()9.92%
net.minecraft.advancements.PlayerAdvancements.<init>()9.92%
net.minecraft.advancements.PlayerAdvancements.func_192740_f()9.92%
net.minecraft.advancements.PlayerAdvancements.func_192752_d()8.92%
net.minecraft.advancements.PlayerAdvancements.func_192742_b()8.76%

Method to check if websocket is still open

This isn't really an issue, but it would be nice if when you create a websocket object there could be a method like ws.isAlive() to check if the connection is still alive.

Reducing ticking

Some commonly placed blocks in CC(:T) have tiles which implement ITickable. Despite they do very little work, it does adds substantial overhead to each tick which would be nice to avoid. The main culprits are as follows:

TileCable

https://github.com/SquidDev-CC/CC-Tweaked/blob/b8957cab5c3c3829f4931dd21faf39323e45fa87/src/main/java/dan200/computercraft/shared/peripheral/modem/TileCable.java#L468-L486

Most of this is just "on first tick" logic, so could potentially be shifted somewhere else?

TileMonitor

https://github.com/SquidDev-CC/CC-Tweaked/blob/b8957cab5c3c3829f4931dd21faf39323e45fa87/src/main/java/dan200/computercraft/shared/peripheral/monitor/TileMonitor.java#L148-L186

Only the primary monitor really needs to tick. While I'd like to avoid having "main" and "non-main" monitor TEs, we should investigate ways to only have one ticking monitor.

TilePrinter

This currently doesn't tick, though may not actually be threadsafe - we're calling .setAnim on the computer thread.

Others?

Could we potentially do the same for other modems - most just run logic on the first tick and then never again after that.

Better computer monitoring

Taken from a now-deleted issue:

  • Prometheus exporter (with configurable port number) for computers running, largest tick times etc. It might be nice to track counts of various TEs (turtles, peripherals, etc...), as well as block updates (monitors) but that might be better done as a more general mod.

  • Tracking the number of various operations performed by computers. Some ideas:

    • Invocations to peripheral.call.
    • Invocations to "expensive" fs methods (so fs.open and fs.copy are tracked, but fs.combine, fs.isDir are ignored).
    • Invocations to "expensive" turtle methods (so turtle.forward but not turtle.select. Maybe split this into movement and other?)

    I'm not entirely sure how we'll display it in the command, as they won't all fit on a screen - possibly stick with default timings for now, and add an additional argument to track dump. Something like: [tasks|total|average|max|fs|peripheral].

    Dumping for Prometheus should be easy, as we can just export it the same way as any other value.

file.read(bytes) is limited to 16kb for seemingly no reason

file.read(bytes) (as added by this PR) is limited to 16 kB on this line:

https://github.com/SquidDev-CC/CC-Tweaked/blob/a0d71cb3ad5cd7279ab9f5be8d79d89074c2e5dd/src/main/java/dan200/computercraft/core/apis/handles/EncodedInputHandle.java#L114

The result of this is an unhelpful "Count out of range" error.

One of three options would be preferable here:

  • Remove the limit. It doesn't make much sense to be limiting at all in this case, as you can just file.readAll() just as maliciously.
  • Increase the limit. 16 kB is a very low value for a limit like this. It could be increased to something more reasonable, perhaps in the megabytes range.
  • Change the error message. The error message is entirely undescriptive here - it makes the user think they are trying to read more bytes than the file has, which is definitely not the case here. It could instead inform the user that they can only read this stupidly arbitrary number of bytes.

[Suggestion] Track who placed turtles and use it with the FakePlayer

Actually, the GameProfile of the TurtlePlayer is a generic one (ComputerCraft). By using this generic player on events, mods listening to them will have inconsistent data and won't be able to proccess it as it would do for real players.

My suggestion is that the turtles should track who placed them (UUID, nickname) and build a GameProfile based on it. This GameProfile would be used to construct the FakePlayer of that turtle, that would be used to fire the events they need. By passing the correct info to the events, mods listening to them would be able to proccess correctly what is happening, since they expect player events to have a real player assigned.

Wired network visualiser

I'm not entirely sure how we should expose this, as I'm somewhat reluctant to add an item specifically for it. Could add a sub-command, but it's a little clunky to use.

Water fries computers

you should make it so that if there is water above a computer said computer doesn't work.

Computers Freeze On Game Startup

What I expect to happen:

  • Boot Mincraft, boot up world.
  • Go to computer, it's either off, or rebooted because it was on when world unloaded. Doesn't really matter which way it was. I know it's supposed to be rebooted, but I'd be okay if it were off.
  • Right click computer, "CraftOS 1.8 \n >_",, start typing
  • Stuff appears

What actually happens:

  • Boot Minecraft, boot up world.
  • These computers were on when I left. The visual screens are blank.
  • Right click computer, "CraftOS 1.8 \n >_", start typing.
  • Nothing happens.
  • If I hit escape, the computer looks like it's off.

Current Workaround:

  • Break Computer (hope it's labeled!)
  • Replace it into the world
  • Computer works fine!

Other Workaround:

  • Go very far away, so that the chunks with the computers unload
  • Come back (visually verify that the chunks are reloading from an unloaded state)
  • Computers work fine!

I'd like to not have to use either of these workarounds. Or at the very least, I'd like to know what's causing this.

This also does not happen 100% of the time. It seems to happen only when I first start Minecraft. If I stop the world (return to menu) and return, the computers work fine.

I am using:

  • Minecraft 1.12.2
  • Forge 2611 (so I can build for SpongeForge)
  • CCTweaked (ComputerCraft 1.8pr1.5)
  • Plethora Peripherals 1.1.11
  • Peripherals Plus One 1.1-build-T58
  • Several dozen other mods, but none of them should interfere, I don't think.

I do have three Windows junction folders inside one of the computers in question so I can work on a program collection, use git without it showing up inside the computer, and not have this program set depending on this world, and so that my changes still take place instantly. I don't think this should affect anything, but I cannot fully test without the junction files because, well... I don't know how far they would affect. If they can affect other computers in the loaded world, would they be able to affect computers in an unloaded world?

Pictures of Problems:

After Typing:
image

After Having right-clicked on computer:
image

Other HTTP request methods

Functions similar to http.post, but for PUT, DELETE and others, in order to access REST APIs more easily.

Pocket computers not refreshing screen in map view

I love the feature added where it allows you to hold a pocket computer in your offhand of just in front of you and it shows the screen. This was working perfectly in the CC-Tweaks implementation of the feature, but in this version the screen does not refresh unless you manually open the computers gui. Not sure if anyone else is having this same issue.

Tested on commits:
18429c5 (the latest release)
81aaead (the latest commit)

Tested on Forge versions:
14.23.2.2634
14.23.4.2709

Hopefully this can be sorted out relatively soon!

[Question] Just few questions

Hello i just saw your fork and i have a few question with it if you don't mind answering them

  1. i am using original version of computercraft if i switch over to your fork how will it effect my world from switching too ComputerCraft to CC-Tweaked?

  2. Is this fork aim to fix ComputCraft bugs?

  3. How is this better performance then the original computercraft?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.