-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from StellarWitch7/main
A very messy, early implementation of a bangboo registry
- Loading branch information
Showing
81 changed files
with
622 additions
and
902 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
4 changes: 0 additions & 4 deletions
4
src/client/java/world/vanillyn/render/Screen/Bangboo/FixBangboo.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/client/java/world/vanillyn/render/Screen/Bangboo/WishBangboo.java
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/client/java/world/vanillyn/render/Screen/Entity/Handler.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/client/java/world/vanillyn/render/Screen/TestScreen.java
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...yn/render/Model/Bangboo/BangbooModel.java → ...d/vanillyn/render/model/BangbooModel.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
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
40 changes: 40 additions & 0 deletions
40
src/client/java/world/vanillyn/render/screen/TestScreen.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,40 @@ | ||
package world.vanillyn.render.screen; | ||
|
||
import io.wispforest.owo.ui.base.BaseUIModelScreen; | ||
import io.wispforest.owo.ui.component.ButtonComponent; | ||
import io.wispforest.owo.ui.component.LabelComponent; | ||
import io.wispforest.owo.ui.container.FlowLayout; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.text.Text; | ||
import world.vanillyn.BangbooMod; | ||
import world.vanillyn.entity.bangboo.Bangboo; | ||
import world.vanillyn.net.BangbooChannel; | ||
|
||
|
||
public class TestScreen extends BaseUIModelScreen<FlowLayout> { | ||
|
||
Bangboo bangboo; | ||
String bangbooName; | ||
Item core; | ||
PlayerEntity player; | ||
|
||
public TestScreen(Bangboo bangboo, PlayerEntity player) { | ||
|
||
super(FlowLayout.class, DataSource.asset(BangbooMod.id("meow"))); | ||
this.bangboo = bangboo; | ||
this.bangbooName = bangboo.getType().getName().getString(); | ||
this.core = bangboo.type().coreItem(); | ||
this.player = player; | ||
} | ||
|
||
//this is another example on how to read buttons and write stuff into the text! the id's come from the xml | ||
@Override | ||
protected void build(FlowLayout rootComponent) { | ||
rootComponent.childById(ButtonComponent.class, "pickup").onPress(button -> { | ||
BangbooChannel.SCREEN_CHANNEL.clientHandle().send(new BangbooChannel.DropBangboo(bangboo.getUuid())); | ||
close(); | ||
}); | ||
rootComponent.childById(LabelComponent.class, "hp").text(Text.of(String.valueOf(bangboo.getMaxHealth()))); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/client/java/world/vanillyn/render/screen/bangboo/FixBangboo.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,4 @@ | ||
package world.vanillyn.render.screen.bangboo; | ||
|
||
public class FixBangboo { | ||
} |
2 changes: 1 addition & 1 deletion
2
.../render/Screen/Bangboo/ManageBangboo.java → .../render/screen/bangboo/ManageBangboo.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
4 changes: 4 additions & 0 deletions
4
src/client/java/world/vanillyn/render/screen/bangboo/WishBangboo.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,4 @@ | ||
package world.vanillyn.render.screen.bangboo; | ||
|
||
public class WishBangboo { | ||
} |
20 changes: 20 additions & 0 deletions
20
src/client/java/world/vanillyn/render/screen/entity/Handler.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,20 @@ | ||
package world.vanillyn.render.screen.entity; | ||
|
||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
import world.vanillyn.BangbooMod; | ||
import world.vanillyn.entity.bangboo.Bangboo; | ||
import world.vanillyn.render.screen.TestScreen; | ||
|
||
public class Handler { | ||
// previously, if the entity wasn't Bangboo, it'd throw a cast exception in the usage of this method | ||
// fixed so that you don't run into that -- Aurora | ||
public static void handleEntityInteraction(PlayerEntity player, Entity entity) { | ||
if (player.isSneaking() && entity instanceof Bangboo bangboo) { | ||
//lazy example of me sending data over. not pretty but it works! | ||
|
||
MinecraftClient.getInstance().setScreen(new TestScreen(bangboo, player)); | ||
} | ||
} | ||
} |
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.