mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-14 21:13:54 +00:00
Fixed the bundle being directly used outside of the registry system.
This commit is contained in:
@ -27,16 +27,25 @@ import com.sk89q.worldedit.world.registry.BundledBlockRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ForgeBlockRegistry extends BundledBlockRegistry {
|
||||
|
||||
private Map<Material, ForgeBlockMaterial> materialMap = new HashMap<>();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getName(BlockType blockType) {
|
||||
return Block.REGISTRY.getObject(new ResourceLocation(blockType.getId())).getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockMaterial getMaterial(BlockType blockType) {
|
||||
return materialMap.computeIfAbsent(Block.getBlockFromName(blockType.getId()).getDefaultState().getMaterial(),
|
||||
|
@ -19,8 +19,16 @@
|
||||
|
||||
package com.sk89q.worldedit.forge;
|
||||
|
||||
import com.sk89q.worldedit.world.registry.ItemRegistry;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.registry.BundledItemRegistry;
|
||||
|
||||
public class ForgeItemRegistry implements ItemRegistry {
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ForgeItemRegistry extends BundledItemRegistry {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getName(ItemType itemType) {
|
||||
return super.getName(itemType); // TODO
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user