Deforester

- Added Deforester Model and Item
This commit is contained in:
simibubi 2019-10-30 02:05:26 +01:00
parent 7462cc5f7e
commit a1850ec90b
27 changed files with 378 additions and 11 deletions

View file

@ -8,12 +8,15 @@ import com.simibubi.create.modules.contraptions.WrenchItemRenderer;
import com.simibubi.create.modules.contraptions.relays.VerticalGearboxItem;
import com.simibubi.create.modules.contraptions.relays.belt.BeltItem;
import com.simibubi.create.modules.curiosities.ChromaticCompoundCubeItem;
import com.simibubi.create.modules.curiosities.deforester.DeforesterItem;
import com.simibubi.create.modules.curiosities.deforester.DeforesterItemRenderer;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItemRenderer;
import com.simibubi.create.modules.curiosities.symmetry.SymmetryWandItem;
import com.simibubi.create.modules.curiosities.symmetry.client.SymmetryWandItemRenderer;
import com.simibubi.create.modules.gardens.TreeFertilizerItem;
import com.simibubi.create.modules.logistics.item.CardboardBoxItem;
import com.simibubi.create.modules.logistics.item.FilterItem;
import com.simibubi.create.modules.logistics.management.LogisticalDialItem;
import com.simibubi.create.modules.logistics.management.base.LogisticalControllerBlock.Type;
import com.simibubi.create.modules.logistics.management.base.LogisticalControllerItem;
@ -41,6 +44,8 @@ public enum AllItems {
standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.SYMMETRY_WAND)))),
PLACEMENT_HANDGUN(
new BuilderGunItem(new Properties().setTEISR(() -> () -> renderUsing(AllItemRenderers.BUILDER_GUN)))),
DEFORESTER(new DeforesterItem(
standardItemProperties().setTEISR(() -> () -> renderUsing(AllItemRenderers.DEFORESTER)))),
__MATERIALS__(),
IRON_SHEET(ingredient()),
@ -95,6 +100,7 @@ public enum AllItems {
CARDBOARD_BOX_1416(new CardboardBoxItem(standardItemProperties())),
CARDBOARD_BOX_1410(new CardboardBoxItem(standardItemProperties())),
FILTER(new FilterItem(standardItemProperties())),
LOGISTICAL_DIAL(new LogisticalDialItem(standardItemProperties())),
LOGISTICAL_CONTROLLER_SUPPLY(new LogisticalControllerItem(standardItemProperties(), Type.SUPPLY)),
LOGISTICAL_CONTROLLER_REQUEST(new LogisticalControllerItem(standardItemProperties(), Type.REQUEST)),
@ -163,7 +169,7 @@ public enum AllItems {
// Client
private enum AllItemRenderers {
SYMMETRY_WAND, BUILDER_GUN, WRENCH;
SYMMETRY_WAND, BUILDER_GUN, WRENCH, DEFORESTER;
}
@OnlyIn(Dist.CLIENT)
@ -186,6 +192,8 @@ public enum AllItems {
return new BuilderGunItemRenderer();
case WRENCH:
return new WrenchItemRenderer();
case DEFORESTER:
return new DeforesterItemRenderer();
default:
return null;
}

View file

@ -6,6 +6,7 @@ import java.util.function.Function;
import com.simibubi.create.modules.contraptions.CachedBufferReloader;
import com.simibubi.create.modules.contraptions.WrenchModel;
import com.simibubi.create.modules.contraptions.receivers.EncasedFanParticleHandler;
import com.simibubi.create.modules.curiosities.deforester.DeforesterModel;
import com.simibubi.create.modules.curiosities.partialWindows.WindowInABlockModel;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunModel;
import com.simibubi.create.modules.curiosities.symmetry.client.SymmetryWandModel;
@ -95,6 +96,8 @@ public class CreateClient {
t -> new BuilderGunModel(t).loadPartials(event));
swapModels(modelRegistry, getItemModelLocation(AllItems.WRENCH),
t -> new WrenchModel(t).loadPartials(event));
swapModels(modelRegistry, getItemModelLocation(AllItems.DEFORESTER),
t -> new DeforesterModel(t).loadPartials(event));
swapModels(modelRegistry,
getBlockModelLocation(AllBlocks.WINDOW_IN_A_BLOCK,
BlockModelShapes
@ -115,6 +118,8 @@ public class CreateClient {
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
for (String location : WrenchModel.getCustomModelLocations())
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
for (String location : DeforesterModel.getCustomModelLocations())
ModelLoader.addSpecialModel(new ResourceLocation(Create.ID, "item/" + location));
}
protected static ModelResourceLocation getItemModelLocation(AllItems item) {

View file

@ -17,7 +17,7 @@ public class WrenchModel extends CustomRenderItemBakedModel {
}
public static List<String> getCustomModelLocations() {
return Arrays.asList("gear");
return Arrays.asList("wrench/gear");
}
@Override

View file

@ -0,0 +1,13 @@
package com.simibubi.create.modules.curiosities.deforester;
import com.simibubi.create.modules.curiosities.tools.AllToolTiers;
import net.minecraft.item.AxeItem;
public class DeforesterItem extends AxeItem {
public DeforesterItem(Properties builder) {
super(AllToolTiers.RADIANT, 10.0F, -3.1F, builder);
}
}

View file

@ -0,0 +1,47 @@
package com.simibubi.create.modules.curiosities.deforester;
import com.mojang.blaze3d.platform.GLX;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.ItemStack;
public class DeforesterItemRenderer extends ItemStackTileEntityRenderer {
@Override
public void renderByItem(ItemStack stack) {
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
DeforesterModel mainModel = (DeforesterModel) itemRenderer.getModelWithOverrides(stack);
float worldTime = AnimationTickHolder.getRenderTick();
float lastCoordx = GLX.lastBrightnessX;
float lastCoordy = GLX.lastBrightnessY;
GlStateManager.pushMatrix();
GlStateManager.translatef(0.5F, 0.5F, 0.5F);
itemRenderer.renderItem(stack, mainModel.getBakedModel());
GlStateManager.disableLighting();
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 120);
itemRenderer.renderItem(stack, mainModel.light);
itemRenderer.renderItem(stack, mainModel.blade);
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
GlStateManager.enableLighting();
float angle = worldTime * -10 % 360;
float xOffset = 0;
float zOffset = 0;
GlStateManager.translatef(-xOffset, 0, -zOffset);
GlStateManager.rotated(angle, 0, 1, 0);
GlStateManager.translatef(xOffset, 0, zOffset);
itemRenderer.renderItem(stack, mainModel.gear);
GlStateManager.popMatrix();
}
}

View file

@ -0,0 +1,33 @@
package com.simibubi.create.modules.curiosities.deforester;
import java.util.Arrays;
import java.util.List;
import com.simibubi.create.foundation.block.CustomRenderItemBakedModel;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraftforge.client.event.ModelBakeEvent;
public class DeforesterModel extends CustomRenderItemBakedModel {
public IBakedModel gear;
public IBakedModel light;
public IBakedModel blade;
public DeforesterModel(IBakedModel template) {
super(template);
}
public static List<String> getCustomModelLocations() {
return Arrays.asList("deforester/gear", "deforester/light", "deforester/blade");
}
@Override
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
this.gear = loadCustomModel(event, "deforester/gear");
this.light = loadCustomModel(event, "deforester/light");
this.blade = loadCustomModel(event, "deforester/blade");
return this;
}
}

View file

@ -40,7 +40,7 @@ public class BuilderGunModel extends CustomRenderItemBakedModel {
}
public static List<String> getCustomModelLocations() {
String p = "placement_handgun/";
String p = "blockzapper/";
return Arrays.asList(p + "core", p + "body", p + "amplifier_core", p + "accelerator", p + "gold_body",
p + "gold_scope", p + "gold_amplifier", p + "gold_retriever", p + "gold_accelerator", p + "chorus_body",
p + "chorus_amplifier", p + "chorus_retriever", p + "chorus_accelerator");
@ -54,7 +54,7 @@ public class BuilderGunModel extends CustomRenderItemBakedModel {
@Override
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
String p = "placement_handgun/";
String p = "blockzapper/";
this.core = loadCustomModel(event, p + "core");
this.body = loadCustomModel(event, p + "body");

View file

@ -22,6 +22,10 @@ public enum AllToolTiers implements IItemTier {
return Ingredient.fromItems(AllItems.SHADOW_STEEL_CUBE.item);
}),
RADIANT(4, 2303, 16.0F, 3.5F, 10, () -> {
return Ingredient.fromItems(AllItems.REFINED_RADIANCE_CUBE.item);
}),
;
private final int harvestLevel;

View file

@ -24,6 +24,7 @@
"item.create.flour": "Wheat Flour",
"item.create.dough": "Dough",
"item.create.wrench": "Wrench",
"item.create.deforester": "Deforester",
"item.create.crushed_iron": "Crushed Iron Ore",
"item.create.crushed_gold": "Crushed Gold Ore",
"item.create.time_scarf": "Scarf with a clock on it",

View file

@ -0,0 +1,117 @@
{
"credit": "Made with Blockbench",
"parent": "create:block/block",
"textures": {
"2": "create:block/andesite_alloy_mesh",
"7": "create:block/blaze_brass_mesh",
"particle": "create:block/andesite_alloy_mesh"
},
"elements": [
{
"name": "connector",
"from": [9.5, 10.5, 7],
"to": [10.5, 15.5, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [8.5, 7, 8]},
"faces": {
"north": {"uv": [2, 0, 3, 5], "texture": "#2"},
"east": {"uv": [2, 0, 4, 5], "texture": "#2"},
"south": {"uv": [2, 0, 3, 5], "texture": "#2"},
"west": {"uv": [2, 0, 4, 5], "texture": "#2"},
"up": {"uv": [2, 0, 3, 2], "texture": "#2"},
"down": {"uv": [2, 0, 3, 2], "texture": "#2"}
}
},
{
"name": "body_top",
"from": [4.5, 13.5, 7.25],
"to": [9.5, 15, 8.75],
"faces": {
"north": {"uv": [1, 9, 6, 10.5], "texture": "#7"},
"east": {"uv": [1, 7, 2.5, 8.5], "texture": "#7"},
"south": {"uv": [1, 8, 6, 9.5], "texture": "#7"},
"west": {"uv": [1, 6, 2.5, 7.5], "texture": "#7"},
"up": {"uv": [1, 8, 6, 9.5], "texture": "#7"},
"down": {"uv": [2, 7, 7, 8.5], "texture": "#7"}
}
},
{
"name": "body_bottom",
"from": [5.5, 11, 7.25],
"to": [9.5, 12.5, 8.75],
"faces": {
"north": {"uv": [4, 3, 8, 4.5], "texture": "#7"},
"east": {"uv": [0, 0, 1.5, 1.5], "texture": "#7"},
"south": {"uv": [4, 3, 8, 4.5], "texture": "#7"},
"west": {"uv": [5, 3, 6.5, 4.5], "texture": "#7"},
"up": {"uv": [5, 3, 10, 3.5], "texture": "#7"},
"down": {"uv": [5, 4, 9, 5.5], "texture": "#7"}
}
},
{
"name": "handle",
"from": [7.5, 1, 7.5],
"to": [8.5, 12, 8.5],
"faces": {
"north": {"uv": [0, 0, 1, 11], "texture": "#2"},
"east": {"uv": [0, 0, 1, 11], "texture": "#2"},
"south": {"uv": [0, 0, 1, 11], "texture": "#2"},
"west": {"uv": [0, 0, 1, 11], "texture": "#2"},
"up": {"uv": [0, 0, 1, 1], "texture": "#2"},
"down": {"uv": [0, 0, 1, 1], "texture": "#2"}
}
},
{
"name": "handle",
"from": [7, 0, 7],
"to": [9, 1, 9],
"rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 2, 1], "texture": "#7"},
"east": {"uv": [3, 0, 5, 1], "texture": "#7"},
"south": {"uv": [2, 0, 4, 1], "texture": "#7"},
"west": {"uv": [5, 0, 7, 1], "texture": "#7"},
"up": {"uv": [5, 9, 7, 11], "texture": "#7"},
"down": {"uv": [5, 9, 7, 11], "texture": "#7"}
}
},
{
"name": "handle",
"from": [7, 8, 7],
"to": [9, 9, 9],
"rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]},
"faces": {
"north": {"uv": [0, 0, 2, 1], "texture": "#7"},
"east": {"uv": [0, 0, 2, 1], "texture": "#7"},
"south": {"uv": [0, 0, 2, 1], "texture": "#7"},
"west": {"uv": [0, 0, 2, 1], "texture": "#7"},
"up": {"uv": [3, 9, 5, 11], "texture": "#7"},
"down": {"uv": [5, 9, 7, 11], "texture": "#7"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [0, 82.5, 0],
"translation": [0, 3.5, 0]
},
"thirdperson_lefthand": {
"rotation": [0, 268.5, 0],
"translation": [0, 3.5, 0]
},
"firstperson_righthand": {
"rotation": [-23.5, 105.25, 22.25],
"translation": [0.25, 3.25, 0]
},
"firstperson_lefthand": {
"rotation": [22, -79, 12],
"translation": [0.25, 3.25, 0]
},
"ground": {
"rotation": [90, 0, 0]
},
"gui": {
"rotation": [21, -157, 46],
"translation": [-0.25, -0.5, 0]
}
}
}

View file

@ -0,0 +1,38 @@
{
"credit": "Made with Blockbench",
"parent": "create:item/deforester",
"textures": {
"3": "block/white_concrete_powder",
"4": "block/white_stained_glass"
},
"elements": [
{
"name": "blade2",
"from": [10.5, 9.7, 7.75],
"to": [11.5, 15.7, 8.25],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.75, 8]},
"faces": {
"north": {"uv": [0, 0, 1, 6], "texture": "#3"},
"east": {"uv": [0, 0, 1, 6], "texture": "#3"},
"south": {"uv": [0, 0, 1, 6], "texture": "#3"},
"west": {"uv": [0, 0, 1, 6], "texture": "#3"},
"up": {"uv": [0, 0, 1, 1], "texture": "#3"},
"down": {"uv": [0, 0, 1, 1], "texture": "#3"}
}
},
{
"name": "blade3",
"from": [10.25, 9.45, 7.5],
"to": [11.75, 15.95, 8.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.75, 8]},
"faces": {
"north": {"uv": [0, 6, 1.5, 12.5], "rotation": 180, "texture": "#4"},
"east": {"uv": [0, 6, 1, 12.5], "texture": "#4"},
"south": {"uv": [0, 7, 1.5, 13.5], "texture": "#4"},
"west": {"uv": [1, 6, 2, 12.5], "texture": "#4"},
"up": {"uv": [0, 9, 1.5, 10], "texture": "#4"},
"down": {"uv": [0, 7, 1.5, 8], "texture": "#4"}
}
}
]
}

View file

@ -0,0 +1,65 @@
{
"credit": "Made with Blockbench",
"parent": "create:item/deforester",
"textures": {
"5": "block/stripped_spruce_log"
},
"elements": [
{
"name": "Cog",
"from": [7.5, 9, 6],
"to": [8.5, 10, 10],
"rotation": {"angle": -45, "axis": "y", "origin": [8, 8.5, 8]},
"faces": {
"north": {"uv": [4, 6, 5, 7], "texture": "#5"},
"east": {"uv": [4, 6, 8, 7], "texture": "#5"},
"south": {"uv": [4, 6, 5, 7], "texture": "#5"},
"west": {"uv": [4, 6, 8, 7], "texture": "#5"},
"up": {"uv": [4, 6, 5, 10], "texture": "#5"},
"down": {"uv": [4, 6, 5, 10], "texture": "#5"}
}
},
{
"name": "Cog",
"from": [7.5, 9, 6],
"to": [8.5, 10, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8.5, 8]},
"faces": {
"north": {"uv": [5, 6, 6, 7], "rotation": 180, "texture": "#5"},
"east": {"uv": [5, 6, 9, 7], "rotation": 180, "texture": "#5"},
"south": {"uv": [5, 6, 6, 7], "rotation": 180, "texture": "#5"},
"west": {"uv": [5, 6, 9, 7], "rotation": 180, "texture": "#5"},
"up": {"uv": [5, 6, 6, 10], "rotation": 180, "texture": "#5"},
"down": {"uv": [5, 6, 6, 10], "rotation": 180, "texture": "#5"}
}
},
{
"name": "Cog",
"from": [7.5, 9, 6],
"to": [8.5, 10, 10],
"rotation": {"angle": 45, "axis": "y", "origin": [8, 8.5, 8]},
"faces": {
"north": {"uv": [5, 6, 6, 7], "rotation": 180, "texture": "#5"},
"east": {"uv": [5, 6, 9, 7], "rotation": 180, "texture": "#5"},
"south": {"uv": [5, 6, 6, 7], "rotation": 180, "texture": "#5"},
"west": {"uv": [5, 6, 9, 7], "rotation": 180, "texture": "#5"},
"up": {"uv": [5, 6, 6, 10], "rotation": 180, "texture": "#5"},
"down": {"uv": [5, 6, 6, 10], "rotation": 180, "texture": "#5"}
}
},
{
"name": "Cog",
"from": [6, 9, 7.5],
"to": [10, 10, 8.5],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8.5, 8]},
"faces": {
"north": {"uv": [4, 6, 5, 10], "rotation": 90, "texture": "#5"},
"east": {"uv": [4, 6, 5, 7], "rotation": 90, "texture": "#5"},
"south": {"uv": [4, 6, 5, 10], "rotation": 90, "texture": "#5"},
"west": {"uv": [4, 6, 5, 7], "rotation": 90, "texture": "#5"},
"up": {"uv": [4, 6, 5, 10], "rotation": 90, "texture": "#5"},
"down": {"uv": [4, 6, 5, 10], "rotation": 90, "texture": "#5"}
}
}
]
}

