#Check if a block is full
1 messages · Page 1 of 1 (latest)
Not really, I'd like it to exclude things like fences, flowers, tall grass, etc
So my main idea was to first exclude all full blocks
then that looks like exactly what you need
I mean if that won't work with that you could just use an EnumSet
good time complexity
My only issue is wouldn't that make the plugin version dependent? (Well it will work on newer versions, just won't really work on new blocks)
If that's the only way then I am fine
Just trying to look if there's a way to use collision shapes or similar as to make it easier
Not necessarily you could statically initialize the enum set and use reflection
hacky solution but it is a solution
The problem is that with reflection, you'll still need to know which blocks are full
you can manually type out those values as you did with the ones that are in your current version
I don't get it
I'll mock you something quick
ty
lol sorry my internet is like fucking dying atm so its taking a while to create this maven project xD
the 100kbs of pain
Holy
thats what happens when companies have Monopolies
Ye
I realized part way through
you don't even need reflection lol
Material#getMaterial or Material#valueOf and check version value
you can make something like if version > x add these to the set
this is god awful code but
public static final List<Material> MATERIALS;
static {
MATERIALS = new ArrayList<Material>();
// currently these are the only materials in the game
MATERIALS.add(Material.WOOD_SLAB);
MATERIALS.add(Material.GRASS_SLAB);
MATERIALS.add(Material.STONE_SLAB);
// oh a new version got added
// is version > target version?
MATERIALS.add(Material.valueOf("DIRT_SLAB"));
}``` kinda displays how'd you sorta go about it
this works because the api used is from the server jar
so it will have those enums there
Yeah
hope I helped somewhat xD
Yeah
https://minecraft.fandom.com/wiki/Category:Blocks I'll just read from here
actually
I can get all blocks by filtering isItem
then remove those that have some tags
like flower
Yep that'd work really well lol
testing to see if it prints the correct items
LEGACY_WATER, LEGACY_STATIONARY_WATER, LEGACY_LAVA, LEGACY_STATIONARY_LAVA, LEGACY_BED_BLOCK, LEGACY_PISTON_EXTENSION, LEGACY_PISTON_MOVING_PIECE, LEGACY_DOUBLE_STEP, LEGACY_FIRE, LEGACY_REDSTONE_WIRE, LEGACY_CROPS, LEGACY_BURNING_FURNACE, LEGACY_SIGN_POST, LEGACY_WOODEN_DOOR, LEGACY_WALL_SIGN, LEGACY_IRON_DOOR_BLOCK, LEGACY_GLOWING_REDSTONE_ORE, LEGACY_REDSTONE_TORCH_OFF, LEGACY_SUGAR_CANE_BLOCK, LEGACY_PORTAL, LEGACY_CAKE_BLOCK, LEGACY_DIODE_BLOCK_OFF, LEGACY_DIODE_BLOCK_ON, LEGACY_PUMPKIN_STEM, LEGACY_MELON_STEM, LEGACY_NETHER_WARTS, LEGACY_BREWING_STAND, LEGACY_CAULDRON, LEGACY_ENDER_PORTAL, LEGACY_REDSTONE_LAMP_ON, LEGACY_WOOD_DOUBLE_STEP, LEGACY_COCOA, LEGACY_TRIPWIRE, LEGACY_FLOWER_POT, LEGACY_CARROT, LEGACY_POTATO, LEGACY_SKULL, LEGACY_REDSTONE_COMPARATOR_OFF, LEGACY_REDSTONE_COMPARATOR_ON, LEGACY_STANDING_BANNER, LEGACY_WALL_BANNER, LEGACY_DAYLIGHT_DETECTOR_INVERTED, LEGACY_DOUBLE_STONE_SLAB2, LEGACY_SPRUCE_DOOR, LEGACY_BIRCH_DOOR, LEGACY_JUNGLE_DOOR, LEGACY_ACACIA_DOOR, LEGACY_DARK_OAK_DOOR, LEGACY_PURPUR_DOUBLE_SLAB, LEGACY_BEETROOT_BLOCK, LEGACY_END_GATEWAY, LEGACY_FROSTED_ICE
w a t
Lmfao