Skip to content

Commit

Permalink
Rendering and item inserting/extracting bugs partially fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lilypuree committed Jul 19, 2020
1 parent 47f4bc9 commit 63cadfe
Show file tree
Hide file tree
Showing 53 changed files with 3,466 additions and 528 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish'


version = "${mod_version}"
Expand Down
217 changes: 1 addition & 216 deletions src/generated/resources/.cache/cache

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/main/java/lilypuree/forest_tree/Registration.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.collect.ImmutableMap;
import lilypuree.forest_tree.trees.block.BranchBlock;
import lilypuree.forest_tree.trees.customization.*;
import lilypuree.forest_tree.trees.items.CustomSaplingItem;
import lilypuree.forest_tree.trees.items.GraftingToolItem;
import lilypuree.forest_tree.trees.species.ModSpecies;
import lilypuree.forest_tree.trees.species.Species;
Expand Down Expand Up @@ -131,13 +132,13 @@ public static void forAllBranchEnds(Consumer<BranchBlock> action) {
// public static final RegistryObject<AdvancedSaplingBlock> PINE_SAPLING = BLOCKS.register("fir_sapling", ()->new AdvancedSaplingBlock(new PineTree(), Block.Properties.create(Material.PLANTS).doesNotBlockMovement().tickRandomly().hardnessAndResistance(0f).sound(SoundType.PLANT)));
// public static final RegistryObject<AdvancedSaplingBlock> PLACEBO_SAPLING = BLOCKS.register("sapling", () -> new AdvancedSaplingBlock(new CustomTree(), Block.Properties.create(Material.PLANTS).doesNotBlockMovement().tickRandomly().hardnessAndResistance(0f).sound(SoundType.PLANT)));
public static final RegistryObject<CustomSaplingBlock> CUSTOM_SAPLING = BLOCKS.register("custom_sapling", () -> new CustomSaplingBlock(Block.Properties.create(Material.PLANTS).doesNotBlockMovement().tickRandomly().hardnessAndResistance(0f).sound(SoundType.PLANT)));
public static final RegistryObject<Item> CUSTOM_SAPLING_ITEM = ITEMS.register("custom_sapling", () -> new BlockItem(CUSTOM_SAPLING.get(), new Item.Properties().group(ITEM_GROUP)));
public static final RegistryObject<Item> CUSTOM_SAPLING_ITEM = ITEMS.register("custom_sapling", () -> new CustomSaplingItem(CUSTOM_SAPLING.get(), new Item.Properties().group(ITEM_GROUP)));
public static final RegistryObject<TileEntityType<CustomSaplingTile>> CUSTOM_SAPLING_TILE = TILE_ENTITIES.register("custom_sapling", () -> TileEntityType.Builder.create(CustomSaplingTile::new, CUSTOM_SAPLING.get()).build(null));

public static final RegistryObject<Block> TREE_DESIGNER_BLOCK = BLOCKS.register("tree_designer", () -> new TreeDesignerBlock(Block.Properties.create(Material.EARTH)));
public static final RegistryObject<Item> TREE_DESIGNER_ITEM = ITEMS.register("tree_designer", () -> new BlockItem(TREE_DESIGNER_BLOCK.get(), new Item.Properties().group(ITEM_GROUP)));
public static final RegistryObject<TileEntityType<TreeDesignerTile>> TREE_DESIGNER_TILE = TILE_ENTITIES.register("tree_designer", () -> TileEntityType.Builder.create(TreeDesignerTile::new, TREE_DESIGNER_BLOCK.get()).build(null));
public static final RegistryObject<ContainerType<TreeDesignerContainer>> TREE_DESIGNER_CONTAINER = CONTAINERS.register("tree_designer", () -> IForgeContainerType.create((TreeDesignerContainer::create)));
public static final RegistryObject<ContainerType<TreeDesignerContainer>> TREE_DESIGNER_CONTAINER = CONTAINERS.register("tree_designer", () -> IForgeContainerType.create((TreeDesignerContainer::getClientContainer)));

// public static final ImmutableMap<String, RegistryObject<Block>> TREE_BLOCKS;
// public static final ImmutableMap<String, RegistryObject<Item>> TREE_BLOCK_ITEMS;
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/lilypuree/forest_tree/client/HologramRenderType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package lilypuree.forest_tree.client;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.renderer.RenderState;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.renderer.vertex.VertexFormat;
import org.lwjgl.opengl.GL14C;

import static org.lwjgl.opengl.GL14C.GL_FUNC_ADD;

public class HologramRenderType extends RenderType {

public HologramRenderType(String nameIn, VertexFormat vertexFormatIn, int drawModeIn, int bufferSizeIn, boolean useDelegateIn, boolean needsSortingIn, Runnable setupTaskIn, Runnable clearTaskIn) {
super(nameIn, vertexFormatIn, drawModeIn, bufferSizeIn, useDelegateIn, needsSortingIn, setupTaskIn, clearTaskIn);
}

public static final RenderState.TransparencyState HOLOGRAM_TRANSPARENCY = new RenderState.TransparencyState("hologram_transparency", ()->{
RenderSystem.enableBlend();
RenderSystem.blendColor(77/256.0f, 154/256.0f,128/256.0f,1.0f);
RenderSystem.blendEquation(GL_FUNC_ADD);
RenderSystem.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.CONSTANT_COLOR);
}, () -> {
RenderSystem.disableBlend();
RenderSystem.defaultBlendFunc();
});

public static final RenderType HOLOGRAM = makeType("hologram", DefaultVertexFormats.BLOCK, 7, 256, true, false,
RenderType.State.getBuilder().shadeModel(RenderState.SHADE_DISABLED).lightmap(RenderState.LIGHTMAP_DISABLED).texture(RenderState.BLOCK_SHEET).transparency(HOLOGRAM_TRANSPARENCY).alpha(RenderState.HALF_ALPHA).build(false));
}
Loading

0 comments on commit 63cadfe

Please sign in to comment.