Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change error reporting to be much more versatile and its now based on…
… ActingPlayer instead of UndoTracker errors, now note lack of chisel, which bit types are missing, even if there are multiple types, and lack of bag space for auto chisel. More interactions now report errors, such as patterns, and tool usage. Auto Chiseling Blocks now reports error if your short on bag space. Fixed a crash when using negative pattern. ( sharing related? )
- Loading branch information
1 parent
6d6e37e
commit 72b26ad
Showing
16 changed files
with
258 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package mod.chiselsandbits.helpers; | ||
|
||
import mod.chiselsandbits.api.APIExceptions.InvalidBitItem; | ||
import mod.chiselsandbits.core.ChiselsAndBits; | ||
|
||
public class BitName | ||
{ | ||
private int state; | ||
|
||
public BitName( | ||
int state ) | ||
{ | ||
this.state = state; | ||
} | ||
|
||
@Override | ||
public boolean equals( | ||
Object obj ) | ||
{ | ||
if ( obj instanceof BitName ) | ||
{ | ||
return this.state == ( (BitName) obj ).state; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return state; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
try | ||
{ | ||
return ChiselsAndBits.getApi().getBitItem( ModUtil.getStateById( state ) ).getDisplayName(); | ||
} | ||
catch ( InvalidBitItem e ) | ||
{ | ||
return "No Such Bit."; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/mod/chiselsandbits/helpers/ChiselErrors.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package mod.chiselsandbits.helpers; | ||
|
||
public enum ChiselErrors | ||
{ | ||
OUT_OF_RANGE( "mod.chiselsandbits.result.out_of_range" ), | ||
NO_BAG_SPACE( "mod.chiselsandbits.result.no_bag_space" ), | ||
HAS_CHANGED( "mod.chiselsandbits.result.has_changed" ), | ||
NO_CHISELS( "mod.chiselsandbits.result.missing_chisels" ), | ||
NO_BITS( "mod.chiselsandbits.result.missing_bits" ), | ||
NOTHING_TO_UNDO( "mod.chiselsandbits.result.nothing_to_undo" ), | ||
NOTHING_TO_REDO( "mod.chiselsandbits.result.nothing_to_redo" ); | ||
|
||
private final String msg; | ||
|
||
private ChiselErrors( | ||
String str ) | ||
{ | ||
msg = str; | ||
} | ||
|
||
public String getLocal( | ||
Object... args ) | ||
{ | ||
return ModUtil.localizeAndInsertVars( msg, args ); | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.