...
 
Commits (4)
......@@ -19,7 +19,7 @@ archivesBaseName = 'rediscovered-1.14.4'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
minecraft {
mappings channel: 'snapshot', version: '20200113-1.14.3'
mappings channel: 'snapshot', version: '20200119-1.14.3'
runs {
client {
workingDirectory project.file('run')
......@@ -68,7 +68,7 @@ minecraft {
}
dependencies {
minecraft 'net.minecraftforge:forge:1.14.4-28.1.45'
minecraft 'net.minecraftforge:forge:1.14.4-28.2.0'
}
jar {
......
......@@ -8,13 +8,13 @@ import com.legacy.rediscovered.event.RediscoveredEvents;
import net.minecraft.entity.EntityClassification;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.placement.CountRangeConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
......@@ -46,11 +46,7 @@ public class RediscoveredMod
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, RediscoveredConfig.CLIENT_SPEC);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, RediscoveredConfig.SERVER_SPEC);
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
{
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientInit);
});
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientInit));
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonInit);
}
......@@ -58,17 +54,15 @@ public class RediscoveredMod
{
for (Biome biome : ForgeRegistries.BIOMES.getValues())
{
if (biome.getRegistryName().getNamespace().equalsIgnoreCase("minecraft") && !biome.getRegistryName().toString().contains("end") && biome != Biomes.NETHER && biome != Biomes.THE_VOID)
if (biome.getRegistryName().getNamespace().equalsIgnoreCase("minecraft") && !BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER) && !BiomeDictionary.hasType(biome, BiomeDictionary.Type.END) && !BiomeDictionary.hasType(biome, BiomeDictionary.Type.VOID))
{
biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, RediscoveredBlocks.ruby_ore.getDefaultState(), 4), Placement.COUNT_RANGE, new CountRangeConfig(2, 0, 0, 32)));
if (RediscoveredConfig.undeadHorsesAgressive && !biome.getRegistryName().toString().contains("ocean"))
biome.getSpawns(EntityClassification.MONSTER).add(new Biome.SpawnListEntry(RediscoveredEntityTypes.VANILLA_SPAWNER, 1, 1, 2));
}
if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER))
biome.getSpawns(EntityClassification.WATER_CREATURE).add(new Biome.SpawnListEntry(RediscoveredEntityTypes.FISH, 10, 3, 6));
if (biome == biome.getRiver() || biome == Biomes.OCEAN || biome == Biomes.WARM_OCEAN || biome == Biomes.COLD_OCEAN || biome == Biomes.DEEP_COLD_OCEAN || biome == Biomes.DEEP_FROZEN_OCEAN || biome == Biomes.DEEP_LUKEWARM_OCEAN || biome == Biomes.DEEP_OCEAN || biome == Biomes.DEEP_WARM_OCEAN || biome == Biomes.FROZEN_OCEAN || biome == Biomes.LUKEWARM_OCEAN)
{
biome.getSpawns(EntityClassification.WATER_CREATURE).add(new Biome.SpawnListEntry(RediscoveredEntityTypes.FISH, 10, 3, 6));
if (RediscoveredConfig.undeadHorsesAgressive && !BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN))
biome.getSpawns(EntityClassification.MONSTER).add(new Biome.SpawnListEntry(RediscoveredEntityTypes.VANILLA_SPAWNER, 1, 1, 2));
}
}
......
......@@ -27,7 +27,7 @@ import net.minecraftforge.registries.ObjectHolder;
@ObjectHolder(RediscoveredMod.MODID)
public class RediscoveredEntityTypes
{
public static final EntityType<FishEntity> FISH = buildEntity("fish", EntityType.Builder.create(FishEntity::new, EntityClassification.CREATURE).size(0.5F, 0.3F));
public static final EntityType<FishEntity> FISH = buildEntity("fish", EntityType.Builder.create(FishEntity::new, EntityClassification.WATER_CREATURE).size(0.5F, 0.3F));
public static final EntityType<PigmanEntity> PIGMAN = buildEntity("pigman", EntityType.Builder.create(PigmanEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
public static final EntityType<MeleePigmanEntity> MELEE_PIGMAN = buildEntity("melee_pigman", EntityType.Builder.create(MeleePigmanEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
public static final EntityType<RangedPigmanEntity> RANGED_PIGMAN = buildEntity("ranged_pigman", EntityType.Builder.create(RangedPigmanEntity::new, EntityClassification.CREATURE).size(0.6F, 1.9F));
......
......@@ -22,6 +22,7 @@ import net.minecraft.entity.ILivingEntityData;
import net.minecraft.entity.SpawnReason;
import net.minecraft.entity.merchant.villager.VillagerEntity;
import net.minecraft.entity.merchant.villager.VillagerProfession;
import net.minecraft.entity.monster.IllusionerEntity;
import net.minecraft.entity.villager.IVillagerType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
......@@ -33,6 +34,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MutableBoundingBox;
import net.minecraft.world.Difficulty;
import net.minecraft.world.IWorld;
import net.minecraft.world.gen.feature.structure.StructurePiece;
import net.minecraft.world.gen.feature.structure.TemplateStructurePiece;
......@@ -120,11 +122,25 @@ public class SmallPigmanVillagePieces
}
else if ("nitwit".equals(function))
{
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
VillagerEntity entity = EntityType.VILLAGER.create(worldIn.getWorld());
entity.setVillagerData(entity.getVillagerData().withType(IVillagerType.PLAINS).withProfession(VillagerProfession.NITWIT));
entity.setPosition(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D);
worldIn.addEntity(entity);
System.out.println("a");
if (rand.nextBoolean() && worldIn.getDifficulty() != Difficulty.PEACEFUL)
{
System.out.println("ill");
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
IllusionerEntity entity = EntityType.ILLUSIONER.create(worldIn.getWorld());
entity.enablePersistence();
entity.setPosition(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D);
worldIn.addEntity(entity);
}
else
{
worldIn.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
VillagerEntity entity = EntityType.VILLAGER.create(worldIn.getWorld());
entity.setVillagerData(entity.getVillagerData().withType(IVillagerType.PLAINS).withProfession(VillagerProfession.NITWIT));
entity.setPosition(pos.getX() + 0.5D, pos.getY(), pos.getZ() + 0.5D);
worldIn.addEntity(entity);
}
}
else if ("melee_pigman".equals(function))
{
......
......@@ -7,6 +7,7 @@ version="${file.jarVersion}"
displayName="Rediscovered"
displayURL="https://moddinglegacy.com/"
logoFile="rediscovered.png"
updateJSONURL="https://gitlab.com/modding-legacy/supporters/-/raw/master/rediscovered.json"
credits="Thanks to Stormister for allowing us to port his amazing mod!"
authors="Stormister, KingPhygieBoo, MCVinnyQ"
description='''
......@@ -15,7 +16,7 @@ A mod that brings back removed or scrapped Minecraft features, giving new life t
[[dependencies.rediscovered]]
modId="forge"
mandatory=true
versionRange="[28.1.40,)"
versionRange="[28.2.0,)"
ordering="NONE"
side="BOTH"
[[dependencies.rediscovered]]
......