-
Notifications
You must be signed in to change notification settings - Fork 81
22w42a (crafter) and 22w43a (copper & tuff additions) #1657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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: 12 additions & 0 deletions
12
chunky/src/java/se/llbit/chunky/block/SolidNonOpaqueBlock.java
This file contains hidden or 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 @@ | ||
| package se.llbit.chunky.block; | ||
|
|
||
| import se.llbit.chunky.resources.Texture; | ||
|
|
||
| public class SolidNonOpaqueBlock extends Block { | ||
|
|
||
| public SolidNonOpaqueBlock(String name, Texture texture) { | ||
| super(name, texture); | ||
| solid = true; | ||
| opaque = false; | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
chunky/src/java/se/llbit/chunky/block/minecraft/CopperBulb.java
This file contains hidden or 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,37 @@ | ||
| /* | ||
| * Copyright (c) 2023 Chunky contributors | ||
| * | ||
| * This file is part of Chunky. | ||
| * | ||
| * Chunky is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * Chunky is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with Chunky. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package se.llbit.chunky.block.minecraft; | ||
|
|
||
| import se.llbit.chunky.block.MinecraftBlock; | ||
| import se.llbit.chunky.resources.Texture; | ||
|
|
||
| public class CopperBulb extends MinecraftBlock { | ||
| public final boolean isLit; | ||
JustinTimeCuber marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public final boolean isPowered; | ||
|
|
||
| public CopperBulb(String name, boolean lit, boolean powered, Texture lp, Texture lnp, Texture nlp, Texture nlnp) { | ||
| super(name, lit ? (powered ? lp : lnp) : (powered ? nlp : nlnp)); | ||
| this.isLit = lit; | ||
| this.isPowered = powered; | ||
| } | ||
|
|
||
| @Override public String description() { | ||
| return "lit=" + isLit + ", powered=" + isPowered; | ||
| } | ||
| } | ||
100 changes: 100 additions & 0 deletions
100
chunky/src/java/se/llbit/chunky/block/minecraft/Crafter.java
This file contains hidden or 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,100 @@ | ||
| /* | ||
| * Copyeast (c) 2023 Chunky contributors | ||
| * | ||
| * This file is part of Chunky. | ||
| * | ||
| * Chunky is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * Chunky is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with Chunky. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package se.llbit.chunky.block.minecraft; | ||
|
|
||
| import se.llbit.chunky.block.AbstractModelBlock; | ||
| import se.llbit.chunky.model.RotatableBlockModel; | ||
| import se.llbit.chunky.resources.Texture; | ||
| import se.llbit.math.Quad; | ||
| import se.llbit.math.Vector3; | ||
| import se.llbit.math.Vector4; | ||
|
|
||
| public class Crafter extends AbstractModelBlock { | ||
|
|
||
| private final String description; | ||
|
|
||
| public Crafter(String name, String orientation, boolean crafting, boolean triggered, Texture north, Texture northCrafting, Texture east, Texture eastCrafting, Texture eastTriggered, | ||
| Texture south, Texture southTriggered, Texture west, Texture westCrafting, Texture westTriggered, Texture top, Texture topCrafting, Texture topTriggered, Texture bottom) { | ||
| super(name, north); | ||
| this.description = "orientation=" + orientation + ", crafting=" + crafting + ", triggered=" + triggered; | ||
| RotatableBlockModel m = new RotatableBlockModel(crafting ? northCrafting : north, | ||
| crafting ? eastCrafting : (triggered ? eastTriggered : east), | ||
| triggered ? southTriggered : south, | ||
| crafting ? westCrafting : (triggered ? westTriggered : west), | ||
| crafting ? topCrafting : (triggered ? topTriggered : top), | ||
| bottom); | ||
| // Fix top quad | ||
| m.setFaceQuad(4, new Quad( | ||
| new Vector3(1, 1, 0), | ||
| new Vector3(0, 1, 0), | ||
| new Vector3(1, 1, 1), | ||
| new Vector4(1, 0, 0, 1))); // texture is mirrored for some reason?? | ||
| switch(orientation) { | ||
| case "north_up": | ||
| break; | ||
| case "east_up": | ||
| m.rotateY(1); | ||
| break; | ||
| case "south_up": | ||
| m.rotateY(2); | ||
| break; | ||
| case "west_up": | ||
| m.rotateY(-1); | ||
| break; | ||
| case "up_south": | ||
| m.rotateX(1); | ||
| break; | ||
| case "up_west": | ||
| m.rotateX(1); | ||
| m.rotateY(1); | ||
| break; | ||
| case "up_north": | ||
| m.rotateX(1); | ||
| m.rotateY(2); | ||
| break; | ||
| case "up_east": | ||
| m.rotateX(1); | ||
| m.rotateY(-1); | ||
| break; | ||
| case "down_north": | ||
| m.rotateX(-1); | ||
| break; | ||
| case "down_east": | ||
| m.rotateX(-1); | ||
| m.rotateY(1); | ||
| break; | ||
| case "down_south": | ||
| m.rotateX(-1); | ||
| m.rotateY(2); | ||
| break; | ||
| case "down_west": | ||
| m.rotateX(-1); | ||
| m.rotateY(-1); | ||
| break; | ||
| } | ||
| this.model = m; | ||
| opaque = true; | ||
| solid = true; | ||
| } | ||
|
|
||
| @Override | ||
| public String description() { | ||
| return description; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.