Handheld Blockzapper

+ Added the Handheld Blockzapper Tool
+ Added several craftable upgrades for
the Tool
+ Added animated Models for Symmetry wand and Handheld Blockzapper
- Schematicannon now uses two items for Double Slabs
- Fixed Warn messages for client packets
- Added misc Crafting Ingredients
- Changed recipe unlock triggers
This commit is contained in:
simibubi 2019-07-28 10:08:49 +02:00
parent e943690baa
commit 903ad95bf0
85 changed files with 3551 additions and 313 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '0.0.3'
version = '0.0.4'
group = 'com.simibubi.create' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'create'
@ -25,7 +25,7 @@ minecraft {
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: '20190717-1.14.3'
mappings channel: 'snapshot', version: '20190725-1.14.3'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
@ -89,7 +89,7 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.14.3-27.0.60'
minecraft 'net.minecraftforge:forge:1.14.4-28.0.14'
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"

View file

@ -0,0 +1,52 @@
package com.simibubi.create;
import net.minecraft.advancements.AdvancementManager;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.entity.player.AdvancementEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber
public class AdvancementListener {
@SubscribeEvent
public static void onAdvancementGet(AdvancementEvent event) {
PlayerEntity player = event.getEntityPlayer();
if (player == null)
return;
if (player.getServer() == null)
return;
// DEBUG
// AdvancementManager advancements = player.getServer().getAdvancementManager();
// player.sendMessage(new StringTextComponent(event.getAdvancement().getId().toString()));
unlockWhen("story/smelt_iron", recipeOf(AllItems.ANDESITE_ALLOY_CUBE), event);
unlockWhen("story/smelt_iron", recipeOf(AllItems.PLACEMENT_HANDGUN), event);
unlockWhen("nether/obtain_blaze_rod", recipeOf(AllItems.BLAZE_BRASS_CUBE), event);
unlockWhen("recipes/misc/popped_chorus_fruit", recipeOf(AllItems.CHORUS_CHROME_CUBE), event);
unlockWhen("recipes/decorations/end_rod", recipeOf(AllItems.SYMMETRY_WAND), event);
unlockWhen("recipes/misc/bone_meal", recipeOf(AllItems.TREE_FERTILIZER), event);
unlockWhen("recipes/misc/book", recipeOf(AllItems.EMPTY_BLUEPRINT), event);
unlockWhen("recipes/misc/book", recipeOf(AllItems.BLUEPRINT_AND_QUILL), event);
unlockWhen("recipes/misc/book", recipeOf(AllBlocks.SCHEMATIC_TABLE), event);
unlockWhen("recipes/misc/book", recipeOf(AllBlocks.SCHEMATICANNON), event);
}
private static void unlockWhen(String advancement, ResourceLocation recipe, AdvancementEvent event) {
AdvancementManager advancements = event.getEntityPlayer().getServer().getAdvancementManager();
if (event.getAdvancement() == advancements.getAdvancement(new ResourceLocation(advancement)))
event.getEntityPlayer().unlockRecipes(new ResourceLocation[] { recipe });
}
private static ResourceLocation recipeOf(AllItems item) {
return item.get().getRegistryName();
}
private static ResourceLocation recipeOf(AllBlocks block) {
return block.get().getRegistryName();
}
}

View file

@ -1,21 +1,42 @@
package com.simibubi.create;
import com.simibubi.create.modules.curiosities.item.TreeFertilizerItem;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItemRenderer;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunModel;
import com.simibubi.create.modules.schematics.item.BlueprintAndQuillItem;
import com.simibubi.create.modules.schematics.item.BlueprintItem;
import com.simibubi.create.modules.symmetry.SymmetryWandItem;
import com.simibubi.create.modules.symmetry.client.SymmetryWandItemRenderer;
import com.simibubi.create.modules.symmetry.client.SymmetryWandModel;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.Item;
import net.minecraft.item.Item.Properties;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Rarity;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.IForgeRegistry;
@EventBusSubscriber(value = Dist.CLIENT, bus = Bus.MOD)
public enum AllItems {
SYMMETRY_WAND(new SymmetryWandItem(
standardProperties().rarity(Rarity.UNCOMMON).setTEISR(() -> () -> withSpecialRenderer("wand")))),
PLACEMENT_HANDGUN(new BuilderGunItem(
new Properties().rarity(Rarity.UNCOMMON).setTEISR(() -> () -> withSpecialRenderer("gun")))),
ANDESITE_ALLOY_CUBE(new Item(standardProperties())), BLAZE_BRASS_CUBE(new Item(standardProperties())),
CHORUS_CHROME_CUBE(new Item(standardProperties().rarity(Rarity.UNCOMMON))),
TREE_FERTILIZER(new TreeFertilizerItem(standardProperties())),
SYMMETRY_WAND(new SymmetryWandItem(standardProperties())),
EMPTY_BLUEPRINT(new Item(standardProperties().maxStackSize(1))),
BLUEPRINT_AND_QUILL(new BlueprintAndQuillItem(standardProperties().maxStackSize(1))),
BLUEPRINT(new BlueprintItem(standardProperties()));
@ -46,7 +67,29 @@ public enum AllItems {
}
@OnlyIn(Dist.CLIENT)
public static void initColorHandlers() {
public static ItemStackTileEntityRenderer withSpecialRenderer(String renderer) {
if ("wand".equals(renderer))
return new SymmetryWandItemRenderer();
if ("gun".equals(renderer))
return new BuilderGunItemRenderer();
return null;
}
@SubscribeEvent
@OnlyIn(Dist.CLIENT)
public static void onModelBake(ModelBakeEvent event) {
ModelResourceLocation wandLocation = getModelLocation(SYMMETRY_WAND);
IBakedModel template = event.getModelRegistry().get(wandLocation);
event.getModelRegistry().put(wandLocation, new SymmetryWandModel(template).loadPartials(event));
ModelResourceLocation handgunLocation = getModelLocation(PLACEMENT_HANDGUN);
template = event.getModelRegistry().get(handgunLocation);
event.getModelRegistry().put(handgunLocation, new BuilderGunModel(template).loadPartials(event));
}
protected static ModelResourceLocation getModelLocation(AllItems item) {
return new ModelResourceLocation(item.item.getRegistryName(), "inventory");
}
}

View file

@ -1,6 +1,7 @@
package com.simibubi.create;
import com.simibubi.create.foundation.packet.NbtPacket;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunBeamPacket;
import com.simibubi.create.modules.schematics.packet.ConfigureSchematicannonPacket;
import com.simibubi.create.modules.schematics.packet.SchematicPlacePacket;
import com.simibubi.create.modules.schematics.packet.SchematicUploadPacket;
@ -12,25 +13,29 @@ import net.minecraftforge.fml.network.simple.SimpleChannel;
public class AllPackets {
private static final String PROTOCOL_VERSION = "1";
public static final ResourceLocation CHANNEL_NAME = new ResourceLocation(Create.ID, "network");
public static final String NETWORK_VERSION = new ResourceLocation(Create.ID, "1").toString();
public static SimpleChannel channel;
public static void registerPackets() {
int i = 0;
channel = NetworkRegistry.newSimpleChannel(new ResourceLocation(Create.ID, "main"), () -> PROTOCOL_VERSION,
PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals);
channel = NetworkRegistry.ChannelBuilder.named(CHANNEL_NAME).serverAcceptedVersions(s -> true)
.clientAcceptedVersions(s -> true).networkProtocolVersion(() -> NETWORK_VERSION).simpleChannel();
channel.messageBuilder(NbtPacket.class, i++).decoder(NbtPacket::new).encoder(NbtPacket::toBytes)
.consumer(NbtPacket::handle).add();
channel.messageBuilder(SchematicPlacePacket.class, i++).decoder(SchematicPlacePacket::new)
.encoder(SchematicPlacePacket::toBytes).consumer(SchematicPlacePacket::handle).add();
channel.messageBuilder(ConfigureSchematicannonPacket.class, i++).decoder(ConfigureSchematicannonPacket::new)
.encoder(ConfigureSchematicannonPacket::toBytes).consumer(ConfigureSchematicannonPacket::handle).add();
channel.messageBuilder(SchematicUploadPacket.class, i++).decoder(SchematicUploadPacket::new)
.encoder(SchematicUploadPacket::toBytes).consumer(SchematicUploadPacket::handle).add();
channel.messageBuilder(SymmetryEffectPacket.class, i++).decoder(SymmetryEffectPacket::new)
.encoder(SymmetryEffectPacket::toBytes).consumer(SymmetryEffectPacket::handle).add();
channel.messageBuilder(BuilderGunBeamPacket.class, i++).decoder(BuilderGunBeamPacket::new)
.encoder(BuilderGunBeamPacket::toBytes).consumer(BuilderGunBeamPacket::handle).add();
channel.registerMessage(i++, NbtPacket.class, NbtPacket::toBytes, NbtPacket::new, NbtPacket::handle);
channel.registerMessage(i++, SchematicPlacePacket.class, SchematicPlacePacket::toBytes,
SchematicPlacePacket::new, SchematicPlacePacket::handle);
channel.registerMessage(i++, ConfigureSchematicannonPacket.class, ConfigureSchematicannonPacket::toBytes,
ConfigureSchematicannonPacket::new, ConfigureSchematicannonPacket::handle);
channel.registerMessage(i++, SchematicUploadPacket.class, SchematicUploadPacket::toBytes,
SchematicUploadPacket::new, SchematicUploadPacket::handle);
channel.registerMessage(i++, SymmetryEffectPacket.class, SymmetryEffectPacket::toBytes,
SymmetryEffectPacket::new, SymmetryEffectPacket::handle);
}
}

View file

@ -0,0 +1,30 @@
package com.simibubi.create;
import java.util.function.Supplier;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunUpgradeRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
public enum AllRecipes {
Placement_Handgun_Upgrade(BuilderGunUpgradeRecipe.Serializer::new);
public IRecipeSerializer<?> serializer;
public Supplier<IRecipeSerializer<?>> supplier;
private AllRecipes(Supplier<IRecipeSerializer<?>> supplier) {
this.supplier = supplier;
}
public static void register(RegistryEvent.Register<IRecipeSerializer<?>> event) {
for (AllRecipes r : AllRecipes.values()) {
r.serializer = r.supplier.get();
ResourceLocation location = new ResourceLocation(Create.ID, r.name().toLowerCase());
event.getRegistry().register(r.serializer.setRegistryName(location));
}
}
}

View file

@ -13,6 +13,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.RegistryEvent;
@ -36,7 +37,7 @@ public class Create {
public static final String ID = "create";
public static final String NAME = "Create";
public static final String VERSION = "0.0.3";
public static final String VERSION = "0.0.4";
public static Logger logger = LogManager.getLogger();
@ -57,7 +58,6 @@ public class Create {
private void clientInit(FMLClientSetupEvent event) {
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
AllItems.initColorHandlers();
AllTileEntities.registerRenderers();
cSchematicLoader = new ClientSchematicLoader();
new SchematicHologram();
@ -103,5 +103,11 @@ public class Create {
public static void registerBlocks(RegistryEvent.Register<Block> event) {
AllBlocks.registerBlocks(event.getRegistry());
}
@SubscribeEvent
public static void registerCustomRecipes(RegistryEvent.Register<IRecipeSerializer<?>> event) {
AllRecipes.register(event);
}
}
}

View file

@ -0,0 +1,28 @@
package com.simibubi.create.foundation.block;
import com.simibubi.create.Create;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ModelRotation;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ModelBakeEvent;
public abstract class CustomRenderItemBakedModel extends WrappedBakedModel {
public CustomRenderItemBakedModel(IBakedModel template) {
super(template);
}
public abstract CustomRenderItemBakedModel loadPartials(ModelBakeEvent event);
@Override
public boolean isBuiltInRenderer() {
return true;
}
protected static IBakedModel loadCustomModel(ModelBakeEvent event, String name) {
return event.getModelLoader().func_217845_a(new ResourceLocation(Create.ID, "item/" + name),
ModelRotation.X0_Y0);
}
}

View file

@ -0,0 +1,80 @@
package com.simibubi.create.foundation.block;
import java.util.List;
import java.util.Random;
import javax.vecmath.Matrix4f;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.client.model.data.IModelData;
@SuppressWarnings("deprecation")
public class WrappedBakedModel implements IBakedModel {
protected IBakedModel template;
public WrappedBakedModel(IBakedModel template) {
this.template = template;
}
@Override
public IBakedModel getBakedModel() {
return template;
}
@Override
public boolean isAmbientOcclusion() {
return template.isAmbientOcclusion();
}
@Override
public boolean isGui3d() {
return template.isGui3d();
}
@Override
public boolean isBuiltInRenderer() {
return template.isBuiltInRenderer();
}
@Override
public TextureAtlasSprite getParticleTexture(IModelData data) {
return template.getParticleTexture(data);
}
@Override
public ItemOverrideList getOverrides() {
return template.getOverrides();
}
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
Pair<? extends IBakedModel, Matrix4f> pair = template.handlePerspective(cameraTransformType);
return Pair.of(this, pair.getRight());
}
@Override
public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand) {
return getQuads(state, side, rand, EmptyModelData.INSTANCE);
}
@Override
public List<BakedQuad> getQuads(BlockState state, Direction side, Random rand, IModelData data) {
return template.getQuads(state, side, rand, data);
}
@Override
public TextureAtlasSprite getParticleTexture() {
return getParticleTexture(EmptyModelData.INSTANCE);
}
}

View file

@ -80,6 +80,16 @@ public abstract class AbstractSimiScreen extends Screen {
return super.mouseScrolled(mouseX, mouseY, delta);
}
@Override
public boolean mouseReleased(double x, double y, int button) {
boolean result = false;
for (Widget widget : widgets) {
if (widget.mouseReleased(x, y, button))
result = true;
}
return result | super.mouseReleased(x, y, button);
}
@Override
public boolean shouldCloseOnEsc() {
return true;

View file

@ -11,6 +11,7 @@ public enum ScreenResources {
// Inventories
PLAYER_INVENTORY("player_inventory.png", 176, 108),
WAND_SYMMETRY("wand_symmetry.png", 207, 58),
PLACEMENT_GUN("placement_handgun.png", 217, 70),
SCHEMATIC_TABLE("schematic_table.png", 207, 89),
SCHEMATIC_TABLE_PROGRESS("schematic_table.png", 209, 0, 24, 17),
@ -64,7 +65,16 @@ public enum ScreenResources {
ICON_PLAY("icons.png", 0, 80, 16, 16),
ICON_PAUSE("icons.png", 16, 80, 16, 16),
ICON_STOP("icons.png", 32, 80, 16, 16);
ICON_STOP("icons.png", 32, 80, 16, 16),
ICON_PATTERN_SOLID("icons.png", 0, 96, 16, 16),
ICON_PATTERN_CHECKERED("icons.png", 16, 96, 16, 16),
ICON_PATTERN_CHECKERED_INVERSED("icons.png", 32, 96, 16, 16),
ICON_PATTERN_CHANCE_25("icons.png", 48, 96, 16, 16),
ICON_PATTERN_CHANCE_50("icons.png", 0, 112, 16, 16),
ICON_PATTERN_CHANCE_75("icons.png", 16, 112, 16, 16),
ICON_FOLLOW_DIAGONAL("icons.png", 32, 112, 16, 16),
ICON_FOLLOW_MATERIAL("icons.png", 48, 112, 16, 16);
public static final int FONT_COLOR = 0x575F7A;

View file

@ -6,6 +6,7 @@ import net.minecraft.client.gui.FontRenderer;
public class Label extends AbstractSimiWidget {
public String text;
public String suffix;
protected boolean hasShadow;
protected int color;
protected FontRenderer font;
@ -16,6 +17,7 @@ public class Label extends AbstractSimiWidget {
this.text = "Label";
color = 0xFFFFFF;
hasShadow = false;
suffix = "";
}
public Label colored(int color) {
@ -28,15 +30,22 @@ public class Label extends AbstractSimiWidget {
return this;
}
public Label withSuffix(String s) {
suffix = s;
return this;
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
if (!visible)
return;
if (text == null || text.isEmpty())
return;
if (hasShadow)
font.drawStringWithShadow(text, x, y, color);
font.drawStringWithShadow(text + suffix, x, y, color);
else
font.drawString(text, x, y, color);
font.drawString(text + suffix, x, y, color);
}
}

View file

@ -43,12 +43,21 @@ public class NbtPacket {
return;
}
if (slot == -2) {
ItemStack heldItem = player.getHeldItemOffhand();
if (heldItem.getItem() == stack.getItem()) {
heldItem.setTag(stack.getTag());
}
return;
}
ItemStack heldInSlot = player.inventory.getStackInSlot(slot);
if (heldInSlot.getItem() == stack.getItem()) {
heldInSlot.setTag(stack.getTag());
}
});
context.get().setPacketHandled(true);
}
}

View file

@ -2,14 +2,14 @@ package com.simibubi.create.foundation.type;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ServerWorld;
import net.minecraft.world.World;
public class DimensionPos {
public ServerWorld world;
public World world;
public BlockPos pos;
public DimensionPos(ServerPlayerEntity player, BlockPos pos) {
this.world = player.getServerWorld();
this.world = player.world;
this.pos = pos;
}
}

View file

@ -0,0 +1,51 @@
package com.simibubi.create.foundation.utility;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.SlabType;
public class BlockHelper {
public static int findAndRemoveInInventory(BlockState block, PlayerEntity player, int amount) {
int amountFound = 0;
Item required = getRequiredItem(block).getItem();
boolean needsTwo = block.has(BlockStateProperties.SLAB_TYPE)
&& block.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE;
if (needsTwo)
amount *= 2;
for (int i = 0; i < player.inventory.getSizeInventory(); ++i) {
if (amountFound == amount)
break;
ItemStack itemstack = player.inventory.getStackInSlot(i);
int count = itemstack.getCount();
if (itemstack.getItem() == required && count > 0) {
int taken = Math.min(count, amount - amountFound);
player.inventory.setInventorySlotContents(i, new ItemStack(itemstack.getItem(), count - taken));
amountFound += taken;
}
}
if (needsTwo) {
// Give back 1 if uneven amount was removed
if (amountFound % 2 != 0)
player.inventory.addItemStackToInventory(new ItemStack(required));
amountFound /= 2;
}
return amountFound;
}
public static ItemStack getRequiredItem(BlockState state) {
ItemStack itemStack = new ItemStack(state.getBlock());
return itemStack;
}
}

View file

@ -77,6 +77,9 @@ public class TreeFertilizerItem extends Item {
for (BlockPos pos : world.blocksAdded.keySet()) {
BlockPos actualPos = pos.add(saplingPos).down(10);
// Don't replace Bedrock
if (context.getWorld().getBlockState(pos).getBlockHardness(context.getWorld(), pos) == -1)
continue;
// Don't replace solid blocks with leaves
if (!world.getBlockState(pos).isNormalCube(world, pos)
&& context.getWorld().getBlockState(actualPos).isNormalCube(context.getWorld(), actualPos))

View file

@ -0,0 +1,55 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import java.util.function.Supplier;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunHandler.LaserBeam;
import net.minecraft.client.Minecraft;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.network.NetworkEvent.Context;
public class BuilderGunBeamPacket {
public Vec3d start;
public Vec3d target;
public Hand hand;
public BuilderGunBeamPacket(Vec3d start, Vec3d target, Hand hand) {
this.start = start;
this.target = target;
this.hand = hand;
}
public BuilderGunBeamPacket(PacketBuffer buffer) {
start = new Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble());
target = new Vec3d(buffer.readDouble(), buffer.readDouble(), buffer.readDouble());
hand = buffer.readBoolean()? Hand.MAIN_HAND : Hand.OFF_HAND;
}
public void toBytes(PacketBuffer buffer) {
buffer.writeDouble(start.x);
buffer.writeDouble(start.y);
buffer.writeDouble(start.z);
buffer.writeDouble(target.x);
buffer.writeDouble(target.y);
buffer.writeDouble(target.z);
buffer.writeBoolean(hand == Hand.MAIN_HAND);
}
public void handle(Supplier<Context> context) {
context.get().enqueueWork(() -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
if (Minecraft.getInstance().player.getPositionVector().distanceTo(start) > 100)
return;
BuilderGunHandler.addBeam(new LaserBeam(start, target));
BuilderGunHandler.playSound(hand, new BlockPos(start));
}));
context.get().setPacketHandled(true);
}
}

View file

@ -0,0 +1,216 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import java.util.LinkedList;
import java.util.List;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllItems;
import com.simibubi.create.foundation.utility.TessellatorHelper;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.AbstractClientPlayerEntity;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.FirstPersonRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.PlayerRenderer;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.util.Hand;
import net.minecraft.util.HandSide;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RenderSpecificHandEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
import net.minecraftforge.eventbus.api.EventPriority;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
@SuppressWarnings("deprecation")
@EventBusSubscriber(value = Dist.CLIENT)
public class BuilderGunHandler {
private static List<LaserBeam> cachedBeams;
private static float leftHandAnimation;
private static float rightHandAnimation;
private static float lastLeftHandAnimation;
private static float lastRightHandAnimation;
public static class LaserBeam {
float itensity;
Vec3d start;
Vec3d end;
public LaserBeam(Vec3d start, Vec3d end) {
this.start = start;
this.end = end;
itensity = 1;
}
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onBlockBroken(BreakEvent event) {
PlayerEntity player = event.getPlayer();
if (player == null)
return;
if (!AllItems.PLACEMENT_HANDGUN.typeOf(player.getHeldItemMainhand()))
return;
if (event.getState().isNormalCube(player.world, event.getPos())) {
player.getHeldItemMainhand().getTag().put("BlockUsed", NBTUtil.writeBlockState(event.getState()));
}
event.setCanceled(true);
}
@SubscribeEvent
public static void onClientTick(ClientTickEvent event) {
if (cachedBeams == null)
cachedBeams = new LinkedList<>();
ClientWorld world = Minecraft.getInstance().world;
if (world == null)
return;
ClientPlayerEntity player = Minecraft.getInstance().player;
if (player == null)
return;
cachedBeams.removeIf(b -> b.itensity < .1f);
cachedBeams.forEach(b -> b.itensity *= .7f);
lastLeftHandAnimation = leftHandAnimation;
lastRightHandAnimation = rightHandAnimation;
leftHandAnimation *= 0.8f;
rightHandAnimation *= 0.8f;
}
@SubscribeEvent
public static void onRenderWorld(RenderWorldLastEvent event) {
if (cachedBeams == null || cachedBeams.isEmpty())
return;
cachedBeams.forEach(beam -> {
TessellatorHelper.prepareForDrawing();
GlStateManager.disableTexture();
GlStateManager.lineWidth(beam.itensity * 40);
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
bufferBuilder.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
bufferBuilder.pos(beam.start.x, beam.start.y, beam.start.z).endVertex();
bufferBuilder.pos(beam.end.x, beam.end.y, beam.end.z).endVertex();
Tessellator.getInstance().draw();
GlStateManager.lineWidth(1);
GlStateManager.enableTexture();
TessellatorHelper.cleanUpAfterDrawing();
});
}
public static void shoot(Hand hand) {
ClientPlayerEntity player = Minecraft.getInstance().player;
boolean rightHand = hand == Hand.MAIN_HAND ^ player.getPrimaryHand() == HandSide.LEFT;
if (rightHand)
rightHandAnimation = .2f;
else
leftHandAnimation = .2f;
playSound(hand, player.getPosition());
}
public static void playSound(Hand hand, BlockPos position) {
float pitch = hand == Hand.MAIN_HAND ? 2f : 0.9f;
SoundEvent sound = SoundEvents.BLOCK_NOTE_BLOCK_BASEDRUM;
Minecraft.getInstance().world.playSound(position, sound, SoundCategory.BLOCKS, 0.8f, pitch, false);
}
public static void addBeam(LaserBeam beam) {
Vec3d step = beam.end.subtract(beam.start).normalize();
int steps = (int) (beam.end.squareDistanceTo(beam.start) / step.lengthSquared());
for (int i = 0; i <= steps; i++) {
Vec3d pos = beam.start.add(step.scale(i));
Minecraft.getInstance().world.addParticle(ParticleTypes.END_ROD, pos.x, pos.y, pos.z, 0, -15000, 0);
}
cachedBeams.add(beam);
}
@SubscribeEvent
public static void onRenderPlayerHand(RenderSpecificHandEvent event) {
if (AllItems.PLACEMENT_HANDGUN.typeOf(event.getItemStack())) {
Minecraft mc = Minecraft.getInstance();
boolean rightHand = event.getHand() == Hand.MAIN_HAND ^ mc.player.getPrimaryHand() == HandSide.LEFT;
GlStateManager.pushMatrix();
float recoil = rightHand
? MathHelper.lerp(event.getPartialTicks(), lastRightHandAnimation, rightHandAnimation)
: MathHelper.lerp(event.getPartialTicks(), lastLeftHandAnimation, leftHandAnimation);
float equipProgress = event.getEquipProgress();
if (rightHand && rightHandAnimation > .01f)
equipProgress = 0;
if (!rightHand && leftHandAnimation > .01f)
equipProgress = 0;
// Render arm
float f = rightHand ? 1.0F : -1.0F;
float f1 = MathHelper.sqrt(event.getSwingProgress());
float f2 = -0.3F * MathHelper.sin(f1 * (float) Math.PI);
float f3 = 0.4F * MathHelper.sin(f1 * ((float) Math.PI * 2F));
float f4 = -0.4F * MathHelper.sin(event.getSwingProgress() * (float) Math.PI);
GlStateManager.translatef(f * (f2 + 0.64000005F - .1f), f3 + -0.4F + equipProgress * -0.6F,
f4 + -0.71999997F + .3f + recoil);
GlStateManager.rotatef(f * 75.0F, 0.0F, 1.0F, 0.0F);
float f5 = MathHelper.sin(event.getSwingProgress() * event.getSwingProgress() * (float) Math.PI);
float f6 = MathHelper.sin(f1 * (float) Math.PI);
GlStateManager.rotatef(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotatef(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F);
AbstractClientPlayerEntity abstractclientplayerentity = mc.player;
mc.getTextureManager().bindTexture(abstractclientplayerentity.getLocationSkin());
GlStateManager.translatef(f * -1.0F, 3.6F, 3.5F);
GlStateManager.rotatef(f * 120.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotatef(200.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotatef(f * -135.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.translatef(f * 5.6F, 0.0F, 0.0F);
GlStateManager.rotatef(f * 40.0F, 0.0F, 1.0F, 0.0F);
PlayerRenderer playerrenderer = mc.getRenderManager().getRenderer(abstractclientplayerentity);
GlStateManager.disableCull();
if (rightHand) {
playerrenderer.renderRightArm(abstractclientplayerentity);
} else {
playerrenderer.renderLeftArm(abstractclientplayerentity);
}
GlStateManager.enableCull();
GlStateManager.popMatrix();
// Render gun
GlStateManager.pushMatrix();
GlStateManager.translatef(f * (f2 + 0.64000005F - .1f), f3 + -0.4F + equipProgress * -0.6F,
f4 + -0.71999997F - 0.1f + recoil);
GlStateManager.rotatef(f * f6 * 70.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotatef(f * f5 * -20.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translatef(f * -0.1f, 0.1f, -0.4f);
GlStateManager.rotatef(f * 5.0F, 0.0F, 1.0F, 0.0F);
FirstPersonRenderer firstPersonRenderer = mc.getFirstPersonRenderer();
firstPersonRenderer.renderItemSide(mc.player, event.getItemStack(),
rightHand ? ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND
: ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND,
!rightHand);
GlStateManager.popMatrix();
event.setCanceled(true);
}
}
}

View file

@ -0,0 +1,583 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.function.Predicate;
import com.google.common.base.Predicates;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllPackets;
import com.simibubi.create.Create;
import com.simibubi.create.foundation.gui.ScreenOpener;
import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.foundation.utility.KeyboardHelper;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunHandler.LaserBeam;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.IFluidState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.item.UseAction;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.StairsShape;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.ActionResultType;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceContext;
import net.minecraft.util.math.RayTraceContext.BlockMode;
import net.minecraft.util.math.RayTraceContext.FluidMode;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.network.PacketDistributor;
public class BuilderGunItem extends Item {
public static enum ComponentTier {
None, BlazeBrass, ChorusChrome
}
public static enum Components {
Body, Amplifier, Accelerator, Retriever, Scope
}
public BuilderGunItem(Properties properties) {
super(properties.maxStackSize(1));
}
@Override
public UseAction getUseAction(ItemStack stack) {
return UseAction.NONE;
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
if (KeyboardHelper.isKeyDown(KeyboardHelper.LSHIFT)) {
if (stack.getOrCreateTag().contains("BlockUsed")) {
BlockState state = NBTUtil.readBlockState(stack.getTag().getCompound("BlockUsed"));
tooltip.add(new StringTextComponent(TextFormatting.BLUE + "Using Block: " + TextFormatting.WHITE
+ new TranslationTextComponent(state.getBlock().getTranslationKey()).getFormattedText()));
} else {
tooltip.add(new StringTextComponent(TextFormatting.BLUE + "Hit a Block to set the material."));
}
tooltip.add(new StringTextComponent(""));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Places or Replaces Blocks at a range."));
tooltip.add(new StringTextComponent(
TextFormatting.GRAY + "> [Left-Click] to set the material used by the gun"));
tooltip.add(new StringTextComponent(
TextFormatting.GRAY + "> [Right-Click] to place/replace blocks with the material"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "> [Shift-Right-Click] to configure"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Craft with components to upgrade."));
tooltip.add(new StringTextComponent(""));
for (Components c : Components.values()) {
ComponentTier tier = getTier(c, stack);
tooltip.add(new StringTextComponent(
TextFormatting.AQUA + "" + TextFormatting.ITALIC + c.name() + ": " + TextFormatting.GRAY
+ (tier == ComponentTier.None ? (c == Components.Body ? "Andesite Alloy" : "Missing")
: tier.name())));
}
} else {
tooltip.add(new StringTextComponent(TextFormatting.DARK_GRAY + "< Hold Shift >"));
}
super.addInformation(stack, worldIn, tooltip, flagIn);
}
@Override
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
if (group == Create.creativeTab) {
ItemStack gunWithoutStuff = new ItemStack(this);
items.add(gunWithoutStuff);
ItemStack gunWithGoldStuff = new ItemStack(this);
for (Components c : Components.values())
setTier(c, ComponentTier.BlazeBrass, gunWithGoldStuff);
items.add(gunWithGoldStuff);
ItemStack gunWithPurpurStuff = new ItemStack(this);
for (Components c : Components.values())
setTier(c, ComponentTier.ChorusChrome, gunWithPurpurStuff);
items.add(gunWithPurpurStuff);
}
super.fillItemGroup(group, items);
}
@Override
public ActionResultType onItemUse(ItemUseContext context) {
// Shift -> open GUI
if (context.isPlacerSneaking()) {
if (context.getWorld().isRemote) {
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
openHandgunGUI(context.getItem(), context.getHand() == Hand.OFF_HAND);
});
applyCooldown(context.getPlayer(), context.getItem(), false);
}
return ActionResultType.SUCCESS;
}
return super.onItemUse(context);
}
@Override
public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity player, Hand hand) {
ItemStack item = player.getHeldItem(hand);
CompoundNBT nbt = item.getOrCreateTag();
// Shift -> Open GUI
if (player.isSneaking()) {
if (world.isRemote) {
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
openHandgunGUI(item, hand == Hand.OFF_HAND);
});
applyCooldown(player, item, false);
}
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
}
boolean mainHand = hand == Hand.MAIN_HAND;
boolean isSwap = item.getTag().contains("_Swap");
boolean gunInOtherHand = AllItems.PLACEMENT_HANDGUN
.typeOf(player.getHeldItem(mainHand ? Hand.OFF_HAND : Hand.MAIN_HAND));
// Pass To Offhand
if (mainHand && isSwap && gunInOtherHand)
return new ActionResult<ItemStack>(ActionResultType.FAIL, item);
if (mainHand && !isSwap && gunInOtherHand)
item.getTag().putBoolean("_Swap", true);
if (!mainHand && isSwap)
item.getTag().remove("_Swap");
if (!mainHand && gunInOtherHand)
player.getHeldItem(Hand.MAIN_HAND).getTag().remove("_Swap");
player.setActiveHand(hand);
// Check if block setting is present
BlockState stateToUse = Blocks.AIR.getDefaultState();
if (nbt.contains("BlockUsed"))
stateToUse = NBTUtil.readBlockState(nbt.getCompound("BlockUsed"));
else {
world.playSound(player, player.getPosition(), SoundEvents.BLOCK_NOTE_BLOCK_BASS, SoundCategory.BLOCKS, 1f,
0.5f);
player.sendStatusMessage(new StringTextComponent(TextFormatting.RED + "Left-Click a Block to set Material"),
true);
return new ActionResult<ItemStack>(ActionResultType.FAIL, item);
}
// Raytrace - Find the target
Vec3d start = player.getPositionVec().add(0, player.getEyeHeight(), 0);
Vec3d range = player.getLookVec().scale(getReachDistance(item));
BlockRayTraceResult raytrace = world.rayTraceBlocks(
new RayTraceContext(start, start.add(range), BlockMode.OUTLINE, FluidMode.NONE, player));
BlockPos pos = raytrace.getPos();
BlockState stateReplaced = world.getBlockState(pos);
// No target
if (pos == null || stateReplaced.getBlock() == Blocks.AIR) {
applyCooldown(player, item, gunInOtherHand);
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
}
// Find exact position of gun barrel for VFX
float yaw = (float) ((player.rotationYaw) / -180 * Math.PI);
float pitch = (float) ((player.rotationPitch) / -180 * Math.PI);
Vec3d barrelPosNoTransform = new Vec3d(mainHand ? -.35f : .35f, -0.1f, 1);
Vec3d barrelPos = start.add(barrelPosNoTransform.rotatePitch(pitch).rotateYaw(yaw));
// Client side - Shoot visual laser
if (world.isRemote) {
BuilderGunHandler.addBeam(new LaserBeam(barrelPos, raytrace.getHitVec()));
if (getTier(Components.Amplifier, item) == ComponentTier.BlazeBrass) {
BuilderGunHandler.addBeam(new LaserBeam(
start.add(barrelPosNoTransform.add(-.09f, -.08f, 0).rotatePitch(pitch).rotateYaw(yaw)),
raytrace.getHitVec()));
}
if (getTier(Components.Amplifier, item) == ComponentTier.ChorusChrome) {
BuilderGunHandler.addBeam(new LaserBeam(
start.add(barrelPosNoTransform.add(-.09f, -.08f, 0).rotatePitch(pitch).rotateYaw(yaw)),
raytrace.getHitVec()));
BuilderGunHandler.addBeam(new LaserBeam(
start.add(barrelPosNoTransform.add(.09f, -.08f, 0).rotatePitch(pitch).rotateYaw(yaw)),
raytrace.getHitVec()));
}
BuilderGunHandler.shoot(hand);
applyCooldown(player, item, gunInOtherHand);
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
}
// Server side - Replace Blocks
boolean replace = nbt.contains("Replace") && nbt.getBoolean("Replace");
List<BlockPos> selectedBlocks = getSelectedBlocks(item, world, player);
applyPattern(selectedBlocks, item);
Direction face = raytrace.getFace();
for (BlockPos placed : selectedBlocks) {
if (world.getBlockState(placed) == stateToUse)
continue;
if (!stateToUse.isValidPosition(world, placed))
continue;
if (!player.isCreative() && !canBreak(item, world.getBlockState(placed), world, placed))
continue;
if (!player.isCreative() && BlockHelper.findAndRemoveInInventory(stateToUse, player, 1) == 0) {
player.getCooldownTracker().setCooldown(item.getItem(), 20);
player.sendStatusMessage(new StringTextComponent(TextFormatting.RED + "Out of Blocks!"), true);
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
}
if (!player.isCreative() && replace)
dropBlocks(world, player, item, face, placed);
for (Direction updateDirection : Direction.values())
stateToUse = stateToUse.updatePostPlacement(updateDirection,
world.getBlockState(placed.offset(updateDirection)), world, placed,
placed.offset(updateDirection));
IFluidState ifluidstate = world.getFluidState(placed);
world.setBlockState(placed, ifluidstate.getBlockState(), 18);
world.setBlockState(placed, stateToUse);
}
applyCooldown(player, item, gunInOtherHand);
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> player),
new BuilderGunBeamPacket(barrelPos, raytrace.getHitVec(), hand));
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, BlockState state, BlockPos pos,
LivingEntity entityLiving) {
if (entityLiving instanceof PlayerEntity && ((PlayerEntity) entityLiving).isCreative()) {
worldIn.setBlockState(pos, state);
return false;
}
return super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving);
}
@Override
public boolean onEntitySwing(ItemStack stack, LivingEntity entity) {
if (!(entity instanceof PlayerEntity))
return false;
if (entity.isSneaking())
return true;
Vec3d start = entity.getPositionVec().add(0, entity.getEyeHeight(), 0);
Vec3d range = entity.getLookVec().scale(getReachDistance(stack));
BlockRayTraceResult raytrace = entity.world.rayTraceBlocks(
new RayTraceContext(start, start.add(range), BlockMode.OUTLINE, FluidMode.NONE, entity));
BlockPos pos = raytrace.getPos();
if (pos == null)
return true;
entity.world.sendBlockBreakProgress(entity.getEntityId(), pos, -1);
BlockState newState = entity.world.getBlockState(pos);
if (BlockHelper.getRequiredItem(newState).isEmpty())
return true;
if (entity.world.getTileEntity(pos) != null)
return true;
if (newState.has(BlockStateProperties.DOUBLE_BLOCK_HALF))
return true;
if (newState.has(BlockStateProperties.ATTACHED))
return true;
if (newState.has(BlockStateProperties.HANGING))
return true;
if (newState.has(BlockStateProperties.BED_PART))
return true;
if (newState.has(BlockStateProperties.STAIRS_SHAPE))
newState = newState.with(BlockStateProperties.STAIRS_SHAPE, StairsShape.STRAIGHT);
if (stack.getTag().contains("BlockUsed")
&& NBTUtil.readBlockState(stack.getTag().getCompound("BlockUsed")) == newState)
return true;
stack.getTag().put("BlockUsed", NBTUtil.writeBlockState(newState));
entity.world.playSound((PlayerEntity) entity, entity.getPosition(), SoundEvents.BLOCK_NOTE_BLOCK_BELL,
SoundCategory.BLOCKS, 0.5f, 0.8f);
return true;
}
@Override
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
if (AllItems.PLACEMENT_HANDGUN.typeOf(stack)) {
CompoundNBT nbt = stack.getOrCreateTag();
if (!nbt.contains("Replace"))
nbt.putBoolean("Replace", false);
if (!nbt.contains("Pattern"))
nbt.putString("Pattern", PlacementPatterns.Solid.name());
if (!nbt.contains("SearchDiagonal"))
nbt.putBoolean("SearchDiagonal", false);
if (!nbt.contains("SearchMaterial"))
nbt.putBoolean("SearchMaterial", false);
if (!nbt.contains("SearchDistance"))
nbt.putInt("SearchDistance", 1);
}
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, PlayerEntity player) {
return true;
}
@Override
public int getUseDuration(ItemStack stack) {
return 0;
}
@Override
public void onPlayerStoppedUsing(ItemStack stack, World worldIn, LivingEntity entityLiving, int timeLeft) {
super.onPlayerStoppedUsing(stack, worldIn, entityLiving, timeLeft);
}
@Override
public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) {
boolean differentBlock = true;
if (oldStack.hasTag() && newStack.hasTag() && oldStack.getTag().contains("BlockUsed")
&& newStack.getTag().contains("BlockUsed"))
differentBlock = NBTUtil.readBlockState(oldStack.getTag().getCompound("BlockUsed")) != NBTUtil
.readBlockState(newStack.getTag().getCompound("BlockUsed"));
return slotChanged || !AllItems.PLACEMENT_HANDGUN.typeOf(newStack) || differentBlock;
}
@OnlyIn(Dist.CLIENT)
private void openHandgunGUI(ItemStack handgun, boolean offhand) {
ScreenOpener.open(new BuilderGunScreen(handgun, offhand));
}
public static List<BlockPos> getSelectedBlocks(ItemStack stack, World worldIn, PlayerEntity player) {
List<BlockPos> list = new LinkedList<>();
CompoundNBT tag = stack.getTag();
if (tag == null)
return list;
boolean searchDiagonals = tag.contains("SearchDiagonal") && tag.getBoolean("SearchDiagonal");
boolean searchAcrossMaterials = tag.contains("SearchFuzzy") && tag.getBoolean("SearchFuzzy");
boolean replace = tag.contains("Replace") && tag.getBoolean("Replace");
int searchRange = tag.contains("SearchDistance") ? tag.getInt("SearchDistance") : 0;
Set<BlockPos> visited = new HashSet<>();
List<BlockPos> frontier = new LinkedList<>();
Vec3d start = player.getPositionVec().add(0, player.getEyeHeight(), 0);
Vec3d range = player.getLookVec().scale(getReachDistance(stack));
BlockRayTraceResult raytrace = player.world.rayTraceBlocks(
new RayTraceContext(start, start.add(range), BlockMode.COLLIDER, FluidMode.NONE, player));
BlockPos pos = raytrace.getPos().toImmutable();
if (pos == null)
return list;
BlockState state = worldIn.getBlockState(pos);
Direction face = raytrace.getFace();
List<BlockPos> offsets = new LinkedList<>();
for (int x = -1; x <= 1; x++)
for (int y = -1; y <= 1; y++)
for (int z = -1; z <= 1; z++)
if (Math.abs(x) + Math.abs(y) + Math.abs(z) < 2 || searchDiagonals)
if (face.getAxis().getCoordinate(x, y, z) == 0)
offsets.add(new BlockPos(x, y, z));
BlockPos startPos = replace ? pos : pos.offset(face);
frontier.add(startPos);
while (!frontier.isEmpty()) {
BlockPos currentPos = frontier.remove(0);
if (visited.contains(currentPos))
continue;
visited.add(currentPos);
if (!currentPos.withinDistance(startPos, searchRange))
continue;
// Replace Mode
if (replace) {
BlockState stateToReplace = worldIn.getBlockState(currentPos);
BlockState stateAboveStateToReplace = worldIn.getBlockState(currentPos.offset(face));
// Criteria
if (stateToReplace.getBlockHardness(worldIn, currentPos) == -1)
continue;
if (stateToReplace.getBlock() != state.getBlock() && !searchAcrossMaterials)
continue;
if (stateToReplace.getMaterial().isReplaceable())
continue;
if (stateAboveStateToReplace.isSolid())
continue;
list.add(currentPos);
// Search adjacent spaces
for (BlockPos offset : offsets)
frontier.add(currentPos.add(offset));
continue;
}
// Place Mode
BlockState stateToPlaceAt = worldIn.getBlockState(currentPos);
BlockState stateToPlaceOn = worldIn.getBlockState(currentPos.offset(face.getOpposite()));
// Criteria
if (stateToPlaceOn.getMaterial().isReplaceable())
continue;
if (stateToPlaceOn.getBlock() != state.getBlock() && !searchAcrossMaterials)
continue;
if (!stateToPlaceAt.getMaterial().isReplaceable())
continue;
list.add(currentPos);
// Search adjacent spaces
for (BlockPos offset : offsets)
frontier.add(currentPos.add(offset));
continue;
}
return list;
}
public static boolean canBreak(ItemStack stack, BlockState state, World world, BlockPos pos) {
ComponentTier tier = getTier(Components.Body, stack);
float blockHardness = state.getBlockHardness(world, pos);
if (blockHardness == -1)
return false;
if (tier == ComponentTier.None)
return blockHardness < 3;
if (tier == ComponentTier.BlazeBrass)
return blockHardness < 6;
if (tier == ComponentTier.ChorusChrome)
return true;
return false;
}
public static int getMaxAoe(ItemStack stack) {
ComponentTier tier = getTier(Components.Amplifier, stack);
if (tier == ComponentTier.None)
return 2;
if (tier == ComponentTier.BlazeBrass)
return 4;
if (tier == ComponentTier.ChorusChrome)
return 8;
return 0;
}
public static int getCooldownDelay(ItemStack stack) {
ComponentTier tier = getTier(Components.Accelerator, stack);
if (tier == ComponentTier.None)
return 8;
if (tier == ComponentTier.BlazeBrass)
return 5;
if (tier == ComponentTier.ChorusChrome)
return 2;
return 20;
}
public static int getReachDistance(ItemStack stack) {
ComponentTier tier = getTier(Components.Scope, stack);
if (tier == ComponentTier.None)
return 15;
if (tier == ComponentTier.BlazeBrass)
return 30;
if (tier == ComponentTier.ChorusChrome)
return 100;
return 0;
}
public static void applyPattern(List<BlockPos> blocksIn, ItemStack stack) {
CompoundNBT tag = stack.getTag();
PlacementPatterns pattern = !tag.contains("Pattern") ? PlacementPatterns.Solid
: PlacementPatterns.valueOf(tag.getString("Pattern"));
Random r = new Random();
Predicate<BlockPos> filter = Predicates.alwaysFalse();
switch (pattern) {
case Chance25:
filter = pos -> r.nextBoolean() || r.nextBoolean();
break;
case Chance50:
filter = pos -> r.nextBoolean();
break;
case Chance75:
filter = pos -> r.nextBoolean() && r.nextBoolean();
break;
case Checkered:
filter = pos -> (pos.getX() + pos.getY() + pos.getZ()) % 2 == 0;
break;
case InverseCheckered:
filter = pos -> (pos.getX() + pos.getY() + pos.getZ()) % 2 != 0;
break;
case Solid:
default:
break;
}
blocksIn.removeIf(filter);
}
protected static void dropBlocks(World worldIn, PlayerEntity playerIn, ItemStack item, Direction face,
BlockPos placed) {
TileEntity tileentity = worldIn.getBlockState(placed).hasTileEntity() ? worldIn.getTileEntity(placed) : null;
if (getTier(Components.Retriever, item) == ComponentTier.None) {
Block.spawnDrops(worldIn.getBlockState(placed), worldIn, placed.offset(face), tileentity);
}
if (getTier(Components.Retriever, item) == ComponentTier.BlazeBrass)
Block.spawnDrops(worldIn.getBlockState(placed), worldIn, playerIn.getPosition(), tileentity);
if (getTier(Components.Retriever, item) == ComponentTier.ChorusChrome)
for (ItemStack stack : Block.getDrops(worldIn.getBlockState(placed), (ServerWorld) worldIn, placed,
tileentity))
if (!playerIn.inventory.addItemStackToInventory(stack))
Block.spawnAsEntity(worldIn, placed, stack);
}
protected static void applyCooldown(PlayerEntity playerIn, ItemStack item, boolean dual) {
playerIn.getCooldownTracker().setCooldown(item.getItem(),
dual ? getCooldownDelay(item) * 2 / 3 : getCooldownDelay(item));
}
public static ComponentTier getTier(Components component, ItemStack stack) {
if (!stack.hasTag() || !stack.getTag().contains(component.name()))
stack.getOrCreateTag().putString(component.name(), ComponentTier.None.name());
return ComponentTier.valueOf(stack.getTag().getString(component.name()));
}
public static void setTier(Components component, ComponentTier tier, ItemStack stack) {
stack.getOrCreateTag().putString(component.name(), tier.name());
}
}

