mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Update to 1.17
Update to Official classnames Patchwork Make the game compile and run Merge in the new HUD overlay API Merge in the new render properties API PEEL Use Gradle 7.2 snapshot to fix eclipse integration bug in 7.1, Would use 7.0 but FG needs 7.1 for some reason. New FML installer Update to 1.17.1 Co-authored-by: LexManos <[email protected]> Co-authored-by: SizableShrimp <[email protected]> Co-authored-by: cpw <[email protected]> Co-authored-by: Curle <[email protected]> Co-authored-by: Unnoen <[email protected]> Co-authored-by: covers1624 <[email protected]> Co-authored-by: DaemonUmbra <[email protected]> Co-authored-by: gigaherz <[email protected]> Signed-off-by: SizableShrimp <[email protected]>
This commit is contained in:
1 parent
064ae6961b
commit
be5446b91c
1990 files changed
+35661
-37544
No files matched your search
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
*
|
||||
* 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.client;
|
||||
|
||||
import com.mojang.math.Vector3d;
|
||||
import net.minecraft.client.particle.ParticleEngine;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.item.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
|
||||
public interface IBlockRenderProperties
|
||||
{
|
||||
IBlockRenderProperties DUMMY = new IBlockRenderProperties()
|
||||
{
|
||||
};
|
||||
|
||||
/**
|
||||
* Spawn a digging particle effect in the Level, this is a wrapper
|
||||
* around EffectRenderer.addBlockHitEffects to allow the block more
|
||||
* control over the particles. Useful when you have entirely different
|
||||
* texture sheets for different sides/locations in the Level.
|
||||
*
|
||||
* @param state The current state
|
||||
* @param Level The current Level
|
||||
* @param target The target the player is looking at {x/y/z/side/sub}
|
||||
* @param manager A reference to the current particle manager.
|
||||
* @return True to prevent vanilla digging particles form spawning.
|
||||
*/
|
||||
default boolean addHitEffects(BlockState state, Level Level, HitResult target, ParticleEngine manager)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawn particles for when the block is destroyed. Due to the nature
|
||||
* of how this is invoked, the x/y/z locations are not always guaranteed
|
||||
* to host your block. So be sure to do proper sanity checks before assuming
|
||||
* that the location is this block.
|
||||
*
|
||||
* @param Level The current Level
|
||||
* @param pos Position to spawn the particle
|
||||
* @param manager A reference to the current particle manager.
|
||||
* @return True to prevent vanilla break particles from spawning.
|
||||
*/
|
||||
default boolean addDestroyEffects(BlockState state, Level Level, BlockPos pos, ParticleEngine manager)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* NOT CURRENTLY IMPLEMENTED
|
||||
* <p>
|
||||
* Use this to change the fog color used when the entity is "inside" a material.
|
||||
* Vec3d is used here as "r/g/b" 0 - 1 values.
|
||||
*
|
||||
* @param Level The Level.
|
||||
* @param pos The position at the entity viewport.
|
||||
* @param state The state at the entity viewport.
|
||||
* @param entity the entity
|
||||
* @param originalColor The current fog color, You are not expected to use this, Return as the default if applicable.
|
||||
* @return The new fog color.
|
||||
*/
|
||||
default Vector3d getFogColor(BlockState state, LevelReader Level, BlockPos pos, Entity entity, Vector3d originalColor, float partialTicks)
|
||||
{
|
||||
if (state.getMaterial() == Material.WATER)
|
||||
{
|
||||
float f12 = 0.0F;
|
||||
|
||||
if (entity instanceof LivingEntity)
|
||||
{
|
||||
LivingEntity ent = (LivingEntity) entity;
|
||||
f12 = (float) EnchantmentHelper.getRespiration(ent) * 0.2F;
|
||||
|
||||
if (ent.hasEffect(MobEffects.WATER_BREATHING))
|
||||
{
|
||||
f12 = f12 * 0.3F + 0.6F;
|
||||
}
|
||||
}
|
||||
return new Vector3d(0.02F + f12, 0.02F + f12, 0.2F + f12);
|
||||
}
|
||||
else if (state.getMaterial() == Material.LAVA)
|
||||
{
|
||||
return new Vector3d(0.6F, 0.1F, 0.0F);
|
||||
}
|
||||
return originalColor;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user