crwdns138545:0crwdne138545:0

crwdns138549:0crwdne138549:0

crwdns138551:0:javadoc:crwdne138551:0

crwdns138553:0crwdne138553:0

crwdns138555:0:javadoc:crwdne138555:0

crwdns138557:0crwdne138557:0

crwdns138559:0crwdne138559:0

crwdns138561:0crwdne138561:0

crwdns138563:0crwdne138563:0

crwdns138565:0crwdne138565:0

crwdns138567:0crwdne138567:0

crwdns138569:0crwdne138569:0

crwdns138571:0crwdne138571:0

crwdns138573:0crwdne138573:0

crwdns138575:0crwdne138575:0

crwdns138577:0crwdne138577:0

crwdns138579:0crwdne138579:0

crwdns157079:0crwdne157079:0

crwdns157081:0crwdne157081:0

crwdns157083:0crwdne157083:0

crwdns138593:0crwdne138593:0

crwdns138595:0crwdne138595:0

crwdns138597:0:doc:crwdne138597:0

  • crwdns138599:0crwdne138599:0

  • crwdns138601:0crwdne138601:0

  • crwdns138603:0crwdne138603:0

  • crwdns138605:0crwdne138605:0

crwdns157085:0:doc:crwdne157085:0

crwdns138609:0crwdne138609:0

crwdns138611:0:javadoc:crwdne138611:0

  • crwdns138613:0crwdne138613:0

  • crwdns138615:0crwdne138615:0

  • crwdns138617:0crwdne138617:0

crwdns138619:0crwdne138619:0

crwdns138621:0crwdne138621:0

crwdns138623:0crwdne138623:0

import org.spongepowered.api.data.DataHolder;
import org.spongepowered.api.data.DataTransactionResult;
import org.spongepowered.api.data.manipulator.DataManipulator;

public void safeOffer(DataHolder target, DataManipulator data) {
    DataTransactionResult result = target.offer(data);
    if (result.getType() != DataTransactionResult.Type.SUCCESS) {
        target.undo(result);
    }
}