View file

@ -0,0 +1,104 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import com.mojang.blaze3d.platform.GLX;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem.ComponentTier;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem.Components;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.client.model.animation.Animation;
public class BuilderGunItemRenderer extends ItemStackTileEntityRenderer {
@Override
public void renderByItem(ItemStack stack) {
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
BuilderGunModel mainModel = (BuilderGunModel) itemRenderer.getModelWithOverrides(stack);
float worldTime = Animation.getWorldTime(Minecraft.getInstance().world,
Minecraft.getInstance().getRenderPartialTicks());
GlStateManager.pushMatrix();
GlStateManager.translatef(0.5F, 0.5F, 0.5F);
float lastCoordx = GLX.lastBrightnessX;
float lastCoordy = GLX.lastBrightnessY;
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, Math.min(lastCoordx + 60, 240), Math.min(lastCoordy + 120, 240));
itemRenderer.renderItem(stack, mainModel.getBakedModel());
if (BuilderGunItem.getTier(Components.Body, stack) == ComponentTier.None)
itemRenderer.renderItem(stack, mainModel.body);
if (BuilderGunItem.getTier(Components.Body, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusBody);
if (BuilderGunItem.getTier(Components.Scope, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldScope);
if (BuilderGunItem.getTier(Components.Scope, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusScope);
if (BuilderGunItem.getTier(Components.Amplifier, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldAmp);
if (BuilderGunItem.getTier(Components.Amplifier, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusAmp);
if (BuilderGunItem.getTier(Components.Retriever, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldRetriever);
if (BuilderGunItem.getTier(Components.Retriever, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusRetriever);
if (BuilderGunItem.getTier(Components.Accelerator, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldAcc);
if (BuilderGunItem.getTier(Components.Accelerator, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusAcc);
if (mainModel.showBlock && stack.hasTag() && stack.getTag().contains("BlockUsed")) {
BlockState state = NBTUtil.readBlockState(stack.getTag().getCompound("BlockUsed"));
GlStateManager.pushMatrix();
GlStateManager.translatef(-0.8F, -0.7F, -0.5F);
GlStateManager.scalef(0.25F, 0.25F, 0.25F);
itemRenderer.renderItem(new ItemStack(state.getBlock()),
Minecraft.getInstance().getBlockRendererDispatcher().getModelForState(state));
GlStateManager.popMatrix();
}
GlStateManager.disableLighting();
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, MathHelper.sin(worldTime * 5) * 120 + 120, 120);
if (BuilderGunItem.getTier(Components.Accelerator, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldAccCore);
if (BuilderGunItem.getTier(Components.Accelerator, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusAccCore);
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 120);
if (BuilderGunItem.getTier(Components.Body, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldBody);
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 240);
if (BuilderGunItem.getTier(Components.Amplifier, stack) == ComponentTier.BlazeBrass)
itemRenderer.renderItem(stack, mainModel.goldAmpCore);
if (BuilderGunItem.getTier(Components.Amplifier, stack) == ComponentTier.ChorusChrome)
itemRenderer.renderItem(stack, mainModel.chorusAmpCore);
float angle = worldTime * -50;
angle %= 360;
float offset = -.19f;
GlStateManager.translatef(0, offset, 0);
GlStateManager.rotatef(angle, 0, 0, 1);
GlStateManager.translatef(0, -offset, 0);
itemRenderer.renderItem(stack, mainModel.rod);
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}

View file

@ -0,0 +1,72 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import javax.vecmath.Matrix4f;
import org.apache.commons.lang3.tuple.Pair;
import com.simibubi.create.foundation.block.CustomRenderItemBakedModel;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
import net.minecraftforge.client.event.ModelBakeEvent;
@SuppressWarnings("deprecation")
public class BuilderGunModel extends CustomRenderItemBakedModel {
public IBakedModel rod;
public IBakedModel body;
public boolean showBlock;
public IBakedModel goldBody;
public IBakedModel goldScope;
public IBakedModel goldAmp;
public IBakedModel goldAmpCore;
public IBakedModel goldRetriever;
public IBakedModel goldAcc;
public IBakedModel goldAccCore;
public IBakedModel chorusBody;
public IBakedModel chorusScope;
public IBakedModel chorusAmp;
public IBakedModel chorusAmpCore;
public IBakedModel chorusRetriever;
public IBakedModel chorusAcc;
public IBakedModel chorusAccCore;
public BuilderGunModel(IBakedModel template) {
super(template);
}
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
showBlock = cameraTransformType == TransformType.GUI;
return super.handlePerspective(cameraTransformType);
}
@Override
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
String p = "placement_handgun/";
this.rod = loadCustomModel(event, p + "core");
this.body = loadCustomModel(event, p + "body");
this.goldBody = loadCustomModel(event, p + "gold_body");
this.goldScope = loadCustomModel(event, p + "gold_scope");
this.goldAmp = loadCustomModel(event, p + "gold_amplifier");
this.goldAmpCore = loadCustomModel(event, p + "gold_amplifier_core");
this.goldRetriever = loadCustomModel(event, p + "gold_retriever");
this.goldAcc = loadCustomModel(event, p + "gold_accelerator");
this.goldAccCore = loadCustomModel(event, p + "gold_accelerator_core");
this.chorusBody = loadCustomModel(event, p + "chorus_body");
this.chorusScope = loadCustomModel(event, p + "chorus_scope");
this.chorusAmp = loadCustomModel(event, p + "chorus_amplifier");
this.chorusAmpCore = loadCustomModel(event, p + "chorus_amplifier_core");
this.chorusRetriever = loadCustomModel(event, p + "chorus_retriever");
this.chorusAcc = loadCustomModel(event, p + "chorus_accelerator");
this.chorusAccCore = loadCustomModel(event, p + "chorus_accelerator_core");
return this;
}
}

View file

@ -0,0 +1,231 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import java.util.Collections;
import java.util.Vector;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.platform.GlStateManager;
import com.simibubi.create.AllPackets;
import com.simibubi.create.foundation.gui.AbstractSimiScreen;
import com.simibubi.create.foundation.gui.ScreenResources;
import com.simibubi.create.foundation.gui.widgets.IconButton;
import com.simibubi.create.foundation.gui.widgets.Indicator;
import com.simibubi.create.foundation.gui.widgets.Indicator.State;
import com.simibubi.create.foundation.gui.widgets.Label;
import com.simibubi.create.foundation.gui.widgets.ScrollInput;
import com.simibubi.create.foundation.packet.NbtPacket;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.client.model.data.EmptyModelData;
@SuppressWarnings("deprecation")
public class BuilderGunScreen extends AbstractSimiScreen {
private ItemStack item;
private boolean offhand;
private float animationProgress;
private IconButton replaceModeButton;
private Indicator replaceModeIndicator;
private IconButton spreadDiagonallyButton;
private Indicator spreadDiagonallyIndicator;
private IconButton spreadMaterialButton;
private Indicator spreadMaterialIndicator;
private ScrollInput spreadRangeInput;
private Label spreadRangeLabel;
private Vector<IconButton> patternButtons;
public BuilderGunScreen(ItemStack handgun, boolean offhand) {
super();
item = handgun;
this.offhand = offhand;
}
@Override
protected void init() {
animationProgress = 0;
setWindowSize(ScreenResources.PLACEMENT_GUN.width + 40, ScreenResources.PLACEMENT_GUN.height);
super.init();
int i = topLeftX - 20;
int j = topLeftY;
CompoundNBT nbt = item.getOrCreateTag();
widgets.clear();
replaceModeIndicator = new Indicator(i + 51, j + 36, "");
replaceModeButton = new IconButton(i + 51, j + 41, ScreenResources.ICON_REPLACE_SOLID);
if (nbt.contains("Replace") && nbt.getBoolean("Replace"))
replaceModeIndicator.state = State.ON;
replaceModeButton.setToolTip("Replace Mode");
spreadDiagonallyIndicator = new Indicator(i + 74, j + 36, "");
spreadDiagonallyButton = new IconButton(i + 74, j + 41, ScreenResources.ICON_FOLLOW_DIAGONAL);
if (nbt.contains("SearchDiagonal") && nbt.getBoolean("SearchDiagonal"))
spreadDiagonallyIndicator.state = State.ON;
spreadDiagonallyButton.setToolTip("Follow Diagonals");
spreadMaterialIndicator = new Indicator(i + 92, j + 36, "");
spreadMaterialButton = new IconButton(i + 92, j + 41, ScreenResources.ICON_FOLLOW_MATERIAL);
if (nbt.contains("SearchFuzzy") && nbt.getBoolean("SearchFuzzy"))
spreadMaterialIndicator.state = State.ON;
spreadMaterialButton.setToolTip("Ignore Material Borders");
spreadRangeLabel = new Label(i + 119, j + 46, "").withShadow().withSuffix("m");
spreadRangeInput = new ScrollInput(i + 115, j + 43, 22, 14)
.withRange(1, BuilderGunItem.getMaxAoe(item)).setState(1)
.titled("Spread Range").writingTo(spreadRangeLabel);
if (nbt.contains("SearchDistance"))
spreadRangeInput.setState(nbt.getInt("SearchDistance"));
Collections.addAll(widgets, replaceModeButton, replaceModeIndicator, spreadDiagonallyButton,
spreadDiagonallyIndicator, spreadMaterialButton, spreadMaterialIndicator, spreadRangeLabel,
spreadRangeInput);
patternButtons = new Vector<>(6);
for (int row = 0; row <= 1; row++) {
for (int col = 0; col <= 2; col++) {
int id = patternButtons.size();
PlacementPatterns pattern = PlacementPatterns.values()[id];
patternButtons.add(new IconButton(i + 147 + col * 18, j + 23 + row * 18, pattern.icon));
patternButtons.get(id).setToolTip(pattern.displayName);
}
}
if (nbt.contains("Pattern"))
patternButtons.get(PlacementPatterns.valueOf(nbt.getString("Pattern")).ordinal()).active = false;
widgets.addAll(patternButtons);
}
@Override
public boolean mouseClicked(double x, double y, int button) {
CompoundNBT nbt = item.getTag();
if (replaceModeButton.isHovered()) {
boolean mode = nbt.contains("Replace") && nbt.getBoolean("Replace");
mode = !mode;
replaceModeIndicator.state = mode ? State.ON : State.OFF;
nbt.putBoolean("Replace", mode);
}
if (spreadDiagonallyButton.isHovered()) {
boolean mode = nbt.contains("SearchDiagonal") && nbt.getBoolean("SearchDiagonal");
mode = !mode;
spreadDiagonallyIndicator.state = mode ? State.ON : State.OFF;
nbt.putBoolean("SearchDiagonal", mode);
}
if (spreadMaterialButton.isHovered()) {
boolean mode = nbt.contains("SearchFuzzy") && nbt.getBoolean("SearchFuzzy");
mode = !mode;
spreadMaterialIndicator.state = mode ? State.ON : State.OFF;
nbt.putBoolean("SearchFuzzy", mode);
}
for (IconButton patternButton : patternButtons) {
if (patternButton.isHovered()) {
patternButtons.forEach(b -> b.active = true);
patternButton.active = false;
patternButton.playDownSound(Minecraft.getInstance().getSoundHandler());
nbt.putString("Pattern", PlacementPatterns.values()[patternButtons.indexOf(patternButton)].name());
}
}
return super.mouseClicked(x, y, button);
}
@Override
public void onClose() {
CompoundNBT nbt = item.getTag();
nbt.putInt("SearchDistance", spreadRangeInput.getState());
AllPackets.channel.sendToServer(new NbtPacket(item, offhand ? -2 : -1));
super.onClose();
}
@Override
public void tick() {
super.tick();
animationProgress += 5;
}
@Override
protected void renderWindow(int mouseX, int mouseY, float partialTicks) {
int i = topLeftX - 20;
int j = topLeftY;
ScreenResources.PLACEMENT_GUN.draw(this, i, j);
font.drawStringWithShadow("Placement Handgun", i + 8, j + 10, 0xCCDDFF);
font.drawString("Patterns", i + 148, j + 11, ScreenResources.FONT_COLOR);
minecraft.getTextureManager().bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
GlStateManager.enableBlend();
renderBlock();
GlStateManager.pushLightingAttributes();
GlStateManager.pushMatrix();
RenderHelper.enableStandardItemLighting();
GlStateManager.enableBlend();
GlStateManager.enableRescaleNormal();
GlStateManager.enableAlphaTest();
GlStateManager.alphaFunc(516, 0.1F);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.translated((this.width - this.sWidth) / 2 + 260, this.height / 2 - this.sHeight / 4, 100);
GlStateManager.rotatef(90 + 0.2f * animationProgress, 0, 1, 0);
GlStateManager.rotatef(-40, .8f, 0, -.0f);
GlStateManager.scaled(100, -100, 100);
IBakedModel model = itemRenderer.getModelWithOverrides(item);
model.handlePerspective(TransformType.FIXED);
itemRenderer.renderItem(item, model);
GlStateManager.disableAlphaTest();
GlStateManager.disableRescaleNormal();
GlStateManager.disableLighting();
GlStateManager.popMatrix();
GlStateManager.popAttributes();
}
private void renderBlock() {
GlStateManager.pushMatrix();
BufferBuilder buffer = Tessellator.getInstance().getBuffer();
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
GlStateManager.translated(topLeftX + 1.7f, topLeftY - 49, 120);
GlStateManager.rotatef(-30f, .5f, .9f, -.1f);
GlStateManager.scaled(20, -20, 20);
BlockState state = Blocks.BEACON.getDefaultState();
if (item.hasTag() && item.getTag().contains("BlockUsed"))
state = NBTUtil.readBlockState(item.getTag().getCompound("BlockUsed"));
minecraft.getBlockRendererDispatcher().renderBlock(state, new BlockPos(0, -5, 0), minecraft.world, buffer,
minecraft.world.rand, EmptyModelData.INSTANCE);
Tessellator.getInstance().draw();
GlStateManager.popMatrix();
}
}

View file

@ -0,0 +1,105 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import com.google.gson.JsonObject;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllRecipes;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem.ComponentTier;
import com.simibubi.create.modules.curiosities.placementHandgun.BuilderGunItem.Components;
import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.ICraftingRecipe;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.ShapedRecipe;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.JSONUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.registries.ForgeRegistryEntry;
public class BuilderGunUpgradeRecipe implements ICraftingRecipe {
private ShapedRecipe recipe;
private Components component;
private ComponentTier tier;
public BuilderGunUpgradeRecipe(ShapedRecipe recipe, Components component, ComponentTier tier) {
this.recipe = recipe;
this.component = component;
this.tier = tier;
}
@Override
public boolean matches(CraftingInventory inv, World worldIn) {
return recipe.matches(inv, worldIn);
}
@Override
public ItemStack getCraftingResult(CraftingInventory inv) {
for (int slot = 0; slot < inv.getSizeInventory(); slot++) {
ItemStack handgun = inv.getStackInSlot(slot).copy();
if (!AllItems.PLACEMENT_HANDGUN.typeOf(handgun))
continue;
BuilderGunItem.setTier(component, tier, handgun);
return handgun;
}
return ItemStack.EMPTY;
}
@Override
public ItemStack getRecipeOutput() {
ItemStack handgun = new ItemStack(AllItems.PLACEMENT_HANDGUN.get());
BuilderGunItem.setTier(component, tier, handgun);
return handgun;
}
@Override
public boolean isDynamic() {
return true;
}
@Override
public ResourceLocation getId() {
return recipe.getId();
}
@Override
public IRecipeSerializer<?> getSerializer() {
return AllRecipes.Placement_Handgun_Upgrade.serializer;
}
public static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<BuilderGunUpgradeRecipe> {
@Override
public BuilderGunUpgradeRecipe read(ResourceLocation recipeId, JsonObject json) {
ShapedRecipe recipe = IRecipeSerializer.CRAFTING_SHAPED.read(recipeId, json);
Components component = Components.valueOf(JSONUtils.getString(json, "component"));
ComponentTier tier = ComponentTier.valueOf(JSONUtils.getString(json, "tier"));
return new BuilderGunUpgradeRecipe(recipe, component, tier);
}
@Override
public BuilderGunUpgradeRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
ShapedRecipe recipe = IRecipeSerializer.CRAFTING_SHAPED.read(recipeId, buffer);
Components component = Components.valueOf(buffer.readString(buffer.readInt()));
ComponentTier tier = ComponentTier.valueOf(buffer.readString(buffer.readInt()));
return new BuilderGunUpgradeRecipe(recipe, component, tier);
}
@Override
public void write(PacketBuffer buffer, BuilderGunUpgradeRecipe recipe) {
IRecipeSerializer.CRAFTING_SHAPED.write(buffer, recipe.recipe);
String name = recipe.component.name();
String name2 = recipe.tier.name();
buffer.writeInt(name.length());
buffer.writeString(name);
buffer.writeInt(name2.length());
buffer.writeString(name2);
}
}
}

View file

@ -0,0 +1,22 @@
package com.simibubi.create.modules.curiosities.placementHandgun;
import com.simibubi.create.foundation.gui.ScreenResources;
public enum PlacementPatterns {
Solid("Solid Material", ScreenResources.ICON_PATTERN_SOLID),
Checkered("Checkerboard", ScreenResources.ICON_PATTERN_CHECKERED),
InverseCheckered("Inversed Checkerboard", ScreenResources.ICON_PATTERN_CHECKERED_INVERSED),
Chance25("25% Roll", ScreenResources.ICON_PATTERN_CHANCE_25),
Chance50("50% Roll", ScreenResources.ICON_PATTERN_CHANCE_50),
Chance75("75% Roll", ScreenResources.ICON_PATTERN_CHANCE_75);
public String displayName;
public ScreenResources icon;
private PlacementPatterns(String displayName, ScreenResources icon) {
this.displayName = displayName;
this.icon = icon;
}
}

View file

@ -146,10 +146,10 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen<Schematica
if (!((IconButton) w).getToolTip().isEmpty()) {
((IconButton) w).setToolTip(((IconButton) w).getToolTip().get(0));
((IconButton) w).getToolTip()
.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + "[Ctrl] for more Info");
.add(TextFormatting.DARK_GRAY + "< Hold Shift >");
}
if (hasControlDown()) {
if (hasShiftDown()) {
if (skipMissingButton.isHovered()) {
List<String> tip = skipMissingButton.getToolTip();
tip.remove(1);

View file

@ -30,6 +30,7 @@ import net.minecraft.network.PacketBuffer;
import net.minecraft.state.properties.BedPart;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.state.properties.DoubleBlockHalf;
import net.minecraft.state.properties.SlabType;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
@ -462,6 +463,11 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
// Find Item
ItemStack requiredItem = getItemForBlock(blockState);
if (blockState.has(BlockStateProperties.SLAB_TYPE)
&& blockState.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE)
requiredItem.setCount(2);
if (!findItemInAttachedInventories(requiredItem)) {
if (skipMissing) {
statusMsg = "Skipping";
@ -545,13 +551,34 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
if (hasCreativeCrate)
return true;
boolean two = requiredItem.getCount() == 2;
int lastSlot = -1;
for (IItemHandler iItemHandler : attachedInventories) {
for (int slot = 0; slot < iItemHandler.getSlots(); slot++) {
ItemStack stackInSlot = iItemHandler.getStackInSlot(slot);
if (!stackInSlot.isItemEqual(requiredItem))
continue;
if (!iItemHandler.extractItem(slot, 1, false).isEmpty())
if (!two && !iItemHandler.extractItem(slot, 1, false).isEmpty())
return true;
// Two Items required (Double slabs)
if (two) {
int count = iItemHandler.extractItem(slot, 2, true).getCount();
if (count == 2) {
iItemHandler.extractItem(slot, 2, false);
return true;
} else if (count == 1) {
if (lastSlot == -1)
lastSlot = slot;
else {
iItemHandler.extractItem(lastSlot, 1, false);
iItemHandler.extractItem(slot, 1, false);
return true;
}
}
}
}
}
return false;
@ -633,8 +660,7 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
if (state.has(BlockStateProperties.DOUBLE_BLOCK_HALF)
&& state.get(BlockStateProperties.DOUBLE_BLOCK_HALF) == DoubleBlockHalf.UPPER)
return true;
if (state.has(BlockStateProperties.BED_PART)
&& state.get(BlockStateProperties.BED_PART) == BedPart.HEAD)
if (state.has(BlockStateProperties.BED_PART) && state.get(BlockStateProperties.BED_PART) == BedPart.HEAD)
return true;
if (state.getBlock() instanceof PistonHeadBlock)
return true;
@ -754,6 +780,12 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
ItemStack requiredItem = getItemForBlock(required);
if (requiredItem.isEmpty())
continue;
// Two items for double slabs
if (required.has(BlockStateProperties.SLAB_TYPE)
&& required.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE)
checklist.require(requiredItem.getItem());
checklist.require(requiredItem.getItem());
blocksToPlace++;
}

View file

@ -5,7 +5,6 @@ import java.util.HashMap;
import org.lwjgl.glfw.GLFW;
import com.google.common.collect.ImmutableList;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllPackets;
import com.simibubi.create.Create;
@ -24,29 +23,25 @@ import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.nbt.NBTUtil;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.Mirror;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.gen.feature.template.PlacementSettings;
import net.minecraft.world.gen.feature.template.Template;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.GuiScreenEvent.MouseScrollEvent;
import net.minecraftforge.client.event.InputEvent.KeyInputEvent;
import net.minecraftforge.client.event.InputEvent.MouseInputEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.client.event.GuiScreenEvent.MouseScrollEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
@EventBusSubscriber(value = Dist.CLIENT, bus = Bus.FORGE)
@ -80,38 +75,6 @@ public class BlueprintHandler {
selectionScreen = new ToolSelectionScreen(ImmutableList.of(Tools.Deploy), this::equip);
}
@SubscribeEvent
public static void onPaperCrafted(ItemCraftedEvent event) {
if (event.isCanceled())
return;
if (event.getCrafting().getItem() == Items.PAPER) {
event.getPlayer()
.unlockRecipes(new ResourceLocation[] { AllItems.EMPTY_BLUEPRINT.get().getRegistryName() });
}
if (event.getCrafting().getItem() == Items.BONE_MEAL) {
event.getPlayer()
.unlockRecipes(new ResourceLocation[] { AllItems.TREE_FERTILIZER.get().getRegistryName() });
}
if (event.getCrafting().getItem() == Items.END_ROD) {
event.getPlayer().unlockRecipes(new ResourceLocation[] { AllItems.SYMMETRY_WAND.get().getRegistryName() });
}
if (AllItems.EMPTY_BLUEPRINT.typeOf(event.getCrafting())) {
event.getPlayer()
.unlockRecipes(new ResourceLocation[] { AllItems.BLUEPRINT_AND_QUILL.get().getRegistryName(),
AllBlocks.SCHEMATIC_TABLE.get().getRegistryName(),
AllBlocks.SCHEMATICANNON.get().getRegistryName() });
}
}
@SubscribeEvent
public static void onItemPickup(ItemPickupEvent event) {
if (event.isCanceled())
return;
if (event.getStack().getItem() == Items.END_ROD) {
event.getPlayer().unlockRecipes(new ResourceLocation[] { AllItems.SYMMETRY_WAND.get().getRegistryName() });
}
}
@SubscribeEvent
public static void onClientTick(ClientTickEvent event) {
ClientPlayerEntity player = Minecraft.getInstance().player;

View file

@ -92,6 +92,7 @@ public class ConfigureSchematicannonPacket {
return;
});
context.get().setPacketHandled(true);
}
}

View file

@ -34,6 +34,7 @@ public class SchematicPlacePacket {
t.addBlocksToWorld(player.getServerWorld(), NBTUtil.readBlockPos(stack.getTag().getCompound("Anchor")),
BlueprintItem.getSettings(stack));
});
context.get().setPacketHandled(true);
}
}

View file

@ -77,6 +77,7 @@ public class SchematicUploadPacket {
Create.sSchematicLoader.handleFinishedUpload(player, schematic);
}
});
context.get().setPacketHandled(true);
}
}

