File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed 
src/main/java/fr/bastoup/bperipherals/peripherals Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ public CompoundNBT serializeNBT() {
128128return  nbt ;
129129}
130130
131- 
131+ 
132132@ Override 
133133public  void  tick () {
134134if  (this .getLevel () == null )
Original file line number Diff line number Diff line change 1010import  javax .annotation .Nonnull ;
1111import  javax .annotation .Nullable ;
1212import  java .nio .ByteBuffer ;
13+ import  java .util .Optional ;
1314
1415public  class  PeripheralMagCardReader  extends  BPeripheral  {
1516
@@ -36,11 +37,11 @@ public boolean equals(@Nullable IPeripheral other) {
3637 }
3738
3839 @ LuaFunction 
39-  public  final  void  write (ByteBuffer  bytes , String  label ) throws  LuaException  {
40+  public  final  void  write (ByteBuffer  bytes , Optional < String >  label ) throws  LuaException  {
4041 byte [] data  = Util .getByteBufferArray (bytes );
4142 if  (data .length  > Config .MAX_MAG_CARD_DATA )
4243 throw  new  LuaException ("You can't put more than "  + Config .MAX_MAG_CARD_DATA  + " characters in a mag card." );
43-  getTile ().writeCard (data , label );
44+  getTile ().writeCard (data , label . orElse ( null ) );
4445 }
4546
4647 @ LuaFunction 
                                 You can’t perform that action at this time. 
               
                  
0 commit comments