forked from Garten/sourcecraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
98 changed files
with
751 additions
and
1,091 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/source/MaterialCodeGenerator.java=UTF-8 | ||
encoding//src/source/MaterialLegacy.java=UTF-8 | ||
encoding//src/minecraft/MaterialLegacy.java=UTF-8 |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package basic; | ||
|
||
import periphery.Place; | ||
|
||
public interface RunnableWith<Argument> { | ||
|
||
public static final RunnableWith<String> INSTANCE = argument -> { | ||
// do nothing | ||
}; | ||
|
||
public static final RunnableWith<Place> INSTANCE_PLACE = argument -> { | ||
// do nothing | ||
}; | ||
|
||
public abstract void run(Argument argument); | ||
} | ||
//package basic; | ||
// | ||
//import periphery.Place; | ||
// | ||
//public interface RunnableWith<Argument> { | ||
// | ||
// public static final RunnableWith<String> INSTANCE = argument -> { | ||
// // do nothing | ||
// }; | ||
// | ||
// public static final RunnableWith<Place> INSTANCE_PLACE = argument -> { | ||
// // do nothing | ||
// }; | ||
// | ||
// public abstract void run(Argument argument); | ||
//} |
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
2 changes: 1 addition & 1 deletion
2
src/minecraft/ConvertingReport.java → src/converter/ConvertingReport.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package minecraft; | ||
package converter; | ||
|
||
public class ConvertingReport { | ||
|
||
|
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,44 @@ | ||
package converter.actions; | ||
|
||
import basic.Tuple; | ||
import converter.actions.actions.NoAction; | ||
import converter.mapper.Mapper; | ||
import minecraft.Block; | ||
import minecraft.Position; | ||
|
||
public class ActionManager { | ||
|
||
protected BlockMap<Action> actions; | ||
|
||
public ActionManager(Action fallBack) { | ||
this.actions = new BlockMap<Action>().setDefault(fallBack); | ||
} | ||
|
||
public ActionManager setAction(Block block, Action addable) { | ||
this.actions.put(block, addable); | ||
return this; | ||
} | ||
|
||
public ActionManager setActions(Iterable<Tuple<Block, Action>> actions) { | ||
actions.forEach(a -> this.setAction(a.getFirst(), a.getSecond())); | ||
return this; | ||
} | ||
|
||
public Action getAction(Block block) { | ||
return this.actions.getFallBackToSuffix(block); | ||
} | ||
|
||
public void add(Mapper context, Position position, Block block) { | ||
Action action; | ||
if (block == null) { | ||
action = NoAction.INSTANCE; | ||
} else { | ||
action = this.getAction(block); | ||
} | ||
action.add(context, position, block); | ||
} | ||
|
||
public void print() { | ||
actions.print(); | ||
} | ||
} |
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.