Commit 3e3887c0 authored by mrAppleXZ's avatar mrAppleXZ 💾

Resources overhaul: first pass

parent b57f0ced
Subproject commit 214dcd1d5cee6193cb8f1da11253717ef1641093
Subproject commit b9950156b2fc0008843aed0fe68b6f01452c1ebc
......@@ -18,10 +18,13 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.apache.commons.lang3.tuple.Pair;
import ru.pearx.carbide.mc.client.models.*;
import ru.pearx.carbide.mc.client.models.connected.ConnectedModel;
import ru.pearx.carbide.mc.client.models.connected.ConnectedTextureGetter;
import ru.pearx.carbide.mc.client.models.processors.SetterProcessor;
import ru.pearx.carbide.mc.client.models.processors.FacingProcessor;
import ru.pearx.carbide.mc.client.models.processors.IVertexProcessor;
import ru.pearx.purmag.PurMag;
import ru.pearx.purmag.client.resources.PMResources;
import ru.pearx.purmag.common.Utils;
import ru.pearx.purmag.common.blocks.BlockAbstractWallIfTablet;
import ru.pearx.purmag.common.blocks.BlockCodeStorage;
......@@ -39,7 +42,7 @@ import java.util.List;
@SideOnly(Side.CLIENT)
public class StandardModels
{
public static class Crystal extends CachedModel
public static class Crystal extends OvModel
{
private Matrix4f mat = new TRSRTransformation(new Vector3f(0, -0.25f, 0), null, new Vector3f(0.45f, 0.45f, 0.45f), new Quat4f(0, -0.20944f, 0, 1)).getMatrix();
......@@ -60,7 +63,7 @@ public class StandardModels
{
public CrystalGlass()
{
setBaseTexture(new ResourceLocation(PurMag.MODID, "blocks/crystal_glass"));
setTextureGetter((north, east, south, west) -> PMResources.CRYSTAL_GLASS[ConnectedTextureGetter.indexFromSides(north, east, south, west)]);
quadProcessors.add(new SetterProcessor().setTintTo(0));
}
}
......@@ -69,7 +72,7 @@ public class StandardModels
{
public LuminousCrystalGlass()
{
setBaseTexture(new ResourceLocation(PurMag.MODID, "blocks/luminous_crystal_glass"));
setTextureGetter((north, east, south, west) -> PMResources.LUMINOUS_CRYSTAL_GLASS[ConnectedTextureGetter.indexFromSides(north, east, south, west)]);
quadProcessors.add(new SetterProcessor().setTintTo(0));
}
}
......@@ -99,27 +102,7 @@ public class StandardModels
}
}
public static class TranslationDesk extends OvModel
{
private Matrix4f mat_gui = new TRSRTransformation(null, null, new Vector3f(0.6f, 0.6f, 0.6f), TRSRTransformation.quatFromXYZDegrees(new Vector3f(30, 225, 0))).getMatrix();
private Matrix4f mat = new TRSRTransformation(null, null, new Vector3f(0.375f, 0.375f, 0.375f), null).getMatrix();
public TranslationDesk()
{
vertexProcessors.add(new FacingProcessor());
setBaseModel(Utils.gRL("obj/translation_desk.obj"));
}
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
{
if (cameraTransformType == ItemCameraTransforms.TransformType.GUI)
return Pair.of(this, mat_gui);
return Pair.of(this, mat);
}
}
public static class CrystalSmall extends CachedModel
public static class CrystalSmall extends OvModel
{
private Matrix4f mat_gui = new TRSRTransformation(new Vector3f(0, 0.35f, 0), null, new Vector3f(1.5f, 1.5f, 1.5f), new Quat4f(0.349066f, 0.20944f, 0, 1)).getMatrix();
private Matrix4f mat = new TRSRTransformation(new Vector3f(0, 0.35f, 0), null, null, null).getMatrix();
......@@ -156,7 +139,7 @@ public class StandardModels
public void preProcess(List<BakedQuad> quads, @Nullable IBlockState state, @Nullable EnumFacing side, long rand, IPXModel model)
{
int tier;
if (state != null && state instanceof IExtendedBlockState)
if (state instanceof IExtendedBlockState)
tier = ((IExtendedBlockState) state).getValue(BlockAbstractWallIfTablet.IF_TIER);
else
tier = getStack().getMetadata();
......@@ -348,7 +331,7 @@ public class StandardModels
}
}
public static class StoneCrusher extends CachedModel
public static class StoneCrusher extends OvModel
{
private ModelStateHide hide;
public StoneCrusher(boolean invert, String... keep)
......
package ru.pearx.purmag.client.particle;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import ru.pearx.carbide.Color;
import ru.pearx.carbide.RandomUtils;
import ru.pearx.carbide.math.MathUtils;
import ru.pearx.carbide.mc.client.gui.DrawingTools;
import ru.pearx.carbide.mc.client.particle.PXParticle;
import ru.pearx.purmag.PurMag;
import ru.pearx.purmag.client.resources.PMResources;
import ru.pearx.purmag.common.Utils;
/*
......@@ -15,61 +15,36 @@ import ru.pearx.purmag.common.Utils;
*/
public class ParticleCrystal extends PXParticle
{
public static final ResourceLocation TEXTURE = Utils.gRL("textures/particle/crystal.png");
private Color color;
private float alpha;
private float prevSin, prevCos;
private float angleDelta;
public ParticleCrystal(double x, double y, double z, String sip, int age)
{
super(x, y, z);
setLightEnabled(false);
setMotionFixed(true);
setColor(PurMag.INSTANCE.getSipRegistry().getType(sip).getColor());
setMaxAge(age);
color = PurMag.INSTANCE.getSipRegistry().getType(sip).getColor();
}
@Override
public float getWidth()
{
return 8;
}
@Override
public float getHeight()
{
return 8;
}
@Override
public void onRender()
{
GlStateManager.pushMatrix();
GlStateManager.translate(getWidth() / 2, getHeight() / 2, 0);
GlStateManager.rotate(degrees, 0, 0, 1);
GlStateManager.translate(-(getWidth() / 2), -(getHeight() / 2), 0);
GlStateManager.enableBlend();
GlStateManager.depthMask(false);
GlStateManager.color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, alpha);
DrawingTools.drawTexture(TEXTURE, 0, 0, (int) getWidth(), (int) getHeight());
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.popMatrix();
setParticleTexture(PMResources.PARTICLE_CRYSTAL);
motionY = RandomUtils.nextFloat(0.02f, 0.03f, PurMag.INSTANCE.random);
setScale(RandomUtils.nextFloat(0.6f, 0.9f, PurMag.INSTANCE.random));
this.angleDelta = MathUtils.toRadians(10);
}
private float prevSin, prevCos;
private int degrees = 0;
@Override
public void onUpdate()
{
alpha = 1f - ((float) getAge() / getMaxAge());
float sin = MathHelper.sin(MathUtils.toRadians(degrees)) * 0.1f;
float cos = MathHelper.cos(MathUtils.toRadians(degrees)) * 0.1f;
move(sin - prevSin, 0.02f, cos - prevCos);
setAlphaF(1f - ((float) getAge() / getMaxAge()));
float sin = MathHelper.sin(getAngle()) * 0.1f;
float cos = MathHelper.cos(getAngle()) * 0.1f;
this.motionX = sin - prevSin;
this.motionZ = cos - prevCos;
prevSin = sin;
prevCos = cos;
super.onUpdate();
degrees += 10;
if (degrees > 360)
degrees = 0;
float angle = getAngle() + angleDelta;
if (angle > Math.PI * 2)
angle = 0;
setAngle(angle);
}
}
package ru.pearx.purmag.client.particle;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import ru.pearx.carbide.mc.client.gui.DrawingTools;
import ru.pearx.carbide.mc.client.particle.ParticlePhysical;
import ru.pearx.carbide.math.MathUtils;
import ru.pearx.carbide.mc.client.particle.PXParticle;
import ru.pearx.purmag.client.resources.PMResources;
import ru.pearx.purmag.common.Utils;
import java.util.Random;
......@@ -14,63 +16,22 @@ import java.util.Random;
* Created by mrAppleXZ on 02.12.17 19:09.
*/
@SideOnly(Side.CLIENT)
public class ParticleMultiblock extends ParticlePhysical
public class ParticleMultiblock extends PXParticle
{
public static final ResourceLocation TEXTURE = Utils.gRL("textures/particle/multiblock.png");
public static final int TEX_COUNT = 4;
private int texIndex;
private int rotation;
private static final int TEX_COUNT = 4;
private static final float SIZE = 0.1f;
public ParticleMultiblock(double x, double y, double z, float dx, float dz, Random rand)
{
super(x, y, z);
setMaxAge(300);
setDx(dx);
setDz(dz);
setDy(-0.05f);
this.texIndex = rand.nextInt(TEX_COUNT);
this.rotation = rand.nextInt(360);
}
@Override
public float getWidth()
{
return 8;
}
@Override
public float getHeight()
{
return 8;
}
@Override
public void onUpdate()
{
setDy(getDy() - (9.8f * 0.01f) / 20);
if(getLastMoveY() != 0)
{
move(0, getDy(), 0);
}
else
{
setDy(-0.05f);
move(getDx(), getDy(), getDz());
}
super.onUpdate();
}
@Override
public void onRender()
{
GlStateManager.pushMatrix();
float scx = (getMaxAge() - getAge()) / (float)getMaxAge();
GlStateManager.translate(getWidth() / 2, getHeight() / 2, 0);
GlStateManager.scale(scx, scx, 1);
GlStateManager.rotate(rotation, 0, 0, 1);
GlStateManager.translate(-(getWidth() / 2), -(getHeight() / 2), 0);
DrawingTools.drawTexture(TEXTURE, 0, 0, (int) getWidth(), (int) getHeight(), texIndex * (int)getWidth(), 0, (int) getWidth() * TEX_COUNT, (int) getHeight());
GlStateManager.popMatrix();
setSize(SIZE, SIZE);
setParticleTexture(PMResources.PARTICLE_MULTIBLOCK);
this.motionX = dx;
this.motionZ = dz;
this.particleGravity = 0.1f;
//this.motionY = -0.05f;
//this.texIndex = rand.nextInt(TEX_COUNT);
this.particleAngle = MathUtils.toRadians(rand.nextInt(360));
}
}
package ru.pearx.purmag.client.particle;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import ru.pearx.carbide.Color;
import ru.pearx.carbide.mc.client.gui.DrawingTools;
import ru.pearx.carbide.mc.client.particle.ParticleEngine;
import net.minecraft.world.World;
import ru.pearx.carbide.mc.client.particle.ParticleMovingTo;
import ru.pearx.carbide.mc.client.particle.ParticleTrail;
import ru.pearx.purmag.PurMag;
......@@ -20,54 +18,28 @@ public class ParticleSipMovingTo extends ParticleMovingTo
{
public static final ResourceLocation TEXTURE = Utils.gRL("textures/particle/sip.png");
private Color color;
private float scale;
public ParticleSipMovingTo(Vector3d loc, Vector3d locTo, String sip, int amount, float speed)
{
super(loc, locTo, speed);
color = PurMag.INSTANCE.getSipRegistry().getType(sip).getColor();
scale = 0.5f + (amount / 8f);
}
@Override
public float getScaleFactor()
{
return super.getScaleFactor() * scale;
}
@Override
public float getWidth()
{
return 32;
}
@Override
public float getHeight()
{
return 32;
setColor(PurMag.INSTANCE.getSipRegistry().getType(sip).getColor());
setScale(0.5f + (amount / 8f));
}
@Override
public void onRender()
public boolean shouldDisableDepth()
{
GlStateManager.enableBlend();
GlStateManager.depthMask(false);
GlStateManager.color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f);
DrawingTools.drawTexture(TEXTURE, 0, 0, (int) getWidth(), (int) getHeight());
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
return true;
}
@Override
public void onUpdate()
{
spawnTrail(getX(), getY(), getZ());
spawnTrail();
super.onUpdate();
}
public void spawnTrail(double x, double y, double z)
public void spawnTrail()
{
ParticleEngine.addParticle(new ParticleTrail(x, y, z, color, 0.75f, TEXTURE, (int) getWidth(), (int) getHeight(), 0.75f, 30));
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleTrail(this, 0.75f, 30));
}
}
package ru.pearx.purmag.client.resources;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import ru.pearx.carbide.mc.client.resources.InjectResource;
import ru.pearx.purmag.PurMag;
/*
* Created by mrAppleXZ on 31.05.18 12:16.
*/
public class PMResources
{
public static TextureAtlasSprite PARTICLE_CRYSTAL;
public static TextureAtlasSprite PARTICLE_MULTIBLOCK;
public static TextureAtlasSprite[] CRYSTAL_GLASS = new TextureAtlasSprite[2 * 2 * 2 * 2];
public static TextureAtlasSprite[] LUMINOUS_CRYSTAL_GLASS = new TextureAtlasSprite[2 * 2 * 2 * 2];
}
package ru.pearx.purmag.client.events;
package ru.pearx.purmag.client.resources;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation;
......@@ -20,15 +20,21 @@ import ru.pearx.purmag.common.magibench.MagibenchRegistry;
*/
@SideOnly(Side.CLIENT)
@Mod.EventBusSubscriber(modid = PurMag.MODID, value = Side.CLIENT)
public class ModelEvents
public class ResourceEvents
{
public static final ResourceLocation PARTICLE_CRYSTAL = Utils.gRL("particle/crystal");
public static final ResourceLocation PARTICLE_MULTIBLOCK = Utils.gRL("particle/multiblock");
public static final String CRYSTAL_GLASS = "blocks/crystal_glass/";
public static final String LUMINOUS_CRYSTAL_GLASS = "blocks/luminous_crystal_glass/";
@SubscribeEvent
public static void onBake(ModelBakeEvent e)
{
putModel(e, new StandardModels.Crystal(), Utils.gRL("crystal"));
putModel(e, new StandardModels.CrystalGlass(), Utils.gRL("crystal_glass"));
putModel(e, new StandardModels.Glove(), Utils.gRL("glove"));
putModel(e, new StandardModels.TranslationDesk(), Utils.gRL("translation_desk"));
putModel(e, new StandardModels.CrystalSmall(), Utils.gRL("crystal_small"));
StandardModels.WallIfTablet wit = new StandardModels.WallIfTablet();
putModel(e, wit, Utils.gRL("wall_if_tablet"));
......@@ -64,24 +70,40 @@ public class ModelEvents
for (int j = 0; j < 2; j++)
for (int k = 0; k < 2; k++)
for (int l = 0; l < 2; l++)
e.getMap().registerSprite(new ResourceLocation(PurMag.MODID, "blocks/crystal_glass/" + i + j + k + l));
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
for (int k = 0; k < 2; k++)
for (int l = 0; l < 2; l++)
e.getMap().registerSprite(new ResourceLocation(PurMag.MODID, "blocks/luminous_crystal_glass/" + i + j + k + l));
{
e.getMap().registerSprite(Utils.gRL(CRYSTAL_GLASS + i + j + k + l));
e.getMap().registerSprite(Utils.gRL(LUMINOUS_CRYSTAL_GLASS + i + j + k + l));
}
e.getMap().registerSprite(Utils.gRL("models/glove"));
e.getMap().registerSprite(Utils.gRL("particle/sip"));
e.getMap().registerSprite(Utils.gRL("models/crystal_small"));
e.getMap().registerSprite(Utils.gRL("models/translation_desk"));
// e.getMap().registerSprite(Utils.gRL("models/translation_desk"));
for (IfTier t : PurMag.INSTANCE.getIfRegistry().tiers)
e.getMap().registerSprite(t.getWallTabletTexture());
e.getMap().registerSprite(Utils.gRL("models/microscope"));
e.getMap().registerSprite(Utils.gRL("models/code_storage/code_storage"));
e.getMap().registerSprite(Utils.gRL("models/code_storage/lock_locked"));
e.getMap().registerSprite(Utils.gRL("models/code_storage/lock_unlocked"));
for(MagibenchRegistry.Tier t : PurMag.INSTANCE.getMagibenchRegistry().getTiers())
for(MagibenchRegistry.Tier t : PurMag.INSTANCE.getMagibenchRegistry().getTiers())
e.getMap().registerSprite(t.getModelTexture());
e.getMap().registerSprite(Utils.gRL("models/stone_crusher"));
e.getMap().registerSprite(PARTICLE_CRYSTAL);
e.getMap().registerSprite(PARTICLE_MULTIBLOCK);
}
@SubscribeEvent
public static void stitchPost(TextureStitchEvent.Post e)
{
PMResources.PARTICLE_CRYSTAL = e.getMap().getAtlasSprite(PARTICLE_CRYSTAL.toString());
PMResources.PARTICLE_MULTIBLOCK = e.getMap().getAtlasSprite(PARTICLE_MULTIBLOCK.toString());
for(int i = 0; i < 2; i++)
for(int j = 0; j < 2; j++)
for(int k = 0; k < 2; k++)
for(int l = 0; l < 2; l++)
{
PMResources.CRYSTAL_GLASS[i*8 + j*4 + k*2 + l] = e.getMap().getAtlasSprite(Utils.gRL(CRYSTAL_GLASS + i + j + k + l).toString());
PMResources.LUMINOUS_CRYSTAL_GLASS[i*8 + j*4 + k*2 + l] = e.getMap().getAtlasSprite(Utils.gRL(LUMINOUS_CRYSTAL_GLASS + i + j + k + l).toString());
}
}
}
......@@ -5,7 +5,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
import ru.pearx.carbide.mc.common.CapabilityStorageSimple;
import ru.pearx.carbide.mc.common.capability.CapabilityStorageSimple;
import ru.pearx.purmag.common.aura.AuraContainer;
import ru.pearx.purmag.common.aura.IAuraContainer;
import ru.pearx.purmag.common.infofield.playerdata.IIfEntryStore;
......@@ -29,11 +29,6 @@ public class CapabilityRegistry
@CapabilityInject(ISifStorage.class)
public static final Capability<ISifStorage> SIF_STORAGE = null;
public static final ResourceLocation ENTRY_STORE_NAME = Utils.gRL("if_entry_store");
public static final ResourceLocation SIP_STORE_NAME = Utils.gRL("sip_store");
public static final ResourceLocation AURA_CONTAINER_NAME = Utils.gRL("aura_container");
public static final ResourceLocation SIF_STORAGE_NAME = Utils.gRL("sif_storage");
public static void register()
{
CapabilityManager.INSTANCE.register(IIfEntryStore.class, new CapabilityStorageSimple<>(NBTTagCompound.class), IfEntryStore.class);
......
......@@ -3,6 +3,7 @@ package ru.pearx.purmag.common.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
......@@ -13,7 +14,6 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import ru.pearx.carbide.mc.client.particle.ParticleEngine;
import ru.pearx.purmag.client.particle.ParticleCrystal;
import ru.pearx.purmag.common.blocks.base.BlockSingleSip;
import ru.pearx.purmag.common.items.ItemRegistry;
......@@ -86,7 +86,7 @@ public class BlockCrystal extends BlockSingleSip
{
if (rand.nextInt(2) == 0)
{
ParticleEngine.addParticle(new ParticleCrystal(pos.getX() + rand.nextFloat(), pos.getY() + 1.5f, pos.getZ() + rand.nextFloat(), SipUtils.getSipInBlock(worldIn, pos), 100));
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleCrystal(pos.getX() + rand.nextFloat(), pos.getY() + 1.5f, pos.getZ() + rand.nextFloat(), SipUtils.getSipInBlock(worldIn, pos), 100));
}
}
}
......@@ -87,11 +87,4 @@ public class BlockRopeCoil extends BlockBase
for(Type t : Type.values())
items.add(new ItemStack(this, 1, t.ordinal()));
}
@Override
@SideOnly(Side.CLIENT)
public void setupModels()
{
//leave this empty.
}
}
......@@ -9,6 +9,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import ru.pearx.purmag.PurMag;
import ru.pearx.purmag.common.CapabilityRegistry;
import ru.pearx.purmag.common.Utils;
import ru.pearx.purmag.common.aura.AuraContainerProvider;
import ru.pearx.purmag.common.infofield.playerdata.IfEntryStoreProvider;
......@@ -23,8 +24,8 @@ public class CapabilityEvents
{
if (e.getObject() instanceof EntityPlayer)
{
e.addCapability(CapabilityRegistry.ENTRY_STORE_NAME, new IfEntryStoreProvider());
e.addCapability(CapabilityRegistry.AURA_CONTAINER_NAME, new AuraContainerProvider());
e.addCapability(Utils.gRL("if_entry_store"), new IfEntryStoreProvider());
e.addCapability(Utils.gRL("aura_container"), new AuraContainerProvider());
}
}
......
......@@ -93,7 +93,7 @@ public class ItemRegistry
register(new ItemSipAmulet(), reg);
register(new ItemGlove(), reg);
register(new ItemPapyrus(), reg);
register(new ItemBlockBase(BlockRegistry.translation_desk), reg);
register(new ItemBlockTranslationDesk(), reg);
register(new ItemBlockCrystalSmall(), reg);
register(new ItemBase("ingot_plumfero"), reg);
register(new ItemBase("verda_wing"), reg);
......
......@@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import ru.pearx.carbide.mc.client.ClientUtils;
import ru.pearx.purmag.common.Utils;
import ru.pearx.purmag.common.blocks.BlockRegistry;
import ru.pearx.purmag.common.blocks.BlockRopeCoil;
......@@ -32,6 +33,6 @@ public class ItemBlockRopeCoil extends ItemBlockBase
public void setupModels()
{
for(BlockRopeCoil.Type t : BlockRopeCoil.Type.values())
ModelLoader.setCustomModelResourceLocation(this, t.ordinal(), new ModelResourceLocation(Utils.gRL("rope_coil"), "axis=x,type=" + t.getName()));
ClientUtils.setModelLocation(this, t.ordinal(), "", "axis=x,type=" + t.getName());
}
}
package ru.pearx.purmag.common.items.block;
import net.minecraft.block.Block;
import ru.pearx.purmag.common.blocks.BlockRegistry;
import ru.pearx.purmag.common.items.base.ItemBlockBase;
/*
* Created by mrAppleXZ on 02.06.18 11:09.
*/
public class ItemBlockTranslationDesk extends ItemBlockBase
{
public ItemBlockTranslationDesk()
{
super(BlockRegistry.translation_desk);
}
}
......@@ -13,8 +13,6 @@ import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import ru.pearx.carbide.RandomUtils;
import ru.pearx.carbide.mc.CarbideMC;
import ru.pearx.carbide.mc.client.particle.ParticleEngine;
import ru.pearx.carbide.mc.common.misc.CoordUtils;
import ru.pearx.carbide.mc.common.networking.ByteBufTools;
import ru.pearx.carbide.mc.common.structure.blockarray.BlockArray;
......@@ -86,10 +84,10 @@ public class CPacketSpawnMultiblockParticles implements IMessage
float delta = RandomUtils.nextFloat(0.001f, 0.002f, rand);
float lightDelta = RandomUtils.nextFloat(-0.001f, 0.001f, rand);
float y = RandomUtils.nextFloat(minY, maxY + 2, rand);
ParticleEngine.addParticle(new ParticleMultiblock(RandomUtils.nextFloat(minX, maxX + 1, rand), y, minZ - 0.2f, lightDelta, -delta, rand));
ParticleEngine.addParticle(new ParticleMultiblock(RandomUtils.nextFloat(minX, maxX + 1, rand), y, maxZ + 1 + 0.2f, lightDelta, delta, rand));
ParticleEngine.addParticle(new ParticleMultiblock(minX - 0.2f, y, RandomUtils.nextFloat(minZ, maxZ + 1, rand), -delta, lightDelta, rand));
ParticleEngine.addParticle(new ParticleMultiblock(maxX + 1 + 0.2f, y, RandomUtils.nextFloat(minZ, maxZ + 1, rand), delta, lightDelta, rand));
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleMultiblock(RandomUtils.nextFloat(minX, maxX + 1, rand), y, minZ - 0.2f, lightDelta, -delta, rand));
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleMultiblock(RandomUtils.nextFloat(minX, maxX + 1, rand), y, maxZ + 1 + 0.2f, lightDelta, delta, rand));
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleMultiblock(minX - 0.2f, y, RandomUtils.nextFloat(minZ, maxZ + 1, rand), -delta, lightDelta, rand));
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleMultiblock(maxX + 1 + 0.2f, y, RandomUtils.nextFloat(minZ, maxZ + 1, rand), delta, lightDelta, rand));
}
});
return null;
......
......@@ -8,7 +8,6 @@ import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import ru.pearx.carbide.mc.client.particle.ParticleEngine;
import ru.pearx.carbide.mc.common.networking.ByteBufTools;
import ru.pearx.purmag.client.particle.ParticleSipMovingTo;
......@@ -67,7 +66,7 @@ public class CPacketSpawnSipParticle implements IMessage
@SideOnly(Side.CLIENT)
public IMessage onMessage(CPacketSpawnSipParticle msg, MessageContext ctx)
{
Minecraft.getMinecraft().addScheduledTask(() -> ParticleEngine.addParticle(new ParticleSipMovingTo(msg.pos, msg.posTo, msg.sipType, msg.amount, msg.speed)));
Minecraft.getMinecraft().addScheduledTask(() -> Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSipMovingTo(msg.pos, msg.posTo, msg.sipType, msg.amount, msg.speed)));
return null;
}
}
......
......@@ -8,6 +8,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import ru.pearx.purmag.PurMag;
import ru.pearx.purmag.client.sif.SifStorageClient;
import ru.pearx.purmag.common.CapabilityRegistry;
import ru.pearx.purmag.common.Utils;
import ru.pearx.purmag.common.networking.NetworkManager;
import ru.pearx.purmag.common.sif.net.CPacketSyncSif;
......@@ -20,7 +21,7 @@ public class SifEvents
@SubscribeEvent
public static void onAttach(AttachCapabilitiesEvent<Chunk> e)
{
e.addCapability(CapabilityRegistry.SIF_STORAGE_NAME, new SifStorageProvider(e.getObject().getWorld().isRemote ? new SifStorageClient() : new SifStorageServer(e.getObject())));
e.addCapability(Utils.gRL("sif_storage"), new SifStorageProvider(e.getObject().getWorld().isRemote ? new SifStorageClient() : new SifStorageServer(e.getObject())));
}
@SubscribeEvent
......
......@@ -5,7 +5,6 @@ import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import ru.pearx.carbide.mc.common.misc.GlobalChunkPos;
import ru.pearx.purmag.PurMag;
import ru.pearx.purmag.common.CapabilityRegistry;
import ru.pearx.purmag.common.blocks.BlockRegistry;
......
{
"variants": {
"axis=x,type=normal": {"model": "purmag:rope_coil_normal", "y": 90},
"axis=y,type=normal": {"model": "purmag:rope_coil_normal", "x": 90},
"axis=z,type=normal": {"model": "purmag:rope_coil_normal"},
"axis=x,type=cog": {"model": "purmag:rope_coil_cog", "y": 90},
"axis=y,type=cog": {"model": "purmag:rope_coil_cog", "x": 90},
"axis=z,type=cog": {"model": "purmag:rope_coil_cog"}
"forge_marker": 1,
"variants":
{
"facing":
{
"north": { "transform": { "rotation": {"y": 0 } }},
"east": { "transform": { "rotation": {"y": 90 } }},
"south": { "transform": { "rotation": {"y": 180 } }},
"west": { "transform": { "rotation": {"y": 270 } }}
},
"type":
{
"cog": { "model": "purmag:rope_coil_cog" },
"normal": { "model": "purmag:rope_coil_cog" }