mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 06:24:43 +00:00
Patching and updates
This commit is contained in:
113 files changed
+1011
-3194
No files matched your search
@@ -369,80 +369,79 @@ public class BiomeDictionary
|
||||
|
||||
private static void registerVanillaBiomes()
|
||||
{
|
||||
addTypes(Biomes.OCEAN, OCEAN, OVERWORLD );
|
||||
addTypes(Biomes.PLAINS, PLAINS, OVERWORLD );
|
||||
addTypes(Biomes.DESERT, HOT, DRY, SANDY, OVERWORLD );
|
||||
addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.FOREST, FOREST, OVERWORLD );
|
||||
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD );
|
||||
addTypes(Biomes.SWAMP, WET, SWAMP, OVERWORLD );
|
||||
addTypes(Biomes.RIVER, RIVER, OVERWORLD );
|
||||
addTypes(Biomes.field_235254_j_, HOT, DRY, NETHER );
|
||||
addTypes(Biomes.THE_END, COLD, DRY, END );
|
||||
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY, OVERWORLD );
|
||||
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY, OVERWORLD );
|
||||
addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND, OVERWORLD );
|
||||
addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN, OVERWORLD );
|
||||
addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE, OVERWORLD );
|
||||
addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE, OVERWORLD );
|
||||
addTypes(Biomes.BEACH, BEACH, OVERWORLD );
|
||||
addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.WOODED_HILLS, FOREST, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN, OVERWORLD );
|
||||
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE, OVERWORLD );
|
||||
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE, OVERWORLD );
|
||||
addTypes(Biomes.DEEP_OCEAN, OCEAN, OVERWORLD );
|
||||
addTypes(Biomes.STONE_SHORE, BEACH, OVERWORLD );
|
||||
addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY, OVERWORLD );
|
||||
addTypes(Biomes.BIRCH_FOREST, FOREST, OVERWORLD );
|
||||
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST, OVERWORLD );
|
||||
addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY, OVERWORLD );
|
||||
addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD );
|
||||
addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD );
|
||||
addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE, OVERWORLD );
|
||||
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE, OVERWORLD );
|
||||
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE, OVERWORLD, PLATEAU );
|
||||
addTypes(Biomes.BADLANDS, MESA, SANDY, DRY, OVERWORLD );
|
||||
addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SANDY, DRY, SPARSE, OVERWORLD, PLATEAU );
|
||||
addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY, DRY, OVERWORLD, PLATEAU );
|
||||
addTypes(Biomes.SMALL_END_ISLANDS, END );
|
||||
addTypes(Biomes.END_MIDLANDS, END );
|
||||
addTypes(Biomes.END_HIGHLANDS, END );
|
||||
addTypes(Biomes.END_BARRENS, END );
|
||||
addTypes(Biomes.WARM_OCEAN, OCEAN, HOT, OVERWORLD );
|
||||
addTypes(Biomes.LUKEWARM_OCEAN, OCEAN, OVERWORLD );
|
||||
addTypes(Biomes.COLD_OCEAN, OCEAN, COLD, OVERWORLD );
|
||||
addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT, OVERWORLD );
|
||||
addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN, OVERWORLD );
|
||||
addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD, OVERWORLD );
|
||||
addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD, OVERWORLD );
|
||||
addTypes(Biomes.THE_VOID, VOID );
|
||||
addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE, OVERWORLD );
|
||||
addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE, OVERWORLD );
|
||||
addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD );
|
||||
addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE, OVERWORLD );
|
||||
addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE, OVERWORLD );
|
||||
addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE, OVERWORLD );
|
||||
addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE, OVERWORLD );
|
||||
addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE, OVERWORLD, MODIFIED);
|
||||
addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE, OVERWORLD, MODIFIED );
|
||||
addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE, OVERWORLD );
|
||||
addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE, OVERWORLD );
|
||||
addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE, OVERWORLD );
|
||||
addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE, OVERWORLD );
|
||||
addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE, OVERWORLD );
|
||||
addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD, MODIFIED );
|
||||
addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE, OVERWORLD, PLATEAU);
|
||||
addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE, OVERWORLD, PLATEAU, MODIFIED );
|
||||
addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD, PLATEAU, MODIFIED);
|
||||
|
||||
addTypes(Biomes.OCEAN, OCEAN, OVERWORLD);
|
||||
addTypes(Biomes.PLAINS, PLAINS, OVERWORLD);
|
||||
addTypes(Biomes.DESERT, HOT, DRY, SANDY, OVERWORLD);
|
||||
addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.FOREST, FOREST, OVERWORLD);
|
||||
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD);
|
||||
addTypes(Biomes.SWAMP, WET, SWAMP, OVERWORLD);
|
||||
addTypes(Biomes.RIVER, RIVER, OVERWORLD);
|
||||
addTypes(Biomes.field_235254_j_, HOT, DRY, NETHER);
|
||||
addTypes(Biomes.THE_END, COLD, DRY, END);
|
||||
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY, OVERWORLD);
|
||||
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY, OVERWORLD);
|
||||
addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND, OVERWORLD);
|
||||
addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN, OVERWORLD);
|
||||
addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE, OVERWORLD);
|
||||
addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE, OVERWORLD);
|
||||
addTypes(Biomes.BEACH, BEACH, OVERWORLD);
|
||||
addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.WOODED_HILLS, FOREST, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN, OVERWORLD);
|
||||
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE, OVERWORLD);
|
||||
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE, OVERWORLD);
|
||||
addTypes(Biomes.DEEP_OCEAN, OCEAN, OVERWORLD);
|
||||
addTypes(Biomes.STONE_SHORE, BEACH, OVERWORLD);
|
||||
addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY, OVERWORLD);
|
||||
addTypes(Biomes.BIRCH_FOREST, FOREST, OVERWORLD);
|
||||
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST, OVERWORLD);
|
||||
addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY, OVERWORLD);
|
||||
addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST, OVERWORLD);
|
||||
addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS, OVERWORLD);
|
||||
addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE, OVERWORLD);
|
||||
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE, OVERWORLD);
|
||||
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE, OVERWORLD, PLATEAU);
|
||||
addTypes(Biomes.BADLANDS, MESA, SANDY, DRY, OVERWORLD);
|
||||
addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SANDY, DRY, SPARSE, OVERWORLD, PLATEAU);
|
||||
addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY, DRY, OVERWORLD, PLATEAU);
|
||||
addTypes(Biomes.SMALL_END_ISLANDS, END);
|
||||
addTypes(Biomes.END_MIDLANDS, END);
|
||||
addTypes(Biomes.END_HIGHLANDS, END);
|
||||
addTypes(Biomes.END_BARRENS, END);
|
||||
addTypes(Biomes.WARM_OCEAN, OCEAN, HOT, OVERWORLD);
|
||||
addTypes(Biomes.LUKEWARM_OCEAN, OCEAN, OVERWORLD);
|
||||
addTypes(Biomes.COLD_OCEAN, OCEAN, COLD, OVERWORLD);
|
||||
addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT, OVERWORLD);
|
||||
addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN, OVERWORLD);
|
||||
addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD, OVERWORLD);
|
||||
addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD, OVERWORLD);
|
||||
addTypes(Biomes.THE_VOID, VOID);
|
||||
addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE, OVERWORLD);
|
||||
addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE, OVERWORLD);
|
||||
addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD);
|
||||
addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE, OVERWORLD);
|
||||
addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE, OVERWORLD);
|
||||
addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE, OVERWORLD);
|
||||
addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE, OVERWORLD, MODIFIED);
|
||||
addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE, OVERWORLD, MODIFIED);
|
||||
addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE, OVERWORLD);
|
||||
addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE, OVERWORLD);
|
||||
addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE, OVERWORLD);
|
||||
addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE, OVERWORLD, MODIFIED);
|
||||
addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE, OVERWORLD, PLATEAU);
|
||||
addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD);
|
||||
addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE, OVERWORLD, PLATEAU, MODIFIED);
|
||||
addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, MOUNTAIN, RARE, OVERWORLD, PLATEAU, MODIFIED);
|
||||
|
||||
if (DEBUG)
|
||||
{
|
||||
|
||||
@@ -218,7 +218,8 @@ public class ForgeHooks
|
||||
blocks.forEach(block -> blockToolSetter.accept(block, ToolType.PICKAXE, 0));
|
||||
blocks = getPrivateValue(ShovelItem.class, null, 0);
|
||||
blocks.forEach(block -> blockToolSetter.accept(block, ToolType.SHOVEL, 0));
|
||||
blocks = getPrivateValue(AxeItem.class, null, 0);
|
||||
//TODO Axes check Material and Blocks now.
|
||||
blocks = getPrivateValue(AxeItem.class, null, 1);
|
||||
blocks.forEach(block -> blockToolSetter.accept(block, ToolType.AXE, 0));
|
||||
|
||||
//This is taken from ItemAxe, if that changes update here.
|
||||
@@ -796,7 +797,7 @@ public class ForgeHooks
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static LootTable loadLootTable(Gson gson, ResourceLocation name, JsonObject data, boolean custom, LootTableManager lootTableManager)
|
||||
public static LootTable loadLootTable(Gson gson, ResourceLocation name, JsonElement data, boolean custom, LootTableManager lootTableManager)
|
||||
{
|
||||
Deque<LootTableContext> que = lootContext.get();
|
||||
if (que == null)
|
||||
@@ -821,10 +822,8 @@ public class ForgeHooks
|
||||
if (!custom)
|
||||
ret = ForgeEventFactory.loadLootTable(name, ret, lootTableManager);
|
||||
|
||||
/* TODO:
|
||||
if (ret != null)
|
||||
ret.freeze();
|
||||
*/
|
||||
if (ret != null)
|
||||
ret.freeze();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
package net.minecraftforge.common;
|
||||
|
||||
import net.minecraft.entity.ai.attributes.Attribute;
|
||||
import net.minecraft.entity.ai.attributes.RangedAttribute;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraft.world.storage.IServerConfiguration;
|
||||
import net.minecraft.world.storage.IWorldInfo;
|
||||
@@ -33,6 +35,8 @@ import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.loading.progress.StartupMessageManager;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.server.command.ConfigCommand;
|
||||
import net.minecraftforge.server.command.ForgeCommand;
|
||||
import net.minecraftforge.versions.forge.ForgeVersion;
|
||||
@@ -84,6 +88,12 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
private static final Marker FORGEMOD = MarkerManager.getMarker("FORGEMOD");
|
||||
|
||||
private static final DeferredRegister<Attribute> ATTRIBUTES = DeferredRegister.create(Attribute.class, "forge");
|
||||
|
||||
public static final RegistryObject<Attribute> SWIM_SPEED = ATTRIBUTES.register("swim_speed", () -> new RangedAttribute("forge.swimSpeed", 1.0D, 0.0D, 1024.0D).func_233753_a_(true));
|
||||
public static final RegistryObject<Attribute> NAMETAG_DISTANCE = ATTRIBUTES.register("nametag_distance", () -> new RangedAttribute("forge.nameTagDistance", 64.0D, 0.0D, Float.MAX_VALUE).func_233753_a_(true));
|
||||
public static final RegistryObject<Attribute> ENTITY_GRAVITY = ATTRIBUTES.register("entity_gravity", () -> new RangedAttribute("forge.entity_gravity", 0.08D, -8.0D, 8.0D).func_233753_a_(true));
|
||||
|
||||
private static ForgeMod INSTANCE;
|
||||
public static ForgeMod getInstance()
|
||||
{
|
||||
@@ -101,6 +111,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
|
||||
modEventBus.addListener(this::preInit);
|
||||
modEventBus.addListener(this::gatherData);
|
||||
modEventBus.register(this);
|
||||
ATTRIBUTES.register(modEventBus);
|
||||
MinecraftForge.EVENT_BUS.addListener(this::serverStarting);
|
||||
MinecraftForge.EVENT_BUS.addListener(this::serverStopping);
|
||||
MinecraftForge.EVENT_BUS.addGenericListener(SoundEvent.class, this::missingSoundMapping);
|
||||
|
||||
@@ -367,11 +367,10 @@ public interface IForgeBlock
|
||||
*
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param exploder The entity that caused the explosion, can be null
|
||||
* @param explosion The explosion
|
||||
* @return The amount of the explosion absorbed.
|
||||
*/
|
||||
default float getExplosionResistance(BlockState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||
default float getExplosionResistance(BlockState state, IBlockReader world, BlockPos pos, Explosion explosion)
|
||||
{
|
||||
return this.getBlock().getExplosionResistance();
|
||||
}
|
||||
|
||||
@@ -311,13 +311,12 @@ public interface IForgeBlockState
|
||||
*
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param exploder The entity that caused the explosion, can be null
|
||||
* @param explosion The explosion
|
||||
* @return The amount of the explosion absorbed.
|
||||
*/
|
||||
default float getExplosionResistance(IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||
default float getExplosionResistance(IBlockReader world, BlockPos pos, Explosion explosion)
|
||||
{
|
||||
return getBlockState().getBlock().getExplosionResistance(getBlockState(), world, pos, exploder, explosion);
|
||||
return getBlockState().getBlock().getExplosionResistance(getBlockState(), world, pos, explosion);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,266 +0,0 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*package net.minecraftforge.common.extensions;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.audio.MusicTicker;
|
||||
import net.minecraft.client.renderer.Vector3f;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.Biomes;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.dimension.Dimension;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.dimension.NetherDimension;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
public interface IForgeDimension
|
||||
{
|
||||
default Dimension getDimension()
|
||||
{
|
||||
return (Dimension) this;
|
||||
}
|
||||
|
||||
World getWorld();
|
||||
|
||||
/**
|
||||
* Called from {@link World#initCapabilities()}, to gather capabilities for this
|
||||
* world. It's safe to access world here since this is called after world is
|
||||
* registered.
|
||||
*
|
||||
* On server, called directly after mapStorage and world data such as Scoreboard
|
||||
* and VillageCollection are initialized. On client, called when world is
|
||||
* constructed, just before world load event is called. Note that this method is
|
||||
* always called before the world load event.
|
||||
*
|
||||
* @return initial holder for capabilities on the world
|
||||
* /
|
||||
default net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The dimension's movement factor. Whenever a player or entity changes
|
||||
* dimension from world A to world B, their coordinates are multiplied by
|
||||
* worldA.provider.getMovementFactor() / worldB.provider.getMovementFactor()
|
||||
* Example: Overworld factor is 1, nether factor is 8. Traveling from overworld
|
||||
* to nether multiplies coordinates by 1/8.
|
||||
*
|
||||
* @return The movement factor
|
||||
* /
|
||||
default double getMovementFactor()
|
||||
{
|
||||
if (getDimension() instanceof NetherDimension)
|
||||
{
|
||||
return 8.0;
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
IRenderHandler getSkyRenderer();
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
void setSkyRenderer(IRenderHandler skyRenderer);
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
IRenderHandler getCloudRenderer();
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
void setCloudRenderer(IRenderHandler renderer);
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Nullable
|
||||
IRenderHandler getWeatherRenderer();
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
void setWeatherRenderer(IRenderHandler renderer);
|
||||
|
||||
/**
|
||||
* Allows for manipulating the coloring of the lightmap texture.
|
||||
* Will be called for each 16*16 combination of sky/block light values.
|
||||
*
|
||||
* @param partialTicks Progress between ticks.
|
||||
* @param sunBrightness Current sun brightness.
|
||||
* @param skyLight Sky light brightness factor.
|
||||
* @param blockLight Block light brightness factor.
|
||||
* @param colors The color values that will be used: [r, g, b].
|
||||
*
|
||||
* @see net.minecraft.client.renderer.GameRenderer#updateLightmap(float)
|
||||
* /
|
||||
default void getLightmapColors(float partialTicks, float sunBrightness, float skyLight, float blockLight, Vector3f colors) {}
|
||||
|
||||
void resetRainAndThunder();
|
||||
|
||||
default boolean canDoLightning(Chunk chunk)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
default boolean canDoRainSnowIce(Chunk chunk)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on the client to get the music type to play when in this world type.
|
||||
* At the time of calling, the client player and world are guaranteed to be non-null
|
||||
* @return null to use vanilla logic, otherwise a MusicType to play in this world
|
||||
* /
|
||||
@Nullable
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
default MusicTicker.MusicType getMusicType()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the player can sleep in this world (or if the bed should explode for example).
|
||||
*
|
||||
* @param player The player that is attempting to sleep
|
||||
* @param pos The location where the player tries to sleep at (the position of the clicked on bed for example)
|
||||
* @return the result of a player trying to sleep at the given location
|
||||
* /
|
||||
default SleepResult canSleepAt(net.minecraft.entity.player.PlayerEntity player, BlockPos pos)
|
||||
{
|
||||
return (getDimension().canRespawnHere() && getWorld().getBiome(pos) != Biomes.NETHER) ? SleepResult.ALLOW : SleepResult.BED_EXPLODES;
|
||||
}
|
||||
|
||||
enum SleepResult
|
||||
{
|
||||
ALLOW,
|
||||
DENY,
|
||||
BED_EXPLODES;
|
||||
}
|
||||
|
||||
default boolean isDaytime()
|
||||
{
|
||||
return getDimension().getType() == DimensionType.OVERWORLD && getWorld().getSkylightSubtracted() < 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the current moon phase factor.
|
||||
* This factor is effective for slimes.
|
||||
* (This method do not affect the moon rendering)
|
||||
* * /
|
||||
default float getCurrentMoonPhaseFactor(long time)
|
||||
{
|
||||
return Dimension.MOON_PHASE_FACTORS[this.getDimension().getMoonPhase(time)];
|
||||
}
|
||||
|
||||
default void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful) { }
|
||||
|
||||
default void calculateInitialWeather()
|
||||
{
|
||||
getWorld().calculateInitialWeatherBody();
|
||||
}
|
||||
|
||||
default void updateWeather(Runnable defaultLogic)
|
||||
{
|
||||
defaultLogic.run();
|
||||
}
|
||||
|
||||
default long getSeed()
|
||||
{
|
||||
return getWorld().getWorldInfo().getSeed();
|
||||
}
|
||||
|
||||
default long getWorldTime()
|
||||
{
|
||||
return getWorld().getWorldInfo().getDayTime();
|
||||
}
|
||||
|
||||
default void setWorldTime(long time)
|
||||
{
|
||||
getWorld().getWorldInfo().setDayTime(time);
|
||||
}
|
||||
|
||||
default BlockPos getSpawnPoint()
|
||||
{
|
||||
WorldInfo info = getWorld().getWorldInfo();
|
||||
return new BlockPos(info.getSpawnX(), info.getSpawnY(), info.getSpawnZ());
|
||||
}
|
||||
|
||||
default void setSpawnPoint(BlockPos pos)
|
||||
{
|
||||
getWorld().getWorldInfo().setSpawn(pos);
|
||||
}
|
||||
|
||||
default boolean canMineBlock(PlayerEntity player, BlockPos pos)
|
||||
{
|
||||
return getWorld().canMineBlockBody(player, pos);
|
||||
}
|
||||
|
||||
default boolean isHighHumidity(BlockPos pos)
|
||||
{
|
||||
return getWorld().getBiome(pos).isHighHumidity();
|
||||
}
|
||||
|
||||
default int getHeight()
|
||||
{
|
||||
return 256;
|
||||
}
|
||||
|
||||
default int getActualHeight()
|
||||
{
|
||||
return getDimension().isNether() ? 128 : 256;
|
||||
}
|
||||
|
||||
default int getSeaLevel()
|
||||
{
|
||||
return 63;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the cursor on the map should 'spin' when rendered, like it does for the player in the nether.
|
||||
*
|
||||
* @param entity The entity holding the map, playername, or frame-ENTITYID
|
||||
* @param x X Position
|
||||
* @param z Z Position
|
||||
* @param rotation the regular rotation of the marker
|
||||
* @return True to 'spin' the cursor
|
||||
* /
|
||||
default boolean shouldMapSpin(String entity, double x, double z, double rotation)
|
||||
{
|
||||
return getDimension().getType() == DimensionType.THE_NETHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the dimension the player will be respawned in, typically this brings them back to the overworld.
|
||||
*
|
||||
* @param player The player that is respawning
|
||||
* @return The dimension to respawn the player in
|
||||
* /
|
||||
default DimensionType getRespawnDimension(ServerPlayerEntity player)
|
||||
{
|
||||
return player.getSpawnDimension();
|
||||
}
|
||||
}*/
|
||||
@@ -33,6 +33,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
|
||||
@@ -94,11 +95,10 @@ public interface IForgeFluid
|
||||
*
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param exploder The entity that caused the explosion, can be null
|
||||
* @param explosion The explosion
|
||||
* @return The amount of the explosion absorbed.
|
||||
*/
|
||||
default float getExplosionResistance(FluidState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||
default float getExplosionResistance(FluidState state, IBlockReader world, BlockPos pos, Explosion explosion)
|
||||
{
|
||||
return state.getExplosionResistance();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.IWorldReader;
|
||||
|
||||
public interface IForgeFluidState
|
||||
@@ -61,15 +62,14 @@ public interface IForgeFluidState
|
||||
*
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param exploder The entity that caused the explosion, can be null
|
||||
* @param explosion The explosion
|
||||
* @return The amount of the explosion absorbed.
|
||||
*/
|
||||
default float getExplosionResistance(IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||
default float getExplosionResistance(IBlockReader world, BlockPos pos, Explosion explosion)
|
||||
{
|
||||
return getFluidState().getFluid().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
|
||||
return getFluidState().getFluid().getExplosionResistance(getFluidState(), world, pos, explosion);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Queries if this fluidstate should render in a given layer.
|
||||
* A custom {@link IBakedModel} can use {@link net.minecraftforge.client.MinecraftForgeClient#getRenderLayer()} to alter the model based on layer.
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.common.extensions;
|
||||
|
||||
public interface IForgeResourcePack
|
||||
{
|
||||
default boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2019.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*package net.minecraftforge.common.extensions;
|
||||
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.CreateBuffetWorldScreen;
|
||||
import net.minecraft.client.gui.screen.CreateFlatWorldScreen;
|
||||
import net.minecraft.client.gui.screen.CreateWorldScreen;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.gen.IExtendedNoiseRandom;
|
||||
import net.minecraft.world.gen.OverworldGenSettings;
|
||||
import net.minecraft.world.gen.area.IArea;
|
||||
import net.minecraft.world.gen.area.IAreaFactory;
|
||||
import net.minecraft.world.gen.layer.AddBambooForestLayer;
|
||||
import net.minecraft.world.gen.layer.BiomeLayer;
|
||||
import net.minecraft.world.gen.layer.EdgeBiomeLayer;
|
||||
import net.minecraft.world.gen.layer.ZoomLayer;
|
||||
import net.minecraft.world.gen.layer.LayerUtil;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
public interface IForgeWorldType
|
||||
{
|
||||
default WorldType getWorldType()
|
||||
{
|
||||
return (WorldType) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when 'Create New World' button is pressed before starting game
|
||||
* /
|
||||
default void onGUICreateWorldPress()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the 'Customize' button is pressed on world creation GUI
|
||||
*
|
||||
* @param mc The Minecraft instance
|
||||
* @param gui the createworld GUI
|
||||
* /
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
default void onCustomizeButton(Minecraft mc, CreateWorldScreen gui)
|
||||
{
|
||||
if (this == WorldType.FLAT)
|
||||
mc.displayGuiScreen(new CreateFlatWorldScreen(gui, gui.chunkProviderSettingsJson));
|
||||
else if (this == WorldType.BUFFET)
|
||||
mc.displayGuiScreen(new CreateBuffetWorldScreen(gui, gui.chunkProviderSettingsJson));
|
||||
}
|
||||
|
||||
default boolean handleSlimeSpawnReduction(java.util.Random random, IWorld world)
|
||||
{
|
||||
return this == WorldType.FLAT ? random.nextInt(4) != 1 : false;
|
||||
}
|
||||
|
||||
default double getHorizon(World world)
|
||||
{
|
||||
return this == WorldType.FLAT ? 0.0D : 63.0D;
|
||||
}
|
||||
|
||||
default double voidFadeMagnitude()
|
||||
{
|
||||
return this == WorldType.FLAT ? 1.0D : 0.03125D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the height to render the clouds for this world type
|
||||
*
|
||||
* @return The height to render clouds at
|
||||
* /
|
||||
default float getCloudHeight()
|
||||
{
|
||||
return 128.0F;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
default ChunkGenerator<?> createChunkGenerator(World world)
|
||||
{
|
||||
return world.dimension.createChunkGenerator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows modifying the {@link IAreaFactory} used for this type's biome
|
||||
* generation.
|
||||
*
|
||||
* @param <T> The type of {@link IArea}.
|
||||
* @param <C> The type of {@link IContextExtended}.
|
||||
*
|
||||
* @param parentLayer The parent layer to feed into any layer you return
|
||||
* @param chunkSettings The {@link OverworldGenSettings} used to create the
|
||||
* {@link GenLayerBiome}.
|
||||
* @param contextFactory A {@link LongFunction} factory to create contexts of
|
||||
* the supplied size.
|
||||
* @return An {@link IAreaFactory} that representing the Biomes to be generated.
|
||||
* @see {@link GenLayerBiome}
|
||||
* /
|
||||
default <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> getBiomeLayer(IAreaFactory<T> parentLayer,
|
||||
OverworldGenSettings chunkSettings, LongFunction<C> contextFactory)
|
||||
{
|
||||
parentLayer = (new BiomeLayer(getWorldType(), chunkSettings.getBiomeId())).apply(contextFactory.apply(200L), parentLayer);
|
||||
parentLayer = AddBambooForestLayer.INSTANCE.apply(contextFactory.apply(1001L), parentLayer);
|
||||
parentLayer = LayerUtil.repeat(1000L, ZoomLayer.NORMAL, parentLayer, 2, contextFactory);
|
||||
parentLayer = EdgeBiomeLayer.INSTANCE.apply(contextFactory.apply(1000L), parentLayer);
|
||||
return parentLayer;
|
||||
}
|
||||
}*/
|
||||
Reference in new issue
Block a user