Reformated
This commit is contained in:
parent
079b51e3f6
commit
852e5a6abc
385 changed files with 6924 additions and 5656 deletions
|
@ -1,5 +1,9 @@
|
|||
package org.betterx.bclib.integration;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v2.tag.TagAPI;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
|
@ -17,10 +21,6 @@ import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
|||
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v2.tag.TagAPI;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
@ -69,11 +69,13 @@ public abstract class ModIntegration {
|
|||
Feature<?> feature = Registry.FEATURE.get(id);
|
||||
Holder<PlacedFeature> featurePlaced = BuiltinRegistries.PLACED_FEATURE.getHolder(getFeatureKey(placedFeatureID))
|
||||
.orElse(null);
|
||||
return new BCLFeature(id,
|
||||
return new BCLFeature(
|
||||
id,
|
||||
feature,
|
||||
featureStep,
|
||||
featurePlaced.value().getFeatures().map(f -> f.config()).findFirst().orElse(null),
|
||||
featurePlaced);
|
||||
featurePlaced
|
||||
);
|
||||
}
|
||||
|
||||
public BCLFeature getFeature(String name, GenerationStep.Decoration featureStep) {
|
||||
|
@ -171,10 +173,12 @@ public abstract class ModIntegration {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Object> T getAndExecuteRuntime(Class<?> cl,
|
||||
Object instance,
|
||||
String functionName,
|
||||
Object... args) {
|
||||
public <T extends Object> T getAndExecuteRuntime(
|
||||
Class<?> cl,
|
||||
Object instance,
|
||||
String functionName,
|
||||
Object... args
|
||||
) {
|
||||
if (instance != null) {
|
||||
Class<?>[] classes = new Class<?>[args.length];
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package org.betterx.bclib.integration.modmenu;
|
||||
|
||||
import org.betterx.bclib.client.gui.modmenu.MainScreen;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import org.betterx.bclib.client.gui.modmenu.MainScreen;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package org.betterx.bclib.integration.modmenu;
|
||||
|
||||
import org.betterx.bclib.integration.modmenu.ModMenuIntegration.ModMenuScreenFactory;
|
||||
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import org.betterx.bclib.integration.modmenu.ModMenuIntegration.ModMenuScreenFactory;
|
||||
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -38,7 +39,8 @@ class ModMenuScreenFactoryImpl {
|
|||
Object o = Proxy.newProxyInstance(
|
||||
ModMenuIntegration.class.getClassLoader(),
|
||||
new Class[]{iConfigScreenFactory, ModMenuScreenFactory.class},
|
||||
new ScreenFactoryInvocationHandler(act));
|
||||
new ScreenFactoryInvocationHandler(act)
|
||||
);
|
||||
|
||||
return (ModMenuScreenFactory) o;
|
||||
}
|
||||
|
@ -90,7 +92,8 @@ public abstract class ModMenuIntegration {
|
|||
Object o = Proxy.newProxyInstance(
|
||||
ModMenuIntegration.class.getClassLoader(),
|
||||
new Class[]{iModMenuAPI},
|
||||
new BCLibModMenuInvocationHandler(target));
|
||||
new BCLibModMenuInvocationHandler(target)
|
||||
);
|
||||
|
||||
return (ModMenuApi) o;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue