Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-05 11:00:05 +01:00
Use the correct Map<String, Tag> when writing enchantments
Dieser Commit ist enthalten in:
Ursprung
4e91f4e988
Commit
40aa6aca60
@ -117,7 +117,7 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock, ContainerB
|
|||||||
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
|
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
|
||||||
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
||||||
Map<String, Tag> enchantment = new HashMap<String, Tag>();
|
Map<String, Tag> enchantment = new HashMap<String, Tag>();
|
||||||
CompoundTag enchantcompound = new CompoundTag(null, ench);
|
CompoundTag enchantcompound = new CompoundTag(null, enchantment);
|
||||||
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
|
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
|
||||||
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
|
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
|
||||||
list.add(enchantcompound);
|
list.add(enchantcompound);
|
||||||
|
@ -117,7 +117,7 @@ public class DispenserBlock extends BaseBlock implements TileEntityBlock, Contai
|
|||||||
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
|
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
|
||||||
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
||||||
Map<String, Tag> enchantment = new HashMap<String, Tag>();
|
Map<String, Tag> enchantment = new HashMap<String, Tag>();
|
||||||
CompoundTag enchantcompound = new CompoundTag(null, ench);
|
CompoundTag enchantcompound = new CompoundTag(null, enchantment);
|
||||||
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
|
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
|
||||||
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
|
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
|
||||||
list.add(enchantcompound);
|
list.add(enchantcompound);
|
||||||
|
@ -159,7 +159,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe
|
|||||||
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
|
ListTag enchlist = new ListTag("ench", CompoundTag.class, list);
|
||||||
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
for(Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
|
||||||
Map<String, Tag> enchantment = new HashMap<String, Tag>();
|
Map<String, Tag> enchantment = new HashMap<String, Tag>();
|
||||||
CompoundTag enchantcompound = new CompoundTag(null, ench);
|
CompoundTag enchantcompound = new CompoundTag(null, enchantment);
|
||||||
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
|
enchantment.put("id", new ShortTag("id", entry.getKey().shortValue()));
|
||||||
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
|
enchantment.put("lvl", new ShortTag("lvl", entry.getValue().shortValue()));
|
||||||
list.add(enchantcompound);
|
list.add(enchantcompound);
|
||||||
|
@ -32,7 +32,7 @@ public interface TileEntityBlock {
|
|||||||
/**
|
/**
|
||||||
* Return the name of the title entity ID.
|
* Return the name of the title entity ID.
|
||||||
*
|
*
|
||||||
* @return title entity ID
|
* @return tile entity ID
|
||||||
*/
|
*/
|
||||||
public String getTileEntityID();
|
public String getTileEntityID();
|
||||||
|
|
||||||
@ -40,16 +40,16 @@ public interface TileEntityBlock {
|
|||||||
* Store additional tile entity data.
|
* Store additional tile entity data.
|
||||||
*
|
*
|
||||||
* @return map of values
|
* @return map of values
|
||||||
* @throws DataException
|
* @throws DataException When invalid data is encountered
|
||||||
*/
|
*/
|
||||||
public Map<String, Tag> toTileEntityNBT()
|
public Map<String, Tag> toTileEntityNBT()
|
||||||
throws DataException;
|
throws DataException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get additional information from the title entity data.
|
* Get additional information from the tile entity data.
|
||||||
*
|
*
|
||||||
* @param values
|
* @param values map of data
|
||||||
* @throws DataException
|
* @throws DataException When invalid data is encountered
|
||||||
*/
|
*/
|
||||||
public void fromTileEntityNBT(Map<String, Tag> values)
|
public void fromTileEntityNBT(Map<String, Tag> values)
|
||||||
throws DataException;
|
throws DataException;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren