-
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.
- Loading branch information
1 parent
e768f6e
commit 8a69abd
Showing
375 changed files
with
8,126 additions
and
1,033 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
23 changes: 23 additions & 0 deletions
23
Common/src/main/java/net/dakotapride/hibernalHerbs/client/HibernalHerbsClientMod.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,23 @@ | ||
package net.dakotapride.hibernalHerbs.client; | ||
|
||
import net.dakotapride.hibernalHerbs.common.entity.render.ModBoatRenderer; | ||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.dakotapride.hibernalHerbs.common.init.EntityTypeInit; | ||
import net.dakotapride.hibernalHerbs.common.init.enum_registry.WoodTypes; | ||
import net.dakotapride.hibernalHerbs.platform.ClientPlatformHelper; | ||
import net.minecraft.client.renderer.blockentity.SignRenderer; | ||
|
||
public class HibernalHerbsClientMod { | ||
|
||
public static void clientInit() { | ||
ClientPlatformHelper.registerEntityRenderer(EntityTypeInit.MOD_BOAT, context -> new ModBoatRenderer<>(context, false)); | ||
ClientPlatformHelper.registerEntityRenderer(EntityTypeInit.MOD_CHEST_BOAT, context -> new ModBoatRenderer<>(context, true)); | ||
|
||
ClientPlatformHelper.registerBlockEntityRenderer(() -> BlockEntityTypeInit.MOD_SIGN, SignRenderer::new); | ||
ClientPlatformHelper.registerBlockEntityRenderer(() -> BlockEntityTypeInit.MYSTICAL_CAMPFIRE, MysticalCampfireRenderer::new); | ||
} | ||
|
||
public static void addWoodTypes() { | ||
ClientPlatformHelper.addWoodType(WoodTypes.MYQUESTE.getWoodType()); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
Common/src/main/java/net/dakotapride/hibernalHerbs/client/MysticalCampfireRenderer.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,50 @@ | ||
package net.dakotapride.hibernalHerbs.client; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.math.Axis; | ||
import net.dakotapride.hibernalHerbs.common.block.MysticalCampfireBlock; | ||
import net.dakotapride.hibernalHerbs.common.block.MysticalCampfireBlockEntity; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; | ||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; | ||
import net.minecraft.client.renderer.entity.ItemRenderer; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.core.NonNullList; | ||
import net.minecraft.world.item.ItemDisplayContext; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class MysticalCampfireRenderer implements BlockEntityRenderer<MysticalCampfireBlockEntity> { | ||
private static final float SIZE = 0.375F; | ||
private final ItemRenderer itemRenderer; | ||
|
||
public MysticalCampfireRenderer(BlockEntityRendererProvider.Context context) { | ||
this.itemRenderer = context.getItemRenderer(); | ||
} | ||
|
||
public void render(MysticalCampfireBlockEntity campfireBlockEntity, float f, PoseStack poseStack, MultiBufferSource multiBufferSource, int i, int j) { | ||
Direction direction = (Direction)campfireBlockEntity.getBlockState().getValue(MysticalCampfireBlock.FACING); | ||
NonNullList<ItemStack> nonNullList = campfireBlockEntity.getItems(); | ||
int k = (int)campfireBlockEntity.getBlockPos().asLong(); | ||
|
||
for(int l = 0; l < nonNullList.size(); ++l) { | ||
ItemStack itemStack = (ItemStack)nonNullList.get(l); | ||
if (itemStack != ItemStack.EMPTY) { | ||
poseStack.pushPose(); | ||
poseStack.translate(0.5F, 0.44921875F, 0.5F); | ||
Direction direction2 = Direction.from2DDataValue((l + direction.get2DDataValue()) % 4); | ||
float g = -direction2.toYRot(); | ||
poseStack.mulPose(Axis.YP.rotationDegrees(g)); | ||
poseStack.mulPose(Axis.XP.rotationDegrees(90.0F)); | ||
poseStack.translate(-0.3125F, -0.3125F, 0.0F); | ||
poseStack.scale(0.375F, 0.375F, 0.375F); | ||
this.itemRenderer.renderStatic(itemStack, ItemDisplayContext.FIXED, i, j, poseStack, multiBufferSource, campfireBlockEntity.getLevel(), k + l); | ||
poseStack.popPose(); | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
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
21 changes: 21 additions & 0 deletions
21
Common/src/main/java/net/dakotapride/hibernalHerbs/common/block/ModHangingSignBlock.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,21 @@ | ||
package net.dakotapride.hibernalHerbs.common.block; | ||
|
||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.CeilingHangingSignBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.WoodType; | ||
|
||
public class ModHangingSignBlock extends CeilingHangingSignBlock { | ||
|
||
public ModHangingSignBlock(WoodType type, Properties properties) { | ||
super(type, properties); | ||
} | ||
|
||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { | ||
return BlockEntityTypeInit.MOD_HANGING_SIGN.create(pos, state); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...n/src/main/java/net/dakotapride/hibernalHerbs/common/block/ModHangingSignBlockEntity.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,19 @@ | ||
package net.dakotapride.hibernalHerbs.common.block; | ||
|
||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.minecraft.world.level.block.entity.HangingSignBlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ModHangingSignBlockEntity extends HangingSignBlockEntity { | ||
public ModHangingSignBlockEntity(BlockPos pos, BlockState state) { | ||
super(pos, state); | ||
} | ||
|
||
@Override | ||
public @NotNull BlockEntityType<?> getType() { | ||
return BlockEntityTypeInit.MOD_HANGING_SIGN; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Common/src/main/java/net/dakotapride/hibernalHerbs/common/block/ModSignBlock.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,21 @@ | ||
package net.dakotapride.hibernalHerbs.common.block; | ||
|
||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.StandingSignBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.WoodType; | ||
|
||
public class ModSignBlock extends StandingSignBlock { | ||
|
||
public ModSignBlock(WoodType type, Properties properties) { | ||
super(type, properties); | ||
} | ||
|
||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { | ||
return BlockEntityTypeInit.MOD_SIGN.create(pos, state); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
Common/src/main/java/net/dakotapride/hibernalHerbs/common/block/ModSignBlockEntity.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,19 @@ | ||
package net.dakotapride.hibernalHerbs.common.block; | ||
|
||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.entity.BlockEntityType; | ||
import net.minecraft.world.level.block.entity.SignBlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ModSignBlockEntity extends SignBlockEntity { | ||
public ModSignBlockEntity(BlockPos pos, BlockState state) { | ||
super(pos, state); | ||
} | ||
|
||
@Override | ||
public @NotNull BlockEntityType<?> getType() { | ||
return BlockEntityTypeInit.MOD_SIGN; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
Common/src/main/java/net/dakotapride/hibernalHerbs/common/block/ModWallHangingSignBlock.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,21 @@ | ||
package net.dakotapride.hibernalHerbs.common.block; | ||
|
||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.WallHangingSignBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.WoodType; | ||
|
||
public class ModWallHangingSignBlock extends WallHangingSignBlock { | ||
|
||
public ModWallHangingSignBlock(WoodType type, Properties properties) { | ||
super(type, properties); | ||
} | ||
|
||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { | ||
return BlockEntityTypeInit.MOD_HANGING_SIGN.create(pos, state); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
Common/src/main/java/net/dakotapride/hibernalHerbs/common/block/ModWallSignBlock.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,21 @@ | ||
package net.dakotapride.hibernalHerbs.common.block; | ||
|
||
import net.dakotapride.hibernalHerbs.common.init.BlockEntityTypeInit; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.block.WallSignBlock; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.WoodType; | ||
|
||
public class ModWallSignBlock extends WallSignBlock { | ||
|
||
public ModWallSignBlock(WoodType type, Properties properties) { | ||
super(type, properties); | ||
} | ||
|
||
@Override | ||
public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { | ||
return BlockEntityTypeInit.MOD_SIGN.create(pos, state); | ||
} | ||
|
||
} |
Oops, something went wrong.