Create

Create

86M Downloads

Computercraft integration documentation has an error (or the code has one)

LelouBil opened this issue ยท 0 comments

commented

Describe the Bug

The Wiki says the getSize() function of the display link (https://github.com/Creators-of-Create/Create/wiki/Display-Link-%28Peripheral%29#getsize) returns (width, height). But in reality it is returning (rows, columns) which is (height, width)

code here:

@LuaFunction(mainThread = true)
public final Object[] getSize() {
DisplayTargetStats stats = blockEntity.activeTarget.provideStats(new DisplayLinkContext(blockEntity.getLevel(), blockEntity));
return new Object[]{stats.maxRows(), stats.maxColumns()};
}

So either the wiki should be changed (to match the code) or the code should be changed (to match the get/setCursorPos functions)

Reproduction Steps

  1. Place a computercraft computer
  2. link a display link to a screen and place it next to the computer
  3. call the getSize() function

Expected Result

(width,height)

Screenshots and Videos

No response

Crash Report or Log

No response

Operating System

Windows 11

Mod Version

0.5.1f

Minecraft Version

1.18.2

Forge Version

40.2.9

Other Mods

No response

Additional Context

No response