View file

@ -8,6 +8,8 @@ import net.minecraft.client.Minecraft;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.network.NetworkEvent.Context;
public class SymmetryEffectPacket {
@ -37,12 +39,14 @@ public class SymmetryEffectPacket {
}
}
public void handle(Supplier<Context> context) {
public void handle(Supplier<Context> ctx) {
ctx.get().enqueueWork(() -> DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
if (Minecraft.getInstance().player.getPositionVector().distanceTo(new Vec3d(mirror)) > 100)
return;
for (BlockPos to : positions)
SymmetryHandler.drawEffect(mirror, to);
}));
ctx.get().setPacketHandled(true);
}
}

View file

@ -7,6 +7,7 @@ import java.util.Map;
import com.simibubi.create.AllPackets;
import com.simibubi.create.foundation.gui.ScreenOpener;
import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.foundation.utility.KeyboardHelper;
import com.simibubi.create.modules.symmetry.mirror.CrossPlaneMirror;
import com.simibubi.create.modules.symmetry.mirror.EmptyMirror;
@ -49,7 +50,6 @@ public class SymmetryWandItem extends Item {
super(properties.maxStackSize(1));
}
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
@ -57,9 +57,10 @@ public class SymmetryWandItem extends Item {
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "Perfectly mirrors your Block placement"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "across the configured planes."));
tooltip.add(new StringTextComponent(""));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "> [Right-Click] on ground to place mirror"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "> [Right-Click] in air to configure mirror"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "> [Shift-Right-Click] to toggle"));
tooltip.add(
new StringTextComponent(TextFormatting.GRAY + "> [Right-Click] on ground to place/move mirror"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "> [Right-Click] in air to remove mirror"));
tooltip.add(new StringTextComponent(TextFormatting.GRAY + "> [Shift-Right-Click] to configure"));
tooltip.add(new StringTextComponent(""));
tooltip.add(new StringTextComponent(TextFormatting.DARK_GRAY + "Active while held in the Hotbar"));
@ -73,22 +74,28 @@ public class SymmetryWandItem extends Item {
PlayerEntity player = context.getPlayer();
BlockPos pos = context.getPos();
player.getCooldownTracker().setCooldown(this, 5);
ItemStack wand = player.getHeldItem(context.getHand());
checkNBT(wand);
// Shift -> open GUI
if (player.isSneaking()) {
if (player.world.isRemote) {
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
openWandGUI(wand);
});
player.getCooldownTracker().setCooldown(this, 5);
}
return ActionResultType.SUCCESS;
}
if (context.getWorld().isRemote || context.getHand() != Hand.MAIN_HAND)
return ActionResultType.SUCCESS;
ItemStack wand = player.getHeldItem(context.getHand());
checkNBT(wand);
CompoundNBT compound = wand.getTag().getCompound($SYMMETRY);
pos = pos.offset(context.getFace());
SymmetryMirror previousElement = SymmetryMirror.fromNBT(compound);
if (player.isSneaking()) {
if (!(previousElement instanceof EmptyMirror))
wand.getTag().putBoolean($ENABLE, !isEnabled(wand));
return ActionResultType.SUCCESS;
}
// No Shift -> Make / Move Mirror
wand.getTag().putBoolean($ENABLE, true);
Vec3d pos3d = new Vec3d(pos.getX(), pos.getY(), pos.getZ());
SymmetryMirror newElement = new PlaneMirror(pos3d);
@ -131,13 +138,23 @@ public class SymmetryWandItem extends Item {
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
ItemStack wand = playerIn.getHeldItem(handIn);
checkNBT(wand);
// Shift -> Open GUI
if (playerIn.isSneaking()) {
if (worldIn.isRemote) {
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
openWandGUI(playerIn.getHeldItem(handIn));
});
playerIn.getCooldownTracker().setCooldown(this, 5);
}
return super.onItemRightClick(worldIn, playerIn, handIn);
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, wand);
}
// No Shift -> Clear Mirror
wand.getTag().putBoolean($ENABLE, false);
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, wand);
}
@OnlyIn(Dist.CLIENT)
@ -179,31 +196,36 @@ public class SymmetryWandItem extends Item {
return;
symmetry.process(blockSet);
BlockPos to = new BlockPos(mirrorPos);
List<BlockPos> targets = new ArrayList<>();
targets.add(pos);
for (BlockPos position : blockSet.keySet()) {
if (position.equals(pos))
continue;
if (world.func_217350_a(block, position, ISelectionContext.forEntity(player))) {
Item required = BlockItem.BLOCK_TO_ITEM.get(block.getBlock());
BlockState blockState = blockSet.get(position);
for (Direction face : Direction.values())
blockState = blockState.updatePostPlacement(face, world.getBlockState(position.offset(face)), world,
position, position.offset(face));
if (player.isCreative()) {
world.setBlockState(position, blockSet.get(position));
world.setBlockState(position, blockState);
targets.add(position);
continue;
}
for (int i = 0; i < player.inventory.getSizeInventory(); ++i) {
ItemStack itemstack = player.inventory.getStackInSlot(i);
if (itemstack.getItem() == required && itemstack.getCount() > 0) {
player.inventory.setInventorySlotContents(i,
new ItemStack(itemstack.getItem(), itemstack.getCount() - 1));
world.setBlockState(position, blockSet.get(position));
BlockState toReplace = world.getBlockState(position);
if (!toReplace.getMaterial().isReplaceable())
continue;
if (toReplace.getBlockHardness(world, position) == -1)
continue;
if (BlockHelper.findAndRemoveInInventory(blockState, player, 1) == 0)
continue;
world.setBlockState(position, blockState);
targets.add(position);
break;
}
}
}
}

View file

@ -137,7 +137,7 @@ public class SymmetryWandScreen extends AbstractSimiScreen {
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.translated((this.width - this.sWidth) / 2 + 250, 250, 100);
GlStateManager.translated((this.width - this.sWidth) / 2 + 250, this.height / 2 + this.sHeight / 2, 100);
GlStateManager.rotatef(-30, .4f, 0, -.2f);
GlStateManager.rotatef(90 + 0.2f * animationProgress, 0, 1, 0);
GlStateManager.scaled(100, -100, 100);

View file

@ -0,0 +1,50 @@
package com.simibubi.create.modules.symmetry.client;
import com.mojang.blaze3d.platform.GLX;
import com.mojang.blaze3d.platform.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.client.model.animation.Animation;
public class SymmetryWandItemRenderer extends ItemStackTileEntityRenderer {
@Override
public void renderByItem(ItemStack stack) {
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
SymmetryWandModel mainModel = (SymmetryWandModel) itemRenderer.getModelWithOverrides(stack);
float worldTime = Animation.getWorldTime(Minecraft.getInstance().world,
Minecraft.getInstance().getRenderPartialTicks());
GlStateManager.pushMatrix();
GlStateManager.translatef(0.5F, 0.5F, 0.5F);
itemRenderer.renderItem(stack, mainModel.getBakedModel());
float lastCoordx = 0;
float lastCoordy = 0;
GlStateManager.disableLighting();
lastCoordx = GLX.lastBrightnessX;
lastCoordy = GLX.lastBrightnessY;
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, 240, 240);
itemRenderer.renderItem(stack, mainModel.core);
float floating = MathHelper.sin(worldTime) * .05f;
GlStateManager.translated(0, floating, 0);
float angle = worldTime * -10 % 360;
GlStateManager.rotated(angle, 0, 1, 0);
itemRenderer.renderItem(stack, mainModel.bits);
GLX.glMultiTexCoord2f(GLX.GL_TEXTURE1, lastCoordx, lastCoordy);
GlStateManager.enableLighting();
GlStateManager.popMatrix();
}
}

View file

@ -0,0 +1,24 @@
package com.simibubi.create.modules.symmetry.client;
import com.simibubi.create.foundation.block.CustomRenderItemBakedModel;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraftforge.client.event.ModelBakeEvent;
public class SymmetryWandModel extends CustomRenderItemBakedModel {
public IBakedModel core;
public IBakedModel bits;
public SymmetryWandModel(IBakedModel template) {
super(template);
}
@Override
public CustomRenderItemBakedModel loadPartials(ModelBakeEvent event) {
this.core = loadCustomModel(event, "symmetry_wand_core");
this.bits = loadCustomModel(event, "symmetry_wand_bits");
return this;
}
}

View file

@ -14,9 +14,9 @@ import net.minecraft.state.DirectionProperty;
import net.minecraft.state.IProperty;
import net.minecraft.state.properties.BlockStateProperties;
import net.minecraft.util.Direction;
import net.minecraft.util.Direction.Axis;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@ -156,67 +156,11 @@ public abstract class SymmetryMirror {
}
protected BlockState flipD1(BlockState in) {
for (IProperty<?> property : in.getProperties()) {
if (property == BlockStateProperties.AXIS || property == BlockStateProperties.HORIZONTAL_AXIS) {
Axis axis = ((Axis) in.get(property));
if (axis.isVertical())
return in;
Axis value = axis == Axis.X ? Axis.Z : Axis.X;
if (property == BlockStateProperties.AXIS)
return in.with(BlockStateProperties.AXIS, value);
return in.with(BlockStateProperties.HORIZONTAL_AXIS, value);
}
if (property instanceof DirectionProperty) {
switch ((Direction) in.get(property)) {
case EAST:
return in.with((DirectionProperty) property, Direction.NORTH);
case NORTH:
return in.with((DirectionProperty) property, Direction.EAST);
case SOUTH:
return in.with((DirectionProperty) property, Direction.WEST);
case WEST:
return in.with((DirectionProperty) property, Direction.SOUTH);
default:
break;
}
}
}
return in;
return in.rotate(Rotation.COUNTERCLOCKWISE_90).mirror(Mirror.FRONT_BACK);
}
protected BlockState flipD2(BlockState in) {
for (IProperty<?> property : in.getProperties()) {
if (property == BlockStateProperties.AXIS || property == BlockStateProperties.HORIZONTAL_AXIS) {
Axis axis = ((Axis) in.get(property));
if (axis.isVertical())
return in;
Axis value = axis == Axis.X ? Axis.Z : Axis.X;
if (property == BlockStateProperties.AXIS)
return in.with(BlockStateProperties.AXIS, value);
return in.with(BlockStateProperties.HORIZONTAL_AXIS, value);
}
if (property instanceof DirectionProperty) {
switch ((Direction) in.get(property)) {
case EAST:
return in.with((DirectionProperty) property, Direction.SOUTH);
case NORTH:
return in.with((DirectionProperty) property, Direction.WEST);
case SOUTH:
return in.with((DirectionProperty) property, Direction.EAST);
case WEST:
return in.with((DirectionProperty) property, Direction.NORTH);
default:
break;
}
}
}
return in;
return in.rotate(Rotation.COUNTERCLOCKWISE_90).mirror(Mirror.LEFT_RIGHT);
}
protected BlockPos flipX(BlockPos position) {

View file

@ -14,7 +14,7 @@ loaderVersion="[26,)" #mandatory (26 is current forge version)
# The modid of the mod
modId="create" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
version="0.0.3" #mandatory
version="0.0.4" #mandatory
# A display name for the mod
displayName="Create" #mandatory
# A URL to query for updates for this mod. See the JSON update specification <here>

View file

@ -1,7 +1,11 @@
{
"item.create.symmetry_wand": "Staff of Symmetry",
"item.create.placement_handgun": "Handheld Blockzapper",
"item.create.tree_fertilizer": "Tree Fertilizer",
"item.create.empty_blueprint": "Empty Schematic",
"item.create.andesite_alloy_cube": "Andesite Alloy",
"item.create.blaze_brass_cube": "Blaze Brass",
"item.create.chorus_chrome_cube": "Chorus Chrome",
"item.create.blueprint_and_quill": "Schematic and Quill",
"item.create.blueprint": "Schematic",
"block.create.schematicannon": "Schematicannon",

View file

@ -3,7 +3,7 @@
"textures": {
"0": "block/white_stained_glass",
"1": "block/obsidian",
"2": "block/light_blue_concrete_powder"
"2": "block/packed_ice"
},
"elements": [
{

View file

@ -3,7 +3,7 @@
"textures": {
"0": "block/white_stained_glass",
"1": "block/obsidian",
"2": "block/light_blue_concrete_powder"
"2": "block/packed_ice"
},
"elements": [
{

View file

@ -3,7 +3,7 @@
"textures": {
"0": "block/white_stained_glass",
"1": "block/obsidian",
"2": "block/light_blue_concrete_powder"
"2": "block/packed_ice"
},
"elements": [
{

View file

@ -3,7 +3,7 @@
"textures": {
"0": "block/white_stained_glass",
"1": "block/obsidian",
"2": "block/light_blue_concrete_powder"
"2": "block/packed_ice"
},
"elements": [
{

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/andesite_alloy_cube"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/blaze_brass_cube"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "create:item/chorus_chrome_cube"
}
}

View file

@ -0,0 +1,95 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": true,
"display": {
"firstperson_righthand": {
"rotation": [ 10, 0, 10 ],
"translation": [ 1, 4, 1],
"scale":[ 1, 1, 1 ]
},
"thirdperson_righthand": {
"rotation": [ 15, 0, 0 ],
"translation": [ 0, 4, -2.5],
"scale":[ 0.8, 0.8, 0.8 ]
},
"gui": {
"rotation": [ 42, 315, 0 ],
"translation": [ -1, 3, 0],
"scale":[ 1, 1, 1 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 4.2, 0],
"scale":[ 0.4, 0.4, 0.4 ]
},
"fixed": {
"rotation": [ 0, 90, 0 ],
"translation": [ 0, -5, 0 ],
"scale": [ 1, 1, 1 ]
}
},
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian"
},
"elements": [
{
"name": "Grip",
"from": [ 7.0, 1.0, 12.0 ],
"to": [ 9.0, 5.0, 15.0 ],
"rotation": { "origin": [ 8.0, 2.0, 14.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 4.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 4.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 4.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 4.0 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 3.0 ] }
}
},
{
"name": "Connector",
"from": [ 6.499999992549419, 4.0, 7.300000004470348 ],
"to": [ 9.49999999254942, 5.0, 14.300000004470348 ],
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 7.0, 1.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 7.0, 1.0 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 7.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 7.0 ] }
}
},
{
"name": "Trigger",
"from": [ 7.499999992549419, 3.0, 11.0 ],
"to": [ 8.49999999254942, 6.0, 13.0 ],
"rotation": { "origin": [ 8.0, 2.0, 14.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"east": { "texture": "#4", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
"south": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"west": { "texture": "#4", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
"up": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
"down": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 2.0 ] }
}
},
{
"name": "Rod Back Cap",
"from": [ 6.799999997019768, 3.800000011920929, 14.0 ],
"to": [ 9.200000002980232, 6.200000017881393, 15.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.4000000059604645 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.4000000059604645 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.4000000059604645, 1.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.4000000059604645, 1.0 ] }
}
}
]
}

View file

@ -0,0 +1,28 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": true,
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian"
},
"elements": [
{
"name": "Rod Back",
"from": [ 7.0, 4.000000014901161, 7.0 ],
"to": [ 9.0, 6.000000014901161, 14.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 7.0, 2.0 ] },
"south": { "texture": "#1", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"west": { "texture": "#1", "uv": [ 4.0, 3.0, 11.0, 5.0 ] },
"up": { "texture": "#1", "uv": [ 6.0, 5.0, 8.0, 12.0 ] },
"down": { "texture": "#1", "uv": [ 8.0, 6.0, 10.0, 13.0 ] }
}
}
]
}

