Skip to content

Commit 618e73f

Browse files
authored
Fix carpet extension display (#140)
* Fix compat api wrong return value * Migrating initialisation parameters to constructors --------- Signed-off-by: Hendrix-Shen <[email protected]>
1 parent 09f252a commit 618e73f

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

magiclib-legacy-compat/src/main/java/top/hendrixshen/magiclib/impl/carpet/CarpetEntrypoint.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ public static void init() {
2626
.orElseThrow(RuntimeException::new)
2727
},
2828
SharedConstants.getMagiclibIdentifier(),
29-
new MagicLibSettingManager(SharedConstants.getMagiclibIdentifier(),
30-
SharedConstants.getMagiclibIdentifier(),
31-
SharedConstants.getMagiclibName()),
29+
new MagicLibSettingManager(),
3230
ReflectionUtil.newInstance("top.hendrixshen.magiclib.impl.carpet.MagicLibAddition", null)
3331
.orElseThrow(RuntimeException::new));
3432
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package top.hendrixshen.magiclib.impl.carpet;
22

3+
import top.hendrixshen.magiclib.SharedConstants;
34
import top.hendrixshen.magiclib.carpet.impl.WrappedSettingManager;
45

56
public class MagicLibSettingManager extends WrappedSettingManager {
6-
public MagicLibSettingManager(String version, String identifier, String fancyName) {
7-
super(version, identifier, fancyName);
7+
public MagicLibSettingManager() {
8+
super(SharedConstants.getMagiclibVersion(), SharedConstants.getMagiclibIdentifier(), SharedConstants.getMagiclibName());
89
}
910
}

magiclib-minecraft-api/src/main/java/top/hendrixshen/magiclib/util/minecraft/ComponentUtil.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,9 @@ public static MutableComponentCompat propertyCompat(Property<?> property, Object
305305

306306
public static @NotNull MutableComponentCompat joinCompat(
307307
MutableComponentCompat joiner, @NotNull Iterable<MutableComponentCompat> items) {
308-
MutableComponentCompat text = ComponentUtil.emptyCompat();
309-
ComponentUtil.join(text.get(), StreamSupport.stream(items.spliterator(), false)
308+
return MutableComponentCompat.of(ComponentUtil.join(joiner.get(), StreamSupport.stream(items.spliterator(), false)
310309
.map(MutableComponentCompat::get)
311-
.collect(Collectors.toList()));
312-
return text;
310+
.collect(Collectors.toList())));
313311
}
314312

315313
public static @NotNull BaseComponent join(BaseComponent joiner, BaseComponent... items) {

0 commit comments

Comments
 (0)