2016-06-23 03:49:47 +00:00
|
|
|
/*
|
|
|
|
* Minecraft Forge
|
2018-07-01 21:17:28 +00:00
|
|
|
* Copyright (c) 2016-2018.
|
2016-06-23 03:49:47 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2012-11-19 04:27:43 +00:00
|
|
|
package net.minecraftforge.event.terraingen;
|
|
|
|
|
2016-05-29 21:05:07 +00:00
|
|
|
import net.minecraftforge.common.MinecraftForge;
|
2018-06-11 01:12:46 +00:00
|
|
|
import net.minecraftforge.eventbus.api.Event;
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
import net.minecraft.block.state.IBlockState;
|
2016-05-18 10:29:10 +00:00
|
|
|
import net.minecraft.world.biome.Biome;
|
2012-11-19 04:27:43 +00:00
|
|
|
|
2018-09-22 10:40:22 +00:00
|
|
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
|
|
|
|
2014-07-06 20:07:49 +00:00
|
|
|
/**
|
|
|
|
* BiomeEvent is fired whenever an event involving biomes occurs.<br>
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
* If a method utilizes this {@link Event} as its parameter, the method will
|
2014-07-06 20:07:49 +00:00
|
|
|
* receive every child event of this class.<br>
|
|
|
|
* <br>
|
2016-05-29 03:15:32 +00:00
|
|
|
* All children of this event are fired on the {@link MinecraftForge#TERRAIN_GEN_BUS}
|
|
|
|
* unless stated otherwise in their Javadocs.
|
2014-07-06 20:07:49 +00:00
|
|
|
**/
|
2018-06-11 01:12:46 +00:00
|
|
|
public class BiomeEvent extends net.minecraftforge.eventbus.api.Event
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
2016-05-18 10:29:10 +00:00
|
|
|
private final Biome biome;
|
2012-11-19 04:27:43 +00:00
|
|
|
|
2016-05-18 10:29:10 +00:00
|
|
|
public BiomeEvent(Biome biome)
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
|
|
|
this.biome = biome;
|
|
|
|
}
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
|
2016-05-18 10:29:10 +00:00
|
|
|
public Biome getBiome()
|
2016-03-24 08:44:52 +00:00
|
|
|
{
|
|
|
|
return biome;
|
|
|
|
}
|
|
|
|
|
2014-07-06 20:07:49 +00:00
|
|
|
/**
|
|
|
|
* BiomeColor is fired whenever an event involving biome colors occurs. <br>
|
2018-06-11 01:12:46 +00:00
|
|
|
* If a method utilizes this {@link net.minecraftforge.eventbus.api.Event} as its parameter, the method will
|
2014-07-06 20:07:49 +00:00
|
|
|
* receive every child event of this class.<br>
|
|
|
|
* <br>
|
2016-05-29 03:15:32 +00:00
|
|
|
* All children of this event are fired on the {@link MinecraftForge#EVENT_BUS}.
|
2014-07-06 20:07:49 +00:00
|
|
|
**/
|
2012-12-18 06:33:28 +00:00
|
|
|
public static class BiomeColor extends BiomeEvent
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
2016-03-24 08:44:52 +00:00
|
|
|
private final int originalColor;
|
|
|
|
private int newColor;
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
|
2016-05-18 10:29:10 +00:00
|
|
|
public BiomeColor(Biome biome, int original)
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
|
|
|
super(biome);
|
|
|
|
originalColor = original;
|
2016-03-24 08:44:52 +00:00
|
|
|
setNewColor(original);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getOriginalColor()
|
|
|
|
{
|
|
|
|
return originalColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getNewColor()
|
|
|
|
{
|
|
|
|
return newColor;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setNewColor(int newColor)
|
|
|
|
{
|
|
|
|
this.newColor = newColor;
|
2012-11-19 04:27:43 +00:00
|
|
|
}
|
|
|
|
}
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
|
2012-11-19 04:27:43 +00:00
|
|
|
/**
|
|
|
|
* This event is fired when the village generator attempts to choose a block ID
|
|
|
|
* based on the village's biome.
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
*
|
2013-12-21 08:10:35 +00:00
|
|
|
* You can cancel the event to override default values
|
2012-11-19 04:27:43 +00:00
|
|
|
*/
|
|
|
|
@HasResult
|
2013-12-21 08:10:35 +00:00
|
|
|
public static class GetVillageBlockID extends BiomeEvent
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
2016-03-24 08:44:52 +00:00
|
|
|
private final IBlockState original;
|
|
|
|
private IBlockState replacement;
|
2013-12-21 08:10:35 +00:00
|
|
|
|
2016-05-18 10:29:10 +00:00
|
|
|
public GetVillageBlockID(Biome biome, IBlockState original)
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
2013-12-21 08:10:35 +00:00
|
|
|
super(biome);
|
|
|
|
this.original = original;
|
2012-11-19 04:27:43 +00:00
|
|
|
}
|
2016-03-24 08:44:52 +00:00
|
|
|
|
|
|
|
public IBlockState getOriginal()
|
|
|
|
{
|
|
|
|
return original;
|
|
|
|
}
|
|
|
|
|
|
|
|
public IBlockState getReplacement()
|
|
|
|
{
|
|
|
|
return replacement;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setReplacement(IBlockState replacement)
|
|
|
|
{
|
|
|
|
this.replacement = replacement;
|
|
|
|
}
|
2012-11-19 04:27:43 +00:00
|
|
|
}
|
2013-12-21 08:10:35 +00:00
|
|
|
|
2012-11-19 04:27:43 +00:00
|
|
|
/**
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
* This event is fired when a biome is queried for its grass color.
|
2012-11-19 04:27:43 +00:00
|
|
|
*/
|
2012-11-20 00:30:04 +00:00
|
|
|
public static class GetGrassColor extends BiomeColor
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
2016-05-18 10:29:10 +00:00
|
|
|
public GetGrassColor(Biome biome, int original)
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
|
|
|
super(biome, original);
|
|
|
|
}
|
|
|
|
}
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
|
2012-11-19 04:27:43 +00:00
|
|
|
/**
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
* This event is fired when a biome is queried for its grass color.
|
2012-11-19 04:27:43 +00:00
|
|
|
*/
|
2012-11-20 00:30:04 +00:00
|
|
|
public static class GetFoliageColor extends BiomeColor
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
2016-05-18 10:29:10 +00:00
|
|
|
public GetFoliageColor(Biome biome, int original)
|
2012-11-20 00:30:04 +00:00
|
|
|
{
|
|
|
|
super(biome, original);
|
|
|
|
}
|
|
|
|
}
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
|
2012-11-20 00:30:04 +00:00
|
|
|
/**
|
Initial update to 1.8, Super beta. Most rendering related hooks are out due to major changes in 1.8.
Some notes:
Almost all int x, int y, int z parameters have been changed to BlockPos class
ForgeDirection has been removed, replaced by net.minecraft.util.EnumFacing.
All FML classes have moved from packet cpw.mods.fml to net.minecraftforge.fml
Fluid Rendering has been disabled for the time being, to be re-evaulated and a test mod created for it.
Minecraft now uses a Model based system for rendering blocks and Items. The intention is to expand the model format to better suit modder's needed once it is evaulated.
As such, The model loaders from Forge have been removed, to be replaced by expanding vanilla's model format.
Metadata has been extracted out in Minecraft to IBlockState, which holds a list of properties instead of magic number metadata. DO NOT listen to the fearmongering, you can do EVERYTHING with block states you could previously with metadata.
Stencil Bits are disabled entirely by for the main Display, Modders must enable and recreate the FrameBuffer if they wish to use Stencil Bits.
2014-11-26 03:56:35 +00:00
|
|
|
* This event is fired when a biome is queried for its water color.
|
2012-11-20 00:30:04 +00:00
|
|
|
*/
|
|
|
|
public static class GetWaterColor extends BiomeColor
|
|
|
|
{
|
2016-05-18 10:29:10 +00:00
|
|
|
public GetWaterColor(Biome biome, int original)
|
2012-11-19 04:27:43 +00:00
|
|
|
{
|
|
|
|
super(biome, original);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|