-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename Coal Generator to Sterling Generator
- Loading branch information
1 parent
21a6877
commit bb39ff4
Showing
25 changed files
with
92 additions
and
71 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
src/main/java/vivatech/api/block/entity/AbstractTieredMachineBlockEntity.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,22 +1,9 @@ | ||
package vivatech.api.block.entity; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.entity.BlockEntityType; | ||
import vivatech.api.block.ITieredBlock; | ||
import vivatech.api.util.BlockTier; | ||
|
||
public abstract class AbstractTieredMachineBlockEntity extends AbstractMachineBlockEntity implements ITieredBlockEntity { | ||
public AbstractTieredMachineBlockEntity(BlockEntityType<?> type) { | ||
super(type); | ||
} | ||
|
||
@Override | ||
public BlockTier getTier() { | ||
Block block = world.getBlockState(pos).getBlock(); | ||
if (block instanceof ITieredBlock) { | ||
return ((ITieredBlock) block).getTier(); | ||
} else { | ||
return BlockTier.MINIMAL; | ||
} | ||
} | ||
} |
16 changes: 15 additions & 1 deletion
16
src/main/java/vivatech/api/block/entity/ITieredBlockEntity.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,7 +1,21 @@ | ||
package vivatech.api.block.entity; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import vivatech.api.block.ITieredBlock; | ||
import vivatech.api.util.BlockTier; | ||
|
||
/** | ||
* WARNING: Only apply on BlockEntity! | ||
*/ | ||
public interface ITieredBlockEntity { | ||
BlockTier getTier(); | ||
default BlockTier getTier() { | ||
BlockEntity self = (BlockEntity) this; | ||
Block block = self.getWorld().getBlockState(self.getPos()).getBlock(); | ||
if (block instanceof ITieredBlock) { | ||
return ((ITieredBlock) block).getTier(); | ||
} else { | ||
return BlockTier.MINIMAL; | ||
} | ||
}; | ||
} |
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
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
12 changes: 0 additions & 12 deletions
12
src/main/resources/assets/vivatech/blockstates/coal_generator.json
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
src/main/resources/assets/vivatech/blockstates/sterling_generator.json
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,12 @@ | ||
{ | ||
"variants": { | ||
"facing=north,active=false": { "model": "vivatech:block/sterling_generator" }, | ||
"facing=east,active=false": { "model": "vivatech:block/sterling_generator", "y": 90 }, | ||
"facing=south,active=false": { "model": "vivatech:block/sterling_generator", "y": 180 }, | ||
"facing=west,active=false": { "model": "vivatech:block/sterling_generator", "y": 270 }, | ||
"facing=north,active=true": { "model": "vivatech:block/sterling_generator_active" }, | ||
"facing=east,active=true": { "model": "vivatech:block/sterling_generator_active", "y": 90 }, | ||
"facing=south,active=true": { "model": "vivatech:block/sterling_generator_active", "y": 180 }, | ||
"facing=west,active=true": { "model": "vivatech:block/sterling_generator_active", "y": 270 } | ||
} | ||
} |
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
6 changes: 0 additions & 6 deletions
6
src/main/resources/assets/vivatech/models/block/coal_generator_active.json
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...vivatech/models/block/coal_generator.json → ...tech/models/block/sterling_generator.json
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,6 +1,6 @@ | ||
{ | ||
"parent": "vivatech:block/normal_machine_chassis", | ||
"textures": { | ||
"front": "vivatech:block/coal_generator_front" | ||
"front": "vivatech:block/sterling_generator_front" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/vivatech/models/block/sterling_generator_active.json
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,6 @@ | ||
{ | ||
"parent": "vivatech:block/sterling_generator", | ||
"textures": { | ||
"front": "vivatech:block/sterling_generator_active_front" | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
src/main/resources/assets/vivatech/models/item/coal_generator.json
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/vivatech/models/item/sterling_generator.json
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,3 @@ | ||
{ | ||
"parent": "vivatech:block/sterling_generator" | ||
} |
File renamed without changes
File renamed without changes
Oops, something went wrong.