mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-15 21:31:05 +00:00
fix server issues
This commit is contained in:
@@ -37,10 +37,12 @@ configure<LoomGradleExtension> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<RemapJarTask>("remapShadedJar") {
|
tasks.register<RemapJarTask>("remapShadedJar") {
|
||||||
dependsOn("shadowJar")
|
val shadowJar = tasks.getByName<ShadowJar>("shadowJar")
|
||||||
setProperty("input", file("build/libs/Terra-fabric-${version}-shaded.jar"))
|
dependsOn(shadowJar)
|
||||||
setProperty("addNestedDependencies", false)
|
input.set(shadowJar.archiveFile)
|
||||||
setProperty("remapAccessWidener", true)
|
archiveFileName.set(shadowJar.archiveFileName.get().replace(Regex("-shaded\\.jar$"), "shaded-mapped.jar"))
|
||||||
|
addNestedDependencies.set(true)
|
||||||
|
remapAccessWidener.set(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import com.dfsek.terra.config.lang.LangUtil;
|
|||||||
import com.dfsek.terra.config.lang.Language;
|
import com.dfsek.terra.config.lang.Language;
|
||||||
import com.dfsek.terra.config.pack.ConfigPack;
|
import com.dfsek.terra.config.pack.ConfigPack;
|
||||||
import com.dfsek.terra.fabric.inventory.FabricItemHandle;
|
import com.dfsek.terra.fabric.inventory.FabricItemHandle;
|
||||||
|
import com.dfsek.terra.fabric.mixin.BiomeEffectsAccessor;
|
||||||
|
import com.dfsek.terra.fabric.mixin.GeneratorTypeAccessor;
|
||||||
import com.dfsek.terra.fabric.world.FabricBiome;
|
import com.dfsek.terra.fabric.world.FabricBiome;
|
||||||
import com.dfsek.terra.fabric.world.FabricTree;
|
import com.dfsek.terra.fabric.world.FabricTree;
|
||||||
import com.dfsek.terra.fabric.world.FabricWorldHandle;
|
import com.dfsek.terra.fabric.world.FabricWorldHandle;
|
||||||
@@ -234,17 +236,19 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
generationSettings.surfaceBuilder(SurfaceBuilder.DEFAULT.withConfig(new TernarySurfaceConfig(Blocks.GRASS_BLOCK.getDefaultState(), Blocks.DIRT.getDefaultState(), Blocks.GRAVEL.getDefaultState()))); // It needs a surfacebuilder, even though we dont use it.
|
generationSettings.surfaceBuilder(SurfaceBuilder.DEFAULT.withConfig(new TernarySurfaceConfig(Blocks.GRASS_BLOCK.getDefaultState(), Blocks.DIRT.getDefaultState(), Blocks.GRAVEL.getDefaultState()))); // It needs a surfacebuilder, even though we dont use it.
|
||||||
generationSettings.feature(GenerationStep.Feature.VEGETAL_DECORATION, POPULATOR_CONFIGURED_FEATURE);
|
generationSettings.feature(GenerationStep.Feature.VEGETAL_DECORATION, POPULATOR_CONFIGURED_FEATURE);
|
||||||
|
|
||||||
|
BiomeEffectsAccessor biomeEffectsAccessor = (BiomeEffectsAccessor) vanilla.getEffects();
|
||||||
|
|
||||||
BiomeEffects.Builder effects = new BiomeEffects.Builder()
|
BiomeEffects.Builder effects = new BiomeEffects.Builder()
|
||||||
.waterColor(vanilla.getWaterColor())
|
.waterColor(biomeEffectsAccessor.getWaterColor())
|
||||||
.waterFogColor(vanilla.getWaterFogColor())
|
.waterFogColor(biomeEffectsAccessor.getWaterFogColor())
|
||||||
.fogColor(vanilla.getFogColor())
|
.fogColor(biomeEffectsAccessor.getFogColor())
|
||||||
.skyColor(vanilla.getSkyColor())
|
.skyColor(biomeEffectsAccessor.getSkyColor())
|
||||||
.grassColorModifier(vanilla.getEffects().getGrassColorModifier());
|
.grassColorModifier(biomeEffectsAccessor.getGrassColorModifier());
|
||||||
if(vanilla.getEffects().getGrassColor().isPresent()) {
|
if(biomeEffectsAccessor.getGrassColor().isPresent()) {
|
||||||
effects.grassColor(vanilla.getEffects().getGrassColor().get());
|
effects.grassColor(biomeEffectsAccessor.getGrassColor().get());
|
||||||
}
|
}
|
||||||
if(vanilla.getEffects().getFoliageColor().isPresent()) {
|
if(biomeEffectsAccessor.getFoliageColor().isPresent()) {
|
||||||
effects.foliageColor(vanilla.getEffects().getFoliageColor().get());
|
effects.foliageColor(biomeEffectsAccessor.getFoliageColor().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
return (new Biome.Builder())
|
return (new Biome.Builder())
|
||||||
@@ -296,8 +300,8 @@ public class TerraFabricPlugin implements TerraPlugin, ModInitializer {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
generatorType.translationKey = (new LiteralText("Terra:" + pack.getTemplate().getID()));
|
((GeneratorTypeAccessor) generatorType).setTranslationKey(new LiteralText("Terra:" + pack.getTemplate().getID()));
|
||||||
GeneratorType.VALUES.add(generatorType);
|
GeneratorTypeAccessor.getVALUES().add(generatorType);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.dfsek.terra.fabric.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.world.biome.BiomeEffects;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Mixin(BiomeEffects.class)
|
||||||
|
public interface BiomeEffectsAccessor {
|
||||||
|
@Accessor
|
||||||
|
int getFogColor();
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
int getWaterColor();
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
int getWaterFogColor();
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
int getSkyColor();
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
Optional<Integer> getFoliageColor();
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
Optional<Integer> getGrassColor();
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
BiomeEffects.GrassColorModifier getGrassColorModifier();
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
package com.dfsek.terra.fabric.mixin;
|
||||||
|
|
||||||
|
import net.minecraft.client.world.GeneratorType;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Mutable;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mixin(GeneratorType.class)
|
||||||
|
public interface GeneratorTypeAccessor {
|
||||||
|
@Accessor
|
||||||
|
static List<GeneratorType> getVALUES() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Accessor
|
||||||
|
Text getTranslationKey();
|
||||||
|
|
||||||
|
@Mutable
|
||||||
|
@Accessor
|
||||||
|
void setTranslationKey(Text translationKey);
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
|
"terra.mixins.json"
|
||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.7.4",
|
"fabricloader": ">=0.7.4",
|
||||||
|
|||||||
@@ -2,16 +2,8 @@ accessWidener v1 named
|
|||||||
|
|
||||||
extendable method net/minecraft/client/world/GeneratorType <init> (Ljava/lang/String;)V
|
extendable method net/minecraft/client/world/GeneratorType <init> (Ljava/lang/String;)V
|
||||||
|
|
||||||
accessible field net/minecraft/client/world/GeneratorType translationKey Lnet/minecraft/text/Text;
|
|
||||||
mutable field net/minecraft/client/world/GeneratorType translationKey Lnet/minecraft/text/Text;
|
|
||||||
|
|
||||||
accessible field net/minecraft/client/world/GeneratorType VALUES Ljava/util/List;
|
|
||||||
|
|
||||||
accessible field net/minecraft/server/world/ServerWorld worldProperties Lnet/minecraft/world/level/ServerWorldProperties;
|
accessible field net/minecraft/server/world/ServerWorld worldProperties Lnet/minecraft/world/level/ServerWorldProperties;
|
||||||
|
|
||||||
accessible method net/minecraft/world/MobSpawnerLogic getEntityId ()Lnet/minecraft/util/Identifier;
|
accessible method net/minecraft/world/MobSpawnerLogic getEntityId ()Lnet/minecraft/util/Identifier;
|
||||||
|
|
||||||
accessible field net/minecraft/state/State PROPERTY_MAP_PRINTER Ljava/util/function/Function;
|
accessible field net/minecraft/state/State PROPERTY_MAP_PRINTER Ljava/util/function/Function;
|
||||||
|
|
||||||
accessible method net/minecraft/block/entity/LootableContainerBlockEntity setInvStackList (Lnet/minecraft/util/collection/DefaultedList;)V
|
|
||||||
accessible method net/minecraft/block/entity/LootableContainerBlockEntity getInvStackList ()Lnet/minecraft/util/collection/DefaultedList;
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"required": true,
|
||||||
|
"minVersion": "0.8",
|
||||||
|
"package": "com.dfsek.terra.fabric.mixin",
|
||||||
|
"compatibilityLevel": "JAVA_8",
|
||||||
|
"mixins": [
|
||||||
|
"BiomeEffectsAccessor"
|
||||||
|
],
|
||||||
|
"client": [
|
||||||
|
"GeneratorTypeAccessor"
|
||||||
|
],
|
||||||
|
"server": [],
|
||||||
|
"injectors": {
|
||||||
|
"defaultRequire": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user