Skip to content

Commit 1ece2aa

Browse files
committed
Merge branch 'mc-1.19.x' into mc-1.20.x
2 parents ff1e5f6 + ec52f3e commit 1ece2aa

File tree

18 files changed

+93
-131
lines changed

18 files changed

+93
-131
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug_report.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ body:
1111
- 1.16.x
1212
- 1.18.x
1313
- 1.19.x
14+
- 1.20.x
1415
validations:
1516
required: true
1617
- type: input

Diff for: buildSrc/src/main/kotlin/cc-tweaked.mod-publishing.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ val publishCurseForge by tasks.registering(TaskPublishCurseForge::class) {
3333
enabled = apiToken != ""
3434

3535
val mainFile = upload("282001", modPublishing.output.get().archiveFile)
36-
dependsOn(modPublishing.output) // See https://github.com/Darkhax/CurseForgeGradle/pull/7.
3736
mainFile.changelog =
3837
"Release notes can be found on the [GitHub repository](https://github.com/cc-tweaked/CC-Tweaked/releases/tag/v$mcVersion-$modVersion)."
3938
mainFile.changelogType = "markdown"

Diff for: buildSrc/src/main/kotlin/cc-tweaked.publishing.gradle.kts

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//
33
// SPDX-License-Identifier: MPL-2.0
44

5-
import org.gradle.kotlin.dsl.`maven-publish`
6-
75
plugins {
86
`java-library`
97
`maven-publish`

Diff for: gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ kotlin.jvm.target.validation.mode=error
1010

1111
# Mod properties
1212
isUnstable=false
13-
modVersion=1.104.0
13+
modVersion=1.105.0
1414

1515
# Minecraft properties: We want to configure this here so we can read it in settings.gradle
1616
mcVersion=1.20

Diff for: gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ junit = "5.9.2"
5050
# Build tools
5151
cctJavadoc = "1.7.0"
5252
checkstyle = "10.3.4"
53-
curseForgeGradle = "1.0.11"
53+
curseForgeGradle = "1.0.14"
5454
errorProne-core = "2.18.0"
5555
errorProne-plugin = "3.0.1"
5656
fabric-loom = "1.1.10"

Diff for: projects/common-api/src/main/java/dan200/computercraft/api/pocket/PocketUpgradeSerialiser.java

-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
package dan200.computercraft.api.pocket;
66

7-
import dan200.computercraft.api.ComputerCraftAPI;
87
import dan200.computercraft.api.upgrades.UpgradeBase;
98
import dan200.computercraft.api.upgrades.UpgradeSerialiser;
109
import dan200.computercraft.impl.ComputerCraftAPIService;
@@ -30,14 +29,6 @@
3029
* @see PocketUpgradeDataProvider
3130
*/
3231
public interface PocketUpgradeSerialiser<T extends IPocketUpgrade> extends UpgradeSerialiser<T> {
33-
/**
34-
* The ID for the associated registry.
35-
*
36-
* @deprecated Use {@link #registryId()} instead.
37-
*/
38-
@Deprecated(forRemoval = true)
39-
ResourceKey<Registry<PocketUpgradeSerialiser<?>>> REGISTRY_ID = ResourceKey.createRegistryKey(new ResourceLocation(ComputerCraftAPI.MOD_ID, "pocket_upgrade_serialiser"));
40-
4132
/**
4233
* The ID for the associated registry.
4334
*

Diff for: projects/common-api/src/main/java/dan200/computercraft/api/turtle/ITurtleAccess.java

-20
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import net.minecraft.nbt.CompoundTag;
1414
import net.minecraft.world.Container;
1515
import net.minecraft.world.level.Level;
16-
import net.minecraft.world.phys.Vec3;
1716
import org.jetbrains.annotations.ApiStatus;
1817

1918
import javax.annotation.Nullable;
@@ -68,25 +67,6 @@ public interface ITurtleAccess {
6867
*/
6968
boolean teleportTo(Level world, BlockPos pos);
7069

71-
/**
72-
* Returns a vector containing the floating point co-ordinates at which the turtle is rendered.
73-
* This will shift when the turtle is moving.
74-
*
75-
* @param f The subframe fraction.
76-
* @return A vector containing the floating point co-ordinates at which the turtle resides.
77-
* @see #getVisualYaw(float)
78-
*/
79-
Vec3 getVisualPosition(float f);
80-
81-
/**
82-
* Returns the yaw the turtle is facing when it is rendered.
83-
*
84-
* @param f The subframe fraction.
85-
* @return The yaw the turtle is facing.
86-
* @see #getVisualPosition(float)
87-
*/
88-
float getVisualYaw(float f);
89-
9070
/**
9171
* Returns the world direction the turtle is currently facing.
9272
*

Diff for: projects/common-api/src/main/java/dan200/computercraft/api/turtle/TurtleUpgradeSerialiser.java

-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
package dan200.computercraft.api.turtle;
66

7-
import dan200.computercraft.api.ComputerCraftAPI;
87
import dan200.computercraft.api.upgrades.UpgradeBase;
98
import dan200.computercraft.api.upgrades.UpgradeSerialiser;
109
import dan200.computercraft.impl.ComputerCraftAPIService;
@@ -65,14 +64,6 @@
6564
* @see dan200.computercraft.api.client.turtle.TurtleUpgradeModeller
6665
*/
6766
public interface TurtleUpgradeSerialiser<T extends ITurtleUpgrade> extends UpgradeSerialiser<T> {
68-
/**
69-
* The ID for the associated registry.
70-
*
71-
* @deprecated Use {@link #registryId()} instead.
72-
*/
73-
@Deprecated(forRemoval = true)
74-
ResourceKey<Registry<TurtleUpgradeSerialiser<?>>> REGISTRY_ID = ResourceKey.createRegistryKey(new ResourceLocation(ComputerCraftAPI.MOD_ID, "turtle_upgrade_serialiser"));
75-
7667
/**
7768
* The ID for the associated registry.
7869
*

Diff for: projects/common/src/client/java/dan200/computercraft/client/ClientTableFormatter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* A {@link TableFormatter} subclass which writes directly to {@linkplain ChatComponent the chat GUI}.
2424
* <p>
2525
* Each message written gets a special {@link GuiMessageTag}, so we can remove the previous table of the same
26-
* {@link TableBuilder#getId() id}.
26+
* {@linkplain TableBuilder#getId() id}.
2727
*/
2828
public class ClientTableFormatter implements TableFormatter {
2929
public static final ClientTableFormatter INSTANCE = new ClientTableFormatter();

Diff for: projects/common/src/client/java/dan200/computercraft/client/gui/widgets/TerminalWidget.java

+29-26
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import net.minecraft.client.gui.components.AbstractWidget;
1616
import net.minecraft.client.gui.narration.NarratedElementType;
1717
import net.minecraft.client.gui.narration.NarrationElementOutput;
18+
import net.minecraft.client.gui.screens.Screen;
1819
import net.minecraft.client.renderer.MultiBufferSource;
1920
import net.minecraft.network.chat.Component;
2021
import org.lwjgl.glfw.GLFW;
@@ -81,6 +82,11 @@ public boolean charTyped(char ch, int modifiers) {
8182
@Override
8283
public boolean keyPressed(int key, int scancode, int modifiers) {
8384
if (key == GLFW.GLFW_KEY_ESCAPE) return false;
85+
if (Screen.isPaste(key)) {
86+
paste();
87+
return true;
88+
}
89+
8490
if ((modifiers & GLFW.GLFW_MOD_CONTROL) != 0) {
8591
switch (key) {
8692
case GLFW.GLFW_KEY_T -> {
@@ -92,32 +98,6 @@ public boolean keyPressed(int key, int scancode, int modifiers) {
9298
case GLFW.GLFW_KEY_R -> {
9399
if (rebootTimer < 0) rebootTimer = 0;
94100
}
95-
case GLFW.GLFW_KEY_V -> {
96-
// Ctrl+V for paste
97-
var clipboard = Minecraft.getInstance().keyboardHandler.getClipboard();
98-
if (clipboard != null) {
99-
// Clip to the first occurrence of \r or \n
100-
var newLineIndex1 = clipboard.indexOf("\r");
101-
var newLineIndex2 = clipboard.indexOf("\n");
102-
if (newLineIndex1 >= 0 && newLineIndex2 >= 0) {
103-
clipboard = clipboard.substring(0, Math.min(newLineIndex1, newLineIndex2));
104-
} else if (newLineIndex1 >= 0) {
105-
clipboard = clipboard.substring(0, newLineIndex1);
106-
} else if (newLineIndex2 >= 0) {
107-
clipboard = clipboard.substring(0, newLineIndex2);
108-
}
109-
110-
// Filter the string
111-
clipboard = SharedConstants.filterText(clipboard);
112-
if (!clipboard.isEmpty()) {
113-
// Clip to 512 characters and queue the event
114-
if (clipboard.length() > 512) clipboard = clipboard.substring(0, 512);
115-
computer.queueEvent("paste", new Object[]{ clipboard });
116-
}
117-
118-
return true;
119-
}
120-
}
121101
}
122102
}
123103

@@ -131,6 +111,29 @@ public boolean keyPressed(int key, int scancode, int modifiers) {
131111
return true;
132112
}
133113

114+
private void paste() {
115+
var clipboard = Minecraft.getInstance().keyboardHandler.getClipboard();
116+
117+
// Clip to the first occurrence of \r or \n
118+
var newLineIndex1 = clipboard.indexOf('\r');
119+
var newLineIndex2 = clipboard.indexOf('\n');
120+
if (newLineIndex1 >= 0 && newLineIndex2 >= 0) {
121+
clipboard = clipboard.substring(0, Math.min(newLineIndex1, newLineIndex2));
122+
} else if (newLineIndex1 >= 0) {
123+
clipboard = clipboard.substring(0, newLineIndex1);
124+
} else if (newLineIndex2 >= 0) {
125+
clipboard = clipboard.substring(0, newLineIndex2);
126+
}
127+
128+
// Filter the string
129+
clipboard = SharedConstants.filterText(clipboard);
130+
if (!clipboard.isEmpty()) {
131+
// Clip to 512 characters and queue the event
132+
if (clipboard.length() > 512) clipboard = clipboard.substring(0, 512);
133+
computer.queueEvent("paste", new Object[]{ clipboard });
134+
}
135+
}
136+
134137
@Override
135138
public boolean keyReleased(int key, int scancode, int modifiers) {
136139
// Queue the "key_up" event and remove from the down set

Diff for: projects/common/src/main/java/dan200/computercraft/shared/details/ItemDetails.java

+3-24
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
package dan200.computercraft.shared.details;
66

77
import com.google.gson.JsonParseException;
8-
import dan200.computercraft.shared.platform.PlatformHelper;
98
import dan200.computercraft.shared.platform.RegistryWrappers;
109
import dan200.computercraft.shared.util.NBTUtil;
11-
import net.minecraft.core.registries.Registries;
1210
import net.minecraft.nbt.ListTag;
1311
import net.minecraft.nbt.Tag;
1412
import net.minecraft.network.chat.Component;
15-
import net.minecraft.world.item.CreativeModeTab;
16-
import net.minecraft.world.item.CreativeModeTabs;
1713
import net.minecraft.world.item.EnchantedBookItem;
1814
import net.minecraft.world.item.ItemStack;
1915
import net.minecraft.world.item.enchantment.EnchantmentHelper;
@@ -46,7 +42,9 @@ public static void fill(Map<? super String, Object> data, ItemStack stack) {
4642
}
4743

4844
data.put("tags", DetailHelpers.getTags(stack.getTags()));
49-
data.put("itemGroups", getItemGroups(stack));
45+
46+
// Include deprecated itemGroups field
47+
data.put("itemGroups", List.of());
5048

5149
var tag = stack.getTag();
5250
if (tag != null && tag.contains("display", Tag.TAG_COMPOUND)) {
@@ -85,25 +83,6 @@ private static Component parseTextComponent(Tag x) {
8583
}
8684
}
8785

88-
/**
89-
* Retrieve all item groups an item stack pertains to.
90-
*
91-
* @param stack Stack to analyse
92-
* @return A filled list that contains pairs of item group IDs and their display names.
93-
*/
94-
private static List<Map<String, Object>> getItemGroups(ItemStack stack) {
95-
return CreativeModeTabs.allTabs().stream()
96-
.filter(x -> x.shouldDisplay() && x.getType() == CreativeModeTab.Type.CATEGORY && x.contains(stack))
97-
.map(group -> {
98-
Map<String, Object> groupData = new HashMap<>(2);
99-
100-
groupData.put("id", PlatformHelper.get().getRegistryKey(Registries.CREATIVE_MODE_TAB, group).toString());
101-
groupData.put("displayName", group.getDisplayName().getString());
102-
return groupData;
103-
})
104-
.toList();
105-
}
106-
10786
/**
10887
* Retrieve all visible enchantments from given stack. Try to follow all tooltip rules : order and visibility.
10988
*

Diff for: projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtleBrain.java

-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ public boolean teleportTo(Level world, BlockPos pos) {
319319
return false;
320320
}
321321

322-
@Override
323322
public Vec3 getVisualPosition(float f) {
324323
var offset = getRenderOffset(f);
325324
var pos = owner.getBlockPos();
@@ -330,7 +329,6 @@ public Vec3 getVisualPosition(float f) {
330329
);
331330
}
332331

333-
@Override
334332
public float getVisualYaw(float f) {
335333
var yaw = getDirection().toYRot();
336334
switch (animation) {

Diff for: projects/common/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private static boolean deployOnBlock(
169169
if (Math.abs(hitY - 0.5f) < 0.01f) hitY = 0.45f;
170170

171171
// Check if there's something suitable to place onto
172-
var hit = new BlockHitResult(new Vec3(hitX, hitY, hitZ), side, position, false);
172+
var hit = new BlockHitResult(new Vec3(position.getX() + hitX, position.getY() + hitY, position.getZ() + hitZ), side, position, false);
173173
var context = new UseOnContext(turtlePlayer.player(), InteractionHand.MAIN_HAND, hit);
174174
if (!canDeployOnBlock(new BlockPlaceContext(context), turtle, turtlePlayer, position, side, adjacent, outErrorMessage)) {
175175
return false;

Diff for: projects/core/src/main/resources/data/computercraft/lua/rom/help/changelog.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# New features in CC: Tweaked 1.105.0
2+
3+
* Optimise JSON string parsing.
4+
* Add `colors.fromBlit` (Erb3).
5+
* Upload file size limit is now configurable (khankul).
6+
* Wired cables no longer have a distance limit.
7+
* Java methods now coerce values to strings consistently with Lua.
8+
* Add custom timeout support to the HTTP API.
9+
* Support custom proxies for HTTP requests (Lemmmy).
10+
* The `speaker` program now errors when playing HTTP files.
11+
* `edit` now shows an error message when editing read-only files.
12+
* Update Ukranian translation (SirEdvin).
13+
14+
Several bug fixes:
15+
* Allow GPS hosts to only be 1 block apart.
16+
* Fix "Turn On"/"Turn Off" buttons being inverted in the computer GUI (Erb3).
17+
* Fix arrow keys not working in the printout UI.
18+
* Several documentation fixes (zyxkad, Lupus590, Commandcracker).
19+
* Fix monitor renderer debug text always being visible on Forge.
20+
* Fix crash when another mod changes the LoggerContext.
21+
* Fix the `monitor_renderer` option not being present in Fabric config files.
22+
* Pasting on MacOS/OSX now uses Cmd+V rather than Ctrl+V.
23+
* Fix turtles placing blocks upside down when at y<0.
24+
125
# New features in CC: Tweaked 1.104.0
226

327
* Update to Minecraft 1.19.4.
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
1-
New features in CC: Tweaked 1.104.0
1+
New features in CC: Tweaked 1.105.0
22

3-
* Update to Minecraft 1.19.4.
4-
* Turtles can now right click items "into" certain blocks (cauldrons and hives by default, configurable with the `computercraft:turtle_can_use` block tag).
5-
* Update Cobalt to 0.7:
6-
* `table` methods and `ipairs` now use metamethods.
7-
* Type errors now use the `__name` metatag.
8-
* Coroutines no longer run on multiple threads.
9-
* Timeout errors should be thrown more reliably.
10-
* `speaker` program now reports an error on common unsupported audio formats.
11-
* `multishell` now hides the implementation details of its terminal redirect from programs.
12-
* Use VBO monitor renderer by default.
13-
* Improve syntax errors when missing commas in tables, and on trailing commas in parameter lists.
14-
* Turtles can now hold flags.
15-
* Update several translations (Alessandro, chesiren, Erlend, RomanPlayer22).
3+
* Optimise JSON string parsing.
4+
* Add `colors.fromBlit` (Erb3).
5+
* Upload file size limit is now configurable (khankul).
6+
* Wired cables no longer have a distance limit.
7+
* Java methods now coerce values to strings consistently with Lua.
8+
* Add custom timeout support to the HTTP API.
9+
* Support custom proxies for HTTP requests (Lemmmy).
10+
* The `speaker` program now errors when playing HTTP files.
11+
* `edit` now shows an error message when editing read-only files.
12+
* Update Ukranian translation (SirEdvin).
1613

1714
Several bug fixes:
18-
* `settings.load` now ignores malformed values created by editing the `.settings` file by hand.
19-
* Fix introduction dates on `os.cancelAlarm` and `os.cancelTimer` (MCJack123).
20-
* Fix the REPL syntax reporting crashing on valid parses.
21-
* Make writes to the ID file atomic.
22-
* Obey stack limits when transferring items with Fabric's APIs.
23-
* Ignore metatables in `textutils.serialize`.
24-
* Correctly recurse into NBT lists when computing the NBT hash (Lemmmy).
25-
* Fix advanced pocket computers rendering as greyscale.
26-
* Fix stack overflow when using `shell` as a hashbang program.
27-
* Fix websocket messages being empty when using a non-default compression settings.
28-
* Fix `gps.locate` returning `nan` when receiving a duplicate location (Wojbie).
29-
* Remove several thread safety issues inside Java-side argument parsing code.
15+
* Allow GPS hosts to only be 1 block apart.
16+
* Fix "Turn On"/"Turn Off" buttons being inverted in the computer GUI (Erb3).
17+
* Fix arrow keys not working in the printout UI.
18+
* Several documentation fixes (zyxkad, Lupus590, Commandcracker).
19+
* Fix monitor renderer debug text always being visible on Forge.
20+
* Fix crash when another mod changes the LoggerContext.
21+
* Fix the `monitor_renderer` option not being present in Fabric config files.
22+
* Pasting on MacOS/OSX now uses Cmd+V rather than Ctrl+V.
23+
* Fix turtles placing blocks upside down when at y<0.
3024

3125
Type "help changelog" to see the full version history.

Diff for: projects/fabric/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,7 @@ publishing {
254254
}
255255
}
256256
}
257+
258+
modrinth {
259+
required.project("fabric-api")
260+
}

0 commit comments

Comments
 (0)