Did a bit more
This commit is contained in:
parent
bf1167098f
commit
48bf5bc58f
|
|
@ -30,6 +30,7 @@ import net.minecraft.util.math.Vec3i;
|
|||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.montoyo.wd.WebDisplays;
|
||||
import net.montoyo.wd.core.DefaultPeripheral;
|
||||
|
|
@ -57,7 +58,7 @@ public class BlockPeripheral extends WDBlockContainer {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected ItemBlock createItemBlock() {
|
||||
protected BlockItem createItemBlock() {
|
||||
return new ItemPeripheral(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ import net.minecraft.util.text.TextFormatting;
|
|||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.level.block.state.properties.BooleanProperty;
|
||||
import net.minecraft.world.level.block.state.properties.Property;
|
||||
import net.minecraftforge.common.property.ExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
|
|
@ -47,9 +49,9 @@ import java.util.List;
|
|||
|
||||
public class BlockScreen extends WDBlockContainer {
|
||||
|
||||
public static final PropertyBool hasTE = PropertyBool.create("haste");
|
||||
public static final PropertyBool emitting = PropertyBool.create("emitting");
|
||||
private static final IProperty[] properties = new IProperty[] { hasTE, emitting };
|
||||
public static final BooleanProperty hasTE = BooleanProperty.create("haste");
|
||||
public static final BooleanProperty emitting = BooleanProperty.create("emitting");
|
||||
private static final Property[] properties = new IProperty[] { hasTE, emitting };
|
||||
public static final IUnlistedProperty<Integer>[] sideFlags = new IUnlistedProperty[6];
|
||||
static {
|
||||
for(int i = 0; i < sideFlags.length; i++)
|
||||
|
|
|
|||
|
|
@ -8,14 +8,18 @@ import net.minecraft.block.BlockContainer;
|
|||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public abstract class WDBlockContainer extends BaseContainerBlockEntity {
|
||||
|
||||
protected ItemBlock itemBlock;
|
||||
protected BlockItem itemBlock;
|
||||
|
||||
public WDBlockContainer(Material material) {
|
||||
super(material);
|
||||
public WDBlockContainer(BlockEntityType<?> type, BlockBehaviour.Properties material, BlockState state) {
|
||||
super(type, material, state);
|
||||
}
|
||||
|
||||
protected void setName(String name) {
|
||||
|
|
@ -23,7 +27,7 @@ public abstract class WDBlockContainer extends BaseContainerBlockEntity {
|
|||
setRegistryName(name);
|
||||
}
|
||||
|
||||
protected abstract ItemBlock createItemBlock();
|
||||
protected abstract BlockItem createItemBlock();
|
||||
|
||||
public void makeItemBlock() {
|
||||
if(itemBlock != null)
|
||||
|
|
@ -34,7 +38,7 @@ public abstract class WDBlockContainer extends BaseContainerBlockEntity {
|
|||
itemBlock.setRegistryName(getRegistryName());
|
||||
}
|
||||
|
||||
public ItemBlock getItem() {
|
||||
public BlockItem getItem() {
|
||||
return itemBlock;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
|
||||
package net.montoyo.wd.client.renderers;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public interface IItemRenderer {
|
||||
|
||||
void render(ItemStack is, float handSideSign, float swingProgress, float equipProgress);
|
||||
void render(PoseStack stack, ItemStack is, float handSideSign, float swingProgress, float equipProgress);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
package net.montoyo.wd.client.renderers;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
|
@ -43,7 +44,7 @@ public final class MinePadRenderer implements IItemRenderer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final void render(ItemStack is, float handSideSign, float swingProgress, float equipProgress) {
|
||||
public final void render(PoseStack stack, ItemStack is, float handSideSign, float swingProgress, float equipProgress) {
|
||||
//Pre-compute values
|
||||
float sqrtSwingProg = (float) Math.sqrt(swingProgress);
|
||||
sinSqrtSwingProg1 = (float) Math.sin(sqrtSwingProg * PI);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.client.renderer.block.model.BakedQuad;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.block.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.block.model.ItemTransforms;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
|
|
@ -29,6 +30,7 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ScreenBaker implements IModelBaker {
|
||||
|
||||
|
|
@ -95,7 +97,7 @@ public class ScreenBaker implements IModelBaker {
|
|||
}
|
||||
|
||||
@Nonnull
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, long rand) {
|
||||
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, Random rand) {
|
||||
if(side == null)
|
||||
return noQuads;
|
||||
BlockState bs = state;
|
||||
|
|
@ -112,7 +114,7 @@ public class ScreenBaker implements IModelBaker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isAmbientOcclusion() {
|
||||
public boolean useAmbientOcclusion() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -122,20 +124,20 @@ public class ScreenBaker implements IModelBaker {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
public boolean isCustomRenderer() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public TextureAtlasSprite getParticleTexture() {
|
||||
public TextureAtlasSprite getParticleIcon() {
|
||||
return texs[15];
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public ItemCameraTransforms getItemCameraTransforms() {
|
||||
return ItemCameraTransforms.DEFAULT;
|
||||
public ItemTransforms getTransforms() {
|
||||
return ItemTransforms.NO_TRANSFORMS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user