View file

@ -0,0 +1,53 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/purpur_pillar"
},
"elements": [
{
"name": "Accelerator",
"from": [ 6.499999992549419, 5.0, 10.300000004470348 ],
"to": [ 9.49999999254942, 6.0, 15.300000004470348 ],
"faces": {
"north": { "texture": "#5", "uv": [ 7.0, 1.0, 10.0, 2.0 ] },
"south": { "texture": "#5", "uv": [ 6.0, 3.0, 9.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 6.0, 10.0, 9.0, 15.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 0.0, 10.0, 5.0 ] }
}
},
{
"name": "Accelerator Connector",
"from": [ 6.4000000059604645, 7.300000004470348, 10.300000004470348 ],
"to": [ 9.600000008940697, 8.699999995529652, 11.699999995529652 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 13.0, 1.0, 15.0, 3.0 ] },
"east": { "texture": "#0", "uv": [ 4.0, 2.0, 5.399999991059303, 3.3999999910593033 ] },
"south": { "texture": "#0", "uv": [ 1.0, 6.0, 4.200000002980232, 7.399999991059303 ] },
"west": { "texture": "#0", "uv": [ 4.0, 2.0, 5.399999991059303, 3.3999999910593033 ] },
"up": { "texture": "#0", "uv": [ 5.0, 6.0, 8.200000002980232, 7.399999991059303 ] },
"down": { "texture": "#0", "uv": [ 4.0, 4.0, 7.200000002980232, 5.399999991059303 ] }
}
},
{
"name": "Accelerator Back Cap",
"from": [ 7.100000001490116, 4.3000000193715096, 15.0 ],
"to": [ 8.699999995529652, 5.900000013411045, 15.399999991059303 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#5", "uv": [ 12.0, 4.0, 13.0, 6.4000000059604645 ] },
"south": { "texture": "#5", "uv": [ 11.0, 5.0, 13.0, 7.0 ] },
"west": { "texture": "#5", "uv": [ 6.0, 2.0, 7.0, 4.4000000059604645 ] },
"up": { "texture": "#5", "uv": [ 7.0, 6.0, 9.400000005960464, 7.0 ] },
"down": { "texture": "#5", "uv": [ 9.0, 0.0, 11.400000005960464, 1.0 ] }
}
}
]
}

