Created
November 23, 2014 16:21
-
-
Save cmoore/144d2f09bb584d90d8dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void show_tags(CompoundTag ctag, Player player) { | |
ctag.keySet().forEach(new Consumer<String>() { | |
@Override | |
public void accept(String s) { | |
player.notice("S: " + s + " V: " + ctag.get(s).toString()); | |
}}); | |
} | |
} | |
// And later... | |
TileEntity tile_entity = the_block.getTileEntity(); | |
CompoundTag ctag = tile_entity.getDataTag(); | |
ctag.put("CustomName", "FARTAHONTAS"); | |
ctag.put("CustomNameVisible", true); | |
tile_entity.writeToTag(ctag); | |
tile_entity.update(); | |
the_block.update(); | |
ctag = the_block.getTileEntity().getDataTag(); | |
player.notice("After Write"); | |
show_tags(ctag, player); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment