Merge branch 'master' of https://github.com/paulevsGitch/BetterEnd
This commit is contained in:
commit
be459bed73
11 changed files with 93 additions and 5 deletions
|
@ -0,0 +1,39 @@
|
||||||
|
package ru.betterend.mixin.common;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
|
import net.minecraft.resource.ServerResourceManager;
|
||||||
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
import ru.betterend.recipe.EndRecipeManager;
|
||||||
|
|
||||||
|
@Mixin(MinecraftServer.class)
|
||||||
|
public class MinecraftServerMixin {
|
||||||
|
@Shadow
|
||||||
|
private ServerResourceManager serverResourceManager;
|
||||||
|
|
||||||
|
@Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true)
|
||||||
|
private void onReload(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> info) {
|
||||||
|
injectRecipes();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "loadWorld", at = @At(value = "RETURN"), cancellable = true)
|
||||||
|
private void onLoadWorld(CallbackInfo info) {
|
||||||
|
injectRecipes();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void injectRecipes() {
|
||||||
|
if (FabricLoader.getInstance().isModLoaded("kubejs")) {
|
||||||
|
RecipeManagerAccessor accessor = (RecipeManagerAccessor) serverResourceManager.getRecipeManager();
|
||||||
|
accessor.setRecipes(EndRecipeManager.getMap(accessor.getRecipes()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package ru.betterend.mixin.common;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
|
|
||||||
|
import net.minecraft.recipe.Recipe;
|
||||||
|
import net.minecraft.recipe.RecipeManager;
|
||||||
|
import net.minecraft.recipe.RecipeType;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
@Mixin(RecipeManager.class)
|
||||||
|
public interface RecipeManagerAccessor {
|
||||||
|
@Accessor("recipes")
|
||||||
|
Map<RecipeType<?>, Map<Identifier, Recipe<?>>> getRecipes();
|
||||||
|
|
||||||
|
@Accessor("recipes")
|
||||||
|
void setRecipes(Map<RecipeType<?>, Map<Identifier, Recipe<?>>> recipes);
|
||||||
|
}
|
|
@ -8,9 +8,11 @@ public class SoundRegistry
|
||||||
{
|
{
|
||||||
// Music
|
// Music
|
||||||
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland");
|
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland");
|
||||||
|
public static final SoundEvent MUSIC_CHORUS_FOREST = register("music", "chorus_forest");
|
||||||
|
|
||||||
// Ambient
|
// Ambient
|
||||||
public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland");
|
public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland");
|
||||||
|
public static final SoundEvent AMBIENT_CHORUS_FOREST = register("ambient", "chorus_forest");
|
||||||
|
|
||||||
// Entity
|
// Entity
|
||||||
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");
|
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||||
import ru.betterend.registry.BlockRegistry;
|
import ru.betterend.registry.BlockRegistry;
|
||||||
import ru.betterend.registry.EntityRegistry;
|
import ru.betterend.registry.EntityRegistry;
|
||||||
import ru.betterend.registry.FeatureRegistry;
|
import ru.betterend.registry.FeatureRegistry;
|
||||||
|
import ru.betterend.registry.SoundRegistry;
|
||||||
|
|
||||||
public class BiomeChorusForest extends EndBiome {
|
public class BiomeChorusForest extends EndBiome {
|
||||||
public BiomeChorusForest() {
|
public BiomeChorusForest() {
|
||||||
|
@ -14,9 +15,9 @@ public class BiomeChorusForest extends EndBiome {
|
||||||
.setFogColor(87, 26, 87)
|
.setFogColor(87, 26, 87)
|
||||||
.setFogDensity(1.5F)
|
.setFogDensity(1.5F)
|
||||||
.setSurface(BlockRegistry.CHORUS_NYLIUM)
|
.setSurface(BlockRegistry.CHORUS_NYLIUM)
|
||||||
.setParticles(ParticleTypes.PORTAL, 0.001F)
|
.setParticles(ParticleTypes.PORTAL, 0.01F)
|
||||||
//.setLoop(SoundRegistry.AMBIENT_FOGGY_MUSHROOMLAND)
|
.setLoop(SoundRegistry.AMBIENT_CHORUS_FOREST)
|
||||||
//.setMusic(SoundRegistry.MUSIC_FOGGY_MUSHROOMLAND)
|
.setMusic(SoundRegistry.MUSIC_CHORUS_FOREST)
|
||||||
.addFeature(FeatureRegistry.ENDER_ORE)
|
.addFeature(FeatureRegistry.ENDER_ORE)
|
||||||
.addFeature(FeatureRegistry.RARE_END_LAKE)
|
.addFeature(FeatureRegistry.RARE_END_LAKE)
|
||||||
.addFeature(FeatureRegistry.PYTHADENDRON_TREE)
|
.addFeature(FeatureRegistry.PYTHADENDRON_TREE)
|
||||||
|
|
|
@ -3,12 +3,27 @@
|
||||||
"category": "music",
|
"category": "music",
|
||||||
"sounds": [
|
"sounds": [
|
||||||
{
|
{
|
||||||
"name": "betterend:music/dan_henig_eternal_garden",
|
"name": "betterend:music/dan_henig-eternal_garden",
|
||||||
"volume": 0.1,
|
"volume": 0.1,
|
||||||
"stream": false
|
"stream": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "betterend:music/dan_henig_nebular_focus",
|
"name": "betterend:music/dan_henig-nebular_focus",
|
||||||
|
"volume": 0.1,
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"betterend.music.chorus_forest": {
|
||||||
|
"category": "music",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "betterend:music/emmit_fenn-creep",
|
||||||
|
"volume": 0.1,
|
||||||
|
"stream": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "betterend:music/jesse_gallagher-the_anunnaki_return",
|
||||||
"volume": 0.1,
|
"volume": 0.1,
|
||||||
"stream": false
|
"stream": false
|
||||||
}
|
}
|
||||||
|
@ -24,6 +39,15 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"betterend.ambient.chorus_forest": {
|
||||||
|
"category": "ambient",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "betterend:ambient/chorus_forest",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"betterend.entity.dragonfly": {
|
"betterend.entity.dragonfly": {
|
||||||
"category": "entity",
|
"category": "entity",
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -12,6 +12,8 @@
|
||||||
"ChorusPlantFeatureMixin",
|
"ChorusPlantFeatureMixin",
|
||||||
"ChorusFlowerBlockMixin",
|
"ChorusFlowerBlockMixin",
|
||||||
"ChorusPlantBlockMixin",
|
"ChorusPlantBlockMixin",
|
||||||
|
"RecipeManagerAccessor",
|
||||||
|
"MinecraftServerMixin",
|
||||||
"TagGroupLoaderMixin",
|
"TagGroupLoaderMixin",
|
||||||
"EndermanEntityMixin",
|
"EndermanEntityMixin",
|
||||||
"LocateCommandMixin",
|
"LocateCommandMixin",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue