Skip to content

Commit

Permalink
update fabrics, update Architect, add tab, add diode pins!
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Dec 26, 2018
1 parent 8111c92 commit 3d3beff
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 56 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ repositories {

dependencies {
minecraft "com.mojang:minecraft:18w50a"
mappings "net.fabricmc:yarn:18w50a.68"
modCompile "net.fabricmc:fabric-loader:0.3.0.74"
modCompile "net.fabricmc:fabric:0.1.2.63"
mappings "net.fabricmc:yarn:18w50a.71"
modCompile "net.fabricmc:fabric-loader:0.3.0.75"
modCompile "net.fabricmc:fabric:0.1.2.64"
implementation 'org.jetbrains:annotations:15.0'
modCompile "io.github.prospector.silk:SilkAPI:1.0.0-25"
modCompile name: "qcommon-architect-1.0.0"
Expand Down
Binary file modified libs/qcommon-architect-1.0.0.jar
Binary file not shown.
34 changes: 3 additions & 31 deletions src/main/java/com/elytradev/infraredstone/InfraRedstone.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,20 @@

import com.elytradev.infraredstone.Container.OscillatorContainer;
import com.elytradev.infraredstone.block.ModBlocks;
import com.elytradev.infraredstone.block.entity.IRComponentBlockEntity;
import com.elytradev.infraredstone.item.ModItems;
import com.elytradev.infraredstone.logic.InRedLogic;
import com.elytradev.infraredstone.util.CommonProxy;
import io.netty.buffer.Unpooled;
import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.fabricmc.fabric.api.container.ContainerProviderRegistry;
import net.fabricmc.fabric.block.FabricBlockSettings;
import net.fabricmc.fabric.events.TickEvent;
import net.fabricmc.fabric.networking.CustomPayloadPacketRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.packet.CustomPayloadClientPacket;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.block.BlockItem;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.network.packet.CustomPayloadServerPacket;
import net.minecraft.item.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.PacketByteBuf;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.Registry;

import java.util.function.Consumer;
import java.util.function.Supplier;

public class InfraRedstone implements ModInitializer {

public static final ItemGroup inRedGroup = ItemGroup.REDSTONE;
public static final ItemGroup inRedGroup = FabricItemGroupBuilder.build(new Identifier("infraredstone:infra_redstone_tab"), () -> new ItemStack(ModBlocks.INFRA_REDSTONE));
public static CommonProxy proxy;

public static final Identifier OSCILLATOR_CONTAINER = new Identifier("infraredstone:oscillator_container");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,4 @@ public void neighborUpdate(BlockState state, World world, BlockPos pos, Block bl
}
}

public boolean canBlockStay(World world, BlockPos pos) {
return world.getBlockState(pos.down()).hasSolidTopSurface(world, pos.down());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public VoxelShape getCollisionShape(BlockState blockState, BlockView blockView,
@Override
public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) {
if (entity instanceof ItemEntity) return;
if (entity.horizontalCollision) { //TODO: find out what this actually is
if (entity.horizontalCollision) {
entity.velocityY = 0.35;
} else if (entity.isSneaking()) {
entity.velocityY = 0.08; //Stop, but also counteract EntityLivingBase-applied microgravity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

import java.util.function.Supplier;



public class ModBlocks {
//TODO: properly implement
public static final Block INFRA_REDSTONE = register(new InfraRedstoneCable(), InfraRedstone.inRedGroup);
public static final Block IN_RED_SCAFFOLD = register(new InfraRedstoneScaffold(), InfraRedstone.inRedGroup);
public static final Block IN_RED_BLOCK = register(new InfraRedstoneBlock(), InfraRedstone.inRedGroup);
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/elytradev/infraredstone/block/ModuleBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView;
import io.github.prospector.silk.block.SilkBlockWithEntity;
import net.minecraft.world.ViewableWorld;
import net.minecraft.world.World;

public class ModuleBase extends SilkBlockWithEntity implements NamedBlock {
Expand Down Expand Up @@ -39,6 +40,15 @@ public Block getBlock() {
}

public boolean canBlockStay(World world, BlockPos pos) {
return world.getBlockState(pos.down()).hasSolidTopSurface(world, pos.down());
return world.getBlockState(pos.down()).hasSolidTopSurface(world, pos.down())
|| world.getBlockState(pos.down()).getBlock() == ModBlocks.IN_RED_SCAFFOLD
|| world.getBlockState(pos.down()).getBlock() == ModBlocks.IN_RED_BLOCK;
}

@Override
public boolean canPlaceAt(BlockState state, ViewableWorld world, BlockPos pos) {
return world.getBlockState(pos.down()).hasSolidTopSurface(world, pos.down())
|| world.getBlockState(pos.down()).getBlock() == ModBlocks.IN_RED_SCAFFOLD
|| world.getBlockState(pos.down()).getBlock() == ModBlocks.IN_RED_BLOCK;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,4 @@ public void neighborUpdate(BlockState state, World world, BlockPos pos, Block bl
}
}

public boolean canBlockStay(World world, BlockPos pos) {
return world.getBlockState(pos.down()).hasSolidTopSurface(world, pos.down());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.ViewableWorld;
import net.minecraft.world.World;

public class XorGateBlock extends ModuleBase {
Expand Down Expand Up @@ -123,9 +124,4 @@ public void neighborUpdate(BlockState state, World world, BlockPos pos, Block bl
.with(BOOLEAN_MODE, ((XorGateBlockEntity)be).booleanMode));
}
}

public boolean canBlockStay(World world, BlockPos pos) {
return world.getBlockState(pos.down()).hasSolidTopSurface(world, pos.down());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraft.util.math.Direction;
import net.minecraft.world.chunk.Chunk;


public class OscillatorBlockEntity extends IRComponentBlockEntity implements Tickable, MultimeterProbeProvider, InfraRedstoneCapable {

private InfraRedstoneHandler signal = new InfraRedstoneHandler();
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/assets/infraredstone/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"msg.inred.multimeter.out": "Module signal output",
"msg.inred.multimeter.cable": "Signal passing through cable",
"msg.inred.multimeter.block": "Block emits value of 0b11_1111 (63)",
"container.infraredstone.oscillator": "Oscillator"
"container.infraredstone.oscillator": "Oscillator",
"itemGroup.infraredstone:infra_redstone_tab": "Infra-Redstone"
}
24 changes: 24 additions & 0 deletions src/main/resources/assets/infraredstone/render/block/diode.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@
{
"type": "external",
"part": "infraredstone:base"
},
{
"type": "external",
"part": "infraredstone:diode/bit_0"
},
{
"type": "external",
"part": "infraredstone:diode/bit_1"
},
{
"type": "external",
"part": "infraredstone:diode/bit_2"
},
{
"type": "external",
"part": "infraredstone:diode/bit_3"
},
{
"type": "external",
"part": "infraredstone:diode/bit_4"
},
{
"type": "external",
"part": "infraredstone:diode/bit_5"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "translate",
"offset: match": {
"bit_0=false": [0, -2, 0],
"bit_0=false": [0, -1, 0],
"default": [0,0,0]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "translate",
"offset: match": {
"bit_1=false": [0, -2, 0],
"bit_1=false": [0, -1, 0],
"default": [0,0,0]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "translate",
"offset: match": {
"bit_2=false": [0, -2, 0],
"bit_2=false": [0, -1, 0],
"default": [0,0,0]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "translate",
"offset: match": {
"bit_3=false": [0, -2, 0],
"bit_3=false": [0, -1, 0],
"default": [0,0,0]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "translate",
"offset: match": {
"bit_4=false": [0, -2, 0],
"bit_4=false": [0, -1, 0],
"default": [0,0,0]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"type": "translate",
"offset: match": {
"bit_5=false": [0, -2, 0],
"bit_5=false": [0, -1, 0],
"default": [0,0,0]
}
}
Expand Down

0 comments on commit 3d3beff

Please sign in to comment.