mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 14:24:22 +00:00
Merge branch 'newblaster' into MC19
This commit is contained in:
commit
9897d3ed80
8 files changed
+250
-27
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ManaGunModel implements IBakedModel {
|
||||
|
||||
private final ItemHandler itemHandler = new ItemHandler();
|
||||
|
||||
@Override public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand) { return null; }
|
||||
@Override public boolean isAmbientOcclusion() { return true; }
|
||||
@Override public boolean isGui3d() { return true; }
|
||||
@Override public boolean isBuiltInRenderer() { return false; }
|
||||
@Override public TextureAtlasSprite getParticleTexture() { return null; }
|
||||
@Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; }
|
||||
|
||||
@Override
|
||||
public ItemOverrideList getOverrides() {
|
||||
return itemHandler;
|
||||
}
|
||||
|
||||
private class ItemHandler extends ItemOverrideList {
|
||||
private ItemHandler() {
|
||||
super(ImmutableList.of());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity) {
|
||||
boolean hasClip = ItemManaGun.hasClip(stack);
|
||||
if (hasClip) {
|
||||
List<ItemStack> lenses = ItemManaGun.getAllLens(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
|
||||
@@ -319,6 +320,16 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem, IColorable {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<ItemStack> getAllLens(ItemStack stack) {
|
||||
List<ItemStack> ret = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
ret.add(getLensAtPos(stack, i));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
if(par1ItemStack.isItemDamaged())
|
||||
|
||||
@@ -1,28 +1,165 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "botania:items/manaGun0",
|
||||
"layer1": "botania:items/manaGun1"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"predicate": {
|
||||
"botania:clip": 1
|
||||
},
|
||||
"model": "botania:item/manaGunClip"
|
||||
},
|
||||
{
|
||||
"predicate": {
|
||||
"botania:desu": 1
|
||||
},
|
||||
"model": "botania:item/desuGun"
|
||||
},
|
||||
{
|
||||
"predicate": {
|
||||
"botania:desu": 1,
|
||||
"botania:clip": 1
|
||||
},
|
||||
"model": "botania:item/desuGunClip"
|
||||
}
|
||||
]
|
||||
{
|
||||
"__comment": "",
|
||||
"textures": {
|
||||
"layer0": "botania:items/manaBlaster",
|
||||
"layer1": "botania:items/manaBlasterColor",
|
||||
"layer2": "botania:items/manaBlasterGlass",
|
||||
"layer3": "botania:items/manaBlasterLensClip"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Barrel1",
|
||||
"from": [ -10.0, 5.0, 5.5 ],
|
||||
"to": [ -3.0, 14.0, 10.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 0.0, 7.01, 3.5, 11.49 ] },
|
||||
"east": { "texture": "layer0", "uv": [ 6.0, 7.0, 8.5, 11.5 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 3.5, 7.01, 0.0, 11.49 ] },
|
||||
"west": { "texture": "layer0", "uv": [ 3.5, 7.01, 6.0, 11.49 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 11.01, 10.5, 13.49, 13.99 ], "rotation": 90 },
|
||||
"down": { "texture": "layer0", "uv": [ 13.5, 10.5, 16.0, 14.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Barrel2",
|
||||
"from": [ -3.0, 5.0, 5.5 ],
|
||||
"to": [ 7.0, 9.0, 10.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 11.01, 14.0, 15.99, 15.99 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 16.0, 14.0, 11.0, 16.0 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 11.01, 5.0, 13.49, 10.0 ], "rotation": 270 },
|
||||
"down": { "texture": "layer0", "uv": [ 13.5, 5.0, 15.99, 10.0 ], "rotation": 270 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Barrel3",
|
||||
"from": [ 7.0, 5.0, 5.5 ],
|
||||
"to": [ 10.0, 14.0, 10.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 0.0, 11.5, 1.5, 16.0 ] },
|
||||
"east": { "texture": "layer0", "uv": [ 1.5, 11.5, 4.0, 16.0 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 0.0, 11.5, 1.5, 16.0 ] },
|
||||
"west": { "texture": "layer0", "uv": [ 1.5, 11.5, 4.0, 16.0 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 11.0, 4.0, 13.5, 5.5 ], "rotation": 90 },
|
||||
"down": { "texture": "layer0", "uv": [ 13.5, 4.0, 16.0, 5.5 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Barrel4",
|
||||
"from": [ 10.0, 12.0, 5.5 ],
|
||||
"to": [ 18.0, 14.0, 10.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 4.01, 14.5, 8.0, 15.5 ] },
|
||||
"east": { "texture": "layer0", "uv": [ 4.0, 14.5, 6.5, 15.5 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 8.0, 14.5, 4.0, 15.5 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 11.01, 0.01, 13.49, 3.99 ], "rotation": 90 },
|
||||
"down": { "texture": "layer0", "uv": [ 11.0, 0.01, 13.5, 4.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Barrel5",
|
||||
"from": [ 10.0, 9.0, 5.5 ],
|
||||
"to": [ 18.0, 11.0, 10.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 8.0, 14.5, 4.0, 15.5 ] },
|
||||
"east": { "texture": "layer0", "uv": [ 6.5, 14.5, 4.0, 15.5 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 4.0, 14.5, 8.0, 15.5 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 11.01, 0.0, 13.49, 3.99 ], "rotation": 90 },
|
||||
"down": { "texture": "layer0", "uv": [ 13.51, 0.01, 15.99, 3.99 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Strap",
|
||||
"from": [ 14.0, -5.0, 6.5 ],
|
||||
"to": [ 19.0, 9.0, 9.5 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 22.5 },
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 0.0, 0.01, 2.5, 6.99 ] },
|
||||
"east": { "texture": "layer0", "uv": [ 4.0, 0.01, 5.5, 6.99 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 2.5, 0.01, 0.0, 6.99 ] },
|
||||
"west": { "texture": "layer0", "uv": [ 2.5, 0.01, 4.0, 6.99 ] },
|
||||
"down": { "texture": "layer0", "uv": [ 5.5, 0.0, 7.0, 2.5 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Magazine",
|
||||
"from": [ 12.5, -6.0, 7.0 ],
|
||||
"to": [ 18.5, -5.0, 9.0 ],
|
||||
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 22.5 },
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 7.5, 0.0, 8.0, 3.0 ], "rotation": 90 },
|
||||
"east": { "texture": "layer0", "uv": [ 8.0, 0.0, 7.0, 0.5 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 8.0, 0.01, 7.5, 3.0 ], "rotation": 90 },
|
||||
"west": { "texture": "layer0", "uv": [ 7.0, 0.01, 8.0, 0.5 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 7.0, 0.01, 8.0, 3.0 ], "rotation": 90 },
|
||||
"down": { "texture": "layer0", "uv": [ 7.01, 0.0, 7.99, 3.0 ], "rotation": 90 }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Trigger Guard1",
|
||||
"from": [ 10.0, 6.0, 7.0 ],
|
||||
"to": [ 16.0, 7.0, 9.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 5.5, 3.01, 8.5, 3.5 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 5.5, 3.01, 8.5, 3.49 ] },
|
||||
"up": { "texture": "layer0", "uv": [ 5.5, 3.0, 8.5, 4.0 ] },
|
||||
"down": { "texture": "layer0", "uv": [ 5.5, 3.0, 8.5, 4.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Trigger",
|
||||
"from": [ 13.0, 7.0, 7.5 ],
|
||||
"to": [ 16.0, 9.0, 8.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 6.0 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 6.0 ] },
|
||||
"west": { "texture": "layer0", "uv": [ 5.5, 5.0, 6.5, 5.5 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Trigger Guard2",
|
||||
"from": [ 10.0, 7.0, 7.0 ],
|
||||
"to": [ 11.0, 9.0, 9.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.0, 5.0 ] },
|
||||
"east": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.5, 5.0 ] },
|
||||
"south": { "texture": "layer0", "uv": [ 5.5, 4.0, 6.0, 5.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Colorizer",
|
||||
"from": [ 9.5, 11.0, 6.0 ],
|
||||
"to": [ 17.5, 12.0, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ] },
|
||||
"east": { "texture": "layer1", "uv": [ 0.0, 0.0, 5.0, 5.0 ] },
|
||||
"south": { "texture": "layer1", "uv": [ 0.0, 0.0, 8.0, 5.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Glass",
|
||||
"from": [ -3.5, 9.5, 6.0 ],
|
||||
"to": [ 7.5, 13.5, 10.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer2", "uv": [ 0.01, 7.01, 6.99, 7.99 ] },
|
||||
"east": { "texture": "layer2", "uv": [ 7.01, 7.01, 9.49, 7.99 ] },
|
||||
"south": { "texture": "layer2", "uv": [ 6.99, 7.01, 0.01, 7.99 ] },
|
||||
"up": { "texture": "layer2", "uv": [ 11.01, 0.01, 13.49, 6.99 ] },
|
||||
"down": { "texture": "layer2", "uv": [ 8.51, 0.01, 6.99, 9.99 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Clip",
|
||||
"from": [ -4.5, 2.0, 5.0 ],
|
||||
"to": [ 8.5, 8.0, 11.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "layer3", "uv": [ 0.01, 6.51, 6.5, 9.49 ] },
|
||||
"east": { "texture": "layer3", "uv": [ 6.01, 0.0, 9.0, 3.0 ] },
|
||||
"south": { "texture": "layer3", "uv": [ 6.5, 6.5, 0.01, 9.5 ] },
|
||||
"west": { "texture": "layer3", "uv": [ 6.0, 3.0, 9.0, 6.0 ] },
|
||||
"up": { "texture": "layer3", "uv": [ 0.0, 0.01, 3.0, 6.5 ], "rotation": 90 },
|
||||
"down": { "texture": "layer3", "uv": [ 3.0, 0.01, 6.0, 6.5 ], "rotation": 90 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"parent": "minecraft:item/handheld",
|
||||
"textures": {
|
||||
"layer0": "botania:items/manaGun0",
|
||||
"layer1": "botania:items/manaGun1"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"predicate": {
|
||||
"botania:clip": 1
|
||||
},
|
||||
"model": "botania:item/manaGunClip"
|
||||
},
|
||||
{
|
||||
"predicate": {
|
||||
"botania:desu": 1
|
||||
},
|
||||
"model": "botania:item/desuGun"
|
||||
},
|
||||
{
|
||||
"predicate": {
|
||||
"botania:desu": 1,
|
||||
"botania:clip": 1
|
||||
},
|
||||
"model": "botania:item/desuGunClip"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in new issue
Block a user