Skip to content

Commit

Permalink
Merge pull request #3 from Goldorion/block-bases
Browse files Browse the repository at this point in the history
New block bases
  • Loading branch information
Goldorion committed Nov 3, 2020
2 parents 22b3849 + a06a7af commit 22f94ed
Show file tree
Hide file tree
Showing 25 changed files with 426 additions and 14 deletions.
81 changes: 81 additions & 0 deletions plugins/generator-1.15.2/forge-1.15.2/block.definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,87 @@ templates:
writer: json
name: "@MODASSETSROOT/models/block/@registryname_wall_open.json"

# TX: StoneButton templates
- template: json/txblock/button_item.json.ftl
condition: "blockBase %= StoneButton"
writer: json
name: "@MODASSETSROOT/models/item/@registryname.json"
- template: json/txblock/button_states.json.ftl
condition: "blockBase %= StoneButton"
writer: json
name: "@MODASSETSROOT/blockstates/@registryname.json"
- template: json/txblock/button.json.ftl
condition: "blockBase %= StoneButton"
writer: json
name: "@MODASSETSROOT/models/block/@registryname.json"
- template: json/txblock/button_pressed.json.ftl
deleteWhenConditionFalse: true
condition: "blockBase %= StoneButton"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_pressed.json"
- template: json/txblock/button_inventory.json.ftl
deleteWhenConditionFalse: true
condition: "blockBase %= StoneButton"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_inventory.json"

# TX: PressurePlate templates
- template: json/txblock/pressure_plate_item.json.ftl
condition: "blockBase %= PressurePlate"
writer: json
name: "@MODASSETSROOT/models/item/@registryname.json"
- template: json/txblock/pressure_plate_states.json.ftl
condition: "blockBase %= PressurePlate"
writer: json
name: "@MODASSETSROOT/blockstates/@registryname.json"
- template: json/txblock/pressure_plate.json.ftl
condition: "blockBase %= PressurePlate"
writer: json
name: "@MODASSETSROOT/models/block/@registryname.json"
- template: json/txblock/pressure_plate_down.json.ftl
deleteWhenConditionFalse: true
condition: "blockBase %= PressurePlate"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_down.json"

# TX: Cake templates
- template: json/block_item.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/item/@registryname.json"
- template: json/txblock/cake_states.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/blockstates/@registryname.json"
- template: json/txblock/cake.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname.json"
- template: json/txblock/cake_slice1.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_slice1.json"
- template: json/txblock/cake_slice2.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_slice2.json"
- template: json/txblock/cake_slice3.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_slice3.json"
- template: json/txblock/cake_slice4.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_slice4.json"
- template: json/txblock/cake_slice5.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_slice5.json"
- template: json/txblock/cake_slice6.json.ftl
condition: "blockBase %= Cake"
writer: json
name: "@MODASSETSROOT/models/block/@registryname_slice6.json"

