-
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.
- Loading branch information
Showing
144 changed files
with
3,579 additions
and
1,021 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,7 +1,11 @@ | ||
# gradle | ||
|
||
.gradle/ | ||
build/ | ||
build/classes/ | ||
build/generated/ | ||
build/libs/ | ||
build/resources/ | ||
build/tmp/ | ||
out/ | ||
classes/ | ||
|
||
|
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
Binary file not shown.
Binary file not shown.
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
Empty file.
This file was deleted.
Oops, something went wrong.
10 changes: 8 additions & 2 deletions
10
src/main/java/eu/midnightdust/motschen/dishes/DishesClient.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,14 +1,20 @@ | ||
package eu.midnightdust.motschen.dishes; | ||
|
||
import eu.midnightdust.motschen.dishes.entities.client.IceCreamTraderRenderer; | ||
import eu.midnightdust.motschen.dishes.init.CropInit; | ||
import eu.midnightdust.motschen.dishes.init.IceCreamTraderInit; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; | ||
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry; | ||
import net.minecraft.client.render.RenderLayer; | ||
|
||
public class DishesClient implements ClientModInitializer { | ||
|
||
@Override | ||
public void onInitializeClient() { | ||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DishesMain.TomatoBush); | ||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DishesMain.LettuceBush); | ||
EntityRendererRegistry.INSTANCE.register(IceCreamTraderInit.ICE_CREAM_TRADER, (dispatcher, context) -> new IceCreamTraderRenderer(dispatcher)); | ||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),CropInit.TomatoBush); | ||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),CropInit.LettuceBush); | ||
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(),DishesMain.BirthdayCake); | ||
} | ||
} |
149 changes: 105 additions & 44 deletions
149
src/main/java/eu/midnightdust/motschen/dishes/DishesMain.java
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
src/main/java/eu/midnightdust/motschen/dishes/LootModifier.java
This file was deleted.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
src/main/java/eu/midnightdust/motschen/dishes/block/Cake.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,62 @@ | ||
package eu.midnightdust.motschen.dishes.block; | ||
|
||
import eu.midnightdust.motschen.dishes.block.blockentity.BirthdayCakeBlockEntity; | ||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; | ||
import net.minecraft.block.*; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.item.ItemPlacementContext; | ||
import net.minecraft.state.StateManager; | ||
import net.minecraft.state.property.Properties; | ||
import net.minecraft.world.BlockView; | ||
|
||
import java.util.function.ToIntFunction; | ||
|
||
public class Cake extends CakeBlock implements BlockEntityProvider { | ||
|
||
public Cake() { | ||
super(FabricBlockSettings.copy(Blocks.CAKE).lightLevel(createLightLevelFromBlockState(15))); | ||
this.setDefaultState(this.stateManager.getDefaultState().with(BITES, 0)); | ||
} | ||
|
||
@Override | ||
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) { | ||
return super.getPlacementState(itemPlacementContext) | ||
.with(BITES, 0); | ||
} | ||
|
||
@Override | ||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { | ||
builder.add(BITES); | ||
} | ||
|
||
@Override | ||
public BlockEntity createBlockEntity(BlockView world) { | ||
return new BirthdayCakeBlockEntity(); | ||
} | ||
|
||
private static ToIntFunction<BlockState> createLightLevelFromBlockState(int litLevel) { | ||
return (blockState) -> { | ||
if (blockState.get(Properties.BITES) == 0) { | ||
return 15; | ||
} | ||
if (blockState.get(Properties.BITES) == 1) { | ||
return 14; | ||
} | ||
else if (blockState.get(Properties.BITES) == 2) { | ||
return 13; | ||
} | ||
else if (blockState.get(Properties.BITES) == 3) { | ||
return 13; | ||
} | ||
else if (blockState.get(Properties.BITES) == 4) { | ||
return 12; | ||
} | ||
else if (blockState.get(Properties.BITES) == 5) { | ||
return 12; | ||
} | ||
else { | ||
return 11; | ||
} | ||
}; | ||
} | ||
} |
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
src/main/java/eu/midnightdust/motschen/dishes/block/Lettuce.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 eu.midnightdust.motschen.dishes.block; | ||
|
||
import eu.midnightdust.motschen.dishes.init.CropInit; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; | ||
import net.minecraft.block.Blocks; | ||
import net.minecraft.block.CropBlock; | ||
import net.minecraft.item.ItemConvertible; | ||
|
||
public class Lettuce extends CropBlock { | ||
|
||
public Lettuce() { | ||
super(FabricBlockSettings.copy(Blocks.CARROTS)); | ||
} | ||
|
||
@Override | ||
@Environment(EnvType.CLIENT) | ||
protected ItemConvertible getSeedsItem() { | ||
return CropInit.LettuceBush; | ||
} | ||
} | ||
|
Oops, something went wrong.