Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network card #63

Draft
wants to merge 319 commits into
base: 1.16-forge
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
319 commits
Select commit Hold shift + click to select a range
fe7fc44
Simplify provider.
fnuecke Jan 13, 2022
3fe23f6
Add base class for network interface devices.
fnuecke Jan 13, 2022
089a133
Single source of truth for device type is now tags.
fnuecke Jan 13, 2022
5c3774f
Small naming changes.
fnuecke Jan 13, 2022
c8a3001
Touched up some textures.
fnuecke Jan 13, 2022
11acafd
Added network tunnel devices.
fnuecke Jan 13, 2022
926cb7a
Add some wrapper/utility methods to make use of network system a litt…
fnuecke Jan 13, 2022
d0ff66f
Update Sedna.
fnuecke Jan 13, 2022
1284764
Ensure worker is synced up when making structural changes to VM. Fixe…
fnuecke Jan 13, 2022
78bebdd
Update Forge.
fnuecke Jan 13, 2022
fc6fe66
Update ru lang
Jan 13, 2022
b40ec4f
Update ru handbook
Jan 13, 2022
ebc60e6
Update Sedna, fixes a bug when merging datapack file systems. Fixes #94.
fnuecke Jan 14, 2022
cc34a48
Merge pull request #95 from Bs0Dd/rus
fnuecke Jan 14, 2022
6a2f55e
Fixed RPCDeviceList not forwarding suspend() calls.
fnuecke Jan 15, 2022
1085a6b
Add mount and unmount lifecycle callbacks to RPCDevices.
fnuecke Jan 15, 2022
8843655
Call unmount on VMDevices that got mounted but discarded due to anoth…
fnuecke Jan 15, 2022
1d28897
Sprinkle some commas for readability.
fnuecke Jan 15, 2022
ac4521a
Fix test names.
fnuecke Jan 15, 2022
e435262
Don't call suspend when removing, only call unmount.
fnuecke Jan 15, 2022
6589689
Add lifecycle flowchart to RPCDevice and VMDevice docs.
fnuecke Jan 15, 2022
6b5dde9
Add interface to allow receiving lifecycle callbacks on ObjectDevices.
fnuecke Jan 15, 2022
34942fc
Convert a few more classes to records.
fnuecke Jan 15, 2022
56e00a1
Move different types of serializer to different packages.
fnuecke Jan 15, 2022
6e5d71b
Removed copy-pasted package javadoc.
fnuecke Jan 15, 2022
4fd47d1
Yet more records.
fnuecke Jan 15, 2022
e458d40
Add util class to work around MC bug (instead of copy-pasted workarou…
fnuecke Jan 15, 2022
0beed24
Various minor fixes.
fnuecke Jan 15, 2022
408dee3
Paranoia null checks.
fnuecke Jan 15, 2022
0be9994
We only have one controller on our buses, but make it a set anyway fo…
fnuecke Jan 15, 2022
6262cd9
Message constructor rework (use passed args).
fnuecke Jan 15, 2022
f84e130
Remove unused logger instance.
fnuecke Jan 15, 2022
903d772
More null paranoia.
fnuecke Jan 15, 2022
2ba854c
Rework int sized ContainerData stuff.
fnuecke Jan 15, 2022
8a3add0
Remove obsolete null check.
fnuecke Jan 15, 2022
5d54c63
Remove obsolete overhead in fake player init.
fnuecke Jan 15, 2022
fc319b6
Update Sedna, adds IPv6 support. Closes #18.
fnuecke Jan 17, 2022
9090c13
Add python util modules for device interop and blocking robot movement.
fnuecke Jan 17, 2022
d424265
Make sure robots can't be used for recursive item storage.
fnuecke Jan 17, 2022
12b6069
Fix depth of tooltips in inventory uis.
fnuecke Jan 17, 2022
4d68997
Avoid redundant serialization of VM state.
fnuecke Jan 17, 2022
71e4269
Only serialize state of running VMs.
fnuecke Jan 17, 2022
b2bbd2f
Set board run state to stopped, don't just reset.
fnuecke Jan 17, 2022
a503549
Fixed interface name in lifecycle diagram.
fnuecke Jan 22, 2022
1fadb9e
Rethrow directly, skip util method.
fnuecke Jan 22, 2022
fd423d9
Explicitly set utf8 encoding for compiler.
fnuecke Jan 22, 2022
d132eca
Allow providing Devices as Capabilities on BlockEntities.
fnuecke Jan 22, 2022
5547527
Make names for capability devices more specific.
fnuecke Jan 22, 2022
520323e
Add readme to API with an overview and some examples.
fnuecke Jan 22, 2022
0f9eb58
Fixed side being used in block device queries being flipped.
fnuecke Jan 23, 2022
aeedebc
Auto-format.
fnuecke Jan 23, 2022
9d73df1
Mention the JsonArray special case on the getParameters method.
fnuecke Jan 23, 2022
c96e52a
Thou shalt not change things after testing them.
fnuecke Jan 23, 2022
ddeff66
Cable rendertype can be static.
fnuecke Jan 23, 2022
6c96c09
Reduce max relative tick time for VMRunner to avoid server slowdowns.
fnuecke Jan 25, 2022
b6a06c9
Fixed sided connectivity of disk drive.
fnuecke Jan 25, 2022
f483f14
Recordify.
fnuecke Jan 25, 2022
28d3159
Mark DiskDrive chunk dirty when contents change.
fnuecke Jan 25, 2022
57a1dc9
Make absolutely sure floppy data is saved to item on disk drive save.
fnuecke Jan 25, 2022
0c27173
Add option to clean up stuff (via unmount) when devices go missing.
fnuecke Jan 25, 2022
dbab733
Explicitly use RPCDeviceList type for tracked list devices, for clarity.
fnuecke Jan 25, 2022
929f13d
fixup! Add option to clean up stuff (via unmount) when devices go mis…
fnuecke Jan 25, 2022
79ab0f0
Fix missing space in documentation.
fnuecke Jan 25, 2022
5f892f2
Fixed no bus scan being triggered when bus cable is placed after bus …
fnuecke Jan 25, 2022
ded98fc
Fixed synthetic devices being collected from sides that should not co…
fnuecke Jan 25, 2022
ba3bc77
Add never called overrides with exception for clarity.
fnuecke Jan 25, 2022
f2d69c1
Add missing forwards in AbstractItemRPCDevice.
fnuecke Jan 25, 2022
0126c6e
Fix use of deprecated method.
fnuecke Jan 25, 2022
557a1b1
Make types optional in documentation generators.
fnuecke Jan 26, 2022
9410781
[BREAKING] Reworked RPC method API to be more flexible.
fnuecke Jan 26, 2022
d9c86cb
Add system to mark chunks as "lazy unsaved".
fnuecke Jan 27, 2022
1ab2b8e
Run firmware check first, as quasi-early exit, before checking vm dev…
fnuecke Jan 27, 2022
28304b1
Make some more block entities use custom base class for consistency.
fnuecke Jan 27, 2022
a5cf919
Mark chunk dirty when bus interface name changes.
fnuecke Jan 27, 2022
bd1b468
Mark chunk lazy dirty when charger charged something, so its stored e…
fnuecke Jan 27, 2022
82a6702
Rework RPCDevice to be more intuitive for typical cases.
fnuecke Jan 27, 2022
ae13fca
Rework VMDevice to be more intuitive for typical cases.
fnuecke Jan 27, 2022
b75f5cb
Simplify network device run state switching.
fnuecke Jan 27, 2022
cbb19ef
Small rename.
fnuecke Jan 27, 2022
a1217ba
Various cleanup.
fnuecke Jan 28, 2022
b4dc58e
Fix computer running sound not stopping when stopped before initial d…
fnuecke Jan 28, 2022
4793aee
Update docs.
fnuecke Jan 28, 2022
dc6089d
Made block entity ticking a little nicer.
fnuecke Jan 28, 2022
7be40b0
Can be an assert.
fnuecke Jan 28, 2022
f8899d3
Update Forge and simplify mixin stuff.
fnuecke Jan 28, 2022
ab69c69
Fixed disk drives being read-only. Fixes #103.
fnuecke Jan 30, 2022
d6a9360
Fix devices not being released when computer is destroyed while running.
fnuecke Jan 30, 2022
8f89d31
Projector block.
fnuecke Jan 23, 2022
a1a1f3e
Render no border without wonky GL settings.
fnuecke Jan 25, 2022
c61c9f4
Small rename.
fnuecke Jan 25, 2022
2f7b044
Fixed facing check.
fnuecke Jan 25, 2022
539beb4
Being reasonable is boring.
fnuecke Jan 25, 2022
3e2914b
Use annotations to register event listeners.
fnuecke Jan 28, 2022
59a3a2b
Trying to render level for projector depth.
fnuecke Jan 30, 2022
2361a84
Use actual projection rendering for projectors.
fnuecke Feb 1, 2022
6c6bcad
Tighter fit on projection.
fnuecke Feb 1, 2022
05c2f43
Use frustum matrix for projector depth rendering, to allow flat proje…
fnuecke Feb 2, 2022
ee232dc
Disable projection when occluded.
fnuecke Feb 2, 2022
ced5a0b
Catch buffer overflow exceptions in encode, since apparently these ca…
fnuecke Feb 2, 2022
94318dc
Run all sending of framebuffer data through a load balancer, so we ha…
fnuecke Feb 3, 2022
4c4385f
Don't do stuff with the VM in robots on client side.
fnuecke Feb 3, 2022
0f2c34f
Don't do stuff with the VM in computers on client side.
fnuecke Feb 3, 2022
fe2fdc9
Make sides and front of projector non "solid" to avoid torch placemen…
fnuecke Feb 3, 2022
8ba0a93
Small rewording.
fnuecke Feb 3, 2022
9af06ea
Ensure client-side event listeners are only added on client.
fnuecke Feb 3, 2022
29b1d4e
Fix data generator breaking because apparently that's `CLIENT` side.
fnuecke Feb 3, 2022
85363b8
Add recipe for projector block.
fnuecke Feb 3, 2022
2b368ca
Don't render projection if there's no way player can see it (too far …
fnuecke Feb 3, 2022
e28370a
Make projector emit some light while projecting something.
fnuecke Feb 3, 2022
5e9dd1a
Organize imports.
fnuecke Feb 3, 2022
c167922
Add SPDX header.
fnuecke Feb 3, 2022
04ee0bc
Fix not sending frame to client when they start observing a projector…
fnuecke Feb 3, 2022
781670b
Fix keyboard deserialization.
fnuecke Feb 4, 2022
1c7da68
Sorted some things.
fnuecke Feb 4, 2022
1d825aa
Updated blockstate.json for projector.
fnuecke Feb 4, 2022
c0268cb
Check bus block entity validity while screen is open.
fnuecke Feb 4, 2022
5e605c3
First draft for the keyboard block.
fnuecke Feb 4, 2022
2b9b239
Add overlay for keyboard screen, hide hotbar. Improve input handling.
fnuecke Feb 4, 2022
68d6dc8
Fix numeric key evdev mapping.
fnuecke Feb 4, 2022
0d62751
Always use relative pos to main camera to reduce precision errors.
fnuecke Feb 4, 2022
12de59d
Small cleanup.
fnuecke Feb 4, 2022
3351b03
Return device as capability for disk drive and projector.
fnuecke Feb 4, 2022
8302371
Use nice names for samplers.
fnuecke Feb 5, 2022
364f5ff
Util method for no-op runnable.
fnuecke Feb 5, 2022
3719e01
Cleaned up bus element implementations a little, to straighten the lo…
fnuecke Feb 5, 2022
73d43ee
Add API to give devices a reference to their context, to flag stuff a…
fnuecke Feb 5, 2022
5819943
Make item bus element update logic read a bit more similar to block one.
fnuecke Feb 5, 2022
2b3858b
Make computer not detecting devices explicit.
fnuecke Feb 5, 2022
5ecafeb
Make some devices properly tell their container they changed.
fnuecke Feb 5, 2022
6f7f0fa
Similar to how it is for blocks now, allow providing devices as capab…
fnuecke Feb 5, 2022
814f9d3
Split up vm and rpc device packages.
fnuecke Feb 5, 2022
ad8082e
Actually, that won't solve anything, so keep it out of the API for now.
fnuecke Feb 5, 2022
ce0c99b
Guess we have to do it like this.
fnuecke Feb 5, 2022
6ad13b9
Ignore removal if block entity was already unloaded.
fnuecke Feb 5, 2022
6fbc455
Add util record for describing chunk pos in a level.
fnuecke Feb 6, 2022
0736cdc
Remove unneeded call.
fnuecke Feb 6, 2022
7698ee5
Small legacy naming fix.
fnuecke Feb 6, 2022
4790438
Fixed removing cable part not directly triggering bus scan.
fnuecke Feb 6, 2022
4f3ffe7
Small rename.
fnuecke Feb 6, 2022
a40899d
Block device queries have optional result now, empty indicating unloa…
fnuecke Feb 6, 2022
94f41f9
Have bus interfaces track their neighbor chunks, if necessary.
fnuecke Feb 6, 2022
c926c3c
Only mark chunks as unsaved for tracked bus elements, not their neigh…
fnuecke Feb 6, 2022
01c28eb
Default new projectors to not be lit.
fnuecke Feb 6, 2022
b9f64e5
Fix computers adding their own devices without attached interface.
fnuecke Feb 6, 2022
6d726de
Fix updating boot error to clients.
fnuecke Feb 6, 2022
fb8b9d4
Fix projector watcher caching.
fnuecke Feb 6, 2022
e1f5111
Fixed chunk load/unload listeners only firing once.
fnuecke Feb 6, 2022
961f04a
Fixed ghost loading bug in projector.
fnuecke Feb 6, 2022
7a4037e
Remove listener tracker when last listener is removed.
fnuecke Feb 6, 2022
d8dc608
Fix potential (silent) NRE when no data is available after all.
fnuecke Feb 6, 2022
bf44259
Don't inject names when there's no other devices.
fnuecke Feb 6, 2022
6980aca
Update sedna-buildroot for evdev.
fnuecke Feb 6, 2022
b0156b6
Update mockito.
fnuecke Feb 6, 2022
ba3d42f
Fix mixin setup.
fnuecke Feb 6, 2022
cb21c17
Update Forge.
fnuecke Feb 6, 2022
95eb899
Got rid of a mixin.
fnuecke Feb 6, 2022
34d82e3
Make projector not break when some other mod enables stencil for the …
fnuecke Feb 7, 2022
917a379
Only copy depth when will render projector. Flush other render layers…
fnuecke Feb 7, 2022
2794002
Moved lock leading to waits on main thread for encoding worker thread.
fnuecke Feb 7, 2022
684c27b
Update JEI.
fnuecke Feb 7, 2022
e1b6fc2
Add JEI plugin to tell it about the sidebars in our computer/robot UIs.
fnuecke Feb 7, 2022
96a3366
Show projector energy consumption in tooltip.
fnuecke Feb 7, 2022
9a8b278
Send detailed projector state to client, show red lens when not powered.
fnuecke Feb 7, 2022
3056d55
Fix GL errors due to disposed textures still being bound after render…
fnuecke Feb 7, 2022
3e6d62e
Upload textures for projectors immediately to avoid GL error before f…
fnuecke Feb 7, 2022
5ec15f4
Fix collision with redstone block.
fnuecke Feb 8, 2022
df62a63
Remove the double escape thing to close keyboard screen. Doesn't feel…
fnuecke Feb 8, 2022
d235669
Allow breaking robots by attacking when in creative mode.
fnuecke Feb 8, 2022
024ee58
Add JEI provider for differently configured items.
fnuecke Feb 8, 2022
2495d98
Add basic documentation for projector and keyboard.
fnuecke Feb 9, 2022
09bda2a
Added Keyboard and Projector
Bs0Dd Feb 9, 2022
6e2c484
Added new devices docs to handbook
Feb 9, 2022
f3a812b
Сorrect paragraph position
Feb 9, 2022
24e8371
One level of indirection for capabilities for tests.
fnuecke Feb 9, 2022
03f9216
Use interface for mocking in tests.
fnuecke Feb 9, 2022
479af15
Make Invalidatable properly implement equals and hashCode.
fnuecke Feb 9, 2022
88c0442
Fix block device entries not equaling.
fnuecke Feb 9, 2022
6094a27
Don't add synthetic devices (type names) when there are no other devi…
fnuecke Feb 9, 2022
82cdd73
Basics for testing block level bus stuff.
fnuecke Feb 9, 2022
07429bf
Made provider registry access test-friendly.
fnuecke Feb 13, 2022
4688106
Made capability access test-friendly.
fnuecke Feb 13, 2022
0564ce6
Consistency.
fnuecke Feb 13, 2022
927f7f4
Add utility method that also checks unloaded, not just removed for bl…
fnuecke Feb 13, 2022
d84a674
Renamed event for clarity, inlined public methods only used in event,…
fnuecke Feb 13, 2022
352af7d
Move dispose method to parent interface.
fnuecke Feb 13, 2022
61323fa
Missed two isRemoved() -> isInvalid() conversions.
fnuecke Feb 13, 2022
3615fd1
Have adapters only unmount, not dispose devices.
fnuecke Feb 13, 2022
5f284ba
Avoid controller scan scheduling ping-pong.
fnuecke Feb 13, 2022
fad198e
Split up controller scan logic into methods for readability, reduced …
fnuecke Feb 13, 2022
3fdf49f
Make getter return readonly collection.
fnuecke Feb 13, 2022
f98d457
Paranoia: when removing cable/interface, ensure previously known devi…
fnuecke Feb 13, 2022
c0b35cd
Trigger device update in controller when some devices may be unloaded…
fnuecke Feb 13, 2022
5f15146
Handle edge case where devices get removed while element is unloaded,…
fnuecke Feb 13, 2022
4b9b921
Update tests.
fnuecke Feb 13, 2022
782217a
Another returned set to readonly and fix potential infinite recursion.
fnuecke Feb 13, 2022
356cf1f
Always store data, even if empty, to know device existed.
fnuecke Feb 13, 2022
b92152c
Fix devices in unloaded chunks not being removed from element device …
fnuecke Feb 13, 2022
ac1b978
Some more tests.
fnuecke Feb 13, 2022
a92ac07
Pass a scan reason for scheduling bus scan, so we can immediately ret…
fnuecke Feb 13, 2022
1be34d1
Fix static state bleeding between tests.
fnuecke Feb 13, 2022
cb4117a
Merge pull request #120 from Bs0Dd/rus
fnuecke Feb 13, 2022
f0a06c8
Send raw error message to client and add extra method to resolve erro…
fnuecke Feb 13, 2022
5d0bd81
Use texture instead of texture2D for MacOS.
fnuecke Feb 13, 2022
72affc6
Fix links in readme, closes #122.
fnuecke Feb 13, 2022
516bd6c
Add config for default ethernet frame TLL. Closes #101.
fnuecke Feb 13, 2022
3685c19
Renamed internal item names for buildroot hard disk and flash to be m…
fnuecke Feb 13, 2022
db06753
Small rename to match mappings.
fnuecke Feb 13, 2022
b958aee
Renamed class, abstract away registry.
fnuecke Feb 13, 2022
df60bd8
Ditto for firmwares.
fnuecke Feb 13, 2022
6148eff
Return empty stack if data is invalid, instead of returning default one.
fnuecke Feb 13, 2022
85c0452
Also list all extra custom hard drives in the creative tab.
fnuecke Feb 13, 2022
8fcaa81
Add matching getter to firmware registry.
fnuecke Feb 13, 2022
777b9f5
Change label of default hard drive and firmware to "Sedna Linux" to b…
fnuecke Feb 13, 2022
e5256f3
Accept long for size formatting.
fnuecke Feb 13, 2022
14210c5
Add support for custom block devices via data packs.
fnuecke Feb 13, 2022
530b830
Update data pack file system readme.
fnuecke Feb 13, 2022
baa3ca8
Reword disk drive docs a bit, to hopefully make it more clear on how …
fnuecke Feb 13, 2022
d5e4315
add volume & pitch to sound card
kore-signet Feb 25, 2022
d9da812
make sound card cooldown configurable
kore-signet Feb 25, 2022
e67a3b9
Merge pull request #137 from allie-signet/1.18-forge
fnuecke Feb 27, 2022
3c8e8be
config field changes for soundcard
kore-signet Feb 27, 2022
f8608c6
Merge pull request #139 from allie-signet/configurable-sound-cooldown
fnuecke Feb 27, 2022
75e50ff
Try to pick a nice name for object devices if none is explicitly prov…
fnuecke Feb 27, 2022
abc7a23
Remove upper limits for device sizes. Needs op rights anyway, so kind…
fnuecke Feb 27, 2022
181cc84
Internet card
Ktlo Apr 3, 2022
c811d88
English locales for internet card
IntQuant Apr 3, 2022
287d820
Added Internet GateWay Block and BlockEntity
IntQuant Apr 3, 2022
eaf8ac8
Refactoring and session layer implementation improvement
Ktlo Apr 3, 2022
95c85ee
Merge branch 'internet-card' of git.handtruth.com:ktlo/oc2 into inter…
IntQuant Apr 3, 2022
258bdd0
EndTag was a mistake
Ktlo Apr 4, 2022
9f3d978
Should work now
IntQuant Apr 4, 2022
37af868
Gateway now uses energy per packet sent
IntQuant Apr 4, 2022
d4d812b
Some simplifications
Ktlo Apr 5, 2022
75db7af
Simplifications, bugfixes and TCP once again
Ktlo Apr 6, 2022
a81a6b6
Fixed getRedstoneInput function on redstone interface card and block.
IpsumCapra Apr 6, 2022
53cd30f
Merge pull request #167 from IpsumCapra/1.18-forge
fnuecke Apr 6, 2022
78ae75a
Update to MC 1.18.2.
fnuecke Apr 7, 2022
6a003fc
Fixed tests.
fnuecke Apr 7, 2022
b79e393
Initial model and graphics for Internet GateWay block
IntQuant Apr 8, 2022
8b41f6a
Merge branch 'internet-card' of git.handtruth.com:ktlo/oc2 into inter…
IntQuant Apr 8, 2022
593497a
Fix merging (hopefully)
IntQuant Apr 9, 2022
57d2b76
Again
IntQuant Apr 9, 2022
f51e379
Special warning-toolip for when internet is disabled
IntQuant Apr 11, 2022
834de3a
More additions to the tooltip
IntQuant Apr 12, 2022
2976add
TCP! Almost ready...
Ktlo Apr 12, 2022
81f92e0
TCP! Now with SSH!
Ktlo Apr 12, 2022
ee06afa
Minus one "kostil"
Ktlo Apr 12, 2022
f478e0f
Some changes to animation
IntQuant Apr 20, 2022
b524fe6
Merge remote-tracking branch 'super/1.18-forge' into internet-card-w
Ktlo Jun 25, 2022
27abaf6
Most working version
Ktlo Jun 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
613 changes: 12 additions & 601 deletions .editorconfig

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf

# Files provided to VM.
src/main/resources/data/oc2/file_systems/**/*.lua text eol=lf
src/main/scripts/**/*.lua text eol=lf
51 changes: 28 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
name: build

on: [pull_request, push]
on:
pull_request:
push:
branches: [ '**' ]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [ 1.8 ]
# and run on both Linux and Windows
os: [ubuntu-latest, windows-latest]
java: [ 17 ]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build
env:
BUILD_NUMBER: ${{ github.run_number }}
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build
env:
GPR_USER: ${{ secrets.GPR_USER }}
GPR_KEY: ${{ secrets.GPR_KEY }}
101 changes: 101 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: publish

on:
release:
types: [published]

jobs:
publish-github:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Extract Version from Tag
uses: rishabhgupta/split-by@v1
id: split_tag
with:
string: ${{ github.event.release.tag_name }}
split-by: '/'

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ubuntu-latest-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ubuntu-latest-gradle-
- name: Build with Gradle
run: ./gradlew -Psemver='${{ steps.split_tag.outputs._1 }}' build
env:
GPR_USER: ${{ secrets.GPR_USER }}
GPR_KEY: ${{ secrets.GPR_KEY }}

- name: Add Artifacts to Github Release
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./build/libs/*.jar"]'

- name: Publish to Github Packages
run: gradle -Psemver='${{ steps.split_tag.outputs._1 }}' publish
env:
GPR_USER: ${{ secrets.GPR_USER }}
GPR_KEY: ${{ secrets.GPR_KEY }}
GITHUB_MAVEN_URL: 'https://maven.pkg.github.com/${{ github.repository }}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-curse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Extract Version from Tag
uses: rishabhgupta/split-by@v1
id: split_tag
with:
string: ${{ github.event.release.tag_name }}
split-by: '/'

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ubuntu-latest-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ubuntu-latest-gradle-

# Set Curseforge release type based on pre-release flag.
- name: Set release type to 'release'
run: |
echo "CURSEFORGE_RELEASE_TYPE=release" >> $GITHUB_ENV
if: github.event.release.prerelease == false
- name: Set release type to 'alpha'
run: |
echo "CURSEFORGE_RELEASE_TYPE=alpha" >> $GITHUB_ENV
if: github.event.release.prerelease == true

- name: Publish to Curseforge
run: ./gradlew -Psemver='${{ steps.split_tag.outputs._1 }}' curseforge
env:
GPR_USER: ${{ secrets.GPR_USER }}
GPR_KEY: ${{ secrets.GPR_KEY }}
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
CURSEFORGE_RELEASE_TYPE: ${{ env.CURSEFORGE_RELEASE_TYPE }}
CHANGELOG: ${{ github.event.release.body }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ forge*changelog.txt
/src/generated/

#vscode
.vscode
.vscode

# Don't ignore bin from scripts
!/src/main/scripts/bin/
21 changes: 21 additions & 0 deletions LICENSE-JCODEC
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright 2008-2019 JCodecProject

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary form
must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with
the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,24 @@ OpenComputers II is a Minecraft mod adding virtual computers to the game. These

This mod is a successor to [OpenComputers]. At least in spirit. While many of the implementation details have changed quite dramatically, the core concepts of customizable hardware, persistence and sand-boxing are shared.

## Gameplay Documentation
For documentation on how the to get computers up and running, and how to use them, see the [documentation]. It is available as a manual item in the game.

## Development Documentation
While the mod isn't quite yet ready for release due to some remaining technical and usability issues, the API should be mostly stable at this point. For most people the high level device API will be sufficient, and is much more accessible. It centers around the [`RPCDevice`][RPC Device]. For a sample block implementation, see the [redstone interface]. For a sample item implementation, see the [sound card]. If you wish to dive deeper, and provide emulated hardware that requires a Linux driver, this centers around the [`VMDevice`][VM Device]. For a sample block implementation, see the [disk drive]. For a sample item implementation, see the [network card].

For documentation on how the to get computers up and running, and how to use them, see the [documentation]. It is available as a manual item in the game.
## Building
To build this project, credentials for the Github Package Repository must be set up once on your machine (see
[the documentation][GithubPackagesGradle] for more information). In short, you'll want to add your username and a
public access token with `read:packages` permissions into your `~/.gradle/gradle.properties`. The properties must be
named `gpr.user` and `gpr.key`.

[OpenComputers]: https://github.com/MightyPirates/OpenComputers
[RPC Device]: src/main/java/li/cil/oc2/api/bus/device/rpc/RPCDevice.java
[redstone interface]: src/main/java/li/cil/oc2/common/tileentity/RedstoneInterfaceTileEntity.java
[sound card]: src/main/java/li/cil/oc2/common/bus/device/item/SoundCardItemDevice.java
[redstone interface]: src/main/java/li/cil/oc2/common/blockentity/RedstoneInterfaceBlockEntity.java
[sound card]: src/main/java/li/cil/oc2/common/bus/device/rpc/item/SoundCardItemDevice.java
[VM Device]: src/main/java/li/cil/oc2/api/bus/device/vm/VMDevice.java
[disk drive]: src/main/java/li/cil/oc2/common/tileentity/DiskDriveTileEntity.java
[network card]: src/main/java/li/cil/oc2/common/bus/device/item/NetworkInterfaceCardItemDevice.java
[documentation]: src/main/resources/assets/oc2/doc/en_us/index.md
[disk drive]: src/main/java/li/cil/oc2/common/blockentity/DiskDriveBlockEntity.java
[network card]: src/main/java/li/cil/oc2/common/bus/device/vm/item/NetworkInterfaceCardDevice.java
[documentation]: src/main/resources/assets/oc2/doc/en_us/index.md
[GithubPackagesGradle]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry
Loading