View file

@ -0,0 +1,23 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/purpur_pillar"
},
"elements": [
{
"name": "Accelerator Core",
"from": [ 6.499999992549419, 5.0, 10.300000004470348 ],
"to": [ 9.49999999254942, 6.0, 15.300000004470348 ],
"faces": {
"east": { "texture": "#2", "uv": [ 4.0, 2.0, 9.0, 3.0 ] },
"west": { "texture": "#2", "uv": [ 7.0, 2.0, 12.0, 3.0 ] }
}
}
]
}

View file

@ -0,0 +1,71 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/purpur_pillar",
"6": "block/redstone_block"
},
"elements": [
{
"name": "Amplifier",
"from": [ 10.000000014901161, 4.0, 4.0 ],
"to": [ 11.000000014901161, 5.0, 10.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 1.0, 2.0, 2.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 10.0, 0.0, 16.0, 1.0 ] },
"south": { "texture": "#5", "uv": [ 7.0, 7.0, 8.0, 8.0 ] },
"west": { "texture": "#5", "uv": [ 0.0, 1.0, 6.0, 2.0 ] },
"up": { "texture": "#5", "uv": [ 2.0, 0.0, 1.0, 6.0 ] },
"down": { "texture": "#5", "uv": [ 13.0, 10.0, 14.0, 16.0 ] }
}
},
{
"name": "Amplifier Connector",
"from": [ 9.800000011920929, 5.0, 8.0 ],
"to": [ 10.800000011920929, 8.0, 9.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"east": { "texture": "#0", "uv": [ 6.0, 3.0, 7.0, 6.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"west": { "texture": "#0", "uv": [ 10.0, 2.0, 14.0, 3.0 ] },
"up": { "texture": "#0", "uv": [ 15.0, 11.0, 14.0, 15.0 ] },
"down": { "texture": "#0", "uv": [ 10.0, 3.0, 11.0, 4.0 ] }
}
},
{
"name": "Amplifier Connector 2",
"from": [ 7.800000011920929, 7.0, 8.0 ],
"to": [ 9.800000011920929, 8.0, 9.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] },
"east": { "texture": "#0", "uv": [ 6.0, 3.0, 7.0, 4.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] },
"west": { "texture": "#0", "uv": [ 10.0, 2.0, 13.0, 3.0 ] },
"up": { "texture": "#0", "uv": [ 7.0, 6.0, 9.0, 7.0 ] },
"down": { "texture": "#0", "uv": [ 10.0, 3.0, 12.0, 4.0 ] }
}
},
{
"name": "Amplifier 2",
"from": [ 5.000000014901161, 3.0, 4.0 ],
"to": [ 6.000000014901161, 4.0, 10.0 ],
"rotation": { "origin": [ 5.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 1.0, 2.0, 2.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 10.0, 0.0, 16.0, 1.0 ] },
"south": { "texture": "#5", "uv": [ 7.0, 7.0, 8.0, 8.0 ] },
"west": { "texture": "#5", "uv": [ 0.0, 1.0, 6.0, 2.0 ] },
"up": { "texture": "#5", "uv": [ 2.0, 0.0, 1.0, 6.0 ] },
"down": { "texture": "#5", "uv": [ 13.0, 10.0, 14.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,71 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/purpur_pillar",
"6": "block/redstone_block"
},
"elements": [
{
"name": "Amplifier Core",
"from": [ 10.000000014901161, 4.0, 3.0 ],
"to": [ 11.000000014901161, 5.0, 4.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"east": { "texture": "#2", "uv": [ 10.0, 1.0, 11.0, 2.0 ] },
"south": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"west": { "texture": "#2", "uv": [ 3.0, 5.0, 4.0, 6.0 ] },
"up": { "texture": "#2", "uv": [ 11.0, 1.0, 10.0, 2.0 ] },
"down": { "texture": "#2", "uv": [ 13.0, 10.0, 14.0, 11.0 ] }
}
},
{
"name": "Amplifier Core 2",
"from": [ 5.000000014901161, 3.0, 3.0 ],
"to": [ 6.000000014901161, 4.0, 4.0 ],
"rotation": { "origin": [ 5.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"east": { "texture": "#2", "uv": [ 10.0, 1.0, 11.0, 2.0 ] },
"south": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"west": { "texture": "#2", "uv": [ 3.0, 5.0, 4.0, 6.0 ] },
"up": { "texture": "#2", "uv": [ 11.0, 1.0, 10.0, 2.0 ] },
"down": { "texture": "#2", "uv": [ 13.0, 10.0, 14.0, 11.0 ] }
}
},
{
"name": "Amplifier Glow",
"from": [ 9.8, 3.7999999970197678, 2.7999999970197678 ],
"to": [ 11.200000005960465, 5.200000002980232, 4.200000002980232 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"south": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"west": { "texture": "#3", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"up": { "texture": "#3", "uv": [ 7.0, 6.0, 9.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }
}
},
{
"name": "Amplifier Glow 2",
"from": [ 4.800000000000001, 2.7999999970197678, 2.7999999970197678 ],
"to": [ 6.200000005960465, 4.200000002980232, 4.200000002980232 ],
"rotation": { "origin": [ 5.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"south": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"west": { "texture": "#3", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"up": { "texture": "#3", "uv": [ 7.0, 6.0, 9.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }
}
}
]
}

View file

@ -0,0 +1,28 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": true,
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/end_stone",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian"
},
"elements": [
{
"name": "Rod Back",
"from": [ 7.0, 4.000000014901161, 7.0 ],
"to": [ 9.0, 6.000000014901161, 14.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 7.0, 2.0 ] },
"south": { "texture": "#1", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"west": { "texture": "#1", "uv": [ 4.0, 3.0, 11.0, 5.0 ] },
"up": { "texture": "#1", "uv": [ 6.0, 5.0, 8.0, 12.0 ] },
"down": { "texture": "#1", "uv": [ 8.0, 6.0, 10.0, 13.0 ] }
}
}
]
}

View file

@ -0,0 +1,341 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/gold_block",
"6": "block/redstone_block"
},
"elements": [
{
"name": "Grip",
"from": [ 7.0, 1.0, 12.0 ],
"to": [ 9.0, 5.0, 15.0 ],
"rotation": { "origin": [ 8.0, 2.0, 14.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 4.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 4.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 4.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 4.0 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 3.0 ] }
}
},
{
"name": "Connector",
"from": [ 6.499999992549419, 4.0, 7.300000004470348 ],
"to": [ 9.49999999254942, 5.0, 14.300000004470348 ],
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 7.0, 1.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 1.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 7.0, 1.0 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 7.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 3.0, 7.0 ] }
}
},
{
"name": "Rod Back",
"from": [ 7.0, 4.000000014901161, 7.0 ],
"to": [ 9.0, 6.000000014901161, 14.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 7.0, 2.0 ] },
"south": { "texture": "#1", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"west": { "texture": "#1", "uv": [ 4.0, 3.0, 11.0, 5.0 ] },
"up": { "texture": "#1", "uv": [ 6.0, 5.0, 8.0, 12.0 ] },
"down": { "texture": "#1", "uv": [ 8.0, 6.0, 10.0, 13.0 ] }
}
},
{
"name": "Rod Front",
"from": [ 7.300000004470348, 4.3000000193715096, 0.5000000074505806 ],
"to": [ 8.699999995529652, 5.700000010430813, 8.50000000745058 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 1.3999999910593033, 1.3999999910593033 ] },
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 8.0, 1.3999999910593033 ] },
"south": { "texture": "#2", "uv": [ 0.0, 0.0, 1.3999999910593033, 1.3999999910593033 ] },
"west": { "texture": "#2", "uv": [ 0.0, 0.0, 8.0, 1.3999999910593033 ] },
"up": { "texture": "#2", "uv": [ 0.0, 0.0, 1.3999999910593033, 8.0 ] },
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 1.3999999910593033, 8.0 ] }
}
},
{
"name": "Rod Glow",
"from": [ 6.899999998509884, 3.900000013411045, 0.0 ],
"to": [ 9.100000001490116, 6.100000016391277, 7.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 0.0, 0.0, 2.2000000029802322, 2.2000000029802322 ] },
"east": { "texture": "#3", "uv": [ 0.0, 0.0, 7.0, 2.2000000029802322 ] },
"south": { "texture": "#3", "uv": [ 0.0, 0.0, 2.2000000029802322, 2.2000000029802322 ] },
"west": { "texture": "#3", "uv": [ 0.0, 0.0, 7.0, 2.2000000029802322 ] },
"up": { "texture": "#3", "uv": [ 0.0, 0.0, 2.2000000029802322, 7.0 ] },
"down": { "texture": "#3", "uv": [ 0.0, 0.0, 2.2000000029802322, 7.0 ] }
}
},
{
"name": "Trigger",
"from": [ 7.499999992549419, 3.0, 11.0 ],
"to": [ 8.49999999254942, 6.0, 13.0 ],
"rotation": { "origin": [ 8.0, 2.0, 14.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"east": { "texture": "#4", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
"south": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"west": { "texture": "#4", "uv": [ 0.0, 0.0, 2.0, 3.0 ] },
"up": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 2.0 ] },
"down": { "texture": "#4", "uv": [ 0.0, 0.0, 1.0, 2.0 ] }
}
},
{
"name": "Rod Back Cap",
"from": [ 6.799999997019768, 3.800000011920929, 14.0 ],
"to": [ 9.200000002980232, 6.200000017881393, 15.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.4000000059604645 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"west": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 2.4000000059604645 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 2.4000000059604645, 1.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 2.4000000059604645, 1.0 ] }
}
},
{
"name": "Scope",
"from": [ 7.500000007450581, 6.0, 6.0 ],
"to": [ 8.50000000745058, 7.0, 12.0 ],
"faces": {
"north": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 8.0 ] },
"east": { "texture": "#5", "uv": [ 8.0, 15.0, 14.0, 16.0 ] },
"south": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 9.0 ] },
"west": { "texture": "#5", "uv": [ 6.0, 15.0, 12.0, 16.0 ] },
"up": { "texture": "#5", "uv": [ 15.0, 5.0, 16.0, 11.0 ] },
"down": { "texture": "#5", "uv": [ 15.0, 4.0, 16.0, 10.0 ] }
}
},
{
"name": "Scope Back",
"from": [ 7.200000002980232, 7.0, 10.0 ],
"to": [ 8.800000011920929, 9.0, 12.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 13.0, 1.0, 15.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 4.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 6.0, 2.6000000089406967, 8.0 ] },
"west": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 5.0, 6.0, 6.600000008940697, 8.0 ] },
"down": { "texture": "#5", "uv": [ 4.0, 4.0, 5.600000008940697, 6.0 ] }
}
},
{
"name": "ScopeTop",
"from": [ 7.0, 7.0, 9.0 ],
"to": [ 9.0, 9.0, 13.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#5", "uv": [ 6.0, 3.0, 10.0, 5.0 ] },
"south": { "texture": "#3", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"west": { "texture": "#5", "uv": [ 10.0, 2.0, 14.0, 3.0 ] },
"up": { "texture": "#5", "uv": [ 15.0, 11.0, 14.0, 15.0 ] },
"down": { "texture": "#5", "uv": [ 10.0, 3.0, 12.0, 7.0 ] }
}
},
{
"name": "Amplifier",
"from": [ 10.000000014901161, 4.0, 4.0 ],
"to": [ 11.000000014901161, 5.0, 10.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 1.0, 2.0, 2.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 10.0, 0.0, 16.0, 1.0 ] },
"south": { "texture": "#5", "uv": [ 7.0, 7.0, 8.0, 8.0 ] },
"west": { "texture": "#5", "uv": [ 0.0, 1.0, 6.0, 2.0 ] },
"up": { "texture": "#5", "uv": [ 2.0, 0.0, 1.0, 6.0 ] },
"down": { "texture": "#5", "uv": [ 13.0, 10.0, 14.0, 16.0 ] }
}
},
{
"name": "Amplifier Connector",
"from": [ 9.800000011920929, 5.0, 8.0 ],
"to": [ 10.800000011920929, 8.0, 9.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"east": { "texture": "#0", "uv": [ 6.0, 3.0, 7.0, 6.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"west": { "texture": "#0", "uv": [ 10.0, 2.0, 14.0, 3.0 ] },
"up": { "texture": "#0", "uv": [ 15.0, 11.0, 14.0, 15.0 ] },
"down": { "texture": "#0", "uv": [ 10.0, 3.0, 11.0, 4.0 ] }
}
},
{
"name": "Amplifier Glow",
"from": [ 9.8, 3.7999999970197678, 2.7999999970197678 ],
"to": [ 11.200000005960465, 5.200000002980232, 4.200000002980232 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"south": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"west": { "texture": "#3", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"up": { "texture": "#3", "uv": [ 7.0, 6.0, 9.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }
}
},
{
"name": "Amplifier Core",
"from": [ 10.000000014901161, 4.0, 3.0 ],
"to": [ 11.000000014901161, 5.0, 4.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"east": { "texture": "#2", "uv": [ 10.0, 1.0, 11.0, 2.0 ] },
"south": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"west": { "texture": "#2", "uv": [ 3.0, 5.0, 4.0, 6.0 ] },
"up": { "texture": "#2", "uv": [ 11.0, 1.0, 10.0, 2.0 ] },
"down": { "texture": "#2", "uv": [ 13.0, 10.0, 14.0, 11.0 ] }
}
},
{
"name": "Retriever Back",
"from": [ 7.0, 2.0, 8.0 ],
"to": [ 9.0, 4.0, 9.0 ],
"rotation": { "origin": [ 8.0, 3.0, 7.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#5", "uv": [ 12.0, 4.0, 14.0, 6.0 ] },
"east": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 10.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 13.0, 3.0, 15.0 ] },
"west": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 9.0 ] },
"up": { "texture": "#5", "uv": [ 3.0, 15.0, 5.0, 16.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 15.0, 9.0, 16.0 ] }
}
},
{
"name": "Accelerator",
"from": [ 6.499999992549419, 5.0, 10.300000004470348 ],
"to": [ 9.49999999254942, 6.0, 15.300000004470348 ],
"faces": {
"north": { "texture": "#5", "uv": [ 7.0, 1.0, 10.0, 2.0 ] },
"south": { "texture": "#5", "uv": [ 6.0, 3.0, 9.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 6.0, 10.0, 9.0, 15.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 0.0, 10.0, 5.0 ] }
}
},
{
"name": "Accelerator Core",
"from": [ 6.499999992549419, 5.0, 10.300000004470348 ],
"to": [ 9.49999999254942, 6.0, 15.300000004470348 ],
"faces": {
"east": { "texture": "#2", "uv": [ 4.0, 2.0, 9.0, 3.0 ] },
"west": { "texture": "#2", "uv": [ 7.0, 2.0, 12.0, 3.0 ] }
}
},
{
"name": "Accelerator Connector",
"from": [ 6.4000000059604645, 7.300000004470348, 10.300000004470348 ],
"to": [ 9.600000008940697, 8.699999995529652, 11.699999995529652 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 13.0, 1.0, 15.0, 3.0 ] },
"east": { "texture": "#0", "uv": [ 4.0, 2.0, 5.399999991059303, 3.3999999910593033 ] },
"south": { "texture": "#0", "uv": [ 1.0, 6.0, 4.200000002980232, 7.399999991059303 ] },
"west": { "texture": "#0", "uv": [ 4.0, 2.0, 5.399999991059303, 3.3999999910593033 ] },
"up": { "texture": "#0", "uv": [ 5.0, 6.0, 8.200000002980232, 7.399999991059303 ] },
"down": { "texture": "#0", "uv": [ 4.0, 4.0, 7.200000002980232, 5.399999991059303 ] }
}
},
{
"name": "Accelerator Back Cap",
"from": [ 7.100000001490116, 4.3000000193715096, 15.0 ],
"to": [ 8.699999995529652, 5.900000013411045, 15.399999991059303 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#5", "uv": [ 12.0, 4.0, 13.0, 6.4000000059604645 ] },
"south": { "texture": "#5", "uv": [ 11.0, 5.0, 13.0, 7.0 ] },
"west": { "texture": "#5", "uv": [ 6.0, 2.0, 7.0, 4.4000000059604645 ] },
"up": { "texture": "#5", "uv": [ 7.0, 6.0, 9.400000005960464, 7.0 ] },
"down": { "texture": "#5", "uv": [ 9.0, 0.0, 11.400000005960464, 1.0 ] }
}
},
{
"name": "Amplifier Connector 2",
"from": [ 7.800000011920929, 7.0, 8.0 ],
"to": [ 9.800000011920929, 8.0, 9.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] },
"east": { "texture": "#0", "uv": [ 6.0, 3.0, 7.0, 4.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 2.0, 1.0 ] },
"west": { "texture": "#0", "uv": [ 10.0, 2.0, 13.0, 3.0 ] },
"up": { "texture": "#0", "uv": [ 7.0, 6.0, 9.0, 7.0 ] },
"down": { "texture": "#0", "uv": [ 10.0, 3.0, 12.0, 4.0 ] }
}
},
{
"name": "Amplifier 2",
"from": [ 5.000000014901161, 3.0, 4.0 ],
"to": [ 6.000000014901161, 4.0, 10.0 ],
"rotation": { "origin": [ 5.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 1.0, 2.0, 2.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 10.0, 0.0, 16.0, 1.0 ] },
"south": { "texture": "#5", "uv": [ 7.0, 7.0, 8.0, 8.0 ] },
"west": { "texture": "#5", "uv": [ 0.0, 1.0, 6.0, 2.0 ] },
"up": { "texture": "#5", "uv": [ 2.0, 0.0, 1.0, 6.0 ] },
"down": { "texture": "#5", "uv": [ 13.0, 10.0, 14.0, 16.0 ] }
}
},
{
"name": "Amplifier Core 2",
"from": [ 5.000000014901161, 3.0, 3.0 ],
"to": [ 6.000000014901161, 4.0, 4.0 ],
"rotation": { "origin": [ 5.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"east": { "texture": "#2", "uv": [ 10.0, 1.0, 11.0, 2.0 ] },
"south": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"west": { "texture": "#2", "uv": [ 3.0, 5.0, 4.0, 6.0 ] },
"up": { "texture": "#2", "uv": [ 11.0, 1.0, 10.0, 2.0 ] },
"down": { "texture": "#2", "uv": [ 13.0, 10.0, 14.0, 11.0 ] }
}
},
{
"name": "Amplifier Glow 2",
"from": [ 4.800000000000001, 2.7999999970197678, 2.7999999970197678 ],
"to": [ 6.200000005960465, 4.200000002980232, 4.200000002980232 ],
"rotation": { "origin": [ 5.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"south": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"west": { "texture": "#3", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"up": { "texture": "#3", "uv": [ 7.0, 6.0, 9.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }
}
},
{
"name": "Retriever Front",
"from": [ 6.0, 2.0, 7.0 ],
"to": [ 10.0, 3.0, 8.0 ],
"rotation": { "origin": [ 8.0, 3.0, 7.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#6", "uv": [ 2.0, 14.0, 6.0, 15.0 ] },
"east": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 9.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 13.0, 5.0, 14.0 ] },
"west": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 8.0 ] },
"up": { "texture": "#5", "uv": [ 3.0, 15.0, 7.0, 16.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 15.0, 11.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,43 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/purpur_pillar",
"6": "block/green_concrete_powder"
},
"elements": [
{
"name": "Retriever Back",
"from": [ 7.0, 2.0, 8.0 ],
"to": [ 9.0, 4.0, 9.0 ],
"rotation": { "origin": [ 8.0, 3.0, 7.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#5", "uv": [ 12.0, 4.0, 14.0, 6.0 ] },
"east": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 10.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 13.0, 3.0, 15.0 ] },
"west": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 9.0 ] },
"up": { "texture": "#5", "uv": [ 3.0, 15.0, 5.0, 16.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 15.0, 9.0, 16.0 ] }
}
},
{
"name": "Retriever Front",
"from": [ 6.0, 2.0, 7.0 ],
"to": [ 10.0, 3.0, 8.0 ],
"rotation": { "origin": [ 8.0, 3.0, 7.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#6", "uv": [ 2.0, 14.0, 6.0, 15.0 ] },
"east": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 9.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 13.0, 5.0, 14.0 ] },
"west": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 8.0 ] },
"up": { "texture": "#5", "uv": [ 3.0, 15.0, 7.0, 16.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 15.0, 11.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,56 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/purpur_pillar",
"6": "block/obsidian"
},
"elements": [
{
"name": "Scope",
"from": [ 7.500000007450581, 6.0, 6.0 ],
"to": [ 8.50000000745058, 7.0, 12.0 ],
"faces": {
"north": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 8.0 ] },
"east": { "texture": "#5", "uv": [ 8.0, 15.0, 14.0, 16.0 ] },
"south": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 9.0 ] },
"west": { "texture": "#5", "uv": [ 6.0, 15.0, 12.0, 16.0 ] },
"up": { "texture": "#5", "uv": [ 15.0, 5.0, 16.0, 11.0 ] },
"down": { "texture": "#5", "uv": [ 15.0, 4.0, 16.0, 10.0 ] }
}
},
{
"name": "Scope Back",
"from": [ 7.200000002980232, 7.0, 10.0 ],
"to": [ 8.800000011920929, 9.0, 12.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 13.0, 1.0, 15.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 4.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 6.0, 2.6000000089406967, 8.0 ] },
"west": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 5.0, 6.0, 6.600000008940697, 8.0 ] },
"down": { "texture": "#5", "uv": [ 4.0, 4.0, 5.600000008940697, 6.0 ] }
}
},
{
"name": "ScopeTop",
"from": [ 7.0, 7.0, 9.0 ],
"to": [ 9.0, 9.0, 13.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#6", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#5", "uv": [ 6.0, 3.0, 10.0, 5.0 ] },
"south": { "texture": "#6", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"west": { "texture": "#5", "uv": [ 10.0, 2.0, 14.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 15.0, 11.0, 13.0, 15.0 ] },
"down": { "texture": "#5", "uv": [ 10.0, 3.0, 12.0, 7.0 ] }
}
}
]
}

