mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-25 14:34:45 +00:00
refactor: port MultipartHelper to Java
MultipartHelper, MultipartHelper$ and MultipartHelper$IPartTileConverter are all public-member- and descriptor-identical to the reference, and the full emitted class list is unchanged -- this port neither adds nor removes a class. MultipartHelper gains a private constructor and its companion's class initializer loses ACC_PUBLIC, neither of which is nameable by a caller. MultipartHelper$ was kept deliberately. It is not among the 17 MODULE$ singletons read from bytecode and no jar links against it, but guidenh names it as a reflective string, and removing a companion breaks that invisibly. createTileFromParts now builds one JavaConversions wrapper for both calls instead of one per call site, and convertMulti returns Collections.emptyList or singletonList instead of a Scala Seq wrapper. The declared type was always java.lang.Iterable. 107 plain-JVM tests and 10 Forge server tests pass unchanged.
This commit is contained in:
1 parent
0fdf9e5e75
commit
c3d5b08ff7
6 files changed
+230
-118
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package codechicken.multipart;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Scala companion singleton, kept because guidenh reflects on this name as well as on MultipartHelper. Pure forwarders.
|
||||
*/
|
||||
public final class MultipartHelper$ {
|
||||
|
||||
public static final MultipartHelper$ MODULE$ = new MultipartHelper$();
|
||||
|
||||
private MultipartHelper$() {}
|
||||
|
||||
public TileEntity createTileFromNBT(World world, NBTTagCompound tag) {
|
||||
return MultipartHelper.createTileFromNBT(world, tag);
|
||||
}
|
||||
|
||||
public void sendDescPacket(World world, TileEntity tile) {
|
||||
MultipartHelper.sendDescPacket(world, tile);
|
||||
}
|
||||
|
||||
public void registerTileConverter(MultipartHelper.IPartTileConverter<?> converter) {
|
||||
MultipartHelper.registerTileConverter(converter);
|
||||
}
|
||||
|
||||
public TileMultipart createTileFromParts(Iterable<TMultiPart> parts) {
|
||||
return MultipartHelper.createTileFromParts(parts);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user