Code style changes, entities fixes
This commit is contained in:
parent
9d604b2d25
commit
44962e18b6
377 changed files with 5038 additions and 4914 deletions
|
@ -1,10 +1,6 @@
|
|||
package ru.betterend.integration;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import ru.bclib.integration.ModIntegration;
|
||||
import ru.bclib.util.ColorUtil;
|
||||
|
@ -12,6 +8,9 @@ import ru.betterend.blocks.HydraluxPetalColoredBlock;
|
|||
import ru.betterend.blocks.complex.ColoredMaterial;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Map;
|
||||
|
||||
public class FlamboyantRefabricatedIntegration extends ModIntegration {
|
||||
public FlamboyantRefabricatedIntegration() {
|
||||
super("flamboyant");
|
||||
|
@ -21,7 +20,7 @@ public class FlamboyantRefabricatedIntegration extends ModIntegration {
|
|||
public void init() {
|
||||
Map<Integer, String> colors = Maps.newHashMap();
|
||||
Map<Integer, ItemLike> dyes = Maps.newHashMap();
|
||||
|
||||
|
||||
addColor("fead1d", "amber", colors, dyes);
|
||||
addColor("bd9a5f", "beige", colors, dyes);
|
||||
addColor("edeada", "cream", colors, dyes);
|
||||
|
@ -38,15 +37,15 @@ public class FlamboyantRefabricatedIntegration extends ModIntegration {
|
|||
addColor("6bb1cf", "sky_blue", colors, dyes);
|
||||
addColor("6e8c9c", "slate_gray", colors, dyes);
|
||||
addColor("b02454", "violet", colors, dyes);
|
||||
|
||||
|
||||
new ColoredMaterial(HydraluxPetalColoredBlock::new, EndBlocks.HYDRALUX_PETAL_BLOCK, colors, dyes, true);
|
||||
}
|
||||
|
||||
|
||||
private void addColor(String hex, String name, Map<Integer, String> colors, Map<Integer, ItemLike> dyes) {
|
||||
int color = ColorUtil.color(hex);
|
||||
colors.put(color, name);
|
||||
dyes.put(color, getItem(name + "_dye"));
|
||||
|
||||
|
||||
System.out.println(name + " " + color + " " + new Color(color));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,35 +18,35 @@ public class Integrations {
|
|||
public static final ModIntegration BYG = ModIntegrationAPI.register(new BYGIntegration());
|
||||
public static final ModIntegration NOURISH = ModIntegrationAPI.register(new NourishIntegration());
|
||||
public static final ModIntegration FLAMBOYANT_REFABRICATED = ModIntegrationAPI.register(new FlamboyantRefabricatedIntegration());
|
||||
|
||||
|
||||
private static boolean hasHydrogen;
|
||||
|
||||
|
||||
public static void init() {
|
||||
if (hasGuideBook()) {
|
||||
GuideBookItem.register();
|
||||
|
||||
|
||||
PlayerAdvancementsCallback.PLAYER_ADVANCEMENT_COMPLETE.register((player, advancement, criterionName) -> {
|
||||
ResourceLocation advId = new ResourceLocation("minecraft:end/enter_end_gateway");
|
||||
if (advId.equals(advancement.getId())) {
|
||||
player.addItem(new ItemStack(GuideBookItem.GUIDE_BOOK));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
GridRecipe.make(BetterEnd.MOD_ID, "guide_book", GuideBookItem.GUIDE_BOOK)
|
||||
.checkConfig(Configs.RECIPE_CONFIG)
|
||||
.setShape("D", "B", "C")
|
||||
.addMaterial('D', EndItems.ENDER_DUST)
|
||||
.addMaterial('B', Items.BOOK)
|
||||
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
|
||||
.build();
|
||||
.checkConfig(Configs.RECIPE_CONFIG)
|
||||
.setShape("D", "B", "C")
|
||||
.addMaterial('D', EndItems.ENDER_DUST)
|
||||
.addMaterial('B', Items.BOOK)
|
||||
.addMaterial('C', EndItems.CRYSTAL_SHARDS)
|
||||
.build();
|
||||
}
|
||||
hasHydrogen = FabricLoader.getInstance().isModLoaded("hydrogen");
|
||||
}
|
||||
|
||||
|
||||
public static boolean hasGuideBook() {
|
||||
return FabricLoader.getInstance().isModLoaded("patchouli");
|
||||
}
|
||||
|
||||
|
||||
public static boolean hasHydrogen() {
|
||||
return hasHydrogen;
|
||||
}
|
||||
|
|
|
@ -17,39 +17,39 @@ public class NourishIntegration extends ModIntegration {
|
|||
Tag.Named<Item> fruit = getItemTag("fruit");
|
||||
Tag.Named<Item> protein = getItemTag("protein");
|
||||
Tag.Named<Item> sweets = getItemTag("sweets");
|
||||
|
||||
|
||||
TagHelper.addTag(
|
||||
fats,
|
||||
EndItems.END_FISH_RAW,
|
||||
EndItems.END_FISH_COOKED
|
||||
fats,
|
||||
EndItems.END_FISH_RAW,
|
||||
EndItems.END_FISH_COOKED
|
||||
);
|
||||
TagHelper.addTag(
|
||||
fruit,
|
||||
EndItems.SHADOW_BERRY_RAW,
|
||||
EndItems.SHADOW_BERRY_COOKED,
|
||||
EndItems.BLOSSOM_BERRY,
|
||||
EndItems.SHADOW_BERRY_JELLY,
|
||||
EndItems.SWEET_BERRY_JELLY,
|
||||
EndItems.BLOSSOM_BERRY_JELLY,
|
||||
EndItems.AMBER_ROOT_RAW,
|
||||
EndItems.CHORUS_MUSHROOM_RAW,
|
||||
EndItems.CHORUS_MUSHROOM_COOKED,
|
||||
EndItems.BOLUX_MUSHROOM_COOKED
|
||||
fruit,
|
||||
EndItems.SHADOW_BERRY_RAW,
|
||||
EndItems.SHADOW_BERRY_COOKED,
|
||||
EndItems.BLOSSOM_BERRY,
|
||||
EndItems.SHADOW_BERRY_JELLY,
|
||||
EndItems.SWEET_BERRY_JELLY,
|
||||
EndItems.BLOSSOM_BERRY_JELLY,
|
||||
EndItems.AMBER_ROOT_RAW,
|
||||
EndItems.CHORUS_MUSHROOM_RAW,
|
||||
EndItems.CHORUS_MUSHROOM_COOKED,
|
||||
EndItems.BOLUX_MUSHROOM_COOKED
|
||||
);
|
||||
TagHelper.addTag(
|
||||
protein,
|
||||
EndItems.END_FISH_RAW,
|
||||
EndItems.END_FISH_COOKED,
|
||||
EndItems.CHORUS_MUSHROOM_COOKED,
|
||||
EndItems.BOLUX_MUSHROOM_COOKED,
|
||||
EndItems.CAVE_PUMPKIN_PIE
|
||||
protein,
|
||||
EndItems.END_FISH_RAW,
|
||||
EndItems.END_FISH_COOKED,
|
||||
EndItems.CHORUS_MUSHROOM_COOKED,
|
||||
EndItems.BOLUX_MUSHROOM_COOKED,
|
||||
EndItems.CAVE_PUMPKIN_PIE
|
||||
);
|
||||
TagHelper.addTag(
|
||||
sweets,
|
||||
EndItems.SHADOW_BERRY_JELLY,
|
||||
EndItems.SWEET_BERRY_JELLY,
|
||||
EndItems.BLOSSOM_BERRY_JELLY,
|
||||
EndItems.CAVE_PUMPKIN_PIE
|
||||
sweets,
|
||||
EndItems.SHADOW_BERRY_JELLY,
|
||||
EndItems.SWEET_BERRY_JELLY,
|
||||
EndItems.BLOSSOM_BERRY_JELLY,
|
||||
EndItems.CAVE_PUMPKIN_PIE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,9 @@ import ru.betterend.registry.EndBlocks;
|
|||
public class BYGBlocks {
|
||||
public static final Block IVIS_MOSS = EndBlocks.registerBlock("ivis_moss", new EndWallPlantBlock());
|
||||
public static final Block NIGHTSHADE_MOSS = EndBlocks.registerBlock("nightshade_moss", new EndWallPlantBlock());
|
||||
|
||||
|
||||
public static final Block IVIS_VINE = EndBlocks.registerBlock("ivis_vine", new BaseVineBlock());
|
||||
|
||||
public static void register() {}
|
||||
|
||||
public static void register() {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package ru.betterend.integration.byg;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.ai.behavior.ShufflingList;
|
||||
|
@ -19,6 +16,9 @@ import ru.betterend.integration.byg.biomes.BYGBiomes;
|
|||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class BYGIntegration extends ModIntegration implements EndBiomeIntegration {
|
||||
public BYGIntegration() {
|
||||
super("byg");
|
||||
|
@ -38,10 +38,10 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio
|
|||
@Override
|
||||
public void addBiomes() {
|
||||
BYGBiomes.addBiomes();
|
||||
|
||||
|
||||
Class<?> biomeClass = this.getClass("corgiaoc.byg.common.world.biome.BYGEndBiome");
|
||||
List<Object> biomes = this.getStaticFieldValue(biomeClass, "BYG_END_BIOMES");
|
||||
|
||||
|
||||
if (biomes != null && biomeClass != null) {
|
||||
biomes.forEach((obj) -> {
|
||||
Biome biome = this.getAndExecuteRuntime(biomeClass, obj, "getBiome");
|
||||
|
|
|
@ -9,11 +9,11 @@ public class BYGBiomes {
|
|||
public static final EndBiome OLD_BULBIS_GARDENS = EndBiomes.registerSubBiomeIntegration(new OldBulbisGardens());
|
||||
public static final EndBiome NIGHTSHADE_REDWOODS = EndBiomes.registerSubBiomeIntegration(new NightshadeRedwoods());
|
||||
//public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
|
||||
|
||||
|
||||
public static void register() {
|
||||
System.out.println("Registered " + OLD_BULBIS_GARDENS);
|
||||
}
|
||||
|
||||
|
||||
public static void addBiomes() {
|
||||
EndBiomes.addSubBiomeIntegration(OLD_BULBIS_GARDENS, Integrations.BYG.getID("bulbis_gardens"));
|
||||
EndBiomes.addSubBiomeIntegration(NIGHTSHADE_REDWOODS, Integrations.BYG.getID("nightshade_forest"));
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package ru.betterend.integration.byg.biomes;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.entity.MobCategory;
|
||||
|
@ -17,15 +15,17 @@ import ru.betterend.integration.byg.features.BYGFeatures;
|
|||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NightshadeRedwoods extends EndBiome {
|
||||
public NightshadeRedwoods() {
|
||||
super(makeDef());
|
||||
}
|
||||
|
||||
|
||||
private static BCLBiomeDef makeDef() {
|
||||
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
|
||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||
|
||||
|
||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods"))
|
||||
.setFogColor(140, 108, 47)
|
||||
.setFogDensity(1.5F)
|
||||
|
@ -39,7 +39,7 @@ public class NightshadeRedwoods extends EndBiome {
|
|||
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
|
||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
|
||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS);
|
||||
|
||||
|
||||
if (BCLib.isClient()) {
|
||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
||||
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
|
||||
|
@ -52,14 +52,14 @@ public class NightshadeRedwoods extends EndBiome {
|
|||
def.addFeature(Decoration.VEGETAL_DECORATION, feature.get());
|
||||
});
|
||||
});
|
||||
|
||||
for (MobCategory group: MobCategory.values()) {
|
||||
|
||||
for (MobCategory group : MobCategory.values()) {
|
||||
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
|
||||
list.forEach((entry) -> {
|
||||
def.addMobSpawn(entry);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package ru.betterend.integration.byg.biomes;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
|
@ -16,7 +13,6 @@ import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.placement.ConfiguredDecorator;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
||||
|
@ -26,7 +22,10 @@ import ru.betterend.integration.byg.features.BYGFeatures;
|
|||
import ru.betterend.registry.EndFeatures;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
class FeaturesAccesor extends Features{
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class FeaturesAccesor extends Features {
|
||||
static ConfiguredDecorator<?> shadowHEIGHTMAP_SQUARE;
|
||||
|
||||
static {
|
||||
|
@ -38,11 +37,11 @@ public class OldBulbisGardens extends EndBiome {
|
|||
public OldBulbisGardens() {
|
||||
super(makeDef());
|
||||
}
|
||||
|
||||
|
||||
private static BCLBiomeDef makeDef() {
|
||||
Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
|
||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||
|
||||
|
||||
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
||||
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens"))
|
||||
|
@ -54,7 +53,7 @@ public class OldBulbisGardens extends EndBiome {
|
|||
.setSurface(ivis, origin)
|
||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
||||
.addFeature(BYGFeatures.OLD_BULBIS_TREE);
|
||||
|
||||
|
||||
if (BCLib.isClient()) {
|
||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
||||
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
|
||||
|
@ -62,14 +61,14 @@ public class OldBulbisGardens extends EndBiome {
|
|||
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent();
|
||||
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood);
|
||||
}
|
||||
|
||||
for (MobCategory group: MobCategory.values()) {
|
||||
|
||||
for (MobCategory group : MobCategory.values()) {
|
||||
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
|
||||
list.forEach((entry) -> {
|
||||
def.addMobSpawn(entry);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> features = biome.getGenerationSettings().features();
|
||||
List<Supplier<ConfiguredFeature<?, ?>>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
|
||||
if (vegetal.size() > 2) {
|
||||
|
@ -90,13 +89,13 @@ public class OldBulbisGardens extends EndBiome {
|
|||
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def.addFeature(EndFeatures.PURPLE_POLYPORE)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS)
|
||||
.addFeature(BYGFeatures.IVIS_VINE)
|
||||
.addFeature(BYGFeatures.IVIS_SPROUT);
|
||||
|
||||
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
|
||||
.addFeature(BYGFeatures.IVIS_MOSS)
|
||||
.addFeature(BYGFeatures.IVIS_VINE)
|
||||
.addFeature(BYGFeatures.IVIS_SPROUT);
|
||||
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,13 @@ public class BYGFeatures {
|
|||
public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation("ivis_moss_wood", new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), 15);
|
||||
public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation("nightshade_moss", new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 2);
|
||||
public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation("nightshade_moss_wood", new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 8);
|
||||
|
||||
|
||||
public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation("nightshade_redwood_tree", new NightshadeRedwoodTreeFeature(), 1);
|
||||
public static final BCLFeature BIG_ETHER_TREE = redisterVegetation("big_ether_tree", new BigEtherTreeFeature(), 1);
|
||||
|
||||
public static void register() {}
|
||||
|
||||
|
||||
public static void register() {
|
||||
}
|
||||
|
||||
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
|
||||
return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
package ru.betterend.integration.byg.features;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.mojang.math.Vector3f;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
@ -20,6 +15,9 @@ import ru.bclib.util.SplineHelper;
|
|||
import ru.bclib.world.features.DefaultFeature;
|
||||
import ru.betterend.integration.Integrations;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BigEtherTreeFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package ru.betterend.integration.byg.features;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.math.Vector3f;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
|
@ -14,7 +10,6 @@ import net.minecraft.world.level.WorldGenLevel;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
@ -32,6 +27,9 @@ import ru.bclib.util.SplineHelper;
|
|||
import ru.bclib.world.features.DefaultFeature;
|
||||
import ru.betterend.integration.Integrations;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
||||
private static final List<Vector3f> BRANCH;
|
||||
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
package ru.betterend.integration.byg.features;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.math.Vector3f;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
|
@ -30,6 +24,10 @@ import ru.bclib.world.features.DefaultFeature;
|
|||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class OldBulbisTreeFeature extends DefaultFeature {
|
||||
private static final List<Vector3f> SPLINE;
|
||||
private static final List<Vector3f> ROOT;
|
||||
|
@ -104,7 +102,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow,
|
||||
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
||||
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
||||
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
|
||||
|
||||
|
@ -152,7 +150,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
}
|
||||
|
||||
private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood,
|
||||
Function<BlockState, Boolean> replacement) {
|
||||
Function<BlockState, Boolean> replacement) {
|
||||
int count = (int) (radius * 1.5F);
|
||||
for (int i = 0; i < count; i++) {
|
||||
float angle = (float) i / (float) count * MHelper.PI2;
|
||||
|
|
|
@ -11,11 +11,9 @@ import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
|
|||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.item.Items;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
|
@ -24,7 +22,8 @@ import java.util.List;
|
|||
|
||||
public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingDisplay> {
|
||||
private final EntryStack ICON;
|
||||
REIAlloyingCategory(EntryStack icon){
|
||||
|
||||
REIAlloyingCategory(EntryStack icon) {
|
||||
ICON = icon;
|
||||
}
|
||||
|
||||
|
@ -37,12 +36,12 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
|||
public @NotNull Component getTitle() {
|
||||
return new TranslatableComponent(EndBlocks.END_STONE_SMELTER.getDescriptionId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull EntryStack getIcon() {
|
||||
return ICON;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull List<Widget> setupDisplay(REIAlloyingDisplay display, Rectangle bounds) {
|
||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
|
||||
|
@ -59,7 +58,8 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
|||
widgets.add(Widgets.createSlot(new Point(startPoint.x - 20, startPoint.y + 1)).entries(inputEntries.get(0)).markInput());
|
||||
if (inputEntries.size() > 1) {
|
||||
widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(inputEntries.get(1)).markInput());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
widgets.add(Widgets.createSlot(new Point(startPoint.x + 1, startPoint.y + 1)).entries(Lists.newArrayList()).markInput());
|
||||
}
|
||||
widgets.add(Widgets.createSlot(new Point(startPoint.x + 61, startPoint.y + 9)).entries(display.getOutputEntries().get(0)).disableBackground().markOutput());
|
||||
|
@ -68,7 +68,7 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
|||
|
||||
@Override
|
||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAlloyingDisplay display,
|
||||
IntList redSlots) {
|
||||
IntList redSlots) {
|
||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
||||
matrices.pushPose();
|
||||
matrices.translate(0, 0, 400);
|
||||
|
@ -78,7 +78,7 @@ public class REIAlloyingCategory implements TransferDisplayCategory<REIAlloyingD
|
|||
}
|
||||
matrices.popPose();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDisplayHeight() {
|
||||
return 49;
|
||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraft.ChatFormatting;
|
|||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.crafting.BlastingRecipe;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
|
||||
|
@ -24,16 +23,16 @@ import java.util.stream.Collectors;
|
|||
public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDisplay {
|
||||
|
||||
private static List<EntryStack> fuel;
|
||||
|
||||
|
||||
private Recipe<?> recipe;
|
||||
private float xp;
|
||||
private double smeltTime;
|
||||
|
||||
|
||||
|
||||
public REIAlloyingDisplay(AlloyingRecipe recipe) {
|
||||
this(recipe, recipe.getExperience(), recipe.getSmeltTime());
|
||||
}
|
||||
|
||||
protected REIAlloyingDisplay(Recipe<?> recipe, float xp, double smeltTime) {
|
||||
super(
|
||||
EntryIngredients.ofIngredients(recipe.getIngredients()),
|
||||
|
@ -48,7 +47,7 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi
|
|||
public static List<EntryStack> getFuel() {
|
||||
return fuel;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<ResourceLocation> getDisplayLocation() {
|
||||
return Optional.ofNullable(recipe).map(Recipe::getId);
|
||||
|
@ -58,20 +57,20 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi
|
|||
public CategoryIdentifier<?> getCategoryIdentifier() {
|
||||
return REIPlugin.ALLOYING;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public @NotNull List<List<EntryStack>> getRequiredEntries() {
|
||||
// return this.input;
|
||||
// }
|
||||
|
||||
|
||||
public float getXp() {
|
||||
return this.xp;
|
||||
}
|
||||
|
||||
|
||||
public double getSmeltTime() {
|
||||
return this.smeltTime;
|
||||
}
|
||||
|
||||
|
||||
public Optional<Recipe<?>> getOptionalRecipe() {
|
||||
return Optional.ofNullable(recipe);
|
||||
}
|
||||
|
@ -90,7 +89,7 @@ public class REIAlloyingDisplay extends BasicDisplay implements SimpleGridMenuDi
|
|||
// public List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<AbstractContainerMenu> containerInfo, AbstractContainerMenu container) {
|
||||
// return this.input;
|
||||
// }
|
||||
|
||||
|
||||
static {
|
||||
fuel = EndStoneSmelterBlockEntity.availableFuels().keySet().stream()
|
||||
.map(Item::getDefaultInstance).map(EntryStacks::of)
|
||||
|
|
|
@ -11,13 +11,11 @@ import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
|
|||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import net.minecraft.client.gui.GuiComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -30,7 +28,7 @@ import java.util.stream.Collectors;
|
|||
public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay> {
|
||||
private final EntryStack[] ANVILS;
|
||||
|
||||
REIAnvilCategory(EntryStack[] anvils){
|
||||
REIAnvilCategory(EntryStack[] anvils) {
|
||||
ANVILS = anvils;
|
||||
}
|
||||
|
||||
|
@ -49,7 +47,7 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
|||
return ANVILS[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull List<Widget> setupDisplay(REIAnvilDisplay display, Rectangle bounds) {
|
||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.y + 10);
|
||||
|
@ -63,7 +61,7 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
|||
int anvilLevel = display.getAnvilLevel();
|
||||
List anvils = Arrays.stream(ANVILS).filter(anvil -> {
|
||||
Object value = anvil.getValue();
|
||||
if (value instanceof ItemStack){
|
||||
if (value instanceof ItemStack) {
|
||||
value = ((ItemStack) value).getItem();
|
||||
}
|
||||
Block block = ((BlockItem) value).getBlock();
|
||||
|
@ -86,7 +84,7 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
|||
|
||||
@Override
|
||||
public void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, REIAnvilDisplay display,
|
||||
IntList redSlots) {
|
||||
IntList redSlots) {
|
||||
Point startPoint = new Point(bounds.getCenterX() - 41, bounds.getCenterY() - 27);
|
||||
matrices.pushPose();
|
||||
matrices.translate(0, 0, 400);
|
||||
|
@ -96,7 +94,7 @@ public class REIAnvilCategory implements TransferDisplayCategory<REIAnvilDisplay
|
|||
}
|
||||
matrices.popPose();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDisplayHeight() {
|
||||
return 60;
|
||||
|
|
|
@ -13,9 +13,9 @@ import java.util.Collections;
|
|||
import java.util.Optional;
|
||||
|
||||
public class REIAnvilDisplay extends BasicDisplay implements SimpleGridMenuDisplay {
|
||||
|
||||
|
||||
private final AnvilRecipe recipe;
|
||||
|
||||
|
||||
public REIAnvilDisplay(AnvilRecipe recipe) {
|
||||
super(
|
||||
EntryIngredients.ofIngredients(recipe.getIngredients()),
|
||||
|
@ -23,7 +23,7 @@ public class REIAnvilDisplay extends BasicDisplay implements SimpleGridMenuDispl
|
|||
);
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
|
||||
public int getDamage() {
|
||||
return recipe.getDamage();
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class REIAnvilDisplay extends BasicDisplay implements SimpleGridMenuDispl
|
|||
public CategoryIdentifier<?> getCategoryIdentifier() {
|
||||
return REIPlugin.SMITHING;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public @NotNull List<List<EntryStack>> getRequiredEntries() {
|
||||
// return input;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package ru.betterend.integration.rei;
|
||||
|
||||
import net.minecraft.world.item.crafting.BlastingRecipe;
|
||||
import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||
|
||||
public class REIBlastingDisplay extends REIAlloyingDisplay{
|
||||
public REIBlastingDisplay(BlastingRecipe recipe) {
|
||||
super(recipe, recipe.getExperience(), recipe.getCookingTime());
|
||||
}
|
||||
public class REIBlastingDisplay extends REIAlloyingDisplay {
|
||||
public REIBlastingDisplay(BlastingRecipe recipe) {
|
||||
super(recipe, recipe.getExperience(), recipe.getCookingTime());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package ru.betterend.integration.rei;
|
||||
|
||||
import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
|
||||
import ru.betterend.recipe.builders.AlloyingRecipe;
|
||||
|
||||
public class REIContainer implements Runnable {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -11,11 +11,9 @@ import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
|
|||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.Items;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -23,11 +21,11 @@ import ru.betterend.registry.EndBlocks;
|
|||
import java.util.List;
|
||||
|
||||
public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionDisplay> {
|
||||
|
||||
|
||||
private final static ResourceLocation BACKGROUND = BetterEnd.makeID("textures/gui/rei_infusion.png");
|
||||
private final EntryStack ICON;
|
||||
|
||||
REIInfusionCategory(EntryStack icon){
|
||||
REIInfusionCategory(EntryStack icon) {
|
||||
ICON = icon;
|
||||
}
|
||||
|
||||
|
@ -40,13 +38,13 @@ public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionD
|
|||
public @NotNull Component getTitle() {
|
||||
return new TranslatableComponent(EndBlocks.INFUSION_PEDESTAL.getDescriptionId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull EntryStack getIcon() {
|
||||
return ICON;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull List<Widget> setupDisplay(REIInfusionDisplay display, Rectangle bounds) {
|
||||
Point centerPoint = new Point(bounds.getCenterX() - 34, bounds.getCenterY() - 2);
|
||||
|
@ -69,7 +67,7 @@ public class REIInfusionCategory implements TransferDisplayCategory<REIInfusionD
|
|||
.noShadow().rightAligned().color(0xFF404040, 0xFFBBBBBB));
|
||||
return widgets;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDisplayHeight() {
|
||||
return 104;
|
||||
|
|
|
@ -13,10 +13,10 @@ import java.util.Collections;
|
|||
import java.util.Optional;
|
||||
|
||||
public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDisplay {
|
||||
|
||||
|
||||
private final InfusionRecipe recipe;
|
||||
private final int time;
|
||||
|
||||
|
||||
public REIInfusionDisplay(InfusionRecipe recipe) {
|
||||
super(
|
||||
EntryIngredients.ofIngredients(recipe.getIngredients()),
|
||||
|
@ -25,11 +25,11 @@ public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDi
|
|||
this.recipe = recipe;
|
||||
this.time = recipe.getInfusionTime();
|
||||
}
|
||||
|
||||
|
||||
public int getInfusionTime() {
|
||||
return this.time;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull Optional<ResourceLocation> getDisplayLocation() {
|
||||
return Optional.ofNullable(recipe).map(Recipe::getId);
|
||||
|
@ -39,7 +39,7 @@ public class REIInfusionDisplay extends BasicDisplay implements SimpleGridMenuDi
|
|||
public CategoryIdentifier<?> getCategoryIdentifier() {
|
||||
return REIPlugin.INFUSION;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public @NotNull List<List<EntryStack>> getRequiredEntries() {
|
||||
// return this.input;
|
||||
|
|
|
@ -7,22 +7,14 @@ import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
|
|||
import me.shedaniel.rei.api.common.category.CategoryIdentifier;
|
||||
import me.shedaniel.rei.api.common.entry.EntryIngredient;
|
||||
import me.shedaniel.rei.api.common.entry.EntryStack;
|
||||
import me.shedaniel.rei.api.common.entry.type.EntryType;
|
||||
import me.shedaniel.rei.api.common.util.EntryIngredients;
|
||||
import me.shedaniel.rei.api.common.util.EntryStacks;
|
||||
import me.shedaniel.rei.impl.ClientInternals;
|
||||
import me.shedaniel.rei.impl.Internals;
|
||||
import me.shedaniel.rei.plugin.common.DefaultPlugin;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.impl.content.registry.FuelRegistryImpl;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.item.crafting.BlastingRecipe;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import ru.bclib.blocks.BaseFurnaceBlock;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.blocks.basis.EndAnvilBlock;
|
||||
|
@ -30,18 +22,15 @@ import ru.betterend.recipe.builders.AlloyingRecipe;
|
|||
import ru.betterend.recipe.builders.AnvilRecipe;
|
||||
import ru.betterend.recipe.builders.InfusionRecipe;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndItems;
|
||||
import ru.betterend.registry.EndPortals;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
//https://github.com/shedaniel/RoughlyEnoughItems/blob/6.x-1.17/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientPlugin.java
|
||||
public class REIPlugin implements REIClientPlugin {
|
||||
public final static ResourceLocation PLUGIN_ID = BetterEnd.makeID("rei_plugin");
|
||||
public final static CategoryIdentifier ALLOYING_FUEL = CategoryIdentifier.of(BetterEnd.MOD_ID, "alloying_fuel");
|
||||
public final static CategoryIdentifier ALLOYING_FUEL = CategoryIdentifier.of(BetterEnd.MOD_ID, "alloying_fuel");
|
||||
public final static CategoryIdentifier ALLOYING = AlloyingRecipe.ID;
|
||||
public final static CategoryIdentifier SMITHING = CategoryIdentifier.of(BetterEnd.MOD_ID, AnvilRecipe.ID.getPath());
|
||||
public final static CategoryIdentifier INFUSION = InfusionRecipe.ID;
|
||||
|
@ -51,10 +40,10 @@ public class REIPlugin implements REIClientPlugin {
|
|||
private EntryStack[] ANVILS;
|
||||
private EntryStack[] FURNACES;
|
||||
|
||||
void init(){
|
||||
void init() {
|
||||
//we need to initialize those variables after the static initialization
|
||||
//otherwise the registry does not know the BlockItems
|
||||
if (END_STONE_SMELTER!=null) {
|
||||
if (END_STONE_SMELTER != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -78,18 +67,18 @@ public class REIPlugin implements REIClientPlugin {
|
|||
registry.registerRecipeFiller(AnvilRecipe.class, AnvilRecipe.TYPE, REIAnvilDisplay::new);
|
||||
registry.registerRecipeFiller(InfusionRecipe.class, InfusionRecipe.TYPE, REIInfusionDisplay::new);
|
||||
|
||||
FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> {
|
||||
FuelRegistryImpl.INSTANCE.getFuelTimes().forEach((item, time) -> {
|
||||
if (time >= 2000) {
|
||||
final List<EntryIngredient> list = Arrays.asList(EntryIngredients.of(item));
|
||||
registry.add(new REIAlloyingFuelDisplay(list, time));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerCategories(CategoryRegistry registry) {
|
||||
init();
|
||||
|
||||
|
||||
registry.add(
|
||||
new REIAlloyingFuelCategory(),
|
||||
new REIAlloyingCategory(END_STONE_SMELTER),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue