idk anymore 2
This commit is contained in:
@@ -227,7 +227,7 @@ public class DieselEngineBlockEntity extends SmartBlockEntity implements IHaveGo
|
|||||||
|
|
||||||
if(consumptionTimer>=10) {
|
if(consumptionTimer>=10) {
|
||||||
//if(signal!=0)
|
//if(signal!=0)
|
||||||
fuelTank.setFluid(new FluidStack(TFMGFluids.DIESEL.getSource(),airTank.getFluidAmount()-1));
|
fuelTank.setFluid(new FluidStack(TFMGFluids.DIESEL.getSource(),fuelTank.getFluidAmount()-1));
|
||||||
consumptionTimer=0;
|
consumptionTimer=0;
|
||||||
}
|
}
|
||||||
//airTank.drain(1, IFluidHandler.FluidAction.EXECUTE);
|
//airTank.drain(1, IFluidHandler.FluidAction.EXECUTE);
|
||||||
|
|||||||
@@ -80,14 +80,20 @@ public class AirIntakeBlockEntity extends KineticBlockEntity implements IWrencha
|
|||||||
if (tankInventory.getFluidAmount() + production <= tankInventory.getCapacity()) {
|
if (tankInventory.getFluidAmount() + production <= tankInventory.getCapacity()) {
|
||||||
//tankInventory.fill(new FluidStack(TFMGFluids.AIR.getSource(), production), IFluidHandler.FluidAction.EXECUTE);
|
//tankInventory.fill(new FluidStack(TFMGFluids.AIR.getSource(), production), IFluidHandler.FluidAction.EXECUTE);
|
||||||
tankInventory.setFluid(new FluidStack(TFMGFluids.AIR.getSource(), production + tankInventory.getFluidAmount()));
|
tankInventory.setFluid(new FluidStack(TFMGFluids.AIR.getSource(), production + tankInventory.getFluidAmount()));
|
||||||
if(controller!=null) {
|
// if(controller!=null) {
|
||||||
((AirIntakeBlockEntity) level.getBlockEntity(controller)).setChanged();
|
// ((AirIntakeBlockEntity) level.getBlockEntity(controller)).setChanged();
|
||||||
((AirIntakeBlockEntity) level.getBlockEntity(controller)).sendData();
|
// ((AirIntakeBlockEntity) level.getBlockEntity(controller)).sendData();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
////////////////
|
////////////////
|
||||||
|
|
||||||
|
if(isUsedByController) {
|
||||||
|
refreshCapability();
|
||||||
|
sendData();
|
||||||
|
setChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(diameter == 3){
|
if(diameter == 3){
|
||||||
visual_angle.chase(angle, 0.1f, LerpedFloat.Chaser.EXP);
|
visual_angle.chase(angle, 0.1f, LerpedFloat.Chaser.EXP);
|
||||||
@@ -239,8 +245,11 @@ public class AirIntakeBlockEntity extends KineticBlockEntity implements IWrencha
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
//if(controller!=null)
|
if (!fluidCapability.isPresent()) {
|
||||||
// refreshCapability();
|
refreshCapability();
|
||||||
|
sendData();
|
||||||
|
setChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -251,36 +260,22 @@ public class AirIntakeBlockEntity extends KineticBlockEntity implements IWrencha
|
|||||||
|
|
||||||
private void refreshCapability() {
|
private void refreshCapability() {
|
||||||
|
|
||||||
if (this.controller == null) {
|
IFluidHandler handlerForCapability;
|
||||||
|
|
||||||
|
if (controller == null || controller == this.getBlockPos()
|
||||||
|
|
||||||
|
) {
|
||||||
|
handlerForCapability = tankInventory;
|
||||||
|
} else
|
||||||
|
if(((AirIntakeBlockEntity) level.getBlockEntity(controller))!=null) {
|
||||||
|
handlerForCapability = ((AirIntakeBlockEntity) level.getBlockEntity(controller)).tankInventory;
|
||||||
|
}else handlerForCapability = tankInventory;
|
||||||
|
|
||||||
|
|
||||||
return;
|
LazyOptional<IFluidHandler> oldCap = fluidCapability;
|
||||||
}
|
IFluidHandler finalHandlerForCapability = handlerForCapability;
|
||||||
|
fluidCapability = LazyOptional.of(() -> finalHandlerForCapability);
|
||||||
|
//oldCap.invalidate();
|
||||||
|
|
||||||
LazyOptional<IFluidHandler> oldFluidCapability = fluidCapability;
|
|
||||||
|
|
||||||
if(diameter==1&&!isUsedByController){
|
|
||||||
|
|
||||||
fluidCapability = LazyOptional.of(() -> new CombinedTankWrapper(tankInventory));
|
|
||||||
|
|
||||||
oldFluidCapability.invalidate();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(!isController) {
|
|
||||||
if (controller != getBlockPos()) {
|
|
||||||
if (level.getBlockEntity(controller) instanceof AirIntakeBlockEntity)
|
|
||||||
fluidCapability = LazyOptional.of(() -> new CombinedTankWrapper(((AirIntakeBlockEntity) level.getBlockEntity(controller)).tankInventory));
|
|
||||||
|
|
||||||
}
|
|
||||||
}else fluidCapability = LazyOptional.of(() -> new CombinedTankWrapper(tankInventory));
|
|
||||||
|
|
||||||
oldFluidCapability.invalidate();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -536,10 +531,10 @@ if(diameter==1&&!isUsedByController){
|
|||||||
protected void onFluidStackChanged(FluidStack newFluidStack) {
|
protected void onFluidStackChanged(FluidStack newFluidStack) {
|
||||||
setChanged();
|
setChanged();
|
||||||
sendData();
|
sendData();
|
||||||
if(controller!=null) {
|
//if(((AirIntakeBlockEntity) level.getBlockEntity(controller))!=null) {
|
||||||
((AirIntakeBlockEntity) level.getBlockEntity(controller)).setChanged();
|
// ((AirIntakeBlockEntity) level.getBlockEntity(controller)).setChanged();
|
||||||
((AirIntakeBlockEntity) level.getBlockEntity(controller)).sendData();
|
// ((AirIntakeBlockEntity) level.getBlockEntity(controller)).sendData();
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,8 @@ public class AirIntakeInstance extends KineticBlockEntityInstance<AirIntakeBlock
|
|||||||
public void beginFrame() {
|
public void beginFrame() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PoseStack msFan = new PoseStack();
|
PoseStack msFan = new PoseStack();
|
||||||
TransformStack msrFan = TransformStack.cast(msFan);
|
TransformStack msrFan = TransformStack.cast(msFan);
|
||||||
msrFan.translate(getInstancePosition());
|
msrFan.translate(getInstancePosition());
|
||||||
@@ -193,6 +195,8 @@ public class AirIntakeInstance extends KineticBlockEntityInstance<AirIntakeBlock
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!blockEntity.isUsedByController) {
|
if(!blockEntity.isUsedByController) {
|
||||||
if(blockEntity.diameter ==1) {
|
if(blockEntity.diameter ==1) {
|
||||||
updateRotation(fan, getFanSpeed());
|
updateRotation(fan, getFanSpeed());
|
||||||
@@ -205,6 +209,13 @@ public class AirIntakeInstance extends KineticBlockEntityInstance<AirIntakeBlock
|
|||||||
fan.delete();
|
fan.delete();
|
||||||
fan_large.setEmptyTransform();
|
fan_large.setEmptyTransform();
|
||||||
|
|
||||||
|
}
|
||||||
|
if(blockEntity.isUsedByController) {
|
||||||
|
//updateRotation(fan_medium, getFanSpeed());
|
||||||
|
fan_medium.setEmptyTransform();
|
||||||
|
fan.delete();
|
||||||
|
fan_large.setEmptyTransform();
|
||||||
|
|
||||||
}
|
}
|
||||||
if(blockEntity.diameter ==3) {
|
if(blockEntity.diameter ==3) {
|
||||||
|
|
||||||
|
|||||||
@@ -269,8 +269,8 @@ public class CokeOvenBlockEntity extends TFMGMachineBlockEntity implements IWren
|
|||||||
itemCapability = LazyOptional.of(() -> new CombinedInvWrapper(controller.inputInventory));
|
itemCapability = LazyOptional.of(() -> new CombinedInvWrapper(controller.inputInventory));
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
oldFluidCapability.invalidate();
|
//oldFluidCapability.invalidate();
|
||||||
oldItemCapability.invalidate();
|
//oldItemCapability.invalidate();
|
||||||
}
|
}
|
||||||
public void setControllers(){
|
public void setControllers(){
|
||||||
if(!isValid())
|
if(!isValid())
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
"parent": "create:block/block",
|
"parent": "block/block",
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "tfmg:block/diesel_engine_back",
|
"0": "tfmg:block/diesel_engine_back",
|
||||||
"1": "tfmg:block/diesel_engine_front",
|
"1": "tfmg:block/diesel_engine_front",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
"parent": "create:block/block",
|
"parent": "block/block",
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "tfmg:block/diesel_engine_back",
|
"0": "tfmg:block/diesel_engine_back",
|
||||||
"1": "tfmg:block/diesel_engine_front",
|
"1": "tfmg:block/diesel_engine_front",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "tfmg:block/diesel_engine_back",
|
"0": "tfmg:block/diesel_engine_back",
|
||||||
"1": "tfmg:block/diesel_engine_expansion",
|
"1": "tfmg:block/diesel_engine_expansion",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Made with Blockbench",
|
||||||
|
"parent": "block/block",
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "tfmg:block/diesel_engine_back",
|
"0": "tfmg:block/diesel_engine_back",
|
||||||
"1": "tfmg:block/diesel_engine_expansion",
|
"1": "tfmg:block/diesel_engine_expansion",
|
||||||
|
|||||||
BIN
src/main/resources/assets/tfmg/textures/block/img.png
Normal file
BIN
src/main/resources/assets/tfmg/textures/block/img.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 493 B |
Binary file not shown.
|
Before Width: | Height: | Size: 493 B After Width: | Height: | Size: 567 B |
Reference in New Issue
Block a user