localizationkeys:
- key: block.@modid.@registryname
mapto: name
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ public class ${name}Block extends ${JavaModName}Elements.ModElement {
super(
<#elseif data.blockBase?has_content && data.blockBase == "Fence">
super(
<#elseif data.blockBase?has_content && data.blockBase == "StoneButton">
super(
<#elseif data.blockBase?has_content && data.blockBase == "PressurePlate">
super(Sensitivity.${data.sensitivity},
<#elseif data.blockBase?has_content && data.blockBase == "Cake">
super(
<#else>
super(
</#if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "block/button",
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",</#if>
"texture": "${modid}:blocks/${data.texture}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "block/button_inventory",
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",</#if>
"texture": "${modid}:blocks/${data.texture}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<#-- @formatter:off -->
<#if data.itemTexture?has_content>
{
"parent": "item/generated",
"textures": {
"layer0": "${modid}:items/${data.itemTexture}"
}
}
<#else>
{
"parent": "${modid}:block/${registryname}_inventory"
}
</#if>
<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "block/button_pressed",
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",</#if>
"texture": "${modid}:blocks/${data.texture}"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"variants": {
"face=floor,facing=east,powered=false": { "model": "${modid}:block/${registryname}", "y": 90 },
"face=floor,facing=west,powered=false": { "model": "${modid}:block/${registryname}", "y": 270 },
"face=floor,facing=south,powered=false": { "model": "${modid}:block/${registryname}", "y": 180 },
"face=floor,facing=north,powered=false": { "model": "${modid}:block/${registryname}" },
"face=wall,facing=east,powered=false": { "model": "${modid}:block/${registryname}", "uvlock": true, "x": 90, "y": 90 },
"face=wall,facing=west,powered=false": { "model": "${modid}:block/${registryname}", "uvlock": true, "x": 90, "y": 270 },
"face=wall,facing=south,powered=false": { "model": "${modid}:block/${registryname}", "uvlock": true, "x": 90, "y": 180 },
"face=wall,facing=north,powered=false": { "model": "${modid}:block/${registryname}", "uvlock": true, "x": 90 },
"face=ceiling,facing=east,powered=false": { "model": "${modid}:block/${registryname}", "x": 180, "y": 270 },
"face=ceiling,facing=west,powered=false": { "model": "${modid}:block/${registryname}", "x": 180, "y": 90 },
"face=ceiling,facing=south,powered=false": { "model": "${modid}:block/${registryname}", "x": 180 },
"face=ceiling,facing=north,powered=false": { "model": "${modid}:block/${registryname}", "x": 180, "y": 180 },
"face=floor,facing=east,powered=true": { "model": "${modid}:block/${registryname}_pressed", "y": 90 },
"face=floor,facing=west,powered=true": { "model": "${modid}:block/${registryname}_pressed", "y": 270 },
"face=floor,facing=south,powered=true": { "model": "${modid}:block/${registryname}_pressed", "y": 180 },
"face=floor,facing=north,powered=true": { "model": "${modid}:block/${registryname}_pressed" },
"face=wall,facing=east,powered=true": { "model": "${modid}:block/${registryname}_pressed", "uvlock": true, "x": 90, "y": 90 },
"face=wall,facing=west,powered=true": { "model": "${modid}:block/${registryname}_pressed", "uvlock": true, "x": 90, "y": 270 },
"face=wall,facing=south,powered=true": { "model": "${modid}:block/${registryname}_pressed", "uvlock": true, "x": 90, "y": 180 },
"face=wall,facing=north,powered=true": { "model": "${modid}:block/${registryname}_pressed", "uvlock": true, "x": 90 },
"face=ceiling,facing=east,powered=true": { "model": "${modid}:block/${registryname}_pressed", "x": 180, "y": 270 },
"face=ceiling,facing=west,powered=true": { "model": "${modid}:block/${registryname}_pressed", "x": 180, "y": 90 },
"face=ceiling,facing=south,powered=true": { "model": "${modid}:block/${registryname}_pressed", "x": 180 },
"face=ceiling,facing=north,powered=true": { "model": "${modid}:block/${registryname}_pressed", "x": 180, "y": 180 }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}"
},
"elements": [
{ "from": [ 1, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",
"inside": "${modid}:blocks/${data.textureBack?has_content?then(data.textureRight, data.texture)}"
},
"elements": [
{ "from": [ 3, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#inside" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",
"inside": "${modid}:blocks/${data.textureBack?has_content?then(data.textureRight, data.texture)}"
},
"elements": [
{ "from": [ 5, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#inside" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",
"inside": "${modid}:blocks/${data.textureBack?has_content?then(data.textureRight, data.texture)}"
},
"elements": [
{ "from": [ 7, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#inside" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",
"inside": "${modid}:blocks/${data.textureBack?has_content?then(data.textureRight, data.texture)}"
},
"elements": [
{ "from": [ 9, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#inside" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",
"inside": "${modid}:blocks/${data.textureBack?has_content?then(data.textureRight, data.texture)}"
},
"elements": [
{ "from": [ 11, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#inside" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<#-- @formatter:off -->
{
"textures": {
<#if data.particleTexture?has_content>"particle": "${modid}:blocks/${data.particleTexture}",
<#else> "particle": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",</#if>
"bottom": "${modid}:blocks/${data.texture}",
"top": "${modid}:blocks/${data.textureTop?has_content?then(data.textureTop, data.texture)}",
"side": "${modid}:blocks/${data.textureFront?has_content?then(data.textureFront, data.texture)}",
"inside": "${modid}:blocks/${data.textureBack?has_content?then(data.textureRight, data.texture)}"
},
"elements": [
{ "from": [ 13, 0, 1 ],
"to": [ 15, 8, 15 ],
"faces": {
"down": { "texture": "#bottom", "cullface": "down" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#inside" },
"east": { "texture": "#side" }
}
}
]
}

<#-- @formatter:on -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<#-- @formatter:off -->
{
"variants": {
"bites=0": { "model": "${modid}:block/${registryname}" },
"bites=1": { "model": "${modid}:block/${registryname}_slice1" },
"bites=2": { "model": "${modid}:block/${registryname}_slice2" },
"bites=3": { "model": "${modid}:block/${registryname}_slice3" },
"bites=4": { "model": "${modid}:block/${registryname}_slice4" },
"bites=5": { "model": "${modid}:block/${registryname}_slice5" },
"bites=6": { "model": "${modid}:block/${registryname}_slice6" }
}
}
<#-- @formatter:on -->

0 comments on commit 22f94ed

Please sign in to comment.