View file

@ -0,0 +1,38 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/white_concrete_powder",
"1": "block/white_stained_glass"
},
"elements": [
{
"name": "Rod Front",
"from": [ 7.300000004470348, 4.3000000193715096, 0.5000000074505806 ],
"to": [ 8.699999995529652, 5.700000010430813, 8.50000000745058 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.3999999910593033, 1.3999999910593033 ] },
"east": { "texture": "#0", "uv": [ 4.0, 4.0, 12.0, 5.399999991059303 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.3999999910593033, 1.3999999910593033 ] },
"west": { "texture": "#0", "uv": [ 1.0, 0.0, 9.0, 1.3999999910593033 ] },
"up": { "texture": "#0", "uv": [ 0.0, 0.0, 1.3999999910593033, 8.0 ] },
"down": { "texture": "#0", "uv": [ 0.0, 0.0, 1.3999999910593033, 8.0 ] }
}
},
{
"name": "Rod Glow",
"from": [ 6.899999998509884, 3.900000013411045, 0.0 ],
"to": [ 9.100000001490116, 6.100000016391277, 7.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.2000000029802322, 2.2000000029802322 ] },
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 7.0, 2.2000000029802322 ] },
"south": { "texture": "#1", "uv": [ 0.0, 0.0, 2.2000000029802322, 2.2000000029802322 ] },
"west": { "texture": "#1", "uv": [ 0.0, 0.0, 7.0, 2.2000000029802322 ] },
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 2.2000000029802322, 7.0 ] },
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 2.2000000029802322, 7.0 ] }
}
}
]
}