View file

@ -0,0 +1,36 @@
{
"credit": "Made with Blockbench",
"parent": "create:item/deforester",
"textures": {
"3": "block/white_concrete_powder",
"4": "block/white_stained_glass"
},
"elements": [
{
"name": "light_inner",
"from": [6, 12, 7.75],
"to": [9.5, 14, 8.25],
"rotation": {"angle": 0, "axis": "y", "origin": [10, 16.5, 7.5]},
"faces": {
"north": {"uv": [0, 0, 3.5, 2], "texture": "#3"},
"east": {"uv": [0, 0, 0.5, 2], "texture": "#3"},
"south": {"uv": [0, 0, 3.5, 2], "texture": "#3"},
"west": {"uv": [0, 0, 0.5, 2], "texture": "#3"},
"up": {"uv": [0, 0, 3.5, 0.5], "texture": "#3"},
"down": {"uv": [0, 0, 3.5, 0.5], "texture": "#3"}
}
},
{
"name": "light_outer",
"from": [5.75, 12, 7.5],
"to": [9.5, 14, 8.5],
"rotation": {"angle": 0, "axis": "y", "origin": [10, 16.5, 7.5]},
"faces": {
"north": {"uv": [7, 0, 10.75, 2], "texture": "#4"},
"east": {"uv": [7, 0, 8, 2], "texture": "#4"},
"south": {"uv": [7, 0, 10.75, 2], "texture": "#4"},
"west": {"uv": [7, 0, 8, 2], "texture": "#4"}
}
}
]
}