Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Commit

Permalink
Finish it up! Prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Jun 18, 2022
1 parent a096d7e commit 203aab7
Show file tree
Hide file tree
Showing 46 changed files with 715 additions and 147 deletions.
74 changes: 19 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,28 @@
<img src="readme-assets/logo.png" alt="CC: Restitched" width="50%"/>

[![Current build status](https://img.shields.io/github/workflow/status/cc-tweaked/cc-restitched/Build?style=for-the-badge&logo=github)](https://github.com/cc-tweaked/cc-restitched/actions "Current build status")
[![Download CC: Restitched on CurseForge](https://img.shields.io/badge/curseforge-cc%3Arestitched-orange?style=for-the-badge&logo=curseforge)](https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched on CurseForge")
[![Download CC: Restitched via Modrinth](https://img.shields.io/badge/dynamic/json?color=5da545&label=modrinth&prefix=downloads%20&query=downloads&url=https://api.modrinth.com/api/v1/mod/cc-restitched&style=for-the-badge&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMSAxMSIgd2lkdGg9IjE0LjY2NyIgaGVpZ2h0PSIxNC42NjciICB4bWxuczp2PSJodHRwczovL3ZlY3RhLmlvL25hbm8iPjxkZWZzPjxjbGlwUGF0aCBpZD0iQSI+PHBhdGggZD0iTTAgMGgxMXYxMUgweiIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNBKSI+PHBhdGggZD0iTTEuMzA5IDcuODU3YTQuNjQgNC42NCAwIDAgMS0uNDYxLTEuMDYzSDBDLjU5MSA5LjIwNiAyLjc5NiAxMSA1LjQyMiAxMWMxLjk4MSAwIDMuNzIyLTEuMDIgNC43MTEtMi41NTZoMGwtLjc1LS4zNDVjLS44NTQgMS4yNjEtMi4zMSAyLjA5Mi0zLjk2MSAyLjA5MmE0Ljc4IDQuNzggMCAwIDEtMy4wMDUtMS4wNTVsMS44MDktMS40NzQuOTg0Ljg0NyAxLjkwNS0xLjAwM0w4LjE3NCA1LjgybC0uMzg0LS43ODYtMS4xMTYuNjM1LS41MTYuNjk0LS42MjYuMjM2LS44NzMtLjM4N2gwbC0uMjEzLS45MS4zNTUtLjU2Ljc4Ny0uMzcuODQ1LS45NTktLjcwMi0uNTEtMS44NzQuNzEzLTEuMzYyIDEuNjUxLjY0NSAxLjA5OC0xLjgzMSAxLjQ5MnptOS42MTQtMS40NEE1LjQ0IDUuNDQgMCAwIDAgMTEgNS41QzExIDIuNDY0IDguNTAxIDAgNS40MjIgMCAyLjc5NiAwIC41OTEgMS43OTQgMCA0LjIwNmguODQ4QzEuNDE5IDIuMjQ1IDMuMjUyLjgwOSA1LjQyMi44MDljMi42MjYgMCA0Ljc1OCAyLjEwMiA0Ljc1OCA0LjY5MSAwIC4xOS0uMDEyLjM3Ni0uMDM0LjU2bC43NzcuMzU3aDB6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiM1ZGE0MjYiLz48L2c+PC9zdmc+)](https://modrinth.com/mod/cc-restitched "Download CC: Restitched via Modrinth")
[![Gitpod ready-to-code](https://shields.io/badge/gitpod-ready--to--code-green?logo=gitpod&style=for-the-badge)](https://gitpod.io/#https://github.com/cc-tweaked/cc-restitched)
# ComputerCraft: Restitched with Polymer

Doing things no one else did...

<img src="readme-assets/whatiscc.png" alt="What is CC:Restitched" width="37.5%"/>
## What is this?
This is a port of CC: Restitched (which by itself is port of CC: Tweaked,
continuation of original ComputerCraft), modified in a way to allow nearly
all functionality of regular version to work purely server side (Vanilla client can join
servers using it and have all functionality!). It still requires server to run on Fabric
or Quilt, so keep that in mind!

This is a port of [cc-tweaked/CC-Tweaked](https://github.com/cc-tweaked/CC-Tweaked) to the [Fabric modloader](https://fabricmc.net/) as well as being a continuation of [JemmaZZ/cc-tweaked-fabric](https://github.com/JemmaZZ/cc-tweaked-fabric) and can be found at [Github Actions](https://github.com/cc-tweaked/cc-restitched/actions), [Modrinth](https://modrinth.com/mod/cc-restitched) and [Curseforge](https://www.curseforge.com/minecraft/mc-mods/cc-restitched).
If you are interested about ComputerCraft and how to use it check
[page of CC:R](https://github.com/cc-tweaked/cc-restitched/#readme).

<img src="readme-assets/ccrandcct.png" alt="CC: Restitched and CC: Tweaked" width="37.5%"/>
This version should be nearly identical in case of usage and functionality,
excluding different guis and no support for DFPWM/playing dynamic audio from speakers.

CC: R tries to maintain parity with CC: T, though it may be behind or divergent in some areas. If you notice a disparity please open an issue. CC: R major and minor version numbers indicate parity with the major features of that version of CC: T. Patch version numbers will NOT align.
![Basic setup](https://i.imgur.com/bZt6Kjj.png)
![Paint](https://imgur.com/STmCBn9.png)
![Turtles](https://imgur.com/HQ8hbP9.png)
![Turtle ui](https://imgur.com/1WMDkjJ.png)

<img src="readme-assets/incluededpacks.png" alt="Included Resource Packs" width="37.5%"/>

This mod includes textures by [Jummit](https://github.com/Jummit) that are more in line with the style of Mojang's new texture-artist, Jappa. If you prefer the original ComputerCraft textures you should enable the `classic` resource pack.
We also have a third resourcepack made by [3prm3](https://github.com/3prm3), it features a complete overhaul of CC's textures (in the style of an industrial mod) and can be used by enabling the `overhaul` resource pack. You can also check out his resource pack over [here](https://github.com/cc-orgs/cc-overhaul/tree/main) as well!<img src="https://raw.githubusercontent.com/cc-orgs/cc-overhaul/main/pack.png" alt="CC: Restitched" width="32" height="32"/>
## Downloads:
- Github Releases: https://github.com/PolymerPorts/cc-restitched/releases
- Modrinth: https://modrinth.com/mod/cc-polymer

<img src="readme-assets/bleedingedgever.png" alt="Bleeding Edge Versions" width="37.5%"/>

Bleeding edge builds can be found [here](https://github.com/cc-tweaked/cc-restitched/actions) at Github Actions.
In the .zip file there should be a `-dev` jar, a `-javadoc` jar, a `-sources-dev` jar, a `-sources` jar, and a "plain" jar (jar without an affixed tag) jar.
Put the "plain" jar in the mods folder.

<img src="readme-assets/contributing.png" alt="Contributing to the Repo" width="37.5%"/>

Any contribution is welcome, be it using the mod, reporting bugs or contributing code. In order to start helping develop CC: R there are a few rules;
1) Follow the [Fabric](https://fabricmc.net/) programming guidelines as close as possible. This means you have to use [`loom`](https://fabricmc.net/wiki/tutorial:mappings) mappings, if you use anything else, your code will be rejected.
2) Make sure your code follows the checkstyle rules. You can test this by running `./gradle build` or `./gradle check`.
3) You cannot intentionally implement bugs and security vulnerabilities.
4) Unless the code is taken directly from CC: Tweaked, `lua` code is offlimits from alteration. If you wish to contribute your changes to the in game rom please contribute upstream at [CC-Tweaked](https://github.com/cc-tweaked/CC-Tweaked).
5) Branches should be named in this format `mc-<major ver.>.x/<specific-mc-ver.>`

<img src="readme-assets/renderingmodcompat.png" alt="Rendering Mod Compatibility" width="37.5%"/>

* [ YES ] [Sodium](https://www.curseforge.com/minecraft/mc-mods/sodium)
* [ YES ] [OptiFabric](https://www.curseforge.com/minecraft/mc-mods/optifabric)
* Works with VBO Rendering (automatically set)
* No issues
* [ YES ] [Iris Shaders & Sodium](https://www.curseforge.com/minecraft/mc-mods/irisshaders)
* [ YES ] [Canvas](https://www.curseforge.com/minecraft/mc-mods/canvas-renderer)
* Works with TBO Rendering (Default)
- ![](https://cdn.discordapp.com/attachments/851534220680495165/960677825185214574/unknown.png)
* Scuffed with VBO Rendering
* <details>
<summary>VBO is broken</summary>

Monitors are following the player?.
- ![](https://cdn.discordapp.com/attachments/851534220680495165/960674312896016394/unknown.png)
- ![](https://cdn.discordapp.com/attachments/851534220680495165/960674662839357530/unknown.png)
- ![](https://cdn.discordapp.com/attachments/851534220680495165/960674410510041128/unknown.png)
* The screen seems to get bigger the closer you get to it.
</details>

<img src="readme-assets/community.png" alt="CC: Restitched" width="37.5%"/>

If you need help getting started with CC: Restitched, want to show off your latest project, or just want to chat about ComputerCraft, here is the [Computercraft Forum](https://forums.computercraft.cc/) and the Computer Mods [Discord!](https://discord.gg/H2UyJXe). There is also a wiki that can be found at [https://tweaked.cc/](https://tweaked.cc/)

<img src="readme-assets/peripheralmods.png" alt="CC: Restitched" width="37.5%"/>

Unfortunately, CC: Restitched does not have as many peripherals mods available as CC: Tweaked though there is one known as Allium Peripherals made by [hugeblank](https://github.com/hugeblank) which can be found [here](https://www.curseforge.com/minecraft/mc-mods/allium-peripherals). But if you're an interested mod developer, please check out our `api` package. If you've already made a mod with CC: R peripheral support OR if you're a player who found a mod with CC: R integration, please open an issue [here](https://github.com/cc-tweaked/cc-restitched/issues/new?assignees=&labels=peripheralShoutout&template=peripheral_shoutout.md) to let us know and we'll add it to the list!
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
id "checkstyle"
id "jacoco"
id "maven-publish"
id "com.github.hierynomus.license" version "0.16.1"
Expand Down Expand Up @@ -83,8 +82,6 @@ configurations {
}

dependencies {
checkstyle "com.puppycrawl.tools:checkstyle:8.45"

minecraft "com.mojang:minecraft:${mc_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
Expand Down Expand Up @@ -137,7 +134,7 @@ dependencies {

modImplementation include("eu.pb4:sgui:1.1.0+1.19")
modImplementation include("eu.pb4:hologram-api:0.2.2+1.19")
modImplementation include("eu.pb4:polymer:0.2.0+1.19")
modImplementation include("eu.pb4:polymer:0.2.1+1.19")
modImplementation include("fr.catcore:server-translations-api:1.4.14+1.19-rc2")
modImplementation include("eu.pb4:map-canvas-api:0.1.4+1.19")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cloth_config_version=7.0.72
modmenu_version=4.0.0
netty_http_version=4.1.77.Final

sub_version=1
sub_version=0
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added player_head.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed skins/advanced_turtle.xcf
Binary file not shown.
Binary file added skins/ender_modem_down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/ender_modem_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/ender_modem_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/printer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/wired_modem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/wireless_modem_down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/wireless_modem_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added skins/wireless_modem_up.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dan200.computercraft.fabric.mixin.poly;

import dan200.computercraft.fabric.poly.ComputerGui;
import dan200.computercraft.fabric.poly.MapGui;
import dan200.computercraft.fabric.poly.gui.MapGui;
import eu.pb4.sgui.virtual.VirtualScreenHandlerInterface;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.player.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package dan200.computercraft.fabric.mixin.poly;

import dan200.computercraft.fabric.poly.MapGui;
import dan200.computercraft.fabric.poly.gui.MapGui;
import eu.pb4.sgui.virtual.VirtualScreenHandlerInterface;
import eu.pb4.sgui.virtual.hotbar.HotbarScreenHandler;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
import net.minecraft.network.protocol.Packet;
Expand Down Expand Up @@ -97,4 +96,14 @@ private void ccp_onVehicleMove(ServerboundPlayerInputPacket serverboundPlayerInp
ci.cancel();
}
}

@Inject(method = "handlePlayerCommand", at = @At("HEAD"), cancellable = true)
private void ccp_onVehicleMove(ServerboundPlayerCommandPacket serverboundPlayerCommandPacket, CallbackInfo ci) {
if (this.player.containerMenu instanceof VirtualScreenHandlerInterface handler && handler.getGui() instanceof MapGui computerGui) {
this.server.execute(() -> {
computerGui.onPlayerCommand(serverboundPlayerCommandPacket.getId(), serverboundPlayerCommandPacket.getAction(), serverboundPlayerCommandPacket.getData());
});
ci.cancel();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dan200.computercraft.fabric.poly;
package dan200.computercraft.fabric.poly.gui;

import com.mojang.authlib.GameProfile;
import dan200.computercraft.fabric.poly.ComputerDisplayAccess;
import dan200.computercraft.fabric.poly.Keys;
import dan200.computercraft.fabric.poly.render.*;
import dan200.computercraft.fabric.poly.textures.GuiTextures;
import dan200.computercraft.fabric.poly.textures.RepeatingCanvas;
Expand Down Expand Up @@ -49,6 +51,7 @@ public final class ComputerGui extends MapGui implements IContainerComputer {
}
ACTIONS.put("enter", pressKey(Keys.ENTER));
ACTIONS.put("backspace", pressKey(Keys.BACKSPACE));
ACTIONS.put("bsp", pressKey(Keys.BACKSPACE));
ACTIONS.put("back", pressKey(Keys.BACKSPACE));
ACTIONS.put("esc", pressKey(Keys.ESCAPE));
ACTIONS.put("ctrl", pressKey(Keys.LEFT_CONTROL));
Expand Down Expand Up @@ -397,25 +400,6 @@ public void onCommandSuggestion(int id, String fullCommand) {
}
}

public void onCameraMove(float xRot, float yRot) {
this.mouseMoves++;

if (this.mouseMoves < 16) {
return;
}

this.xRot = xRot;
this.yRot = yRot;

this.cursorX = this.cursorX + (int) ((xRot > 0.3 ? 3 : xRot < -0.3 ? -3 : 0) * (Math.abs(xRot) - 0.3));
this.cursorY = this.cursorY + (int) ((yRot > 0.3 ? 3 : yRot < -0.3 ? -3 : 0) * (Math.abs(yRot) - 0.3));

this.cursorX = Mth.clamp(this.cursorX, 5, this.canvas.getWidth() * 2 - 5);
this.cursorY = Mth.clamp(this.cursorY, 5, this.canvas.getHeight() * 2 - 5);

this.cursor.move(this.cursorX + 4, this.cursorY + 4, this.cursor.getRotation());
}

@Override
public boolean onClickEntity(int entityId, EntityInteraction type, boolean isSneaking, @Nullable Vec3 interactionPos) {
//this.player.sendMessage(new TextComponent("x: " + this.cursorX / 2 + " | y: " + this.cursorY / 2), Util.NIL_UUID);
Expand All @@ -428,10 +412,6 @@ public boolean onClickEntity(int entityId, EntityInteraction type, boolean isSne
return super.onClickEntity(entityId, type, isSneaking, interactionPos);
}

public void setDistance(double i) {
this.entity.setPos(this.entity.getX(), this.entity.getY(), this.pos.getZ() - 0.8 - i);
this.player.connection.send(new ClientboundTeleportEntityPacket(this.entity));
}

@Nullable
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dan200.computercraft.fabric.poly;
package dan200.computercraft.fabric.poly.gui;

import com.google.common.base.Predicates;
import com.mojang.authlib.GameProfile;
Expand Down Expand Up @@ -207,6 +207,9 @@ public void onPlayerInput(float deltaX, float deltaZ, boolean jumping, boolean s

}

public void onPlayerCommand(int id, ServerboundPlayerCommandPacket.Action action, int data) {
}

static {
var commandNode = new RootCommandNode<SharedSuggestionProvider>();

Expand All @@ -225,4 +228,6 @@ public void onPlayerInput(float deltaX, float deltaZ, boolean jumping, boolean s

COMMAND_PACKET = new ClientboundCommandsPacket(commandNode);
}


}
Loading

0 comments on commit 203aab7

Please sign in to comment.