View file

@ -0,0 +1,53 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/gold_block"
},
"elements": [
{
"name": "Accelerator",
"from": [ 6.499999992549419, 5.0, 10.300000004470348 ],
"to": [ 9.49999999254942, 6.0, 15.300000004470348 ],
"faces": {
"north": { "texture": "#5", "uv": [ 7.0, 1.0, 10.0, 2.0 ] },
"south": { "texture": "#5", "uv": [ 6.0, 3.0, 9.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 6.0, 10.0, 9.0, 15.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 0.0, 10.0, 5.0 ] }
}
},
{
"name": "Accelerator Connector",
"from": [ 6.4000000059604645, 7.300000004470348, 10.300000004470348 ],
"to": [ 9.600000008940697, 8.699999995529652, 11.699999995529652 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 13.0, 1.0, 15.0, 3.0 ] },
"east": { "texture": "#0", "uv": [ 4.0, 2.0, 5.399999991059303, 3.3999999910593033 ] },
"south": { "texture": "#0", "uv": [ 1.0, 6.0, 4.200000002980232, 7.399999991059303 ] },
"west": { "texture": "#0", "uv": [ 4.0, 2.0, 5.399999991059303, 3.3999999910593033 ] },
"up": { "texture": "#0", "uv": [ 5.0, 6.0, 8.200000002980232, 7.399999991059303 ] },
"down": { "texture": "#0", "uv": [ 4.0, 4.0, 7.200000002980232, 5.399999991059303 ] }
}
},
{
"name": "Accelerator Back Cap",
"from": [ 7.100000001490116, 4.3000000193715096, 15.0 ],
"to": [ 8.699999995529652, 5.900000013411045, 15.399999991059303 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#5", "uv": [ 12.0, 4.0, 13.0, 6.4000000059604645 ] },
"south": { "texture": "#5", "uv": [ 11.0, 5.0, 13.0, 7.0 ] },
"west": { "texture": "#5", "uv": [ 6.0, 2.0, 7.0, 4.4000000059604645 ] },
"up": { "texture": "#5", "uv": [ 7.0, 6.0, 9.400000005960464, 7.0 ] },
"down": { "texture": "#5", "uv": [ 9.0, 0.0, 11.400000005960464, 1.0 ] }
}
}
]
}

View file

@ -0,0 +1,23 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/gold_block"
},
"elements": [
{
"name": "Accelerator Core",
"from": [ 6.499999992549419, 5.0, 10.300000004470348 ],
"to": [ 9.49999999254942, 6.0, 15.300000004470348 ],
"faces": {
"east": { "texture": "#2", "uv": [ 4.0, 2.0, 9.0, 3.0 ] },
"west": { "texture": "#2", "uv": [ 7.0, 2.0, 12.0, 3.0 ] }
}
}
]
}

View file

@ -0,0 +1,42 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/gold_block"
},
"elements": [
{
"name": "Amplifier",
"from": [ 10.000000014901161, 4.0, 4.0 ],
"to": [ 11.000000014901161, 5.0, 10.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 1.0, 2.0, 2.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 10.0, 0.0, 16.0, 1.0 ] },
"south": { "texture": "#5", "uv": [ 7.0, 7.0, 8.0, 8.0 ] },
"west": { "texture": "#5", "uv": [ 0.0, 1.0, 6.0, 2.0 ] },
"up": { "texture": "#5", "uv": [ 2.0, 0.0, 1.0, 6.0 ] },
"down": { "texture": "#5", "uv": [ 13.0, 10.0, 14.0, 16.0 ] }
}
},
{
"name": "Amplifier Connector",
"from": [ 9.800000011920929, 5.0, 8.0 ],
"to": [ 10.800000011920929, 8.0, 9.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"east": { "texture": "#0", "uv": [ 6.0, 3.0, 7.0, 6.0 ] },
"south": { "texture": "#0", "uv": [ 0.0, 0.0, 1.0, 3.0 ] },
"west": { "texture": "#0", "uv": [ 10.0, 2.0, 14.0, 3.0 ] },
"up": { "texture": "#0", "uv": [ 15.0, 11.0, 14.0, 15.0 ] },
"down": { "texture": "#0", "uv": [ 10.0, 3.0, 11.0, 4.0 ] }
}
}
]
}

View file

@ -0,0 +1,42 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/gold_block"
},
"elements": [
{
"name": "Amplifier Core",
"from": [ 10.000000014901161, 4.0, 3.0 ],
"to": [ 11.000000014901161, 5.0, 4.0 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"east": { "texture": "#2", "uv": [ 10.0, 1.0, 11.0, 2.0 ] },
"south": { "texture": "#2", "uv": [ 9.0, 8.0, 10.0, 9.0 ] },
"west": { "texture": "#2", "uv": [ 3.0, 5.0, 4.0, 6.0 ] },
"up": { "texture": "#2", "uv": [ 11.0, 1.0, 10.0, 2.0 ] },
"down": { "texture": "#2", "uv": [ 13.0, 10.0, 14.0, 11.0 ] }
}
},
{
"name": "Amplifier Glow",
"from": [ 9.8, 3.7999999970197678, 2.7999999970197678 ],
"to": [ 11.200000005960465, 5.200000002980232, 4.200000002980232 ],
"rotation": { "origin": [ 11.0, 4.0, 8.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"east": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"south": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] },
"west": { "texture": "#3", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"up": { "texture": "#3", "uv": [ 7.0, 6.0, 9.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 7.0, 7.0, 9.0, 9.0 ] }
}
}
]
}

View file

@ -0,0 +1,28 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": true,
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/magma",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian"
},
"elements": [
{
"name": "Rod Back",
"from": [ 7.0, 4.000000014901161, 7.0 ],
"to": [ 9.0, 6.000000014901161, 14.0 ],
"rotation": { "origin": [ 8.0, 5.0, 8.0 ], "axis": "z", "angle": -45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 2.0, 2.0 ] },
"east": { "texture": "#1", "uv": [ 0.0, 0.0, 7.0, 2.0 ] },
"south": { "texture": "#1", "uv": [ 6.0, 7.0, 8.0, 9.0 ] },
"west": { "texture": "#1", "uv": [ 4.0, 3.0, 11.0, 5.0 ] },
"up": { "texture": "#1", "uv": [ 6.0, 5.0, 8.0, 12.0 ] },
"down": { "texture": "#1", "uv": [ 8.0, 6.0, 10.0, 13.0 ] }
}
}
]
}

View file

@ -0,0 +1,29 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"0": "block/anvil",
"1": "block/gray_concrete_powder",
"2": "block/white_concrete_powder",
"3": "block/white_stained_glass",
"4": "block/obsidian",
"5": "block/gold_block",
"6": "block/redstone_block"
},
"elements": [
{
"name": "Retriever Back",
"from": [ 7.0, 2.0, 8.0 ],
"to": [ 9.0, 4.0, 9.0 ],
"rotation": { "origin": [ 8.0, 3.0, 7.0 ], "axis": "x", "angle": -22.5 },
"faces": {
"north": { "texture": "#6", "uv": [ 12.0, 4.0, 14.0, 6.0 ] },
"east": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 10.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 13.0, 3.0, 15.0 ] },
"west": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 9.0 ] },
"up": { "texture": "#5", "uv": [ 3.0, 15.0, 5.0, 16.0 ] },
"down": { "texture": "#5", "uv": [ 7.0, 15.0, 9.0, 16.0 ] }
}
}
]
}

View file

