
net.minecraft.server.BlockHugeMushroom Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package net.minecraft.server;
import java.util.Random;
public class BlockHugeMushroom extends Block {
public static final BlockStateEnum VARIANT = BlockStateEnum.of("variant", EnumHugeMushroomVariant.class);
private final Block b;
public BlockHugeMushroom(Material material, MaterialMapColor materialmapcolor, Block block) {
super(material, materialmapcolor);
this.j(this.blockStateList.getBlockData().set(BlockHugeMushroom.VARIANT, EnumHugeMushroomVariant.ALL_OUTSIDE));
this.b = block;
}
public int a(Random random) {
return Math.max(0, random.nextInt(10) - 7);
}
public MaterialMapColor g(IBlockData iblockdata) {
switch (SyntheticClass_1.a[iblockdata.get(BlockHugeMushroom.VARIANT).ordinal()]) {
case 1:
return MaterialMapColor.e;
case 2:
case 3:
return MaterialMapColor.d;
default:
return super.g(iblockdata);
}
}
public Item getDropType(IBlockData iblockdata, Random random, int i) {
return Item.getItemOf(this.b);
}
public IBlockData getPlacedState(World world, BlockPosition blockposition, EnumDirection enumdirection, float f, float f1, float f2, int i, EntityLiving entityliving) {
return this.getBlockData();
}
public IBlockData fromLegacyData(int i) {
return this.getBlockData().set(BlockHugeMushroom.VARIANT, EnumHugeMushroomVariant.a(i));
}
public int toLegacyData(IBlockData iblockdata) {
return iblockdata.get(BlockHugeMushroom.VARIANT).a();
}
protected BlockStateList getStateList() {
return new BlockStateList(this, BlockHugeMushroom.VARIANT);
}
public enum EnumHugeMushroomVariant implements INamable {
NORTH_WEST(1, "north_west"), NORTH(2, "north"), NORTH_EAST(3, "north_east"), WEST(4, "west"), CENTER(5, "center"), EAST(6, "east"), SOUTH_WEST(7, "south_west"), SOUTH(8, "south"), SOUTH_EAST(9, "south_east"), STEM(10, "stem"), ALL_INSIDE(0, "all_inside"), ALL_OUTSIDE(14, "all_outside"), ALL_STEM(15, "all_stem");
private static final EnumHugeMushroomVariant[] n = new EnumHugeMushroomVariant[16];
static {
EnumHugeMushroomVariant[] ablockhugemushroom_enumhugemushroomvariant = values();
int i = ablockhugemushroom_enumhugemushroomvariant.length;
for (EnumHugeMushroomVariant variant : ablockhugemushroom_enumhugemushroomvariant) {
EnumHugeMushroomVariant.n[variant.a()] = variant;
}
}
private final int o;
private final String p;
EnumHugeMushroomVariant(int i, String s) {
this.o = i;
this.p = s;
}
public static EnumHugeMushroomVariant a(int i) {
if (i < 0 || i >= EnumHugeMushroomVariant.n.length) {
i = 0;
}
EnumHugeMushroomVariant blockhugemushroom_enumhugemushroomvariant = EnumHugeMushroomVariant.n[i];
return blockhugemushroom_enumhugemushroomvariant == null ? EnumHugeMushroomVariant.n[0] : blockhugemushroom_enumhugemushroomvariant;
}
public int a() {
return this.o;
}
public String toString() {
return this.p;
}
public String getName() {
return this.p;
}
}
static class SyntheticClass_1 {
static final int[] a = new int[EnumHugeMushroomVariant.values().length];
static {
try {
SyntheticClass_1.a[EnumHugeMushroomVariant.ALL_STEM.ordinal()] = 1;
} catch (NoSuchFieldError ignored) {
}
try {
SyntheticClass_1.a[EnumHugeMushroomVariant.ALL_INSIDE.ordinal()] = 2;
} catch (NoSuchFieldError ignored) {
}
try {
SyntheticClass_1.a[EnumHugeMushroomVariant.STEM.ordinal()] = 3;
} catch (NoSuchFieldError ignored) {
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy