aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/level/block/WitherRoseBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/level/block/WitherRoseBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/level/block/WitherRoseBlock.java.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/level/block/WitherRoseBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/level/block/WitherRoseBlock.java.patch
new file mode 100644
index 0000000000..347e9a53de
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/level/block/WitherRoseBlock.java.patch
@@ -0,0 +1,100 @@
+--- a/net/minecraft/world/level/block/WitherRoseBlock.java
++++ b/net/minecraft/world/level/block/WitherRoseBlock.java
+@@ -2,7 +2,6 @@
+
+ import com.mojang.serialization.MapCodec;
+ import com.mojang.serialization.codecs.RecordCodecBuilder;
+-import com.mojang.serialization.codecs.RecordCodecBuilder.Instance;
+ import java.util.List;
+ import net.minecraft.core.BlockPos;
+ import net.minecraft.core.particles.ParticleTypes;
+@@ -16,62 +15,61 @@
+ import net.minecraft.world.level.BlockGetter;
+ import net.minecraft.world.level.Level;
+ import net.minecraft.world.level.block.state.BlockBehaviour;
+-import net.minecraft.world.level.block.state.BlockState;
++import net.minecraft.world.level.block.state.IBlockData;
+ import net.minecraft.world.phys.Vec3;
+ import net.minecraft.world.phys.shapes.CollisionContext;
+ import net.minecraft.world.phys.shapes.VoxelShape;
+
+ public class WitherRoseBlock extends FlowerBlock {
+- public static final MapCodec<WitherRoseBlock> CODEC = RecordCodecBuilder.mapCodec(
+- instance -> instance.group(EFFECTS_FIELD.forGetter(FlowerBlock::getSuspiciousEffects), propertiesCodec()).apply(instance, WitherRoseBlock::new)
+- );
+
++ public static final MapCodec<WitherRoseBlock> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
++ return instance.group(WitherRoseBlock.EFFECTS_FIELD.forGetter(FlowerBlock::getSuspiciousEffects), propertiesCodec()).apply(instance, WitherRoseBlock::new);
++ });
++
+ @Override
+ public MapCodec<WitherRoseBlock> codec() {
+- return CODEC;
++ return WitherRoseBlock.CODEC;
+ }
+
+- public WitherRoseBlock(MobEffect mobEffect, int i, BlockBehaviour.Properties properties) {
+- this(makeEffectList(mobEffect, i), properties);
++ public WitherRoseBlock(MobEffect suspiciousStewEffect, int effectDuration, BlockBehaviour.Properties properties) {
++ this(makeEffectList(suspiciousStewEffect, effectDuration), properties);
+ }
+
+- public WitherRoseBlock(List<SuspiciousEffectHolder.EffectEntry> list, BlockBehaviour.Properties properties) {
+- super(list, properties);
++ public WitherRoseBlock(List<SuspiciousEffectHolder.a> list, BlockBehaviour.Properties blockbase_info) {
++ super(list, blockbase_info);
+ }
+
+ @Override
+- protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) {
++ protected boolean mayPlaceOn(IBlockData state, BlockGetter level, BlockPos pos) {
+ return super.mayPlaceOn(state, level, pos) || state.is(Blocks.NETHERRACK) || state.is(Blocks.SOUL_SAND) || state.is(Blocks.SOUL_SOIL);
+ }
+
+ @Override
+- public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
+- VoxelShape shape = this.getShape(state, level, pos, CollisionContext.empty());
+- Vec3 center = shape.bounds().getCenter();
+- double d = (double)pos.getX() + center.x;
+- double d1 = (double)pos.getZ() + center.z;
++ public void animateTick(IBlockData state, Level level, BlockPos pos, RandomSource random) {
++ VoxelShape voxelshape = this.getShape(state, level, pos, CollisionContext.empty());
++ Vec3 vec3d = voxelshape.bounds().getCenter();
++ double d0 = (double) pos.getX() + vec3d.x;
++ double d1 = (double) pos.getZ() + vec3d.z;
+
+- for (int i = 0; i < 3; i++) {
++ for (int i = 0; i < 3; ++i) {
+ if (random.nextBoolean()) {
+- level.addParticle(
+- ParticleTypes.SMOKE,
+- d + random.nextDouble() / 5.0,
+- (double)pos.getY() + (0.5 - random.nextDouble()),
+- d1 + random.nextDouble() / 5.0,
+- 0.0,
+- 0.0,
+- 0.0
+- );
++ level.addParticle(ParticleTypes.SMOKE, d0 + random.nextDouble() / 5.0D, (double) pos.getY() + (0.5D - random.nextDouble()), d1 + random.nextDouble() / 5.0D, 0.0D, 0.0D, 0.0D);
+ }
+ }
++
+ }
+
+ @Override
+- public void entityInside(BlockState state, Level level, BlockPos pos, Entity entity) {
++ public void entityInside(IBlockData state, Level level, BlockPos pos, Entity entity) {
+ if (!level.isClientSide && level.getDifficulty() != Difficulty.PEACEFUL) {
+- if (entity instanceof LivingEntity livingEntity && !livingEntity.isInvulnerableTo(level.damageSources().wither())) {
+- livingEntity.addEffect(new MobEffectInstance(MobEffects.WITHER, 40));
++ if (entity instanceof LivingEntity) {
++ LivingEntity entityliving = (LivingEntity) entity;
++
++ if (!entityliving.isInvulnerableTo(level.damageSources().wither())) {
++ entityliving.addEffect(new MobEffectInstance(MobEffects.WITHER, 40), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.WITHER_ROSE); // CraftBukkit
++ }
+ }
++
+ }
+ }
+ }