@ -0,0 +1,50 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"parent": "create:item/placement_handgun",
"textures": {
"3": "block/white_concrete",
"5": "block/gold_block"
},
"elements": [
{
"name": "Scope",
"from": [ 7.500000007450581, 6.0, 6.0 ],
"to": [ 8.50000000745058, 7.0, 12.0 ],
"faces": {
"north": { "texture": "#5", "uv": [ 15.0, 7.0, 16.0, 8.0 ] },
"east": { "texture": "#5", "uv": [ 8.0, 15.0, 14.0, 16.0 ] },
"south": { "texture": "#5", "uv": [ 15.0, 8.0, 16.0, 9.0 ] },
"west": { "texture": "#5", "uv": [ 6.0, 15.0, 12.0, 16.0 ] },
"up": { "texture": "#5", "uv": [ 15.0, 5.0, 16.0, 11.0 ] },
"down": { "texture": "#5", "uv": [ 15.0, 4.0, 16.0, 10.0 ] }
}
},
{
"name": "Scope Back",
"from": [ 7.200000002980232, 7.0, 10.0 ],
"to": [ 8.800000011920929, 9.0, 12.0 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#5", "uv": [ 13.0, 1.0, 15.0, 3.0 ] },
"east": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 4.0 ] },
"south": { "texture": "#5", "uv": [ 1.0, 6.0, 2.6000000089406967, 8.0 ] },
"west": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 4.0 ] },
"up": { "texture": "#5", "uv": [ 5.0, 6.0, 6.600000008940697, 8.0 ] },
"down": { "texture": "#5", "uv": [ 4.0, 4.0, 5.600000008940697, 6.0 ] }
}
},
{
"name": "ScopeTop",
"from": [ 7.500000007450581, 7.0, 9.0 ],
"to": [ 8.50000000745058, 8.0, 13.0 ],
"faces": {
"north": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
"east": { "texture": "#5", "uv": [ 6.0, 3.0, 10.0, 4.0 ] },
"south": { "texture": "#3", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
"west": { "texture": "#5", "uv": [ 10.0, 2.0, 14.0, 3.0 ] },
"up": { "texture": "#5", "uv": [ 15.0, 11.0, 14.0, 15.0 ] },
"down": { "texture": "#5", "uv": [ 10.0, 3.0, 11.0, 7.0 ] }
}
}
]
}

View file

@ -1,6 +1,6 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": true,
"ambientocclusion": true,
"display": {
"firstperson_righthand": {
"rotation": [ 15, 0, 0 ],
@ -13,8 +13,8 @@
"scale":[ 0.5, 0.5, 0.5 ]
},
"gui": {
"rotation": [ 40, 135, 32 ],
"translation": [ -1.2, -1, 3],
"rotation": [ 42, 135, 32 ],
"translation": [ -1.7, -1.7, 3],
"scale":[ 0.8, 0.8, 0.8 ]
},
"ground": {
@ -24,23 +24,23 @@
},
"fixed": {
"rotation": [ 0, 90, 0 ],
"translation": [ -2, -1, 0 ],
"translation": [ 0, -5, 0 ],
"scale": [ 1, 1, 1 ]
}
},
"textures": {
"0": "block/obsidian",
"1": "block/light_blue_concrete_powder",
"1": "block/packed_ice",
"2": "block/dark_oak_log",
"3": "block/white_stained_glass",
"4": "block/light_blue_stained_glass",
"5": "block/white_concrete"
"5": "block/white_concrete_powder"
},
"elements": [
{
"name": "Grip Core",
"from": [ 6.500000007450581, -5.0, 6.500000007450581 ],
"to": [ 9.50000000745058, 6.0, 9.50000000745058 ],
"from": [ 6.5, -5.0, 6.5 ],
"to": [ 9.5, 6.0, 9.5 ],
"faces": {
"north": { "texture": "#0", "uv": [ 5.0, 1.0, 8.0, 12.0 ] },
"east": { "texture": "#0", "uv": [ 2.0, 3.0, 5.0, 14.0 ] },
@ -52,8 +52,8 @@
},
{
"name": "Rod Bottom Core",
"from": [ 6.500000007450581, 8.000000014901161, 6.500000007450581 ],
"to": [ 9.50000000745058, 17.00000001490116, 9.50000000745058 ],
"from": [ 6.5, 8.0, 6.5 ],
"to": [ 9.5, 17.0, 9.5 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 5.0, 7.0, 8.0, 16.0 ] },
@ -66,8 +66,8 @@
},
{
"name": "Grip Cap",
"from": [ 5.999999985098839, 6.0, 6.0 ],
"to": [ 9.999999985098839, 7.0, 10.0 ],
"from": [ 6.0, 6.0, 6.0 ],
"to": [ 10.0, 7.0, 10.0 ],
"faces": {
"north": { "texture": "#2", "uv": [ 2.0, 0.0, 6.0, 1.0 ] },
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
@ -77,23 +77,10 @@
"down": { "texture": "#2", "uv": [ 5.0, 3.0, 9.0, 7.0 ] }
}
},
{
"name": "Rod Core",
"from": [ 7.0, 18.00000001490116, 7.0 ],
"to": [ 9.0, 26.00000001490116, 9.0 ],
"faces": {
"north": { "texture": "#5", "uv": [ 2.0, 2.0, 4.0, 10.0 ] },
"east": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 10.0 ] },
"south": { "texture": "#5", "uv": [ 4.0, 2.0, 6.0, 10.0 ] },
"west": { "texture": "#5", "uv": [ 8.0, 2.0, 10.0, 10.0 ] },
"up": { "texture": "#5", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"down": { "texture": "#5", "uv": [ 2.0, 2.0, 4.0, 4.0 ] }
}
},
{
"name": "Rod Top Core",
"from": [ 6.500000007450581, 27.00000001490116, 6.500000007450581 ],
"to": [ 9.50000000745058, 30.00000001490116, 9.50000000745058 ],
"from": [ 6.5, 27.0, 6.5 ],
"to": [ 9.5, 30.0, 9.5 ],
"rotation": { "origin": [ 8.0, 8.0, 8.0 ], "axis": "y", "angle": 45.0 },
"faces": {
"north": { "texture": "#1", "uv": [ 1.0, 4.0, 4.0, 7.0 ] },
@ -106,8 +93,8 @@
},
{
"name": "Cap",
"from": [ 5.999999985098839, 31.0, 6.0 ],
"to": [ 9.999999985098839, 32.0, 10.0 ],
"from": [ 6.0, 30.0, 6.0 ],
"to": [ 10.0, 31.0, 10.0 ],
"faces": {
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 4.0, 1.0 ] },
@ -128,64 +115,10 @@
"west": { "texture": "#2", "uv": [ 7.0, 7.0, 10.400000005960464, 8.0 ] }
}
},
{
"name": "Rod Bottom Cap",
"from": [ 6.000000014901161, 16.0, 6.000000014901161 ],
"to": [ 10.000000014901161, 18.0, 10.000000014901161 ],
"rotation": { "origin": [ 8.0, 6.0, 8.0 ], "axis": "y", "angle": 45.0 },
"faces": {
"north": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] },
"east": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] },
"south": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] },
"west": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] }
}
},
{
"name": "Rod Top Cap",
"from": [ 6.000000014901161, 26.0, 6.000000014901161 ],
"to": [ 10.000000014901161, 28.0, 10.000000014901161 ],
"rotation": { "origin": [ 8.0, 6.0, 8.0 ], "axis": "y", "angle": 45.0 },
"faces": {
"north": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] },
"east": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] },
"south": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] },
"west": { "texture": "#4", "uv": [ 2.0, 2.0, 6.0, 4.0 ] }
}
},
{
"name": "Square North",
"from": [ 7.499999992549419, 21.0, 3.0 ],
"to": [ 8.49999999254942, 23.0, 5.0 ],
"shade": false,
"rotation": { "origin": [ 9.0, 22.0, 5.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"east": { "texture": "#3", "uv": [ 6.0, 6.0, 8.0, 8.0 ] },
"south": { "texture": "#3", "uv": [ 8.0, 6.0, 9.0, 8.0 ] },
"west": { "texture": "#3", "uv": [ 11.0, 9.0, 13.0, 11.0 ] },
"up": { "texture": "#3", "uv": [ 9.0, 5.0, 6.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 5.0, 7.0, 6.0, 9.0 ] }
}
},
{
"name": "Square South",
"from": [ 7.499999992549419, 22.0, 10.0 ],
"to": [ 8.49999999254942, 24.0, 12.0 ],
"shade": false,
"rotation": { "origin": [ 13.0, 22.0, 11.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"east": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"south": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"west": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"up": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"down": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] }
}
},
{
"name": "Rod Bottom Deco 1",
"from": [ 7.499999992549419, 9.0, 5.500000007450581 ],
"to": [ 8.49999999254942, 10.0, 10.50000000745058 ],
"from": [ 7.5, 9.0, 5.5 ],
"to": [ 8.5, 10.0, 10.5 ],
"faces": {
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] },
@ -197,8 +130,8 @@
},
{
"name": "Rod Bottom Deco 2",
"from": [ 5.499999992549419, 9.0, 7.500000007450581 ],
"to": [ 10.49999999254942, 10.0, 8.50000000745058 ],
"from": [ 5.5, 9.0, 7.5 ],
"to": [ 10.5, 10.0, 8.5 ],
"faces": {
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] },
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
@ -208,36 +141,6 @@
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 5.0, 1.0 ] }
}
},
{
"name": "Square West",
"from": [ 11.49999999254942, 22.49999999254942, 7.499999992549419 ],
"to": [ 13.49999999254942, 24.49999999254942, 8.49999999254942 ],
"shade": false,
"rotation": { "origin": [ 13.0, 22.0, 11.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"east": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"south": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"west": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"up": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 3.0 ] },
"down": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 3.0 ] }
}
},
{
"name": "Square East",
"from": [ 6.499999992549419, 27.49999999254942, 7.499999992549419 ],
"to": [ 8.49999999254942, 29.49999999254942, 8.49999999254942 ],
"shade": false,
"rotation": { "origin": [ 13.0, 22.0, 11.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"east": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"south": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 4.0 ] },
"west": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 4.0 ] },
"up": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 3.0 ] },
"down": { "texture": "#3", "uv": [ 2.0, 2.0, 4.0, 3.0 ] }
}
},
{
"name": "Cube",
"from": [ 6.3000000193715096, -4.0, 6.3000000193715096 ],

View file

@ -0,0 +1,75 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": false,
"parent": "create:item/symmetry_wand",
"textures": {
"0": "block/obsidian",
"1": "block/light_blue_concrete_powder",
"2": "block/dark_oak_log",
"3": "block/white_stained_glass",
"4": "block/light_blue_stained_glass",
"5": "block/white_concrete_powder"
},
"elements": [
{
"name": "Square North",
"from": [ 7.5, 24.0, 4.0 ],
"to": [ 8.5, 25.0, 5.0 ],
"shade": false,
"rotation": { "origin": [ 9.0, 24.0, 5.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"east": { "texture": "#3", "uv": [ 6.0, 6.0, 7.0, 7.0 ] },
"south": { "texture": "#3", "uv": [ 8.0, 6.0, 9.0, 7.0 ] },
"west": { "texture": "#3", "uv": [ 11.0, 9.0, 12.0, 10.0 ] },
"up": { "texture": "#3", "uv": [ 9.0, 5.0, 10.0, 6.0 ] },
"down": { "texture": "#3", "uv": [ 5.0, 7.0, 6.0, 8.0 ] }
}
},
{
"name": "Square South",
"from": [ 7.5, 24.0, 10.0 ],
"to": [ 8.5, 25.0, 11.0 ],
"shade": false,
"rotation": { "origin": [ 13.0, 24.0, 11.0 ], "axis": "x", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"east": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"south": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"west": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"up": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"down": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] }
}
},
{
"name": "Square West",
"from": [ 11.5, 25.5, 7.5 ],
"to": [ 12.5, 26.5, 8.5 ],
"shade": false,
"rotation": { "origin": [ 13.0, 24.0, 11.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"east": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"south": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"west": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"up": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"down": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] }
}
},
{
"name": "Square East",
"from": [ 7.5, 29.5, 7.5 ],
"to": [ 8.5, 30.5, 8.5 ],
"shade": false,
"rotation": { "origin": [ 13.0, 24.0, 11.0 ], "axis": "z", "angle": 45.0 },
"faces": {
"north": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"east": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"south": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"west": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"up": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] },
"down": { "texture": "#3", "uv": [ 2.0, 2.0, 3.0, 3.0 ] }
}
}
]
}

View file

@ -0,0 +1,41 @@
{
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
"ambientocclusion": false,
"parent": "create:item/symmetry_wand",
"textures": {
"0": "block/obsidian",
"1": "block/light_blue_concrete_powder",
"2": "block/dark_oak_log",
"3": "block/white_stained_glass",
"4": "block/light_blue_stained_glass",
"5": "block/white_concrete_powder"
},
"elements": [
{
"name": "Rod Core",
"from": [ 7.0, 18.0, 7.0 ],
"to": [ 9.0, 26.0, 9.0 ],
"faces": {
"north": { "texture": "#5", "uv": [ 10.0, 3.0, 12.0, 11.0 ] },
"east": { "texture": "#5", "uv": [ 13.0, 6.0, 15.0, 14.0 ] },
"south": { "texture": "#5", "uv": [ 11.0, 6.0, 13.0, 14.0 ] },
"west": { "texture": "#5", "uv": [ 11.0, 4.0, 13.0, 12.0 ] },
"up": { "texture": "#5", "uv": [ 14.0, 0.0, 16.0, 2.0 ] },
"down": { "texture": "#5", "uv": [ 14.0, 6.0, 16.0, 8.0 ] }
}
},
{
"name": "Cube",
"from": [ 6.5, 17.5, 6.5 ],
"to": [ 9.5, 26.5, 9.5 ],
"faces": {
"north": { "texture": "#3", "uv": [ 10.0, 5.0, 13.0, 13.0 ] },
"east": { "texture": "#3", "uv": [ 5.0, 3.0, 8.0, 12.0 ] },
"south": { "texture": "#3", "uv": [ 7.0, 6.0, 10.0, 14.0 ] },
"west": { "texture": "#3", "uv": [ 7.0, 4.0, 4.0, 12.0 ] },
"up": { "texture": "#3", "uv": [ 7.0, 5.0, 10.0, 8.0 ] },
"down": { "texture": "#3", "uv": [ 9.0, 3.0, 12.0, 6.0 ] }
}
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

View file

@ -0,0 +1,19 @@
{
"type": "crafting_shaped",
"pattern": [
"SW",
"WS"
],
"key": {
"W": {
"item": "minecraft:andesite"
},
"S": {
"item": "minecraft:iron_nugget"
}
},
"result": {
"item": "create:andesite_alloy_cube",
"count": 1
}
}

View file

@ -0,0 +1,19 @@
{
"type": "crafting_shaped",
"pattern": [
"SW",
"WS"
],
"key": {
"W": {
"item": "minecraft:blaze_powder"
},
"S": {
"item": "minecraft:gold_nugget"
}
},
"result": {
"item": "create:blaze_brass_cube",
"count": 1
}
}

View file

@ -0,0 +1,19 @@
{
"type": "crafting_shaped",
"pattern": [
"SW",
"WS"
],
"key": {
"W": {
"item": "minecraft:popped_chorus_fruit"
},
"S": {
"item": "minecraft:dragon_breath"
}
},
"result": {
"item": "create:chorus_chrome_cube",
"count": 1
}
}

View file

@ -0,0 +1,23 @@
{
"type": "crafting_shaped",
"pattern": [
" E",
" A ",
"AO "
],
"key": {
"E": {
"item": "minecraft:end_rod"
},
"O": {
"item": "minecraft:obsidian"
},
"A": {
"item": "create:andesite_alloy_cube"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
}
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"SE",
"BS"
],
"key": {
"B": {
"item": "create:blaze_brass_cube"
},
"S": {
"item": "minecraft:sugar"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Accelerator",
"tier": "BlazeBrass"
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"E ",
"BR"
],
"key": {
"B": {
"item": "create:blaze_brass_cube"
},
"R": {
"item": "minecraft:end_rod"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Amplifier",
"tier": "BlazeBrass"
}

View file

@ -0,0 +1,22 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
" B ",
"BEB",
" B "
],
"key": {
"B": {
"item": "create:blaze_brass_cube"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Body",
"tier": "BlazeBrass"
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"E ",
"BR"
],
"key": {
"B": {
"item": "create:blaze_brass_cube"
},
"R": {
"item": "minecraft:redstone"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Retriever",
"tier": "BlazeBrass"
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"GBG",
" E "
],
"key": {
"B": {
"item": "create:blaze_brass_cube"
},
"G": {
"item": "minecraft:glass"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Scope",
"tier": "BlazeBrass"
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"SE",
"BS"
],
"key": {
"B": {
"item": "create:chorus_chrome_cube"
},
"S": {
"item": "minecraft:sugar"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Accelerator",
"tier": "ChorusChrome"
}

View file

@ -0,0 +1,25 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"BR",
"E ",
"BR"
],
"key": {
"B": {
"item": "create:chorus_chrome_cube"
},
"R": {
"item": "minecraft:end_rod"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Amplifier",
"tier": "ChorusChrome"
}

View file

@ -0,0 +1,22 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
" B ",
"BEB",
" B "
],
"key": {
"B": {
"item": "create:chorus_chrome_cube"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Body",
"tier": "ChorusChrome"
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"E ",
"BR"
],
"key": {
"B": {
"item": "create:chorus_chrome_cube"
},
"R": {
"item": "minecraft:ender_pearl"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Retriever",
"tier": "ChorusChrome"
}

View file

@ -0,0 +1,24 @@
{
"type": "create:placement_handgun_upgrade",
"pattern": [
"GBG",
" E "
],
"key": {
"B": {
"item": "create:chorus_chrome_cube"
},
"G": {
"item": "minecraft:glass"
},
"E": {
"item": "create:placement_handgun"
}
},
"result": {
"item": "create:placement_handgun",
"count": 1
},
"component": "Scope",
"tier": "ChorusChrome"
}